HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  SWIGOUT(%kwargs pressButton;)
67  virtual void pressButton(std::map<std::string, hboost::any> const & arguments=std::map<std::string, hboost::any>()) = 0;
68 
69  virtual void _set(double float_value) = 0;
70  virtual void setPending(double float_value) = 0;
71  virtual void _set(int int_value) = 0;
72  virtual void setPending(int int_value) = 0;
73  virtual void _set(const char *string_value) = 0;
74  virtual void setPending(const char *string_value) = 0;
75  virtual void _set(HOM_Geometry *geo) = 0;
76  virtual void setPending(HOM_Geometry *geo) = 0;
77  virtual void _set(const std::map<std::string, std::string> &map) = 0;
78  virtual void setPending(const std::map<std::string, std::string> &map) = 0;
79  virtual void _set(HOM_Ramp *ramp_value) = 0;
80  virtual void setPending(HOM_Ramp *ramp_value) = 0;
81 
82  virtual void _set(
83  HOM_Parm &parm, HOM_EnumValue *language=nullptr,
84  bool follow_parm_reference=true) = 0;
85 
86  virtual void setFromParm(HOM_Parm &src) = 0;
87 
88  virtual void revertToDefaults() = 0;
89  virtual void revertToAndRestorePermanentDefaults() = 0;
90  virtual bool hasTemporaryDefaults() = 0;
91  SWIGOUT(%kwargs isAtDefault;)
92  virtual bool isAtDefault(bool compare_temporary_defaults=true,
93  bool compare_expressions=true) = 0;
94 
95  SWIGOUT(%kwargs setExpression;)
96  virtual void setExpression(const char *expression,
97  HOM_EnumValue *language = NULL,
98  bool replace_expression=true) = 0;
99  virtual std::string expression() = 0;
100 
101  virtual HOM_EnumValue *expressionLanguage() = 0;
102 
103  virtual std::string rawValue() = 0;
104 
105 
106  virtual void setKeyframe(HOM_BaseKeyframe &keyframe) = 0;
107  virtual void setKeyframes(const std::vector<HOM_BaseKeyframe *> &keyframes) = 0;
108 
109  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframes() = 0;
110 
111  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> >
112  keyframesInRange(double start_frame, double end_frame) = 0;
113 
114  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframesBefore(double frame) = 0;
115  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframesAfter(double frame) = 0;
116 
117  virtual double evalAsFloat() = 0;
118  virtual double evalAsFloatAtFrame(double frame) = 0;
119  virtual int evalAsInt() = 0;
120  virtual int evalAsIntAtFrame(double frame) = 0;
121  virtual std::string evalAsString() = 0;
122  virtual std::string evalAsStringAtFrame(double frame) = 0;
123  virtual HOM_Geometry *evalAsGeometry() = 0;
124  virtual HOM_Geometry *evalAsGeometryAtFrame(double frame) = 0;
125  virtual std::map<std::string, std::string> evalAsJSONMap() = 0;
126  virtual std::map<std::string, std::string>
127  evalAsJSONMapAtFrame(double frame) = 0;
128  SWIGOUT(%newobject evalAsRamp;)
129  virtual HOM_Ramp *evalAsRamp() = 0;
130  SWIGOUT(%newobject evalAsRampAtFrame;)
131  virtual HOM_Ramp *evalAsRampAtFrame(double frame) = 0;
132  SWIGOUT(%newobject evalAsNode;)
133  virtual HOM_Node *evalAsNode() = 0;
134  SWIGOUT(%newobject evalAsNodeAtFrame;)
135  virtual HOM_Node *evalAsNodeAtFrame(double frame) = 0;
136  virtual std::vector<HOM_ElemPtr<HOM_Node> > evalAsNodes() = 0;
137  virtual std::vector<HOM_ElemPtr<HOM_Node> > evalAsNodesAtFrame(double frame) = 0;
138 
139  virtual std::string unexpandedString() = 0;
140 
141  virtual void deleteKeyframeAtFrame(double frame) = 0;
142 
143  virtual void deleteAllKeyframes() = 0;
144 
145  // TODO: Rename this to referencedParm()!
146  virtual HOM_Parm *getReferencedParm() = 0;
147 
148  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parmsReferencingThis() = 0;
149 
150  virtual bool isLocked() = 0;
151  virtual void lock(bool on) = 0;
152 
153  virtual bool isAutoscoped() = 0;
154  virtual void setAutoscope(bool on) = 0;
155 
156  virtual bool isScoped() = 0;
157  virtual void setScope(bool on) = 0;
158 
159  virtual bool isAutoSelected() = 0;
160  virtual void setAutoSelect(bool on) = 0;
161 
162  virtual bool isSelected() = 0;
163  virtual void setSelect(bool on) = 0;
164 
165  virtual std::string alias() = 0;
166  virtual void setAlias(const char *alias_name) = 0;
167 
168  virtual bool isSpare() = 0;
169 
170  virtual bool isTimeDependent() = 0;
171 
172  virtual bool isMultiParmInstance() = 0;
173  SWIGOUT(%newobject parentMultiParm;)
174  virtual HOM_Parm *parentMultiParm() = 0;
175  virtual std::vector<int> multiParmInstanceIndices() = 0;
176 
177  virtual std::vector<HOM_ElemPtr<HOM_Parm> > multiParmInstances() = 0;
178 
179  virtual void insertMultiParmInstance(int inst_index) = 0;
180 
181  virtual void removeMultiParmInstance(int inst_index) = 0;
182 
183  virtual std::vector<std::string> containingFolders() = 0;
184 
185  virtual std::vector<int> containingFolderIndices() = 0;
186 
187  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> >
188  containingFolderSetParmTuples() = 0;
189 
190  SWIGOUT(%kwargs asCode;)
191  virtual std::string asCode(
192  bool brief = false,
193  bool save_values = true,
194  bool save_keyframes = true,
195  bool save_keys_in_frames=false,
196  bool save_flag_values=true,
197  bool save_aliases=true,
198  const char *function_name = NULL) = 0;
199 
200  // You can get the parm data type with parmTemplate().dataType().
201  // However, we need a way to get the parm data type's enum value
202  // from C++ code without creating a temporary ParmTemplate object,
203  // so that's why parmDataTypeEnumId() exists.
204  SWIGOUT(%ignore parmDataTypeEnumId;)
205  virtual int parmDataTypeEnumId() = 0;
206 
207  // For data parameters only.
208  // You can get the data parm type with parmTemplate().dataParmType().
209  // However, we need a way to get the data parm type's enum value
210  // from C++ code without creating a temporary ParmTemplate object,
211  // so that's why dataParmTypeEnumId() exists.
212  SWIGOUT(%ignore dataParmTypeEnumId;)
213  virtual int dataParmTypeEnumId() = 0;
214 
215  SWIGOUT(%newobject createClip;)
216  virtual HOM_Node *createClip(HOM_Node &parent_node,
217  const char *name,
218  bool create_new,
219  bool apply_immediately,
220  bool current_value_only=false,
221  bool create_locked=false,
222  bool set_value_to_default=false) = 0;
223 
224  virtual void appendClip(HOM_Node &chop_node,
225  bool apply_immediately,
226  bool current_value_only=false,
227  bool create_locked=false,
228  bool set_value_to_default=false) = 0;
229 
230  virtual HOM_BinaryString _clipData(double start,
231  double end,
232  bool binary = true,
233  bool use_blosc_compression = true,
234  double sample_rate = 0) = 0;
235 
236  SWIGOUT(%kwargs _setClipData;)
237  virtual void _setClipData(HOM_BinaryString data,
238  bool binary = true,
239  bool blosc_compressed = true,
240  double sample_rate = 0,
241  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
242 
243  virtual void _saveClip(std::string file_name,
244  double start,
245  double end,
246  double sample_rate = 0) = 0;
247 
248  SWIGOUT(%kwargs _loadClip;)
249  virtual void _loadClip(std::string file_name,
250  double sample_rate = 0,
251  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
252 
253  SWIGOUT(%newobject overrideTrack;)
254  virtual HOM_Track *overrideTrack() = 0;
255 
256  virtual void copyToParmClipboard() = 0;
257 
258  virtual bool isDisabled() = 0;
259 
260  virtual void disable(bool on) = 0;
261 
262  virtual bool isHidden() = 0;
263 
264  virtual void hide(bool on) = 0;
265 
266  virtual bool isVisible() = 0;
267 
268  virtual bool isConstrained() = 0;
269 
270  virtual HOM_EnumValue &keyframeExtrapolation( bool before ) = 0;
271 
272  virtual void setKeyframeExtrapolation( bool before, HOM_EnumValue &e ) = 0;
273 
274  virtual void keyframesRefit(
275  bool refit, double refit_tol, bool refit_preserve_extremas,
276  bool refit_bezier, bool resample, double resample_rate, double resample_tol,
277  bool range, double range_start, double range_end, HOM_EnumValue &bake_chop, const char *expression="") = 0;
278 
279 #ifdef SWIG
280 %extend
281 {
282  InterpreterObject eval()
283  {
284  return HOMevalParm(*self);
285  }
286 
287  InterpreterObject evalAtFrame(double frame)
288  {
289  return HOMevalParmAtFrame(*self, frame);
290  }
291 
292  InterpreterObject evalAtTime(double time)
293  {
294  return HOMevalParmAtFrame(*self, HOM().timeToFrame(time));
295  }
296 }
297 #endif
298 };
299 
300 #endif
virtual ~HOM_Parm()
Definition: HOM_Parm.h:36
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1056
GLenum GLint * range
Definition: glcorearb.h:1924
GT_API const UT_StringHolder time
GLuint start
Definition: glcorearb.h:474
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:344
#define HOM_API
Definition: HOM_API.h:13
GLuint GLuint end
Definition: glcorearb.h:474
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1055
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:604
char * lock(exint offset=0, exint reserve_bytes=0)
#define HOM_MIN_NEGATIVE_DOUBLE
Definition: HOM_Defines.h:46
GLboolean * data
Definition: glcorearb.h:130
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:590
GLenum src
Definition: glcorearb.h:1792