HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_PolySplit2.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: PolySplit tool. Slices and dices polygons.
9  *
10  */
11 
12 #ifndef __SOP_PolySplit2_h__
13 #define __SOP_PolySplit2_h__
14 
15 #include "SOP_API.h"
16 #include <GEO/GEO_PrimClassifier.h>
17 #include <UT/UT_ValArray.h>
18 #include "SOP_Node.h"
19 
20 class MSS_PolySplitState2;
21 class GU_RayIntersect;
22 
24 {
25 public:
26  SOP_PolySplit2(OP_Network *net, const char *name,
27  OP_Operator *entry);
28  ~SOP_PolySplit2() override;
29 
30  static OP_Node *myConstructor(OP_Network *net,
31  const char *name,
32  OP_Operator *entry);
33 
34  static PRM_Template *buildTemplates();
35 
36  const SOP_NodeVerb *cookVerb() const override;
37 
38  static const char *myInputLabels[];
39 
40 protected:
41  OP_ERROR cookMySop(OP_Context &context) override;
42  const char *inputLabel(unsigned idx) const override;
43 
44 private:
45  // Properties
46  void getSplitLoc(UT_String &str, fpreal t)
47  { evalString(str, "splitloc", 0, t); }
48 
49  void setSplitLoc(UT_String &str, fpreal t, CH_StringMeaning meaning)
50  { setString(str, meaning, "splitloc", 0, t); }
51 
52  // returns true if there is something in the second input
53  bool curveInput() { return getInput(1) != NULL; }
54 
55  int PATHTYPE() { return evalInt("pathtype", 0, 0); }
56  // MSS needs this so it can create the node in quad strip mode
57  void SET_PATHTYPE(int i) { setInt("pathtype", 0, 0, i); }
58 
59  int CLOSED() { return evalInt("close", 0, 0); }
60  void SET_CLOSED(int i) { setInt("close", 0, 0, i); }
61 
62  int ALLOWFACES() { return evalInt("allowfaces", 0, 0); }
63  void SET_ALLOWFACES(int i) { setInt("allowfaces", 0, 0, i); }
64 
65  int NUMLOOPS() { return evalInt("numloops", 0, 0); }
66  int PARALLELLOOP() { return evalInt("parallellooptoggle", 0, 0); }
67  void SET_PARALLELLOOP(int i) { setInt("parallellooptoggle", 0, 0, i); }
68  int PARALLELFLIP() { return evalInt("parallelfliptoggle", 0, 0); }
69  void SET_PARALLELFLIP(int i) { setInt("parallelfliptoggle", 0, 0, i); }
70 
71  int QUADCOMPLETE() { return evalInt("quadcomplete", 0, 0); }
72  void SET_QUADCOMPLETE(int i) { setInt("quadcomplete", 0, 0, i); }
73 
74  int EDGEPERCENTTOGGLE() { return evalInt("edgepercenttoggle", 0, 0); }
75  void SET_EDGEPERCENTTOGGLE(int i) { setInt("edgepercenttoggle", 0, 0, i); }
76  float EDGEPERCENTAGE() { return evalFloat("edgepercent", 0, 0); }
77 
78  int UPDATENORMS(fpreal t) { return evalInt("updatenorms", 0, t); }
79 
80  int CREATEGROUP() { return evalInt("grouptoggle", 0, 0); }
81  void GROUPNAME(UT_String &str, fpreal t) { evalString(str, "groupname", 0, t); }
82  int GROUPAPPEND() { return evalInt("groupappend", 0, 0); }
83 
84  float TOLERANCE(fpreal t) { return evalFloat("tolerance", 0, t); }
85 
86  friend class sop_SplitParser2;
87  friend class MSS_PolySplitState2;
88  friend class SOP_PolySplit2Verb;
89 };
90 
91 #endif
virtual const SOP_NodeVerb * cookVerb() const
Definition: SOP_Node.h:906
CH_StringMeaning
virtual const char * inputLabel(unsigned idx) const
fpreal evalFloat(int pi, int vi, fpreal t) const
UT_ErrorSeverity
Definition: UT_Error.h:25
void setString(const UT_StringRef &val, CH_StringMeaning meaning, int parmi, int vectori, fpreal t)
void evalString(UT_String &val, int pi, int vi, fpreal t) const
OP_Node * getInput(unsigned idx, bool mark_used=false) const
Returns the node connected to a particular input (may be null).
GLuint const GLchar * name
Definition: glcorearb.h:786
GLdouble t
Definition: glad.h:2397
fpreal64 fpreal
Definition: SYS_Types.h:277
void setInt(int parmi, int vectori, fpreal t, exint value)
#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