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