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 void lock(const std::vector<bool> &bool_values) = 0;
92  virtual void setAutoscope(const std::vector<bool> &bool_values) = 0;
93 
94  virtual bool isSpare() = 0;
95 
96  virtual bool isMultiParmInstance() = 0;
97  SWIGOUT(%newobject parentMultiParm;)
98  virtual HOM_Parm *parentMultiParm() = 0;
99  virtual std::vector<int> multiParmInstanceIndices() = 0;
100 
101  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > multiParmInstances() = 0;
102 
103  virtual void deleteAllKeyframes() = 0;
104 
105  SWIGOUT(%newobject __getitem__;)
106  virtual HOM_Parm *__getitem__(int index) = 0;
107  virtual int __len__() = 0;
108 
109  SWIGOUT(%newobject createClip;)
110  virtual HOM_Node *createClip(HOM_Node &parent_node,
111  const char *name,
112  bool create_new,
113  bool apply_immediately,
114  bool current_value_only=false,
115  bool create_locked=false,
116  bool set_value_to_default=false) = 0;
117 
118  virtual void appendClip(HOM_Node &chop_node,
119  bool apply_immediately,
120  bool current_value_only=false,
121  bool create_locked=false,
122  bool set_value_to_default=false) = 0;
123 
124  virtual HOM_BinaryString _clipData(double start,
125  double end,
126  bool binary = true,
127  bool use_blosc_compression = true,
128  double sample_rate = 0) = 0;
129 
130  SWIGOUT(%kwargs _setClipData;)
131  virtual void _setClipData(HOM_BinaryString data,
132  bool binary = true,
133  bool blosc_compressed = true,
134  double sample_rate = 0,
135  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
136 
137  virtual void _saveClip(std::string file_name,
138  double start,
139  double end,
140  double sample_rate = 0) = 0;
141 
142  SWIGOUT(%kwargs _loadClip;)
143  virtual void _loadClip(std::string file_name,
144  double sample_rate = 0,
145  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
146 
147  virtual void copyToParmClipboard() = 0;
148 
149  virtual void *_asVoidPointer() = 0;
150 
151  SWIGOUT(%kwargs asCode;)
152  virtual std::string asCode(bool brief=false, bool save_values=true,
153  bool save_keyframes=true,
154  bool save_keys_in_frames=false,
155  bool save_flag_values=true,
156  bool save_aliases=true,
157  const char *function_name=NULL) = 0;
158 
159  // You can get the parm data type with parmTemplate().dataType().
160  // However, we need a way to get the parm data type's enum value
161  // from C++ code without creating a temporary ParmTemplate object,
162  // so that's why parmDataTypeEnumId() exists.
163  SWIGOUT(%ignore parmDataTypeEnumId;)
164  virtual int parmDataTypeEnumId() = 0;
165 
166  virtual std::string help() = 0;
167  virtual std::string helpUrl() = 0;
168 
169  virtual bool isDisabled() = 0;
170 
171  virtual void disable(bool on) = 0;
172 
173  virtual bool isHidden() = 0;
174 
175  virtual void hide(bool on) = 0;
176 
177  virtual bool isConstrained() = 0;
178 
179 #ifdef SWIG
180 %extend
181 {
182  InterpreterObject eval()
183  {
184  return HOMevalParmTuple(*self);
185  }
186 
187  InterpreterObject evalAtFrame(double frame)
188  {
189  return HOMevalParmTupleAtFrame(*self, frame);
190  }
191 
192  InterpreterObject evalAtTime(double time)
193  {
194  return HOMevalParmTupleAtFrame(*self, HOM().timeToFrame(time));
195  }
196 }
197 #endif
198 };
199 
200 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1056
GT_API const UT_StringHolder time
GLuint start
Definition: glcorearb.h:474
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
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:344
#define HOM_API
Definition: HOM_API.h:13
GLuint GLuint end
Definition: glcorearb.h:474
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1055
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:604
#define HOM_MIN_NEGATIVE_DOUBLE
Definition: HOM_Defines.h:46
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
void * _asVoidPointer()
Definition: HOM_Ramp.h:62
GLuint index
Definition: glcorearb.h:785
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:590
HOM_ParmTuple(const HOM_ParmTuple &parm_tuple)
Definition: HOM_ParmTuple.h:31