HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_DopRecord.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_DopRecord_h__
10 #define __HOM_DopRecord_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Module.h"
15 #include "HOM_EnumValue.h"
16 #include "HOM_Errors.h"
17 #include "HOM_PtrOrNull.h"
18 #include <UT/UT_Options.h>
19 #include <UT/UT_UniquePtr.h>
20 #include <string>
21 #include <vector>
22 
23 class HOM_DopData;
24 class HOM_Vector2;
25 class HOM_Vector3;
26 class HOM_Vector4;
27 class HOM_Quaternion;
28 class HOM_Matrix3;
29 class HOM_Matrix4;
30 
31 SWIGOUT(%rename(DopRecord) HOM_DopRecord;)
32 
34 {
35 public:
37  { HOM_CONSTRUCT_OBJECT(this) }
39  { HOM_CONSTRUCT_OBJECT(this) }
40  virtual ~HOM_DopRecord()
41  { HOM_DESTRUCT_OBJECT(this) }
42 
43  // We compare against a pointer instead of a reference because we want
44  // to be able to compare against None.
45  virtual bool operator==(HOM_PtrOrNull<HOM_DopRecord> record) = 0;
46  virtual bool operator!=(HOM_PtrOrNull<HOM_DopRecord> record) = 0;
47 
48  virtual int __hash__() = 0;
49  virtual std::string __repr__() = 0;
50 
51  virtual std::string recordType() = 0;
52  virtual int recordIndex() = 0;
53 
54  // Get the names of all fields in this record.
55  virtual std::vector<std::string> fieldNames() = 0;
56 
57  // Get the data type of a particular field.
58  virtual HOM_EnumValue &fieldType(const char *field_name) = 0;
59 
60  // This is the function that does the real work of fetching the field
61  // value. It returns a UT_OptionEntry, which gets converted by the field
62  // function into a python object. This function is never called directly,
63  // only through field.
64  SWIGOUT(%ignore fieldAsRaw;)
65  virtual UT_OptionEntry *fieldAsRaw(const char *field_name) = 0;
66 
67 #ifdef SWIG
68 %extend
69 {
70  InterpreterObject field(const char *field_name)
71  {
73  self->fieldAsRaw(field_name));
74  return raw_value.get()
75  ? HOMoptionEntryToInterpreterObject(*raw_value) : SWIG_Py_Void();
76  }
77 }
78 #endif
79 
80  // Swig refuses to check for a bool before an int, even if you rearrange
81  // the declarations, so we need a different method to set bool fields.
82  virtual void setFieldBool(const char *field_name, bool value) = 0;
83  virtual void setField(const char *field_name, int value) = 0;
84  virtual void setField(const char *field_name, double value) = 0;
85  virtual void setField(const char *field_name, const char *value) = 0;
86  virtual void setField(const char *field_name, HOM_Vector2 &value) = 0;
87  virtual void setField(const char *field_name, HOM_Vector3 &value) = 0;
88  virtual void setField(const char *field_name, HOM_Vector4 &value) = 0;
89  virtual void setField(const char *field_name, HOM_Quaternion &value) = 0;
90  virtual void setField(const char *field_name, HOM_Matrix3 &value) = 0;
91  virtual void setField(const char *field_name, HOM_Matrix4 &value) = 0;
92 };
93 
94 #endif
95 
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1053
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
HOM_DopRecord(const HOM_DopRecord &record)
Definition: HOM_DopRecord.h:38
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:344
#define HOM_API
Definition: HOM_API.h:13
virtual ~HOM_DopRecord()
Definition: HOM_DopRecord.h:40
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1052
int __hash__()
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:604
GLsizei const GLfloat * value
Definition: glcorearb.h:823
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:47
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:590