HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_UVPelt-2.0.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: Pelt SOP
9  */
10 
11 
12 #ifndef __SOP_UVPelt2_h__
13 #define __SOP_UVPelt2_h__
14 
15 #include "SOP_API.h"
16 
17 #include <GU/GU_Pelt.h>
18 
19 #include "SOP_Node.h"
20 
21 namespace sop_uvpelt2_private {
22 enum
23 {
30 #define SOP_PELT2_NUM_PELT_PARMS 4
35 #define SOP_PELT2_NUM_FRAME_PARMS 8
44 };
45 }
46 
47 using namespace sop_uvpelt2_private;
48 
50 {
51 public:
52  SOP_UVPelt2(OP_Network *net, const char *name, OP_Operator *op);
53  virtual ~SOP_UVPelt2()
54  {
55  }
56 
57  virtual int isRefInput(unsigned int i) const;
58 
59  // This method is created so that it can be called by handles. It only
60  // cooks the input group of this SOP. The geometry in this group is
61  // the only geometry manipulated by this SOP.
62  virtual OP_ERROR cookInputGroups(OP_Context &context,
63  int alone = 0);
64  virtual bool updateParmsFlags();
65 
66  static PRM_Template myTemplateList[];
67  static OP_Node *myConstructor(OP_Network*, const char *,
68  OP_Operator *);
69 
70  UT_Array<GU_Pelt::FramePoint> &getFrame(int &metacachecount);
71 
72  virtual void getDescriptiveParmName(UT_String &name) const
73  {
74  name = "uvattrib";
75  }
76 
77 protected:
78  virtual const char *inputLabel(unsigned idx) const;
79 
80  // Method to cook geometry for the SOP
81  virtual OP_ERROR cookMySop(OP_Context &context);
82 
83  void pelt(OP_Context &context,
84  const GA_EdgeGroup *group,
85  const GEO_Face *frame,
86  bool (*callback_func)(void *),
87  void *callback_data);
88 
89 private:
90  bool OUTPUTTOGGLE()
91  { return evalInt(SOP_PELT2_OUTPUTTOGGLE_INDEX, 0, 0) != 0; }
92  void OUTPUTGROUP(UT_String &str)
93  { return evalString(str, SOP_PELT2_OUTPUTGROUP_INDEX, 0, 0); }
94  int METHODTYPE()
95  { return evalInt(SOP_PELT2_PELTINGMETHOD_INDEX, 0, 0); }
96  int ITERATIONS()
97  { return evalInt(SOP_PELT2_ITERATIONS_INDEX, 0, 0); }
98  float SPRINGCONSTANT(fpreal t)
99  { return evalFloat(SOP_PELT2_SPRINGCONSTANT_INDEX, 0, t); }
100  int HINTPOLY()
101  { return evalInt(SOP_PELT2_HINTPOLY_INDEX, 0, 0); }
102  int UFROM()
103  { return evalInt(SOP_PELT2_UFROM_INDEX, 0, 0); }
104  int VFROM()
105  { return evalInt(SOP_PELT2_VFROM_INDEX, 0, 0); }
106  bool USERANGE()
107  { return evalInt(SOP_PELT2_USERANGE_INDEX, 0, 0) != 0; }
108  float MINU(fpreal t)
109  { return evalFloat(SOP_PELT2_URANGE_INDEX, 0, t); }
110  float MAXU(fpreal t)
111  { return evalFloat(SOP_PELT2_URANGE_INDEX, 1, t); }
112  float MINV(fpreal t)
113  { return evalFloat(SOP_PELT2_VRANGE_INDEX, 0, t); }
114  float MAXV(fpreal t)
115  { return evalFloat(SOP_PELT2_VRANGE_INDEX, 1, t); }
116  float ORIENTATION()
117  { return evalFloat(SOP_PELT2_ORIENTATION_INDEX, 0, 0); }
118 
119  // This is the group of geometry to be manipulated by this SOP and cooked
120  // by the method "cookInputGroups".
121  const GA_EdgeGroup *myGroup;
122  const GEO_Face *myFrame;
123  int myFrameMetaCacheCount;
124  UT_Array<GU_Pelt::FramePoint>myFramePoints;
125  int myFramePointCount;
126 };
127 
128 #endif
UT_ErrorSeverity
Definition: UT_Error.h:25
virtual void getDescriptiveParmName(UT_String &name) const
png_uint_32 i
Definition: png.h:2877
GLuint const GLchar * name
Definition: glcorearb.h:785
double fpreal
Definition: SYS_Types.h:263
#define SOP_API
Definition: SOP_API.h:10
virtual ~SOP_UVPelt2()