HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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() override;
49 
50  int isRefInput(unsigned int i) const override;
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  OP_ERROR cookInputGroups(OP_Context &context,
56  int alone = 0) override;
57  OP_ERROR cookExtraSeamsGroup(OP_Context &context,
58  int alone = 0);
59  bool updateParmsFlags() override;
60 
61  void syncNodeVersion(
62  const char *old_version,
63  const char *cur_version,
64  bool *node_deleted) override;
65 
66  static PRM_Template myTemplateList[];
67  static OP_Node *myConstructor(OP_Network*,const char *, OP_Operator *);
68 
69 protected:
70  const char *inputLabel(unsigned idx) const override;
71 
72  // Method to cook geometry for the SOP
73  OP_ERROR cookMySop(OP_Context &context) override;
74 
75  bool mustReflattenAll(fpreal now);
76  bool extraCutsChanged(fpreal now);
77 
78 private:
79 
80  bool UESEXISTINGUV()
81  { return evalInt(SOP_FLATTEN_USEEXISTINGUV_INDEX, 0, 0); }
82  bool ISLANDTOGGLE()
83  { return evalInt(SOP_FLATTEN_ISLANDPRIM_INDEX, 0, 0); }
84  bool CREATEPINGROUPS()
85  { return evalInt(SOP_FLATTEN_CREATEPINGROUPS_INDEX, 0, 0); }
86  bool USEPINS()
87  { return evalInt(SOP_FLATTEN_USEPINS_INDEX, 0, 0); }
88  void INITIALPINGROUP(UT_String &s)
89  { evalString(s, SOP_FLATTEN_INITIALPINGROUP_INDEX, 0, 0); }
90  void ACTIVEPINGROUP(UT_String &s)
91  { evalString(s, SOP_FLATTEN_ACTIVEPINGROUP_INDEX, 0, 0); }
92  int NUMPINNED()
93  { return evalInt("pins", 0, 0.0f); }
94  int USEPOINT(int i)
95  { return evalIntInst("usepin#", &i, 0, 0.0f); }
96  fpreal POINTVAL(int i, int vi, fpreal t)
97  { return evalFloatInst("pinuv#", &i, vi, t); }
98  int PRIM(int i)
99  { return evalIntInst("primvert#", &i, 0, 0.0f); }
100  int VERT(int i)
101  { return evalIntInst("primvert#", &i, 1, 0.0f); }
102  fpreal U(int i, fpreal t)
103  { return POINTVAL(i, 0, t); }
104  fpreal V(int i, fpreal t)
105  { return POINTVAL(i, 1, t); }
106 
107  const
108  GA_PrimitiveGroup *myGroup;
109 
110  const GA_EdgeGroup *mySeams;
111  const GA_EdgeGroup *myExtraSeams;
112 
113  GU_Flatten *myFlatten;
114  DEP_MicroNode myReflattenAllMicroNode;
115  DEP_MicroNode myExtraCutsMicroNode;
116  bool myCookInterrupted;
117 };
118 
119 #endif
GLdouble s
Definition: glad.h:3009
UT_ErrorSeverity
Definition: UT_Error.h:25
GLfloat f
Definition: glcorearb.h:1926
GLuint const GLchar * name
Definition: glcorearb.h:786
GLdouble t
Definition: glad.h:2397
fpreal64 fpreal
Definition: SYS_Types.h:277
#define SOP_API
Definition: SOP_API.h:10