HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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) = 0;
116 
117  virtual void copyToParmClipboard() = 0;
118 
119  virtual void *_asVoidPointer() = 0;
120 
121  SWIGOUT(%kwargs asCode;)
122  virtual std::string asCode(bool brief=false, bool save_values=true,
123  bool save_keyframes=true,
124  bool save_keys_in_frames=false,
125  bool save_flag_values=true,
126  bool save_aliases=true,
127  const char *function_name=NULL) = 0;
128 
129  // You can get the parm data type with parmTemplate().dataType().
130  // However, we need a way to get the parm data type's enum value
131  // from C++ code without creating a temporary ParmTemplate object,
132  // so that's why parmDataTypeEnumId() exists.
133  SWIGOUT(%ignore parmDataTypeEnumId;)
134  virtual int parmDataTypeEnumId() = 0;
135 
136  virtual std::string help() = 0;
137  virtual std::string helpUrl() = 0;
138 
139  virtual bool isDisabled() = 0;
140 
141  virtual void disable(bool on) = 0;
142 
143  virtual bool isHidden() = 0;
144 
145  virtual void hide(bool on) = 0;
146 
147 
148 #ifdef SWIG
149 %extend
150 {
151  InterpreterObject eval()
152  {
153  return HOMevalParmTuple(*self);
154  }
155 
156  InterpreterObject evalAtFrame(double frame)
157  {
158  return HOMevalParmTupleAtFrame(*self, frame);
159  }
160 
161  InterpreterObject evalAtTime(double time)
162  {
163  return HOMevalParmTupleAtFrame(*self, HOM().timeToFrame(time));
164  }
165 }
166 #endif
167 };
168 
169 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:983
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
std::string __repr__()
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:982
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:610
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:596
HOM_ParmTuple(const HOM_ParmTuple &parm_tuple)
Definition: HOM_ParmTuple.h:31