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 
21 #include <map>
22 #include <string>
23 #include <vector>
24 
25 class HOM_EnumValue;
26 class HOM_Geometry;
27 class HOM_PrimGroup;
28 class HOM_Edge;
29 class HOM_Vector2;
30 class HOM_Vector3;
31 
32 SWIGOUT(%rename(Prim) HOM_Prim;)
33 
35 {
36 public:
38  { HOM_CONSTRUCT_OBJECT(this) }
39  HOM_Prim(const HOM_Prim &)
40  { HOM_CONSTRUCT_OBJECT(this) }
41  virtual ~HOM_Prim()
42  { HOM_DESTRUCT_OBJECT(this) }
43 
44  virtual bool operator==(HOM_PtrOrNull<HOM_Prim> prim) = 0;
45  virtual bool operator!=(HOM_PtrOrNull<HOM_Prim> prim) = 0;
46 
47  virtual int __hash__() = 0;
48  virtual std::string __repr__() = 0;
49 
50  SWIGOUT(%newobject geometry;)
51  virtual HOM_Geometry *geometry() = 0;
52 
53  virtual int number() = 0;
54 
55  SWIGOUT(%warnfilter(321) type;)
56  virtual HOM_EnumValue &type() = 0;
57  virtual HOM_EnumValue &attribType() = 0;
58 
59 
60  SWIGOUT(%newobject vertices;)
61  virtual HOM_IterableList<HOM_Vertex> *vertices() = 0;
62 
63  virtual int numVertices() = 0;
64 
65 
66  virtual std::vector<HOM_ElemPtr<HOM_Edge> > edges() = 0;
67 
68  virtual int numEdges() = 0;
69 
70  virtual double floatAttribValue(const char *name) = 0;
71 
72  virtual double floatAttribValue(HOM_Attrib &attrib) = 0;
73 
74  virtual std::vector<double> floatListAttribValue(const char *name) = 0;
75 
76  virtual std::vector<double> floatListAttribValue(HOM_Attrib &attrib) = 0;
77 
78  virtual int64 intAttribValue(const char *name) = 0;
79 
80  virtual int64 intAttribValue(HOM_Attrib &attrib) = 0;
81 
82  virtual std::vector<int64> intListAttribValue(const char *name) = 0;
83 
84  virtual std::vector<int64> intListAttribValue(HOM_Attrib &attrib) = 0;
85 
86  virtual std::string stringAttribValue(const char *name) = 0;
87 
88  virtual std::string stringAttribValue(HOM_Attrib &attrib) = 0;
89 
90  virtual std::vector<std::string> stringListAttribValue(const char *name) = 0;
91 
92  virtual std::vector<std::string> stringListAttribValue(HOM_Attrib &attrib) = 0;
93  virtual std::map<std::string,hboost::any> dictAttribValue(const char *name) = 0;
94  virtual std::map<std::string,hboost::any> dictAttribValue(HOM_Attrib &name) = 0;
95  virtual std::vector<std::map<std::string,hboost::any> > dictListAttribValue(const char *name) = 0;
96  virtual std::vector<std::map<std::string,hboost::any> > dictListAttribValue(HOM_Attrib &name) = 0;
97 
98 
99  virtual void setAttribValue(
100  HOM_Attrib &attrib, int64 attrib_value) = 0;
101  virtual void setAttribValue(
102  HOM_Attrib &attrib, double attrib_value) = 0;
103  virtual void setAttribValue(
104  HOM_Attrib &attrib, const char *attrib_value) = 0;
105  virtual void setAttribValue(
106  HOM_Attrib &attrib, const std::vector<int64> &attrib_value) = 0;
107  virtual void setAttribValue(
108  HOM_Attrib &attrib, const std::vector<double> &attrib_value) = 0;
109  virtual void setAttribValue(
110  HOM_Attrib &attrib, const std::vector<std::string> &attrib_value) = 0;
111  virtual void setAttribValue(
112  HOM_Attrib &attrib, const std::map<std::string, hboost::any> &attrib_value) = 0;
113  virtual void setAttribValue(
114  HOM_Attrib &attrib, const std::vector<std::map<std::string,hboost::any> > &attrib_value) = 0;
115 
116  virtual void setAttribValue(
117  const char *attrib_name, int64 attrib_value) = 0;
118  virtual void setAttribValue(
119  const char *attrib_name, double attrib_value) = 0;
120  virtual void setAttribValue(
121  const char *attrib_name, const char *attrib_value) = 0;
122  // Note that, because of strangess the with way swig works when deciding
123  // which overloaded method to call, it's very important that we list the
124  // vector of ints before the vector of doubles. Otherwise, swig will call
125  // the double version when you pass in a vector of ints.
126  // It isn't that simple, the order is important but also depends on
127  // everything else in the override, so you may have to switch these
128  // until SWIG generates the right code...
129  virtual void setAttribValue(
130  const char *attrib_name, const std::vector<int64> &attrib_value) = 0;
131  virtual void setAttribValue(
132  const char *attrib_name, const std::vector<double> &attrib_value) = 0;
133  virtual void setAttribValue(
134  const char *attrib_name,
135  const std::vector<std::string> &attrib_value) = 0;
136  virtual void setAttribValue(
137  const char *attrib_name,
138  const std::map<std::string, hboost::any> &attrib_value) = 0;
139  virtual void setAttribValue(
140  const char *attrib_name,
141  const std::vector<std::map<std::string,hboost::any> > &attrib_value) = 0;
142 
143 
144  virtual std::vector<std::string> intrinsicNames() = 0;
145 
146  virtual hboost::any intrinsicValue(
147  const char *intrinsic_name) = 0;
148  virtual size_t intrinsicSize(const char *intrinsic_name) = 0;
149  virtual bool intrinsicReadOnly(const char *intrinsic_name) = 0;
150 
151  virtual void setIntrinsicValue(const char *intrinsic_name, double value) = 0;
152  virtual void setIntrinsicValue(const char *intrinsic_name, int value) = 0;
153  virtual void setIntrinsicValue(const char *intrinsic_name, int64 value) = 0;
154  virtual void setIntrinsicValue(
155  const char *intrinsic_name, const char *value) = 0;
156  virtual void setIntrinsicValue(
157  const char *intrinsic_name, const std::vector<double> &value) = 0;
158  virtual void setIntrinsicValue(
159  const char *intrinsic_name, const std::vector<int> &value) = 0;
160  virtual void setIntrinsicValue(
161  const char *intrinsic_name, const std::vector<int64> &value) = 0;
162  virtual void setIntrinsicValue(
163  const char *intrinsic_name, const std::vector<std::string> &value) = 0;
164 
165 #ifdef SWIG
166 %extend
167 {
168  InterpreterObject attribValue(const char *name)
169  { return HOMattribValue(*self, name); }
170 
171  InterpreterObject attribValue(HOM_Attrib &attrib)
172  { return HOMattribValue(*self, attrib); }
173 }
174 #endif
175 
176  SWIGOUT(%newobject positionAtInterior;)
177  virtual HOM_Vector3 *positionAtInterior(double u, double v, double w = 0.0) = 0;
178 
179  SWIGOUT(%ignore boostAnyAttribValueAtInterior;)
180  virtual hboost::any boostAnyAttribValueAtInterior(
181  const char *name, double u, double v, double w) = 0;
182 
183  SWIGOUT(%ignore boostAnyAttribValueAtInterior;)
184  virtual hboost::any boostAnyAttribValueAtInterior(
185  HOM_Attrib &attrib, double u, double v, double w) = 0;
186 
187  SWIGOUT(%newobject _nearestPointOnPrimToPosition;)
188  virtual HOM_Point *_nearestPointOnPrimToPosition(
189  const HOM_Vector3 &uvw, const HOM_Vector3 &position) = 0;
190 
191 #ifdef SWIG
192 %extend
193 {
194  InterpreterObject attribValueAtInterior(
195  const char *name, double u, double v, double w = 0.0)
196  {
197  return HOMboostAnyToInterpreterObject(
198  self->boostAnyAttribValueAtInterior(name, u, v, w));
199  }
200 
201  InterpreterObject attribValueAtInterior(
202  HOM_Attrib &attrib, double u, double v, double w = 0.0)
203  {
204  return HOMboostAnyToInterpreterObject(
205  self->boostAnyAttribValueAtInterior(attrib, u, v, w));
206  }
207 }
208 #endif
209 
210  virtual HOM_BoundingBox boundingBox() = 0;
211 
212  virtual UT_Tuple<double, double, double> nearestToPosition(
213  const std::vector<double> &position) = 0;
214 
215  virtual std::vector< HOM_ElemPtr<HOM_PrimGroup> > groups() = 0;
216 
217  virtual HOM_Vector2 *primuvConvert(const HOM_Vector2 &uv, int mode) = 0;
218  virtual HOM_Vector2 *primuvConvert(const HOM_Vector2 &uv, int mode, double tol) =0;
219  virtual double primuConvert(double u, int mode) = 0;
220  virtual double primuConvert(double u, int mode, double tol) =0;
221 
222  virtual void _attribInfo( const char *name, int &attr_data_type, int &attr_size, bool &is_array_type) = 0;
223 
224 };
225 
226 #endif
HOM_Prim()
Definition: HOM_Prim.h:37
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
GA_API const UT_StringHolder uv
const GLdouble * v
Definition: glcorearb.h:837
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
bool any(const vbool4 &v)
Definition: simd.h:3468
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1302
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:556
long long int64
Definition: SYS_Types.h:116
GLuint const GLchar * name
Definition: glcorearb.h:786
GLenum mode
Definition: glcorearb.h:99
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
virtual ~HOM_Prim()
Definition: HOM_Prim.h:41
SIM_API const UT_StringHolder position
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
Definition: core.h:1131
HOM_Prim(const HOM_Prim &)
Definition: HOM_Prim.h:39
type
Definition: core.h:1059
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542
int __hash__()