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 setFromParm(HOM_Parm &src) = 0;
86 
87  virtual void revertToDefaults() = 0;
88  virtual void revertToAndRestorePermanentDefaults() = 0;
89  virtual bool hasTemporaryDefaults() = 0;
90  SWIGOUT(%kwargs isAtDefault;)
91  virtual bool isAtDefault(bool compare_temporary_defaults=true,
92  bool compare_expressions=true) = 0;
93 
94  SWIGOUT(%kwargs setExpression;)
95  virtual void setExpression(const char *expression,
96  HOM_EnumValue *language = NULL,
97  bool replace_expression=true) = 0;
98  virtual std::string expression() = 0;
99 
100  virtual HOM_EnumValue *expressionLanguage() = 0;
101 
102  virtual std::string rawValue() = 0;
103 
104 
105  virtual void setKeyframe(HOM_BaseKeyframe &keyframe) = 0;
106  virtual void setKeyframes(const std::vector<HOM_BaseKeyframe *> &keyframes) = 0;
107 
108  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframes() = 0;
109 
110  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> >
111  keyframesInRange(double start_frame, double end_frame) = 0;
112 
113  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframesBefore(double frame) = 0;
114  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframesAfter(double frame) = 0;
115 
116  virtual double evalAsFloat() = 0;
117  virtual double evalAsFloatAtFrame(double frame) = 0;
118  virtual int evalAsInt() = 0;
119  virtual int evalAsIntAtFrame(double frame) = 0;
120  virtual std::string evalAsString() = 0;
121  virtual std::string evalAsStringAtFrame(double frame) = 0;
122  virtual HOM_Geometry *evalAsGeometry() = 0;
123  virtual HOM_Geometry *evalAsGeometryAtFrame(double frame) = 0;
124  virtual std::map<std::string, std::string> evalAsJSONMap() = 0;
125  virtual std::map<std::string, std::string>
126  evalAsJSONMapAtFrame(double frame) = 0;
127  SWIGOUT(%newobject evalAsRamp;)
128  virtual HOM_Ramp *evalAsRamp() = 0;
129  SWIGOUT(%newobject evalAsRampAtFrame;)
130  virtual HOM_Ramp *evalAsRampAtFrame(double frame) = 0;
131  SWIGOUT(%newobject evalAsNode;)
132  virtual HOM_Node *evalAsNode() = 0;
133  SWIGOUT(%newobject evalAsNodeAtFrame;)
134  virtual HOM_Node *evalAsNodeAtFrame(double frame) = 0;
135  virtual std::vector<HOM_ElemPtr<HOM_Node> > evalAsNodes() = 0;
136  virtual std::vector<HOM_ElemPtr<HOM_Node> > evalAsNodesAtFrame(double frame) = 0;
137 
138  virtual std::string unexpandedString() = 0;
139 
140  virtual void deleteKeyframeAtFrame(double frame) = 0;
141 
142  virtual void deleteAllKeyframes() = 0;
143 
144  // TODO: Rename this to referencedParm()!
145  virtual HOM_Parm *getReferencedParm() = 0;
146 
147  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parmsReferencingThis() = 0;
148 
149  virtual bool isLocked() = 0;
150  virtual void lock(bool on) = 0;
151 
152  virtual bool isAutoscoped() = 0;
153  virtual void setAutoscope(bool on) = 0;
154 
155  virtual bool isScoped() = 0;
156  virtual void setScope(bool on) = 0;
157 
158  virtual std::string alias() = 0;
159  virtual void setAlias(const char *alias_name) = 0;
160 
161  virtual bool isSpare() = 0;
162 
163  virtual bool isTimeDependent() = 0;
164 
165  virtual bool isMultiParmInstance() = 0;
166  SWIGOUT(%newobject parentMultiParm;)
167  virtual HOM_Parm *parentMultiParm() = 0;
168  virtual std::vector<int> multiParmInstanceIndices() = 0;
169 
170  virtual std::vector<HOM_ElemPtr<HOM_Parm> > multiParmInstances() = 0;
171 
172  virtual void insertMultiParmInstance(int inst_index) = 0;
173 
174  virtual void removeMultiParmInstance(int inst_index) = 0;
175 
176  virtual std::vector<std::string> containingFolders() = 0;
177 
178  virtual std::vector<int> containingFolderIndices() = 0;
179 
180  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> >
181  containingFolderSetParmTuples() = 0;
182 
183  SWIGOUT(%kwargs asCode;)
184  virtual std::string asCode(
185  bool brief = false,
186  bool save_values = true,
187  bool save_keyframes = true,
188  bool save_keys_in_frames=false,
189  bool save_flag_values=true,
190  bool save_aliases=true,
191  const char *function_name = NULL) = 0;
192 
193  // You can get the parm data type with parmTemplate().dataType().
194  // However, we need a way to get the parm data type's enum value
195  // from C++ code without creating a temporary ParmTemplate object,
196  // so that's why parmDataTypeEnumId() exists.
197  SWIGOUT(%ignore parmDataTypeEnumId;)
198  virtual int parmDataTypeEnumId() = 0;
199 
200  // For data parameters only.
201  // You can get the data parm type with parmTemplate().dataParmType().
202  // However, we need a way to get the data parm type's enum value
203  // from C++ code without creating a temporary ParmTemplate object,
204  // so that's why dataParmTypeEnumId() exists.
205  SWIGOUT(%ignore dataParmTypeEnumId;)
206  virtual int dataParmTypeEnumId() = 0;
207 
208  SWIGOUT(%newobject createClip;)
209  virtual HOM_Node *createClip(HOM_Node &parent_node,
210  const char *name,
211  bool create_new,
212  bool apply_immediately,
213  bool current_value_only=false,
214  bool create_locked=false) = 0;
215 
216  SWIGOUT(%newobject overrideTrack;)
217  virtual HOM_Track *overrideTrack() = 0;
218 
219  virtual void copyToParmClipboard() = 0;
220 
221  virtual bool isDisabled() = 0;
222 
223  virtual void disable(bool on) = 0;
224 
225  virtual bool isHidden() = 0;
226 
227  virtual void hide(bool on) = 0;
228 
229  virtual bool isVisible() = 0;
230 
231  virtual HOM_EnumValue &keyframeExtrapolation( bool before ) = 0;
232 
233  virtual void setKeyframeExtrapolation( bool before, HOM_EnumValue &e ) = 0;
234 
235  virtual void keyframesRefit(
236  bool refit, double refit_tol, bool refit_preserve_extremas,
237  bool refit_bezier, bool resample, double resample_rate, double resample_tol,
238  bool range, double range_start, double range_end, HOM_EnumValue &bake_chop, const char *expression="") = 0;
239 
240 #ifdef SWIG
241 %extend
242 {
243  InterpreterObject eval()
244  {
245  return HOMevalParm(*self);
246  }
247 
248  InterpreterObject evalAtFrame(double frame)
249  {
250  return HOMevalParmAtFrame(*self, frame);
251  }
252 
253  InterpreterObject evalAtTime(double time)
254  {
255  return HOMevalParmAtFrame(*self, HOM().timeToFrame(time));
256  }
257 }
258 #endif
259 };
260 
261 #endif
virtual ~HOM_Parm()
Definition: HOM_Parm.h:36
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:983
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:982
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
GLenum src
Definition: glcorearb.h:1792