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 overwriteDefaults() = 0;
62  virtual void revertToDefaults() = 0;
63  virtual void revertToAndRestorePermanentDefaults() = 0;
64 
65  SWIGOUT(%kwargs isAtDefault;)
66  virtual bool isAtDefault(bool compare_temporary_defaults=true,
67  bool compare_expressions=true) = 0;
68  virtual bool isAtRampDefault() = 0;
69 
70  virtual std::vector<double> evalAsFloats() = 0;
71 
72  virtual std::vector<double> evalAsFloatsAtFrame(double frame) = 0;
73 
74  virtual std::vector<int> evalAsInts() = 0;
75 
76  virtual std::vector<int> evalAsIntsAtFrame(double frame) = 0;
77 
78  virtual std::vector<std::string> evalAsStrings() = 0;
79 
80  virtual std::vector<std::string> evalAsStringsAtFrame(double frame) = 0;
81 
82  virtual std::vector<HOM_ElemPtr<HOM_Ramp> > evalAsRamps() = 0;
83 
84  SWIGOUT(%newobject evalAsRampAtFrame;)
85  virtual std::vector<HOM_ElemPtr<HOM_Ramp> > evalAsRampsAtFrame(double frame) = 0;
86 
87  SWIGOUT(%newobject evalAsGeometries;)
88  virtual std::vector<HOM_ElemPtr<HOM_Geometry> > evalAsGeometries() = 0;
89 
90  SWIGOUT(%newobject evalAsGeometryAtFrame;)
91  virtual std::vector<HOM_ElemPtr<HOM_Geometry> > evalAsGeometriesAtFrame(double frame) = 0;
92 
93  virtual std::vector<std::map<std::string, std::string> >
94  evalAsJSONMaps() = 0;
95  virtual std::vector<std::map<std::string, std::string> >
96  evalAsJSONMapsAtFrame(double frame) = 0;
97 
98 
99  virtual void lock(bool on) = 0;
100  virtual void lock(const std::vector<bool> &bool_values) = 0;
101  virtual void setAutoscope(const std::vector<bool> &bool_values) = 0;
102 
103  virtual bool isSpare() = 0;
104 
105  virtual bool isTimeDependent() = 0;
106 
107  virtual bool isMultiParmInstance() = 0;
108  virtual bool isMultiParmParent() = 0;
109  SWIGOUT(%newobject parentMultiParm;)
110  virtual HOM_Parm *parentMultiParm() = 0;
111  virtual std::vector<int> multiParmInstanceIndices() = 0;
112 
113  virtual int multiParmInstancesPerItem() = 0;
114  virtual int multiParmInstancesCount() = 0;
115  virtual int multiParmStartOffset() = 0;
116 
117  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > multiParmInstances() = 0;
118 
119  virtual std::vector<std::string> containingFolders() = 0;
120  virtual std::vector<int> containingFolderIndices() = 0;
121  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> >
122  containingFolderSetParmTuples() = 0;
123 
124  virtual void setKeyframe(const std::vector<HOM_BaseKeyframe *> &keyframes) = 0;
125  virtual void deleteKeyframeAtFrame(double frame) = 0;
126  virtual void deleteAllKeyframes() = 0;
127 
128  SWIGOUT(%newobject __getitem__;)
129  virtual HOM_Parm *__getitem__(int index) = 0;
130  virtual int __len__() = 0;
131  virtual bool __bool__() = 0;
132 
133  SWIGOUT(%newobject createClip;)
134  virtual HOM_Node *createClip(HOM_Node &parent_node,
135  const char *name,
136  bool create_new,
137  bool apply_immediately,
138  bool current_value_only=false,
139  bool create_locked=false,
140  bool set_value_to_default=false) = 0;
141 
142  virtual void appendClip(HOM_Node &chop_node,
143  bool apply_immediately,
144  bool current_value_only=false,
145  bool create_locked=false,
146  bool set_value_to_default=false) = 0;
147 
148  virtual HOM_BinaryString _clipData(double start,
149  double end,
150  bool binary = true,
151  bool use_blosc_compression = true,
152  double sample_rate = 0) = 0;
153 
154  SWIGOUT(%kwargs _setClipData;)
155  virtual void _setClipData(HOM_BinaryString data,
156  bool binary = true,
157  bool blosc_compressed = true,
158  double sample_rate = 0,
159  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
160 
161  virtual void _saveClip(std::string file_name,
162  double start,
163  double end,
164  double sample_rate = 0) = 0;
165 
166  SWIGOUT(%kwargs _loadClip;)
167  virtual void _loadClip(std::string file_name,
168  double sample_rate = 0,
169  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
170 
171  virtual void copyToParmClipboard() = 0;
172 
173  virtual void *_asVoidPointer() = 0;
174 
175  SWIGOUT(%kwargs asCode;)
176  virtual std::string asCode(bool brief=false, bool save_values=true,
177  bool save_keyframes=true,
178  bool save_keys_in_frames=false,
179  bool save_flag_values=true,
180  bool save_aliases=true,
181  const char *function_name=NULL) = 0;
182 
183  // You can get the parm data type with parmTemplate().dataType().
184  // However, we need a way to get the parm data type's enum value
185  // from C++ code without creating a temporary ParmTemplate object,
186  // so that's why parmDataTypeEnumId() exists.
187  SWIGOUT(%ignore parmDataTypeEnumId;)
188  virtual int parmDataTypeEnumId() = 0;
189 
190  // For data parameters only.
191  // You can get the data parm type with parmTemplate().dataParmType().
192  // However, we need a way to get the data parm type's enum value
193  // from C++ code without creating a temporary ParmTemplate object,
194  // so that's why dataParmTypeEnumId() exists.
195  SWIGOUT(%ignore dataParmTypeEnumId;)
196  virtual int dataParmTypeEnumId() = 0;
197 
198  virtual std::string help() = 0;
199  virtual std::string helpUrl() = 0;
200 
201  virtual bool isDisabled() = 0;
202 
203  virtual void disable(bool on) = 0;
204 
205  virtual bool isHidden() = 0;
206 
207  virtual void hide(bool on) = 0;
208 
209  virtual bool isConstrained() = 0;
210 
211  virtual bool isShowingExpression() = 0;
212  virtual void showExpression(bool value) = 0;
213 
214 #ifdef SWIG
215 %extend
216 {
217  %warnfilter(321) eval;
218  InterpreterObject eval()
219  {
220  return HOMevalParmTuple(*self);
221  }
222 
223  InterpreterObject evalAtFrame(double frame)
224  {
225  return HOMevalParmTupleAtFrame(*self, frame);
226  }
227 
228  InterpreterObject evalAtTime(double time)
229  {
230  return HOMevalParmTupleAtFrame(*self, HOM().timeToFrame(time));
231  }
232 }
233 #endif
234 };
235 
236 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
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
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
std::string help(const App *app, const Error &e)
Printout the full help string on error (if this fn is set, the old default for CLI11) ...
Definition: CLI11.h:8978
#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
#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
void * _asVoidPointer()
Definition: HOM_Ramp.h:62
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
GLuint index
Definition: glcorearb.h:786
virtual ~HOM_ParmTuple()
Definition: HOM_ParmTuple.h:33
Definition: core.h:1131
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
HOM_ParmTuple(const HOM_ParmTuple &parm_tuple)
Definition: HOM_ParmTuple.h:31