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  virtual bool isMultiParmParent() = 0;
107  SWIGOUT(%newobject parentMultiParm;)
108  virtual HOM_Parm *parentMultiParm() = 0;
109  virtual std::vector<int> multiParmInstanceIndices() = 0;
110 
111  virtual int multiParmInstancesPerItem() = 0;
112  virtual int multiParmInstancesCount() = 0;
113  virtual int multiParmStartOffset() = 0;
114 
115  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > multiParmInstances() = 0;
116 
117  virtual std::vector<std::string> containingFolders() = 0;
118  virtual std::vector<int> containingFolderIndices() = 0;
119  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> >
120  containingFolderSetParmTuples() = 0;
121 
122  virtual void setKeyframe(const std::vector<HOM_BaseKeyframe *> &keyframes) = 0;
123  virtual void deleteKeyframeAtFrame(double frame) = 0;
124  virtual void deleteAllKeyframes() = 0;
125 
126  SWIGOUT(%newobject __getitem__;)
127  virtual HOM_Parm *__getitem__(int index) = 0;
128  virtual int __len__() = 0;
129 
130  SWIGOUT(%newobject createClip;)
131  virtual HOM_Node *createClip(HOM_Node &parent_node,
132  const char *name,
133  bool create_new,
134  bool apply_immediately,
135  bool current_value_only=false,
136  bool create_locked=false,
137  bool set_value_to_default=false) = 0;
138 
139  virtual void appendClip(HOM_Node &chop_node,
140  bool apply_immediately,
141  bool current_value_only=false,
142  bool create_locked=false,
143  bool set_value_to_default=false) = 0;
144 
145  virtual HOM_BinaryString _clipData(double start,
146  double end,
147  bool binary = true,
148  bool use_blosc_compression = true,
149  double sample_rate = 0) = 0;
150 
151  SWIGOUT(%kwargs _setClipData;)
152  virtual void _setClipData(HOM_BinaryString data,
153  bool binary = true,
154  bool blosc_compressed = true,
155  double sample_rate = 0,
156  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
157 
158  virtual void _saveClip(std::string file_name,
159  double start,
160  double end,
161  double sample_rate = 0) = 0;
162 
163  SWIGOUT(%kwargs _loadClip;)
164  virtual void _loadClip(std::string file_name,
165  double sample_rate = 0,
166  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
167 
168  virtual void copyToParmClipboard() = 0;
169 
170  virtual void *_asVoidPointer() = 0;
171 
172  SWIGOUT(%kwargs asCode;)
173  virtual std::string asCode(bool brief=false, bool save_values=true,
174  bool save_keyframes=true,
175  bool save_keys_in_frames=false,
176  bool save_flag_values=true,
177  bool save_aliases=true,
178  const char *function_name=NULL) = 0;
179 
180  // You can get the parm data type with parmTemplate().dataType().
181  // However, we need a way to get the parm data type's enum value
182  // from C++ code without creating a temporary ParmTemplate object,
183  // so that's why parmDataTypeEnumId() exists.
184  SWIGOUT(%ignore parmDataTypeEnumId;)
185  virtual int parmDataTypeEnumId() = 0;
186 
187  // For data parameters only.
188  // You can get the data parm type with parmTemplate().dataParmType().
189  // However, we need a way to get the data parm type's enum value
190  // from C++ code without creating a temporary ParmTemplate object,
191  // so that's why dataParmTypeEnumId() exists.
192  SWIGOUT(%ignore dataParmTypeEnumId;)
193  virtual int dataParmTypeEnumId() = 0;
194 
195  virtual std::string help() = 0;
196  virtual std::string helpUrl() = 0;
197 
198  virtual bool isDisabled() = 0;
199 
200  virtual void disable(bool on) = 0;
201 
202  virtual bool isHidden() = 0;
203 
204  virtual void hide(bool on) = 0;
205 
206  virtual bool isConstrained() = 0;
207 
208  virtual bool isShowingExpression() = 0;
209  virtual void showExpression(bool value) = 0;
210 
211 #ifdef SWIG
212 %extend
213 {
214  %warnfilter(321) eval;
215  InterpreterObject eval()
216  {
217  return HOMevalParmTuple(*self);
218  }
219 
220  InterpreterObject evalAtFrame(double frame)
221  {
222  return HOMevalParmTupleAtFrame(*self, frame);
223  }
224 
225  InterpreterObject evalAtTime(double time)
226  {
227  return HOMevalParmTupleAtFrame(*self, HOM().timeToFrame(time));
228  }
229 }
230 #endif
231 };
232 
233 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1238
GT_API const UT_StringHolder time
GLuint start
Definition: glcorearb.h:474
OIIO_API bool rename(string_view from, string_view to, std::string &err)
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:353
GLuint const GLchar * name
Definition: glcorearb.h:785
#define HOM_API
Definition: HOM_API.h:13
GLuint GLuint end
Definition: glcorearb.h:474
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1237
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:570
#define HOM_MIN_NEGATIVE_DOUBLE
Definition: HOM_Defines.h:46
HUSD_API bool eval(VtValue &val, T &ret_val)
void * _asVoidPointer()
Definition: HOM_Ramp.h:62
GLboolean * data
Definition: glcorearb.h:130
GLuint index
Definition: glcorearb.h:785
GLsizei const GLfloat * value
Definition: glcorearb.h:823
virtual ~HOM_ParmTuple()
Definition: HOM_ParmTuple.h:33
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:556
HOM_ParmTuple(const HOM_ParmTuple &parm_tuple)
Definition: HOM_ParmTuple.h:31