HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_UVPelt.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_UVPelt_h__
13 #define __SOP_UVPelt_h__
14 
15 #include "SOP_API.h"
16 #include <GQ/GQ_Pelt.h>
17 
18 #include "SOP_Node.h"
19 
20 enum
21 {
27 #define SOP_PELT_NUM_PELT_PARMS 4
32 #define SOP_PELT_NUM_FRAME_PARMS 8
41 };
42 
43 class SOP_API SOP_UVPelt : public SOP_Node
44 {
45 public:
46  SOP_UVPelt(OP_Network *net, const char *name, OP_Operator *op);
47  virtual ~SOP_UVPelt();
48 
49  virtual int isRefInput(unsigned int i) const;
50 
51  // This method is created so that it can be called by handles. It only
52  // cooks the input group of this SOP. The geometry in this group is
53  // the only geometry manipulated by this SOP.
54  virtual OP_ERROR cookInputGroups(OP_Context &context,
55  int alone = 0);
56  virtual bool updateParmsFlags();
57 
58  static PRM_Template myTemplateList[];
59  static OP_Node *myConstructor(OP_Network*, const char *,
60  OP_Operator *);
61 
62  void getFrame(int &numpoints, GQ_Pelt::FramePoint *&framepoints, int &metacachecount);
63 
64 protected:
65  virtual const char *inputLabel(unsigned idx) const;
66 
67  // Method to cook geometry for the SOP
68  virtual OP_ERROR cookMySop(OP_Context &context);
69 
70  void pelt(OP_Context &context,
71  const GA_EdgeGroup *group,
72  const GEO_Face *frame,
73  GEO_Primitive *hint,
74  bool (*callback_func)(void *),
75  void *callback_data);
76 
77 private:
78  bool OUTPUTTOGGLE()
79  { return evalInt(SOP_PELT_OUTPUTTOGGLE_INDEX, 0, 0) != 0; }
80  void OUTPUTGROUP(UT_String &str)
81  { return evalString(str, SOP_PELT_OUTPUTGROUP_INDEX, 0, 0); }
82  int TARGETTYPE()
83  { return evalInt(SOP_PELT_TARGETTYPE_INDEX, 0, 0); }
84  int ITERATIONS()
85  { return evalInt(SOP_PELT_ITERATIONS_INDEX, 0, 0); }
86  float SPRINGCONSTANT(fpreal t)
87  { return evalFloat(SOP_PELT_SPRINGCONSTANT_INDEX, 0, t); }
88  int HINTPOLY()
89  { return evalInt(SOP_PELT_HINTPOLY_INDEX, 0, 0); }
90  int UFROM()
91  { return evalInt(SOP_PELT_UFROM_INDEX, 0, 0); }
92  int VFROM()
93  { return evalInt(SOP_PELT_VFROM_INDEX, 0, 0); }
94  bool USERANGE()
95  { return evalInt(SOP_PELT_USERANGE_INDEX, 0, 0) != 0; }
96  float MINU(fpreal t)
97  { return evalFloat(SOP_PELT_URANGE_INDEX, 0, t); }
98  float MAXU(fpreal t)
99  { return evalFloat(SOP_PELT_URANGE_INDEX, 1, t); }
100  float MINV(fpreal t)
101  { return evalFloat(SOP_PELT_VRANGE_INDEX, 0, t); }
102  float MAXV(fpreal t)
103  { return evalFloat(SOP_PELT_VRANGE_INDEX, 1, t); }
104  float ORIENTATION()
105  { return evalFloat(SOP_PELT_ORIENTATION_INDEX, 0, 0); }
106 
107  // This is the group of geometry to be manipulated by this SOP and cooked
108  // by the method "cookInputGroups".
109  const GA_EdgeGroup *myGroup;
110  const GEO_Face *myFrame;
111  int myFrameMetaCacheCount;
112 
113  int myFramePointCount;
114  GQ_Pelt::FramePoint *myFramePoints;
115 };
116 
117 #endif
virtual bool updateParmsFlags()
virtual const char * inputLabel(unsigned idx) const
fpreal evalFloat(int pi, int vi, fpreal t) const
UT_ErrorSeverity
Definition: UT_Error.h:25
png_uint_32 i
Definition: png.h:2877
void evalString(UT_String &val, int pi, int vi, fpreal t) const
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual OP_ERROR cookInputGroups(OP_Context &context, int alone=0)
double fpreal
Definition: SYS_Types.h:269
#define SOP_API
Definition: SOP_API.h:10
exint evalInt(int pi, int vi, fpreal t) const
virtual OP_ERROR cookMySop(OP_Context &context)=0
virtual int isRefInput(unsigned idx) const