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