HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual ~OBJ_Muscle();
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  virtual OBJ_OBJECT_TYPE getObjectType() const { return OBJ_STD_MUSCLE; }
87 
88  // Override this method so that we know when our input
89  // connections have been modified, and so we can
90  // update our child SOP muscle accordingly
91  virtual void inputConnectChanged(int which);
92 
93  bool getTranslates(OP_Context &context,
95  &translates);
96 
97  bool getRotates(OP_Context &context,
98  UT_Array<UT_Matrix4> &rotates);
99 
100  const GEO_PrimPoly *getCenterCurve(OP_Context &context);
101 
102  void getCurrColorValues(UT_Vector3 &color);
103 
104 protected:
105  virtual bool updateParmsFlags();
106 
107  // Used to get pointer to indirection indices for each object type
108  virtual int *getIndirect() const
109  { return muscleIndirect; }
110 
111  virtual int isObjectRenderable(fpreal t) const;
112 
113  virtual OP_ERROR cookMyObj(OP_Context &context);
114 
115  // Override this method so that the profile channels can be checked, and
116  // can indicate to the child node if they have changed
117  virtual void checkChannelDependencies(
118  CH_Channel *ch,
119  CH_CHANGE_TYPE reason);
120 
121 private:
122  // A function used to return our child SOP muscle,
123  // if it can be found
124  SOP_Muscle *getSOPMuscle();
125 
126  void verifyNames();
127 
128  // Paramter retrieval functions
129  bool DOPROFILES()
130  {
131  return evalInt("profiletoggle", 0, 0);
132  }
133 
134  bool DOCOLOR()
135  {
136  return evalInt("togglecolor", 0, 0);
137  }
138 
139  bool DOGRADIENT()
140  {
141  return evalInt("enablegradient", 0, 0);
142  }
143 
144  void MUSCLENAME(UT_String &str)
145  {
146  evalString(str, "musclename", 0, 0);
147  }
148 
149  bool USEHANDLES()
150  {
151  return (evalInt("typeswitcher", 0, 0) == 1);
152  }
153 
154 private:
155  static int *muscleIndirect;
156 
157  UT_Array<UT_String> myInputNames;
158 
159  // Stores the total number of inputs for this object
160  int myNumInputs;
161 
162  // Stores the total number of actual connected
163  // inputs for this object
164  int myNumConnectedInputs;
165 
166 };
167 
168 #endif
GLuint color
Definition: glcorearb.h:1260
virtual void checkChannelDependencies(CH_Channel *ch, CH_CHANGE_TYPE reason)
UT_ErrorSeverity
Definition: UT_Error.h:25
virtual int * getIndirect() const
Definition: OBJ_Muscle.h:108
3D Vector class.
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:785
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)
virtual void inputConnectChanged(int which)
virtual OBJ_OBJECT_TYPE getObjectType() const
Definition: OBJ_Muscle.h:86
double fpreal
Definition: SYS_Types.h:269
virtual int isObjectRenderable(fpreal t) const
exint evalInt(int pi, int vi, fpreal t) const
#define OBJ_API
Definition: OBJ_API.h:10
virtual bool updateParmsFlags() override
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:70