HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_UVFlatten.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SOP library (C++)
7  *
8  * COMMENTS: UVFlatten SOP
9  */
10 
11 
12 #ifndef __SOP_UVFlatten_h__
13 #define __SOP_UVFlatten_h__
14 
15 #include "SOP_API.h"
16 #include <GU/GU_Flatten.h>
17 
18 #include "SOP_Node.h"
19 
20 class DEP_MicroNode;
21 
22 namespace sop_uvflatten_private {
23 enum
24 {
38 };
39 }
40 
41 using namespace sop_uvflatten_private;
42 
44 {
45 public:
46  SOP_UVFlatten(OP_Network *net, const char *name,
47  OP_Operator *op);
48  ~SOP_UVFlatten();
49 
50  virtual int isRefInput(unsigned int i) const;
51 
52  // This method is created so that it can be called by handles. It only
53  // cooks the input group of this SOP. The geometry in this group is
54  // the only geometry manipulated by this SOP.
55  virtual OP_ERROR cookInputGroups(OP_Context &context, int alone = 0);
56  OP_ERROR cookExtraSeamsGroup(OP_Context &context,
57  int alone = 0);
58  virtual bool updateParmsFlags();
59 
60  virtual void syncNodeVersion(const char *old_version,
61  const char *cur_version, bool *node_deleted);
62 
63  static PRM_Template myTemplateList[];
64  static OP_Node *myConstructor(OP_Network*,const char *, OP_Operator *);
65 
66 protected:
67  virtual const char *inputLabel(unsigned idx) const;
68 
69  // Method to cook geometry for the SOP
70  virtual OP_ERROR cookMySop(OP_Context &context);
71 
72  bool mustReflattenAll(fpreal now);
73  bool extraCutsChanged(fpreal now);
74 
75 private:
76 
77  bool UESEXISTINGUV()
78  { return evalInt(SOP_FLATTEN_USEEXISTINGUV_INDEX, 0, 0); }
79  bool ISLANDTOGGLE()
80  { return evalInt(SOP_FLATTEN_ISLANDPRIM_INDEX, 0, 0); }
81  bool CREATEPINGROUPS()
82  { return evalInt(SOP_FLATTEN_CREATEPINGROUPS_INDEX, 0, 0); }
83  bool USEPINS()
84  { return evalInt(SOP_FLATTEN_USEPINS_INDEX, 0, 0); }
85  void INITIALPINGROUP(UT_String &s)
86  { evalString(s, SOP_FLATTEN_INITIALPINGROUP_INDEX, 0, 0); }
87  void ACTIVEPINGROUP(UT_String &s)
88  { evalString(s, SOP_FLATTEN_ACTIVEPINGROUP_INDEX, 0, 0); }
89  int NUMPINNED()
90  { return evalInt("pins", 0, 0.0f); }
91  int USEPOINT(int i)
92  { return evalIntInst("usepin#", &i, 0, 0.0f); }
93  fpreal POINTVAL(int i, int vi, fpreal t)
94  { return evalFloatInst("pinuv#", &i, vi, t); }
95  int PRIM(int i)
96  { return evalIntInst("primvert#", &i, 0, 0.0f); }
97  int VERT(int i)
98  { return evalIntInst("primvert#", &i, 1, 0.0f); }
99  fpreal U(int i, fpreal t)
100  { return POINTVAL(i, 0, t); }
101  fpreal V(int i, fpreal t)
102  { return POINTVAL(i, 1, t); }
103 
104  const
105  GA_PrimitiveGroup *myGroup;
106 
107  const GA_EdgeGroup *mySeams;
108  const GA_EdgeGroup *myExtraSeams;
109 
110  GU_Flatten *myFlatten;
111  DEP_MicroNode myReflattenAllMicroNode;
112  DEP_MicroNode myExtraCutsMicroNode;
113  bool myCookInterrupted;
114 };
115 
116 #endif
UT_ErrorSeverity
Definition: UT_Error.h:25
png_uint_32 i
Definition: png.h:2877
GLfloat f
Definition: glcorearb.h:1925
GLuint const GLchar * name
Definition: glcorearb.h:785
double fpreal
Definition: SYS_Types.h:263
#define SOP_API
Definition: SOP_API.h:10