HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HOM_Parm.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  * COMMENTS:
7  */
8 
9 #ifndef __HOM_Parm_h__
10 #define __HOM_Parm_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_BaseKeyframe.h"
16 #include "HOM_PtrOrNull.h"
17 #include <string>
18 #include <map>
19 #include <vector>
20 class HOM_ParmTemplate;
21 class HOM_ParmTuple;
22 class HOM_Track;
23 class HOM_Ramp;
24 class HOM_Geometry;
25 class UT_WorkBuffer;
26 
27 SWIGOUT(%rename(Parm) HOM_Parm;)
28 
30 {
31 public:
33  { HOM_CONSTRUCT_OBJECT(this) }
34  HOM_Parm(const HOM_Parm &parm)
35  { HOM_CONSTRUCT_OBJECT(this) }
36  virtual ~HOM_Parm()
37  { HOM_DESTRUCT_OBJECT(this) }
38 
39  // We compare against a pointer instead of a reference because we want
40  // to be able to compare against None.
41  virtual bool operator==(HOM_PtrOrNull<HOM_Parm> parm) = 0;
42  virtual bool operator!=(HOM_PtrOrNull<HOM_Parm> parm) = 0;
43  SWIGOUT(%ignore operator<(HOM_Parm *parm);)
44  virtual bool operator<(HOM_Parm *parm) = 0;
45 
46  virtual int __hash__() = 0;
47  virtual std::string __repr__() = 0;
48 
49  SWIGOUT(%newobject node;)
50  virtual HOM_Node *node() = 0;
51 
52  SWIGOUT(%newobject tuple;)
53  virtual HOM_ParmTuple *tuple() = 0;
54 
55  SWIGOUT(%newobject parmTemplate;)
56  virtual HOM_ParmTemplate *parmTemplate() = 0;
57 
58  virtual std::string name() = 0;
59  virtual std::string path() = 0;
60  virtual std::string description() = 0;
61  virtual int componentIndex() = 0;
62 
63  virtual std::vector<std::string> menuLabels() = 0;
64  virtual std::vector<std::string> menuItems() = 0;
65 
66  virtual void pressButton() = 0;
67 
68  virtual void _set(double float_value) = 0;
69  virtual void setPending(double float_value) = 0;
70  virtual void _set(int int_value) = 0;
71  virtual void setPending(int int_value) = 0;
72  virtual void _set(const char *string_value) = 0;
73  virtual void setPending(const char *string_value) = 0;
74  virtual void _set(HOM_Geometry *geo) = 0;
75  virtual void setPending(HOM_Geometry *geo) = 0;
76  virtual void _set(const std::map<std::string, std::string> &map) = 0;
77  virtual void setPending(const std::map<std::string, std::string> &map) = 0;
78  virtual void _set(HOM_Ramp *ramp_value) = 0;
79  virtual void setPending(HOM_Ramp *ramp_value) = 0;
80 
81  virtual void _set(
82  HOM_Parm &parm, HOM_EnumValue *language=nullptr,
83  bool follow_parm_reference=true) = 0;
84 
85  virtual void revertToDefaults() = 0;
86  virtual void revertToAndRestorePermanentDefaults() = 0;
87  virtual bool hasTemporaryDefaults() = 0;
88  SWIGOUT(%kwargs isAtDefault;)
89  virtual bool isAtDefault(bool compare_temporary_defaults=true,
90  bool compare_expressions=true) = 0;
91 
92  SWIGOUT(%kwargs setExpression;)
93  virtual void setExpression(const char *expression,
94  HOM_EnumValue *language = NULL,
95  bool replace_expression=true) = 0;
96  virtual std::string expression() = 0;
97 
98  virtual HOM_EnumValue *expressionLanguage() = 0;
99 
100  virtual std::string rawValue() = 0;
101 
102 
103  virtual void setKeyframe(HOM_BaseKeyframe &keyframe) = 0;
104  virtual void setKeyframes(const std::vector<HOM_BaseKeyframe *> &keyframes) = 0;
105 
106  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframes() = 0;
107 
108  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> >
109  keyframesInRange(double start_frame, double end_frame) = 0;
110 
111  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframesBefore(double frame) = 0;
112  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframesAfter(double frame) = 0;
113 
114  virtual double evalAsFloat() = 0;
115  virtual double evalAsFloatAtFrame(double frame) = 0;
116  virtual int evalAsInt() = 0;
117  virtual int evalAsIntAtFrame(double frame) = 0;
118  virtual std::string evalAsString() = 0;
119  virtual std::string evalAsStringAtFrame(double frame) = 0;
120  virtual HOM_Geometry *evalAsGeometry() = 0;
121  virtual HOM_Geometry *evalAsGeometryAtFrame(double frame) = 0;
122  virtual std::map<std::string, std::string> evalAsJSONMap() = 0;
123  virtual std::map<std::string, std::string>
124  evalAsJSONMapAtFrame(double frame) = 0;
125  SWIGOUT(%newobject evalAsRamp;)
126  virtual HOM_Ramp *evalAsRamp() = 0;
127  SWIGOUT(%newobject evalAsRampAtFrame;)
128  virtual HOM_Ramp *evalAsRampAtFrame(double frame) = 0;
129  SWIGOUT(%newobject evalAsNode;)
130  virtual HOM_Node *evalAsNode() = 0;
131  SWIGOUT(%newobject evalAsNodeAtFrame;)
132  virtual HOM_Node *evalAsNodeAtFrame(double frame) = 0;
133  virtual std::vector<HOM_ElemPtr<HOM_Node> > evalAsNodes() = 0;
134  virtual std::vector<HOM_ElemPtr<HOM_Node> > evalAsNodesAtFrame(double frame) = 0;
135 
136  virtual std::string unexpandedString() = 0;
137 
138  virtual void deleteKeyframeAtFrame(double frame) = 0;
139 
140  virtual void deleteAllKeyframes() = 0;
141 
142  // TODO: Rename this to referencedParm()!
143  virtual HOM_Parm *getReferencedParm() = 0;
144 
145  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parmsReferencingThis() = 0;
146 
147  virtual bool isLocked() = 0;
148  virtual void lock(bool on) = 0;
149 
150  virtual bool isAutoscoped() = 0;
151  virtual void setAutoscope(bool on) = 0;
152 
153  virtual bool isScoped() = 0;
154  virtual void setScope(bool on) = 0;
155 
156  virtual std::string alias() = 0;
157  virtual void setAlias(const char *alias_name) = 0;
158 
159  virtual bool isSpare() = 0;
160 
161  virtual bool isTimeDependent() = 0;
162 
163  virtual bool isMultiParmInstance() = 0;
164  SWIGOUT(%newobject parentMultiParm;)
165  virtual HOM_Parm *parentMultiParm() = 0;
166  virtual std::vector<int> multiParmInstanceIndices() = 0;
167 
168  virtual std::vector<HOM_ElemPtr<HOM_Parm> > multiParmInstances() = 0;
169 
170  virtual void insertMultiParmInstance(int inst_index) = 0;
171 
172  virtual void removeMultiParmInstance(int inst_index) = 0;
173 
174  virtual std::vector<std::string> containingFolders() = 0;
175 
176  virtual std::vector<int> containingFolderIndices() = 0;
177 
178  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> >
179  containingFolderSetParmTuples() = 0;
180 
181  SWIGOUT(%kwargs asCode;)
182  virtual std::string asCode(
183  bool brief = false,
184  bool save_values = true,
185  bool save_keyframes = true,
186  bool save_keys_in_frames=false,
187  bool save_flag_values=true,
188  bool save_aliases=true,
189  const char *function_name = NULL) = 0;
190 
191  // You can get the parm data type with parmTemplate().dataType().
192  // However, we need a way to get the parm data type's enum value
193  // from C++ code without creating a temporary ParmTemplate object,
194  // so that's why parmDataTypeEnumId() exists.
195  SWIGOUT(%ignore parmDataTypeEnumId;)
196  virtual int parmDataTypeEnumId() = 0;
197 
198  // For data parameters only.
199  // You can get the data parm type with parmTemplate().dataParmType().
200  // However, we need a way to get the data parm type's enum value
201  // from C++ code without creating a temporary ParmTemplate object,
202  // so that's why dataParmTypeEnumId() exists.
203  SWIGOUT(%ignore dataParmTypeEnumId;)
204  virtual int dataParmTypeEnumId() = 0;
205 
206  SWIGOUT(%newobject createClip;)
207  virtual HOM_Node *createClip(HOM_Node &parent_node,
208  const char *name,
209  bool create_new,
210  bool apply_immediately,
211  bool current_value_only=false,
212  bool create_locked=false) = 0;
213 
214  SWIGOUT(%newobject overrideTrack;)
215  virtual HOM_Track *overrideTrack() = 0;
216 
217  virtual void copyToParmClipboard() = 0;
218 
219  virtual bool isDisabled() = 0;
220 
221  virtual void disable(bool on) = 0;
222 
223  virtual bool isHidden() = 0;
224 
225  virtual void hide(bool on) = 0;
226 
227  virtual bool isVisible() = 0;
228 
229  virtual HOM_EnumValue &keyframeExtrapolation( bool before ) = 0;
230 
231  virtual void setKeyframeExtrapolation( bool before, HOM_EnumValue &e ) = 0;
232 
233  virtual void keyframesRefit(
234  bool refit, double refit_tol, bool refit_preserve_extremas,
235  bool refit_bezier, bool resample, double resample_rate, double resample_tol,
236  bool range, double range_start, double range_end, HOM_EnumValue &bake_chop, const char *expression="") = 0;
237 
238 #ifdef SWIG
239 %extend
240 {
241  InterpreterObject eval()
242  {
243  return HOMevalParm(*self);
244  }
245 
246  InterpreterObject evalAtFrame(double frame)
247  {
248  return HOMevalParmAtFrame(*self, frame);
249  }
250 
251  InterpreterObject evalAtTime(double time)
252  {
253  return HOMevalParmAtFrame(*self, HOM().timeToFrame(time));
254  }
255 }
256 #endif
257 };
258 
259 #endif
virtual ~HOM_Parm()
Definition: HOM_Parm.h:36
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:973
GLenum GLint * range
Definition: glcorearb.h:1924
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:972
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:610
char * lock(exint offset=0, exint reserve_bytes=0)
GLuint const GLchar * name
Definition: glcorearb.h:785
HOM_Parm(const HOM_Parm &parm)
Definition: HOM_Parm.h:34
HOM_Parm()
Definition: HOM_Parm.h:32
HOM_API HOM_Module & HOM()
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:596