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_Color;
21 class HOM_ParmTemplate;
22 class HOM_ParmTuple;
23 class HOM_Track;
24 class HOM_Ramp;
25 class HOM_Geometry;
26 class UT_WorkBuffer;
27 
28 SWIGOUT(%rename(Parm) HOM_Parm;)
29 
31 {
32 public:
34  { HOM_CONSTRUCT_OBJECT(this) }
35  HOM_Parm(const HOM_Parm &parm)
36  { HOM_CONSTRUCT_OBJECT(this) }
37  virtual ~HOM_Parm()
38  { HOM_DESTRUCT_OBJECT(this) }
39 
40  // We compare against a pointer instead of a reference because we want
41  // to be able to compare against None.
42  virtual bool operator==(HOM_PtrOrNull<HOM_Parm> parm) = 0;
43  virtual bool operator!=(HOM_PtrOrNull<HOM_Parm> parm) = 0;
44  SWIGOUT(%ignore operator<(HOM_Parm *parm);)
45  virtual bool operator<(HOM_Parm *parm) = 0;
46 
47  virtual int __hash__() = 0;
48  virtual std::string __repr__() = 0;
49 
50  SWIGOUT(%newobject node;)
51  virtual HOM_Node *node() = 0;
52 
53  SWIGOUT(%newobject tuple;)
54  SWIGOUT(%warnfilter(321) tuple;)
55  virtual HOM_ParmTuple *tuple() = 0;
56 
57  SWIGOUT(%newobject parmTemplate;)
58  virtual HOM_ParmTemplate *parmTemplate() = 0;
59 
60  virtual std::string name() = 0;
61  virtual std::string path() = 0;
62  virtual std::string description() = 0;
63  virtual int componentIndex() = 0;
64 
65  virtual std::vector<std::string> menuLabels() = 0;
66  virtual std::vector<std::string> menuItems() = 0;
67 
68  SWIGOUT(%kwargs pressButton;)
69  virtual void pressButton(std::map<std::string, hboost::any> const & arguments=std::map<std::string, hboost::any>()) = 0;
70 
71  virtual void _set(double float_value) = 0;
72  virtual void _setPending(double float_value) = 0;
73  virtual void _set(int int_value) = 0;
74  virtual void _setPending(int int_value) = 0;
75  virtual void _set(const char *string_value) = 0;
76  virtual void _setPending(const char *string_value) = 0;
77  virtual void _set(HOM_Geometry *geo) = 0;
78  virtual void _setPending(HOM_Geometry *geo) = 0;
79  virtual void _set(const std::map<std::string, std::string> &map) = 0;
80  virtual void _setPending(const std::map<std::string, std::string> &map) = 0;
81  virtual void _set(HOM_Ramp *ramp_value) = 0;
82  virtual void _setPending(HOM_Ramp *ramp_value) = 0;
83 
84  virtual void _set(
85  HOM_Parm &parm, HOM_EnumValue *language=nullptr,
86  bool follow_parm_reference=true) = 0;
87 
88  virtual void setFromParm(HOM_Parm &src) = 0;
89  virtual void setFromParmDefaults(HOM_Parm &src) = 0;
90 
91  virtual void revertToDefaults() = 0;
92  virtual void revertToAndRestorePermanentDefaults() = 0;
93  virtual bool hasTemporaryDefaults() = 0;
94  SWIGOUT(%kwargs isAtDefault;)
95  virtual bool isAtDefault(bool compare_temporary_defaults=true,
96  bool compare_expressions=true) = 0;
97 
98  SWIGOUT(%kwargs setExpression;)
99  virtual void setExpression(const char *expression,
100  HOM_EnumValue *language = NULL,
101  bool replace_expression=true) = 0;
102  virtual std::string expression() = 0;
103 
104  virtual HOM_EnumValue *expressionLanguage() = 0;
105 
106  virtual std::string rawValue() = 0;
107 
108  virtual bool isShowingExpression() = 0;
109  virtual void showExpression(bool value) = 0;
110 
111  virtual void setKeyframe(HOM_BaseKeyframe &keyframe) = 0;
112  virtual void setKeyframes(const std::vector<HOM_BaseKeyframe *> &keyframes) = 0;
113 
114  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframes() = 0;
115 
116  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> >
117  keyframesInRange(double start_frame, double end_frame) = 0;
118 
119  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframesBefore(double frame) = 0;
120  virtual std::vector<HOM_ElemPtr<HOM_BaseKeyframe> > keyframesAfter(double frame) = 0;
121 
122  virtual double evalAsFloat() = 0;
123  virtual double evalAsFloatAtFrame(double frame) = 0;
124  virtual int evalAsInt() = 0;
125  virtual int evalAsIntAtFrame(double frame) = 0;
126  virtual std::string evalAsString() = 0;
127  virtual std::string evalAsStringAtFrame(double frame) = 0;
128  virtual HOM_Geometry *evalAsGeometry() = 0;
129  virtual HOM_Geometry *evalAsGeometryAtFrame(double frame) = 0;
130  virtual std::map<std::string, std::string> evalAsJSONMap() = 0;
131  virtual std::map<std::string, std::string>
132  evalAsJSONMapAtFrame(double frame) = 0;
133  SWIGOUT(%newobject evalAsRamp;)
134  virtual HOM_Ramp *evalAsRamp() = 0;
135  SWIGOUT(%newobject evalAsRampAtFrame;)
136  virtual HOM_Ramp *evalAsRampAtFrame(double frame) = 0;
137  SWIGOUT(%newobject evalAsNode;)
138  virtual HOM_Node *evalAsNode() = 0;
139  SWIGOUT(%newobject evalAsNodeAtFrame;)
140  virtual HOM_Node *evalAsNodeAtFrame(double frame) = 0;
141  virtual std::vector<HOM_ElemPtr<HOM_Node> > evalAsNodes() = 0;
142  virtual std::vector<HOM_ElemPtr<HOM_Node> > evalAsNodesAtFrame(double frame) = 0;
143 
144  virtual std::string unexpandedString() = 0;
145 
146  virtual void deleteKeyframeAtFrame(double frame) = 0;
147 
148  virtual void deleteAllKeyframes() = 0;
149 
150  // TODO: Rename this to referencedParm()!
151  SWIGOUT(%newobject getReferencedParm;)
152  virtual HOM_Parm *getReferencedParm() = 0;
153 
154  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parmsReferencingThis() = 0;
155 
156  virtual bool isLocked() = 0;
157  virtual void lock(bool on) = 0;
158 
159  virtual bool isAutoscoped() = 0;
160  virtual void setAutoscope(bool on) = 0;
161 
162  virtual bool isScoped() = 0;
163  virtual void setScope(bool on) = 0;
164 
165  virtual bool isAutoSelected() = 0;
166  virtual void setAutoSelect(bool on) = 0;
167 
168  virtual bool isSelected() = 0;
169  virtual void setSelect(bool on) = 0;
170 
171  virtual std::string alias() = 0;
172  virtual void setAlias(const char *alias_name) = 0;
173 
174  virtual bool isSpare() = 0;
175 
176  virtual bool isTimeDependent() = 0;
177 
178  virtual bool isMultiParmInstance() = 0;
179  SWIGOUT(%newobject parentMultiParm;)
180  virtual HOM_Parm *parentMultiParm() = 0;
181  virtual std::vector<int> multiParmInstanceIndices() = 0;
182 
183  virtual int multiParmInstancesPerItem() = 0;
184  virtual int multiParmInstancesCount() = 0;
185  virtual int multiParmStartOffset() = 0;
186 
187  virtual std::vector<HOM_ElemPtr<HOM_Parm> > multiParmInstances() = 0;
188 
189  virtual void insertMultiParmInstance(int inst_index) = 0;
190 
191  virtual void removeMultiParmInstance(int inst_index) = 0;
192 
193  virtual std::vector<std::string> containingFolders() = 0;
194  virtual std::vector<int> containingFolderIndices() = 0;
195  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> >
196  containingFolderSetParmTuples() = 0;
197 
198  SWIGOUT(%kwargs asCode;)
199  virtual std::string asCode(
200  bool brief = false,
201  bool save_values = true,
202  bool save_keyframes = true,
203  bool save_keys_in_frames=false,
204  bool save_flag_values=true,
205  bool save_aliases=true,
206  const char *function_name = NULL) = 0;
207 
208  // You can get the parm data type with parmTemplate().dataType().
209  // However, we need a way to get the parm data type's enum value
210  // from C++ code without creating a temporary ParmTemplate object,
211  // so that's why parmDataTypeEnumId() exists.
212  SWIGOUT(%ignore parmDataTypeEnumId;)
213  virtual int parmDataTypeEnumId() = 0;
214 
215  // For data parameters only.
216  // You can get the data parm type with parmTemplate().dataParmType().
217  // However, we need a way to get the data parm type's enum value
218  // from C++ code without creating a temporary ParmTemplate object,
219  // so that's why dataParmTypeEnumId() exists.
220  SWIGOUT(%ignore dataParmTypeEnumId;)
221  virtual int dataParmTypeEnumId() = 0;
222 
223  SWIGOUT(%newobject createClip;)
224  virtual HOM_Node *createClip(HOM_Node &parent_node,
225  const char *name,
226  bool create_new,
227  bool apply_immediately,
228  bool current_value_only=false,
229  bool create_locked=false,
230  bool set_value_to_default=false) = 0;
231 
232  virtual void appendClip(HOM_Node &chop_node,
233  bool apply_immediately,
234  bool current_value_only=false,
235  bool create_locked=false,
236  bool set_value_to_default=false) = 0;
237 
238  virtual HOM_BinaryString _clipData(double start,
239  double end,
240  bool binary = true,
241  bool use_blosc_compression = true,
242  double sample_rate = 0) = 0;
243 
244  SWIGOUT(%kwargs _setClipData;)
245  virtual void _setClipData(HOM_BinaryString data,
246  bool binary = true,
247  bool blosc_compressed = true,
248  double sample_rate = 0,
249  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
250 
251  virtual void _saveClip(std::string file_name,
252  double start,
253  double end,
254  double sample_rate = 0) = 0;
255 
256  SWIGOUT(%kwargs _loadClip;)
257  virtual void _loadClip(std::string file_name,
258  double sample_rate = 0,
259  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
260 
261  SWIGOUT(%newobject overrideTrack;)
262  virtual HOM_Track *overrideTrack() = 0;
263  virtual bool isOverrideTrackActive() = 0;
264 
265  virtual void copyToParmClipboard() = 0;
266 
267  virtual bool isDisabled() = 0;
268 
269  virtual void disable(bool on) = 0;
270 
271  virtual bool isHidden() = 0;
272 
273  virtual void hide(bool on) = 0;
274 
275  virtual bool isVisible() = 0;
276 
277  virtual bool isConstrained() = 0;
278 
279  virtual HOM_EnumValue &keyframeExtrapolation( bool before ) = 0;
280 
281  virtual void setKeyframeExtrapolation( bool before, HOM_EnumValue &e ) = 0;
282 
283  virtual void keyframesRefit(
284  bool refit, double refit_tol, bool refit_preserve_extrema,
285  bool refit_bezier, bool resample, double resample_rate, double resample_tol,
286  bool range, double range_start, double range_end, HOM_EnumValue &bake_chop, const char *expression="") = 0;
287 
288  SWIGOUT(%newobject uiBackgroundColor;)
289  virtual HOM_Color *uiBackgroundColor() = 0;
290 
291 #ifdef SWIG
292 %extend
293 {
294  %warnfilter(321) eval;
295  InterpreterObject eval()
296  {
297  return HOMevalParm(*self);
298  }
299 
300  InterpreterObject evalAtFrame(double frame)
301  {
302  return HOMevalParmAtFrame(*self, frame);
303  }
304 
305  InterpreterObject evalAtTime(double time)
306  {
307  return HOMevalParmAtFrame(*self, HOM().timeToFrame(time));
308  }
309 }
310 #endif
311 };
312 
313 #endif
virtual ~HOM_Parm()
Definition: HOM_Parm.h:37
GLenum GLint * range
Definition: glew.h:3500
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1210
GLenum src
Definition: glew.h:2410
GLuint const GLchar * name
Definition: glew.h:1814
GT_API const UT_StringHolder time
OIIO_API bool rename(string_view from, string_view to, std::string &err)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
PUGI__FN xpath_string string_value(const xpath_node &na, xpath_allocator *alloc)
Definition: pugixml.cpp:7757
#define HOM_API
Definition: HOM_API.h:13
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
const GLuint GLenum const void * binary
Definition: glew.h:3502
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1209
GLuint GLuint end
Definition: glew.h:1253
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:563
char * lock(exint offset=0, exint reserve_bytes=0)
#define HOM_MIN_NEGATIVE_DOUBLE
Definition: HOM_Defines.h:46
HUSD_API bool eval(VtValue &val, T &ret_val)
GLuint start
Definition: glew.h:1253
GLsizei const GLchar *const * path
Definition: glew.h:6461
GLsizei const GLchar *const * string
Definition: glew.h:1844
HOM_Parm(const HOM_Parm &parm)
Definition: HOM_Parm.h:35
HOM_Parm()
Definition: HOM_Parm.h:33
ImageBuf OIIO_API resample(const ImageBuf &src, bool interpolate=true, ROI roi={}, int nthreads=0)
HOM_API HOM_Module & HOM()
GLsizei const GLfloat * value
Definition: glew.h:1849
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:549