HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_ParmTuple.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_ParmTuple_h__
10 #define __HOM_ParmTuple_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 <vector>
19 #include <stdexcept>
20 class HOM_ParmTemplate;
21 class HOM_Parm;
22 class HOM_Ramp;
23 
24 SWIGOUT(%rename(ParmTuple) HOM_ParmTuple;)
25 
27 {
28 public:
30  { HOM_CONSTRUCT_OBJECT(this) }
31  HOM_ParmTuple(const HOM_ParmTuple &parm_tuple)
32  { HOM_CONSTRUCT_OBJECT(this) }
33  virtual ~HOM_ParmTuple()
34  { HOM_DESTRUCT_OBJECT(this) }
35 
36  virtual bool operator==(HOM_PtrOrNull<HOM_ParmTuple> parm_tuple) = 0;
37  virtual bool operator!=(HOM_PtrOrNull<HOM_ParmTuple> parm_tuple) = 0;
38 
39  virtual int __hash__() = 0;
40  virtual std::string __repr__() = 0;
41 
42  SWIGOUT(%newobject node;)
43  virtual HOM_Node *node() = 0;
44 
45  SWIGOUT(%newobject parmTemplate;)
46  virtual HOM_ParmTemplate *parmTemplate() = 0;
47 
48  virtual std::string name() = 0;
49  virtual std::string description() = 0;
50 
51  // Wrapping a version of set() that takes a vector of doubles will
52  // let you pass a vector of doubles or a vector of ints to it. So,
53  // we don't bother to provide a version that takes a vector of ints.
54  virtual void _set(const std::vector<double> &float_values) = 0;
55  virtual void setPending(const std::vector<double> &float_values) = 0;
56  virtual void _set(const std::vector<std::string> &string_values) = 0;
57  virtual void setPending(const std::vector<std::string> &string_values) = 0;
58  virtual void _set(const std::vector<HOM_Ramp *> &ramp_values) = 0;
59  virtual void setPending(const std::vector<HOM_Ramp *> &ramp_values) = 0;
60 
61  virtual void revertToDefaults() = 0;
62  virtual void revertToAndRestorePermanentDefaults() = 0;
63 
64  SWIGOUT(%kwargs isAtDefault;)
65  virtual bool isAtDefault(bool compare_temporary_defaults=true,
66  bool compare_expressions=true) = 0;
67 
68  virtual std::vector<double> evalAsFloats() = 0;
69 
70  virtual std::vector<double> evalAsFloatsAtFrame(double frame) = 0;
71 
72  virtual std::vector<int> evalAsInts() = 0;
73 
74  virtual std::vector<int> evalAsIntsAtFrame(double frame) = 0;
75 
76  virtual std::vector<std::string> evalAsStrings() = 0;
77 
78  virtual std::vector<std::string> evalAsStringsAtFrame(double frame) = 0;
79 
80  virtual std::vector<HOM_ElemPtr<HOM_Ramp> > evalAsRamps() = 0;
81 
82  SWIGOUT(%newobject evalAsRampAtFrame;)
83  virtual std::vector<HOM_ElemPtr<HOM_Ramp> > evalAsRampsAtFrame(double frame) = 0;
84 
85  SWIGOUT(%newobject evalAsGeometries;)
86  virtual std::vector<HOM_ElemPtr<HOM_Geometry> > evalAsGeometries() = 0;
87 
88  SWIGOUT(%newobject evalAsGeometryAtFrame;)
89  virtual std::vector<HOM_ElemPtr<HOM_Geometry> > evalAsGeometriesAtFrame(double frame) = 0;
90 
91  virtual std::vector<std::map<std::string, std::string> >
92  evalAsJSONMaps() = 0;
93  virtual std::vector<std::map<std::string, std::string> >
94  evalAsJSONMapsAtFrame(double frame) = 0;
95 
96 
97  virtual void lock(bool on) = 0;
98  virtual void lock(const std::vector<bool> &bool_values) = 0;
99  virtual void setAutoscope(const std::vector<bool> &bool_values) = 0;
100 
101  virtual bool isSpare() = 0;
102 
103  virtual bool isTimeDependent() = 0;
104 
105  virtual bool isMultiParmInstance() = 0;
106  SWIGOUT(%newobject parentMultiParm;)
107  virtual HOM_Parm *parentMultiParm() = 0;
108  virtual std::vector<int> multiParmInstanceIndices() = 0;
109 
110  virtual int multiParmInstancesPerItem() = 0;
111  virtual int multiParmInstancesCount() = 0;
112  virtual int multiParmStartOffset() = 0;
113 
114  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > multiParmInstances() = 0;
115 
116  virtual std::vector<std::string> containingFolders() = 0;
117  virtual std::vector<int> containingFolderIndices() = 0;
118  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> >
119  containingFolderSetParmTuples() = 0;
120 
121  virtual void setKeyframe(const std::vector<HOM_BaseKeyframe *> &keyframes) = 0;
122  virtual void deleteKeyframeAtFrame(double frame) = 0;
123  virtual void deleteAllKeyframes() = 0;
124 
125  SWIGOUT(%newobject __getitem__;)
126  virtual HOM_Parm *__getitem__(int index) = 0;
127  virtual int __len__() = 0;
128 
129  SWIGOUT(%newobject createClip;)
130  virtual HOM_Node *createClip(HOM_Node &parent_node,
131  const char *name,
132  bool create_new,
133  bool apply_immediately,
134  bool current_value_only=false,
135  bool create_locked=false,
136  bool set_value_to_default=false) = 0;
137 
138  virtual void appendClip(HOM_Node &chop_node,
139  bool apply_immediately,
140  bool current_value_only=false,
141  bool create_locked=false,
142  bool set_value_to_default=false) = 0;
143 
144  virtual HOM_BinaryString _clipData(double start,
145  double end,
146  bool binary = true,
147  bool use_blosc_compression = true,
148  double sample_rate = 0) = 0;
149 
150  SWIGOUT(%kwargs _setClipData;)
151  virtual void _setClipData(HOM_BinaryString data,
152  bool binary = true,
153  bool blosc_compressed = true,
154  double sample_rate = 0,
155  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
156 
157  virtual void _saveClip(std::string file_name,
158  double start,
159  double end,
160  double sample_rate = 0) = 0;
161 
162  SWIGOUT(%kwargs _loadClip;)
163  virtual void _loadClip(std::string file_name,
164  double sample_rate = 0,
165  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
166 
167  virtual void copyToParmClipboard() = 0;
168 
169  virtual void *_asVoidPointer() = 0;
170 
171  SWIGOUT(%kwargs asCode;)
172  virtual std::string asCode(bool brief=false, bool save_values=true,
173  bool save_keyframes=true,
174  bool save_keys_in_frames=false,
175  bool save_flag_values=true,
176  bool save_aliases=true,
177  const char *function_name=NULL) = 0;
178 
179  // You can get the parm data type with parmTemplate().dataType().
180  // However, we need a way to get the parm data type's enum value
181  // from C++ code without creating a temporary ParmTemplate object,
182  // so that's why parmDataTypeEnumId() exists.
183  SWIGOUT(%ignore parmDataTypeEnumId;)
184  virtual int parmDataTypeEnumId() = 0;
185 
186  // For data parameters only.
187  // You can get the data parm type with parmTemplate().dataParmType().
188  // However, we need a way to get the data parm type's enum value
189  // from C++ code without creating a temporary ParmTemplate object,
190  // so that's why dataParmTypeEnumId() exists.
191  SWIGOUT(%ignore dataParmTypeEnumId;)
192  virtual int dataParmTypeEnumId() = 0;
193 
194  virtual std::string help() = 0;
195  virtual std::string helpUrl() = 0;
196 
197  virtual bool isDisabled() = 0;
198 
199  virtual void disable(bool on) = 0;
200 
201  virtual bool isHidden() = 0;
202 
203  virtual void hide(bool on) = 0;
204 
205  virtual bool isConstrained() = 0;
206 
207  virtual bool isShowingExpression() = 0;
208  virtual void showExpression(bool value) = 0;
209 
210 #ifdef SWIG
211 %extend
212 {
213  %warnfilter(321) eval;
214  InterpreterObject eval()
215  {
216  return HOMevalParmTuple(*self);
217  }
218 
219  InterpreterObject evalAtFrame(double frame)
220  {
221  return HOMevalParmTupleAtFrame(*self, frame);
222  }
223 
224  InterpreterObject evalAtTime(double time)
225  {
226  return HOMevalParmTupleAtFrame(*self, HOM().timeToFrame(time));
227  }
228 }
229 #endif
230 };
231 
232 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1210
GLuint const GLchar * name
Definition: glew.h:1814
GT_API const UT_StringHolder time
GLuint index
Definition: glew.h:1814
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
#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
#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
void * _asVoidPointer()
Definition: HOM_Ramp.h:62
GLsizei const GLchar *const * string
Definition: glew.h:1844
virtual ~HOM_ParmTuple()
Definition: HOM_ParmTuple.h:33
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
HOM_ParmTuple(const HOM_ParmTuple &parm_tuple)
Definition: HOM_ParmTuple.h:31