HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Prim.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_Prim_h__
10 #define __HOM_Prim_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_BoundingBox.h"
16 #include "HOM_Vertex.h"
17 #include "HOM_IterableList.h"
18 #include "HOM_PtrOrNull.h"
19 #include <UT/UT_Tuple.h>
20 #include <vector>
21 
22 class HOM_EnumValue;
23 class HOM_Geometry;
24 class HOM_PrimGroup;
25 class HOM_Edge;
26 class HOM_Vector3;
27 
28 SWIGOUT(%rename(Prim) HOM_Prim;)
29 
31 {
32 public:
34  { HOM_CONSTRUCT_OBJECT(this) }
35  HOM_Prim(const HOM_Prim &)
36  { HOM_CONSTRUCT_OBJECT(this) }
37  virtual ~HOM_Prim()
38  { HOM_DESTRUCT_OBJECT(this) }
39 
40  virtual bool operator==(HOM_PtrOrNull<HOM_Prim> prim) = 0;
41  virtual bool operator!=(HOM_PtrOrNull<HOM_Prim> prim) = 0;
42 
43  virtual int __hash__() = 0;
44  virtual std::string __repr__() = 0;
45 
46  SWIGOUT(%newobject geometry;)
47  virtual HOM_Geometry *geometry() = 0;
48 
49  virtual int number() = 0;
50 
51  virtual HOM_EnumValue &type() = 0;
52  virtual HOM_EnumValue &attribType() = 0;
53 
54 
55  SWIGOUT(%newobject vertices;)
56  virtual HOM_IterableList<HOM_Vertex> *vertices() = 0;
57 
58  virtual int numVertices() = 0;
59 
60 
61  virtual std::vector<HOM_ElemPtr<HOM_Edge> > edges() = 0;
62 
63  virtual int numEdges() = 0;
64 
65  virtual double floatAttribValue(const char *name) = 0;
66 
67  virtual double floatAttribValue(HOM_Attrib &attrib) = 0;
68 
69  virtual std::vector<double> floatListAttribValue(const char *name) = 0;
70 
71  virtual std::vector<double> floatListAttribValue(HOM_Attrib &attrib) = 0;
72 
73  virtual int64 intAttribValue(const char *name) = 0;
74 
75  virtual int64 intAttribValue(HOM_Attrib &attrib) = 0;
76 
77  virtual std::vector<int64> intListAttribValue(const char *name) = 0;
78 
79  virtual std::vector<int64> intListAttribValue(HOM_Attrib &attrib) = 0;
80 
81  virtual std::string stringAttribValue(const char *name) = 0;
82 
83  virtual std::string stringAttribValue(HOM_Attrib &attrib) = 0;
84 
85  virtual std::vector<std::string> stringListAttribValue(const char *name) = 0;
86 
87  virtual std::vector<std::string> stringListAttribValue(HOM_Attrib &attrib) = 0;
88 
89 
90  virtual void setAttribValue(
91  HOM_Attrib &attrib, int64 attrib_value) = 0;
92  virtual void setAttribValue(
93  HOM_Attrib &attrib, double attrib_value) = 0;
94  virtual void setAttribValue(
95  HOM_Attrib &attrib, const char *attrib_value) = 0;
96  virtual void setAttribValue(
97  HOM_Attrib &attrib, const std::vector<int64> &attrib_value) = 0;
98  virtual void setAttribValue(
99  HOM_Attrib &attrib, const std::vector<double> &attrib_value) = 0;
100  virtual void setAttribValue(
101  HOM_Attrib &attrib, const std::vector<std::string> &attrib_value) = 0;
102 
103  virtual void setAttribValue(
104  const char *attrib_name, int64 attrib_value) = 0;
105  virtual void setAttribValue(
106  const char *attrib_name, double attrib_value) = 0;
107  virtual void setAttribValue(
108  const char *attrib_name, const char *attrib_value) = 0;
109  // Note that, because of strangess the with way swig works when deciding
110  // which overloaded method to call, it's very important that we list the
111  // vector of ints before the vector of doubles. Otherwise, swig will call
112  // the double version when you pass in a vector of ints.
113  virtual void setAttribValue(
114  const char *attrib_name, const std::vector<int64> &attrib_value) = 0;
115  virtual void setAttribValue(
116  const char *attrib_name, const std::vector<double> &attrib_value) = 0;
117  virtual void setAttribValue(
118  const char *attrib_name,
119  const std::vector<std::string> &attrib_value) = 0;
120 
121 
122  virtual std::vector<std::string> intrinsicNames() = 0;
123 
124  virtual hboost::any intrinsicValue(
125  const char *intrinsic_name) = 0;
126  virtual size_t intrinsicSize(const char *intrinsic_name) = 0;
127  virtual bool intrinsicReadOnly(const char *intrinsic_name) = 0;
128 
129  virtual void setIntrinsicValue(const char *intrinsic_name, double value) = 0;
130  virtual void setIntrinsicValue(const char *intrinsic_name, int value) = 0;
131  virtual void setIntrinsicValue(const char *intrinsic_name, int64 value) = 0;
132  virtual void setIntrinsicValue(
133  const char *intrinsic_name, const char *value) = 0;
134  virtual void setIntrinsicValue(
135  const char *intrinsic_name, const std::vector<double> &value) = 0;
136  virtual void setIntrinsicValue(
137  const char *intrinsic_name, const std::vector<int> &value) = 0;
138  virtual void setIntrinsicValue(
139  const char *intrinsic_name, const std::vector<int64> &value) = 0;
140  virtual void setIntrinsicValue(
141  const char *intrinsic_name, const std::vector<std::string> &value) = 0;
142 
143 #ifdef SWIG
144 %extend
145 {
146  InterpreterObject attribValue(const char *name)
147  { return HOMattribValue(*self, name); }
148 
149  InterpreterObject attribValue(HOM_Attrib &attrib)
150  { return HOMattribValue(*self, attrib); }
151 }
152 #endif
153 
154  SWIGOUT(%newobject positionAtInterior;)
155  virtual HOM_Vector3 *positionAtInterior(double u, double v, double w = 0.0) = 0;
156 
157  SWIGOUT(%ignore boostAnyAttribValueAtInterior;)
158  virtual hboost::any boostAnyAttribValueAtInterior(
159  const char *name, double u, double v, double w) = 0;
160 
161  SWIGOUT(%ignore boostAnyAttribValueAtInterior;)
162  virtual hboost::any boostAnyAttribValueAtInterior(
163  HOM_Attrib &attrib, double u, double v, double w) = 0;
164 
165 #ifdef SWIG
166 %extend
167 {
168  InterpreterObject attribValueAtInterior(
169  const char *name, double u, double v, double w = 0.0)
170  {
171  return HOMboostAnyToInterpreterObject(
172  self->boostAnyAttribValueAtInterior(name, u, v, w));
173  }
174 
175  InterpreterObject attribValueAtInterior(
176  HOM_Attrib &attrib, double u, double v, double w = 0.0)
177  {
178  return HOMboostAnyToInterpreterObject(
179  self->boostAnyAttribValueAtInterior(attrib, u, v, w));
180  }
181 }
182 #endif
183 
184  virtual HOM_BoundingBox boundingBox() = 0;
185 
186  virtual UT_Tuple<double, double, double> nearestToPosition(
187  const std::vector<double> &position) = 0;
188 
189  virtual std::vector< HOM_ElemPtr<HOM_PrimGroup> > groups() = 0;
190 
191 };
192 
193 #endif
HOM_Prim()
Definition: HOM_Prim.h:33
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1056
const GLdouble * v
Definition: glcorearb.h:836
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:344
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
long long int64
Definition: SYS_Types.h:107
#define HOM_API
Definition: HOM_API.h:13
#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
GLuint const GLchar * name
Definition: glcorearb.h:785
GLsizei const GLfloat * value
Definition: glcorearb.h:823
virtual ~HOM_Prim()
Definition: HOM_Prim.h:37
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
HOM_Prim(const HOM_Prim &)
Definition: HOM_Prim.h:35
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:590
int __hash__()