HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OBJ_Muscle.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: OBJ_Muscle.h (Custom Library, C++)
7  *
8  * COMMENTS: An object that creates muscle geometry. Essentially
9  * just a container for the muscle SOP.
10  */
11 
12 #ifndef __OBJ_Muscle__
13 #define __OBJ_Muscle__
14 
15 #include <CH/CH_Channel.h>
16 #include <UT/UT_Array.h>
17 #include <UT/UT_Vector3Array.h>
18 #include "OBJ_API.h"
19 #include "OBJ_Geometry.h"
20 
21 class SOP_Muscle;
22 class UT_String;
23 class GEO_PrimPoly;
24 
26  // Muscle tab
31 
32  // Muscle/Controls tab
52 
54 
55  // Preferences tab
61 
62  // Center line tab
68 
70 };
71 
73 {
74 public:
76  const char *name,
77  OP_Operator *op);
78  ~OBJ_Muscle() override;
79 
80  static OP_Node *myConstructor(OP_Network *net,
81  const char *name,
82  OP_Operator *entry);
83 
84  static PRM_Template *getTemplateList();
85 
86  OBJ_OBJECT_TYPE getObjectType() const override
87  { return OBJ_STD_MUSCLE; }
88 
89  // Override this method so that we know when our input
90  // connections have been modified, and so we can
91  // update our child SOP muscle accordingly
92  void inputConnectChanged(int which) override;
93 
94  bool getTranslates(OP_Context &context,
96  &translates);
97 
98  bool getRotates(OP_Context &context,
99  UT_Array<UT_Matrix4> &rotates);
100 
101  const GEO_PrimPoly *getCenterCurve(OP_Context &context);
102 
103  void getCurrColorValues(UT_Vector3 &color);
104 
105 protected:
106  bool updateParmsFlags() override;
107 
108  // Used to get pointer to indirection indices for each object type
109  int *getIndirect() const override
110  { return muscleIndirect; }
111 
112  int isObjectRenderable(fpreal t) const override;
113 
114  OP_ERROR cookMyObj(OP_Context &context) override;
115 
116  // Override this method so that the profile channels can be checked, and
117  // can indicate to the child node if they have changed
119  CH_Channel *ch,
120  CH_CHANGE_TYPE reason) override;
121 
122 private:
123  // A function used to return our child SOP muscle,
124  // if it can be found
125  SOP_Muscle *getSOPMuscle();
126 
127  void verifyNames();
128 
129  // Paramter retrieval functions
130  bool DOPROFILES()
131  {
132  return evalInt("profiletoggle", 0, 0);
133  }
134 
135  bool DOCOLOR()
136  {
137  return evalInt("togglecolor", 0, 0);
138  }
139 
140  bool DOGRADIENT()
141  {
142  return evalInt("enablegradient", 0, 0);
143  }
144 
145  void MUSCLENAME(UT_String &str)
146  {
147  evalString(str, "musclename", 0, 0);
148  }
149 
150  bool USEHANDLES()
151  {
152  return (evalInt("typeswitcher", 0, 0) == 1);
153  }
154 
155 private:
156  static int *muscleIndirect;
157 
158  UT_Array<UT_String> myInputNames;
159 
160  // Stores the total number of inputs for this object
161  int myNumInputs;
162 
163  // Stores the total number of actual connected
164  // inputs for this object
165  int myNumConnectedInputs;
166 
167 };
168 
169 #endif
int * getIndirect() const override
Definition: OBJ_Muscle.h:109
UT_ErrorSeverity
Definition: UT_Error.h:25
void checkChannelDependencies(CH_Channel *ch, CH_CHANGE_TYPE reason) override
static PRM_Template * getTemplateList(OBJ_ParmsStyle style)
CH_CHANGE_TYPE
void evalString(UT_String &val, int pi, int vi, fpreal t) const
OBJ_MuscleIndex
Definition: OBJ_Muscle.h:25
virtual OP_ERROR cookMyObj(OP_Context &context)
GLuint const GLchar * name
Definition: glcorearb.h:786
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)
GLdouble t
Definition: glad.h:2397
virtual int isObjectRenderable(fpreal t) const
GLuint color
Definition: glcorearb.h:1261
fpreal64 fpreal
Definition: SYS_Types.h:277
bool updateParmsFlags() override
exint evalInt(int pi, int vi, fpreal t) const
void inputConnectChanged(int which) override
#define OBJ_API
Definition: OBJ_API.h:10
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:73
OBJ_OBJECT_TYPE getObjectType() const override
Definition: OBJ_Muscle.h:86