HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Geometry.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_Geometry_h__
10 #define __HOM_Geometry_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_BinaryString.h"
14 #include "HOM_Defines.h"
15 #include "HOM_Errors.h"
16 #include "HOM_IterableList.h"
17 #include "HOM_BoundingBox.h"
19 #include "HOM_Attrib.h"
20 #include "HOM_LopNode.h"
21 #include "HOM_LopSelectionRule.h"
22 #include <UT/UT_Tuple.h>
23 #include <vector>
24 #include <string>
25 
26 class HOM_AttribDataId;
27 class HOM_Edge;
28 class HOM_EdgeGroup;
29 class HOM_Face;
30 class HOM_GUDetailHandle;
31 class HOM_LopLockedStage;
32 class HOM_Matrix4;
33 class HOM_PackedGeometry;
34 class HOM_PackedPrim;
35 class HOM_Parm;
36 class HOM_Point;
37 class HOM_PointGroup;
38 class HOM_Polygon;
39 class HOM_Prim;
40 class HOM_PrimGroup;
41 class HOM_Selection;
42 class HOM_SopNode;
43 class HOM_Surface;
44 class HOM_VDB;
45 class HOM_Vector2;
46 class HOM_Vector3;
47 class HOM_Vertex;
48 class HOM_VertexGroup;
49 class HOM_Volume;
50 class HOMF_GeometryHandle;
51 
52 SWIGOUT(%rename(Geometry) HOM_Geometry;)
53 // Force SWIG to output an __init__ method even though it determines this
54 // class is abstract.
55 SWIGOUT(%feature("notabstract") HOM_Geometry;)
56 
58 {
59 public:
60 #ifdef SWIG
61 %extend
62 {
63  HOM_Geometry(HOM_Geometry *geo=nullptr, bool clone_data_ids=false)
64  { return HOM().newGeometry(geo, clone_data_ids); }
65 }
66 #else
68  { HOM_CONSTRUCT_OBJECT(this) }
70  { HOM_CONSTRUCT_OBJECT(this) }
71 #endif
72  virtual ~HOM_Geometry()
73  { HOM_DESTRUCT_OBJECT(this) }
74 
75  virtual std::string __repr__() = 0;
76 
77  SWIGOUT(%newobject sopNode;)
78  virtual HOM_SopNode *sopNode() = 0;
79  virtual int sopNodeOutputIndex() = 0;
80 
81  virtual bool isValid() = 0;
82 
83  SWIGOUT(%newobject freeze;)
84  virtual HOM_Geometry *freeze(bool read_only=false,
85  bool clone_data_ids=false) = 0;
86 
87  SWIGOUT(%newobject iterPoints;)
88  virtual HOM_IterableList<HOM_Point> *iterPoints() = 0;
89 
90  virtual std::vector<HOM_ElemPtr<HOM_Point> > points() = 0;
91 
92  SWIGOUT(%newobject point;)
93  virtual HOM_Point *point(int index) = 0;
94 
95  SWIGOUT(%newobject iterPrims;)
96  virtual HOM_IterableList<HOM_Prim> *iterPrims() = 0;
97 
98  virtual std::vector<HOM_ElemPtr<HOM_Prim> > prims() = 0;
99 
100  SWIGOUT(%newobject prim;)
101  virtual HOM_Prim *prim(int index) = 0;
102 
103  virtual bool containsPrimType(const char *type_name) = 0;
104  virtual bool containsPrimType(HOM_EnumValue &prim_type) = 0;
105  virtual int64 countPrimType(const char *type_name) = 0;
106  virtual int64 countPrimType(HOM_EnumValue &prim_type) = 0;
107 
108  virtual int64 preferredPrecision() = 0;
109  virtual void setPreferredPrecision(int64 prec) = 0;
110 
111  virtual double averageMinDistance(
112  const HOM_Matrix4& local_transform,
113  HOM_Geometry& geometry,
114  const HOM_Matrix4& geometry_transform) = 0;
115 
116  virtual double averageEdgeLength() = 0;
117 
118  virtual std::vector<HOM_ElemPtr<HOM_Point> > globPoints(const char *pattern, bool ordered = false) = 0;
119 
120  virtual std::vector<HOM_ElemPtr<HOM_Prim> > globPrims(const char *pattern) = 0;
121 
122  virtual std::vector<HOM_ElemPtr<HOM_Vertex> > globVertices(
123  const char *pattern) = 0;
124 
125  virtual std::vector<HOM_ElemPtr<HOM_Edge> > globEdges(const char *pattern) = 0;
126 
127  virtual std::vector<HOM_ElemPtr<HOM_Attrib> > pointAttribs(bool include_private=false) = 0;
128 
129  virtual std::vector<HOM_ElemPtr<HOM_Attrib> > primAttribs(bool include_private=false) = 0;
130 
131  virtual std::vector<HOM_ElemPtr<HOM_Attrib> > vertexAttribs(bool include_private=false) = 0;
132 
133  virtual std::vector<HOM_ElemPtr<HOM_Attrib> > globalAttribs(bool include_private=false) = 0;
134 
135 
136  SWIGOUT(%newobject findPointAttrib;)
137  virtual HOM_Attrib *findPointAttrib(const char *name) = 0;
138 
139  SWIGOUT(%newobject findPrimAttrib;)
140  virtual HOM_Attrib *findPrimAttrib(const char *name) = 0;
141 
142  SWIGOUT(%newobject findVertexAttrib;)
143  virtual HOM_Attrib *findVertexAttrib(const char *name) = 0;
144 
145  SWIGOUT(%newobject findGlobalAttrib;)
146  virtual HOM_Attrib *findGlobalAttrib(const char *name) = 0;
147 
148  virtual HOM_EnumValue& attribType() = 0;
149 
150 
151  // These methods return global (detail) attribute values.
152  virtual double floatAttribValue(const char *name) = 0;
153 
154  virtual double floatAttribValue(HOM_Attrib &attrib) = 0;
155 
156  virtual std::vector<double> floatListAttribValue(const char *name) = 0;
157 
158  virtual std::vector<double> floatListAttribValue(HOM_Attrib &attrib) = 0;
159 
160  virtual int64 intAttribValue(const char *name) = 0;
161 
162  virtual int64 intAttribValue(HOM_Attrib &attrib) = 0;
163 
164  virtual std::vector<int64> intListAttribValue(const char *name) = 0;
165 
166  virtual std::vector<int64> intListAttribValue(HOM_Attrib &attrib) = 0;
167 
168  virtual std::string stringAttribValue(const char *name) = 0;
169 
170  virtual std::string stringAttribValue(HOM_Attrib &attrib) = 0;
171 
172  virtual std::vector<std::string> stringListAttribValue(const char *name) = 0;
173 
174  virtual std::vector<std::string> stringListAttribValue(HOM_Attrib &attrib) = 0;
175  virtual std::map<std::string,hboost::any> dictAttribValue(const char *name) = 0;
176  virtual std::map<std::string,hboost::any> dictAttribValue(HOM_Attrib &name) = 0;
177  virtual std::vector<std::map<std::string,hboost::any> > dictListAttribValue(const char *name) = 0;
178  virtual std::vector<std::map<std::string,hboost::any> > dictListAttribValue(HOM_Attrib &name) = 0;
179 
180 
181  // These methods return/set arrays of point/primitive attribute values.
182  virtual std::vector<double> pointFloatAttribValues(const char *name) = 0;
183  SWIGOUT(%kwargs pointFloatAttribValuesAsString;)
184  virtual HOM_BinaryString pointFloatAttribValuesAsString(const char *name,
185  HOM_EnumValue &float_type = HOM_numericData::Float32) = 0;
186  virtual std::vector<double> primFloatAttribValues(const char *name) = 0;
187  SWIGOUT(%kwargs primFloatAttribValuesAsString;)
188  virtual HOM_BinaryString primFloatAttribValuesAsString(const char *name,
189  HOM_EnumValue &float_type = HOM_numericData::Float32) = 0;
190  virtual std::vector<double> vertexFloatAttribValues(const char *name) = 0;
191  SWIGOUT(%kwargs vertexFloatAttribValuesAsString;)
192  virtual HOM_BinaryString vertexFloatAttribValuesAsString(const char *name,
193  HOM_EnumValue &float_type = HOM_numericData::Float32) = 0;
194 
195  virtual std::vector<int64> pointIntAttribValues(const char *name) = 0;
196  SWIGOUT(%kwargs pointIntAttribValuesAsString;)
197  virtual HOM_BinaryString pointIntAttribValuesAsString(const char *name,
199  virtual std::vector<int64> primIntAttribValues(const char *name) = 0;
200  SWIGOUT(%kwargs primIntAttribValuesAsString;)
201  virtual HOM_BinaryString primIntAttribValuesAsString(const char *name,
203  virtual std::vector<int64> vertexIntAttribValues(const char *name) = 0;
204  SWIGOUT(%kwargs vertexIntAttribValuesAsString;)
205  virtual HOM_BinaryString vertexIntAttribValuesAsString(const char *name,
207 
208  virtual std::vector<std::string> pointStringAttribValues(const char *name) = 0;
209  virtual std::vector<std::string> primStringAttribValues(const char *name) = 0;
210  virtual std::vector<std::string> vertexStringAttribValues(const char *name) = 0;
211 
212  virtual void setPointFloatAttribValues(
213  const char *name, const std::vector<double> &values) = 0;
214  virtual void setPrimFloatAttribValues(
215  const char *name, const std::vector<double> &values) = 0;
216  virtual void setVertexFloatAttribValues(
217  const char *name, const std::vector<double> &values) = 0;
218 
219  SWIGOUT(%ignore opaqueSetPointFloatAttribValuesFromString);
220  virtual void opaqueSetPointFloatAttribValuesFromString(
221  const char *name, const char *values, int64 length,
223  SWIGOUT(%ignore opaqueSetPrimFloatAttribValuesFromString);
224  virtual void opaqueSetPrimFloatAttribValuesFromString(
225  const char *name, const char *values, int64 length,
227  SWIGOUT(%ignore opaqueSetVertexFloatAttribValuesFromString);
228  virtual void opaqueSetVertexFloatAttribValuesFromString(
229  const char *name, const char *values, int64 length,
231 
232 #ifdef SWIG
233 %extend
234 {
235  %kwargs setPointFloatAttribValuesFromString;
236  void setPointFloatAttribValuesFromString(
237  const char *name, InterpreterObject values,
238  HOM_EnumValue &float_type = HOM_numericData::Float32)
239  {
240  HOM_PyBuffer buffer(values);
241  self->opaqueSetPointFloatAttribValuesFromString(
242  name, (const char *)buffer.myData, buffer.myLength, float_type);
243  }
244 
245  %kwargs setPrimFloatAttribValuesFromString;
246  void setPrimFloatAttribValuesFromString(
247  const char *name, InterpreterObject values,
248  HOM_EnumValue &float_type = HOM_numericData::Float32)
249  {
250  HOM_PyBuffer buffer(values);
251  self->opaqueSetPrimFloatAttribValuesFromString(
252  name, (const char *)buffer.myData, buffer.myLength, float_type);
253  }
254 
255  %kwargs setVertexFloatAttribValuesFromString;
256  void setVertexFloatAttribValuesFromString(
257  const char *name, InterpreterObject values,
258  HOM_EnumValue &float_type = HOM_numericData::Float32)
259  {
260  HOM_PyBuffer buffer(values);
261  self->opaqueSetVertexFloatAttribValuesFromString(
262  name, (const char *)buffer.myData, buffer.myLength, float_type);
263  }
264 }
265 #endif
266 
267  virtual void setPointIntAttribValues(
268  const char *name, const std::vector<int64> &values) = 0;
269  virtual void setPrimIntAttribValues(
270  const char *name, const std::vector<int64> &values) = 0;
271  virtual void setVertexIntAttribValues(
272  const char *name, const std::vector<int64> &values) = 0;
273 
274  SWIGOUT(%ignore opaqueSetPointIntAttribValuesFromString);
275  virtual void opaqueSetPointIntAttribValuesFromString(
276  const char *name, const char *values, int64 length,
277  HOM_EnumValue &int_type) = 0;
278  SWIGOUT(%ignore opaqueSetPrimIntAttribValuesFromString);
279  virtual void opaqueSetPrimIntAttribValuesFromString(
280  const char *name, const char *values, int64 length,
281  HOM_EnumValue &int_type) = 0;
282  SWIGOUT(%ignore opaqueSetVertexIntAttribValuesFromString);
283  virtual void opaqueSetVertexIntAttribValuesFromString(
284  const char *name, const char *values, int64 length,
285  HOM_EnumValue &int_type) = 0;
286 
287 #ifdef SWIG
288 %extend
289 {
290  %kwargs setPointIntAttribValuesFromString;
291  void setPointIntAttribValuesFromString(
292  const char *name, InterpreterObject values,
294  {
295  HOM_PyBuffer buffer(values);
296  self->opaqueSetPointIntAttribValuesFromString(
297  name, (const char *)buffer.myData, buffer.myLength, int_type);
298  }
299 
300  %kwargs setPrimIntAttribValuesFromString;
301  void setPrimIntAttribValuesFromString(
302  const char *name, InterpreterObject values,
304  {
305  HOM_PyBuffer buffer(values);
306  self->opaqueSetPrimIntAttribValuesFromString(
307  name, (const char *)buffer.myData, buffer.myLength, int_type);
308  }
309 
310  %kwargs setVertexIntAttribValuesFromString;
311  void setVertexIntAttribValuesFromString(
312  const char *name, InterpreterObject values,
314  {
315  HOM_PyBuffer buffer(values);
316  self->opaqueSetVertexIntAttribValuesFromString(
317  name, (const char *)buffer.myData, buffer.myLength, int_type);
318  }
319 }
320 #endif
321 
322  virtual void setPointStringAttribValues(
323  const char *name, const std::vector<std::string> &values) = 0;
324  virtual void setPrimStringAttribValues(
325  const char *name, const std::vector<std::string> &values) = 0;
326  virtual void setVertexStringAttribValues(
327  const char *name, const std::vector<std::string> &values) = 0;
328 
329  virtual void renamePointAttrib(const char *old_name, const char *new_name) = 0;
330  virtual void renamePrimAttrib(const char *old_name, const char *new_name) = 0;
331  virtual void renameVertexAttrib(const char *old_name, const char *new_name) = 0;
332  virtual void renameGlobalAttrib(const char *old_name, const char *new_name) = 0;
333 
334  SWIGOUT(%newobject createPoint;)
335  virtual HOM_Point *createPoint() = 0;
336  virtual std::vector<HOM_ElemPtr<HOM_Point> >createPoints(
337  const std::vector<std::vector<double> > &point_positions) = 0;
338  virtual std::vector<HOM_ElemPtr<HOM_Point> >createPoints(
339  const std::vector<HOM_Vector3 *> &point_positions) = 0;
340 
341  SWIGOUT(%newobject createPolygon;)
342  virtual HOM_Polygon *createPolygon(bool is_closed=true) = 0;
343  virtual std::vector<HOM_ElemPtr<HOM_Polygon> >createPolygons(
344  const std::vector<std::vector<HOM_Point *> > &points,
345  bool is_closed=true) = 0;
346  virtual std::vector<HOM_ElemPtr<HOM_Polygon> >createPolygons(
347  const std::vector<std::vector<int> > &point_numbers,
348  bool is_closed=true) = 0;
349 
350  SWIGOUT(%newobject createPacked;)
351  virtual HOM_PackedPrim *createPacked(
352  const char *packed_type,
353  HOM_Point *point = nullptr) = 0;
354 
355  SWIGOUT(%newobject createTetrahedron;)
356  virtual HOM_Prim *createTetrahedron() = 0;
357 
358  SWIGOUT(%newobject createTetrahedronInPlace;)
359  virtual HOM_Prim *createTetrahedronInPlace(HOM_Point *p0, HOM_Point *p1,
360  HOM_Point *p2, HOM_Point *p3) = 0;
361 
362  SWIGOUT(%newobject createHexahedron;)
363  virtual HOM_Prim *createHexahedron() = 0;
364 
365  SWIGOUT(%newobject createHexahedronInPlace;)
366  virtual HOM_Prim *createHexahedronInPlace(HOM_Point *p0, HOM_Point *p1,
367  HOM_Point *p2, HOM_Point *p3,
368  HOM_Point *p4, HOM_Point *p5,
369  HOM_Point *p6, HOM_Point *p7
370  ) = 0;
371 
372  SWIGOUT(%newobject createNURBSCurve;)
373  SWIGOUT(%kwargs createNURBSCurve;)
374  virtual HOM_Face *createNURBSCurve(int num_points=4, bool is_closed=false,
375  int order=4) = 0;
376 
377  SWIGOUT(%newobject createBezierCurve;)
378  SWIGOUT(%kwargs createBezierCurve;)
379  virtual HOM_Face *createBezierCurve(int num_points=4, bool is_closed=false,
380  int order=4) = 0;
381 
382  SWIGOUT(%newobject createNURBSSurface;)
383  SWIGOUT(%kwargs createNURBSSurface;)
384  virtual HOM_Surface *createNURBSSurface(
385  int rows, int cols,
386  bool is_closed_in_u=false, bool is_closed_in_v=false,
387  int order_u=4, int order_v=4) = 0;
388 
389  SWIGOUT(%newobject createBezierSurface;)
390  SWIGOUT(%kwargs createBezierSurface;)
391  virtual HOM_Surface *createBezierSurface(
392  int rows, int cols,
393  bool is_closed_in_u=false, bool is_closed_in_v=false,
394  int order_u=4, int order_v=4) = 0;
395 
396  SWIGOUT(%newobject createMeshSurface;)
397  SWIGOUT(%kwargs createMeshSurface;)
398  virtual HOM_Surface *createMeshSurface(
399  int rows, int cols,
400  bool is_closed_in_u=false, bool is_closed_in_v=false) = 0;
401 
402  SWIGOUT(%newobject createVolume;)
403  SWIGOUT(%kwargs createVolume;)
404  virtual HOM_Volume *createVolume(
405  int xres, int yres, int zres, HOM_BoundingBox *bounding_box=NULL) = 0;
406 
407 
408  virtual void transform(HOM_Matrix4 &matrix) = 0;
409 
410  virtual void transformPrims(
411  const std::vector<HOM_Prim *> &prims, HOM_Matrix4 &matrix) = 0;
412 
413  SWIGOUT(%kwargs deletePrims;)
414  virtual void deletePrims(
415  const std::vector<HOM_Prim *> &prims, bool keep_points=false) = 0;
416 
417  SWIGOUT(%kwargs deletePrimsOutsideBoundingBox;)
418  virtual void deletePrimsOutsideBoundingBox(
419  const HOM_BoundingBox &bbox) = 0;
420 
421  virtual void deletePoints(const std::vector<HOM_Point *> &points) = 0;
422 
423 
424  // Swig does not allow keyword arguments for overloaded functions, so
425  // addAttrib is wrapped in houpythonportion.py to enable keyword
426  // arguments. If you want to change the signature of addAttrib, you must
427  // also edit houpythonportion.py.
428  SWIGOUT(%newobject addAttrib;)
429  virtual HOM_Attrib *addAttrib(
430  HOM_EnumValue &type, const char *name,
431  int64 default_value,
432  bool transform_as_normal,
433  bool create_local_variable) = 0;
434 
435  virtual HOM_Attrib *addAttrib(
436  HOM_EnumValue &type, const char *name,
437  double default_value,
438  bool transform_as_normal,
439  bool create_local_variable) = 0;
440 
441  virtual HOM_Attrib *addAttrib(
442  HOM_EnumValue &type, const char *name,
443  const char *default_value,
444  bool transform_as_normal,
445  bool create_local_variable) = 0;
446 
447  virtual HOM_Attrib *addAttrib(
449  const char *name,
450  const std::vector<int64> &default_value,
451  bool transform_as_normal,
452  bool create_local_variable) = 0;
453 
454  virtual HOM_Attrib *addAttrib(
456  const char *name,
457  const std::vector<double> &default_value,
458  bool transform_as_normal,
459  bool create_local_variable) = 0;
460 
461  virtual HOM_Attrib *addAttrib(
463  const char *name,
464  const std::vector<std::string> &default_value,
465  bool transform_as_normal,
466  bool create_local_variable) = 0;
467 
468  virtual HOM_Attrib *addAttrib(
470  const char *name,
471  const std::map<std::string, hboost::any> &default_value,
472  bool transform_as_normal,
473  bool create_local_variable) = 0;
474 
475  SWIGOUT(%kwargs addArrayAttrib;)
476  SWIGOUT(%newobject addArrayAttrib;)
477  virtual HOM_Attrib *addArrayAttrib(
478  HOM_EnumValue &type, const char *name,
479  HOM_EnumValue &data_type,
480  int64 tuple_size = 1) = 0;
481 
482 
483  virtual void setGlobalAttribValue(
484  HOM_Attrib &attrib, int64 attrib_value) = 0;
485  virtual void setGlobalAttribValue(
486  HOM_Attrib &attrib, double attrib_value) = 0;
487  virtual void setGlobalAttribValue(
488  HOM_Attrib &attrib, const char *attrib_value) = 0;
489  virtual void setGlobalAttribValue(
490  HOM_Attrib &attrib, const std::vector<int64> &attrib_value) = 0;
491  virtual void setGlobalAttribValue(
492  HOM_Attrib &attrib, const std::vector<double> &attrib_value) = 0;
493  virtual void setGlobalAttribValue(
494  HOM_Attrib &attrib, const std::vector<std::string> &attrib_value) = 0;
495  virtual void setGlobalAttribValue(
496  HOM_Attrib &attrib, const std::map<std::string, hboost::any> &attrib_value) = 0;
497  virtual void setGlobalAttribValue(
498  HOM_Attrib &attrib, const std::vector<std::map<std::string,hboost::any> > &attrib_value) = 0;
499 
500  virtual void setGlobalAttribValue(
501  const char *attrib_name, int64 attrib_value) = 0;
502  virtual void setGlobalAttribValue(
503  const char *attrib_name, double attrib_value) = 0;
504  virtual void setGlobalAttribValue(
505  const char *attrib_name, const char *attrib_value) = 0;
506  // Note that, because of strangess the with way swig works when deciding
507  // which overloaded method to call, it's very important that we list the
508  // vector of ints before the vector of doubles. Otherwise, swig will call
509  // the double version when you pass in a vector of ints.
510  // It isn't that simple, the order is important but also depends on
511  // everything else in the override, so you may have to switch these
512  // until SWIG generates the right code...
513  virtual void setGlobalAttribValue(
514  const char *attrib_name, const std::vector<int64> &attrib_value) = 0;
515  virtual void setGlobalAttribValue(
516  const char *attrib_name, const std::vector<double> &attrib_value) = 0;
517  virtual void setGlobalAttribValue(
518  const char *attrib_name,
519  const std::vector<std::string> &attrib_value) = 0;
520  virtual void setGlobalAttribValue(
521  const char *attrib_name,
522  const std::map<std::string, hboost::any> &attrib_value) = 0;
523  virtual void setGlobalAttribValue(
524  const char *attrib_name,
525  const std::vector<std::map<std::string,hboost::any> > &attrib_value) = 0;
526 
527  virtual void copyAttrib(HOM_Attrib *attrib) = 0;
528  virtual void copyAttribs(const std::vector<HOM_Attrib *> &attribs) = 0;
529  virtual void copy(HOM_Geometry &geometry, bool clone_data_ids=false) = 0;
530 
531 
532  virtual std::vector<HOM_ElemPtr<HOM_Point> > _getPointChildren(HOM_Point *pt) = 0;
533 #ifdef SWIG
534 %extend
535 {
536  InterpreterObject attribValue(const char *name)
537  { return HOMattribValue(*self, name); }
538 
539  InterpreterObject attribValue(HOM_Attrib &attrib)
540  { return HOMattribValue(*self, attrib); }
541 }
542 #endif
543 
544  virtual std::vector<std::string> attributeCaptureRegions() = 0;
545  virtual std::vector<std::string> attributeCaptureObjectPaths() = 0;
546 
547 
548  virtual std::vector<std::string> intrinsicNames() = 0;
549 
550  virtual hboost::any intrinsicValue(
551  const char *intrinsic_name) = 0;
552  virtual size_t intrinsicSize(const char *intrinsic_name) = 0;
553  virtual bool intrinsicReadOnly(const char *intrinsic_name) = 0;
554 
555  virtual void setIntrinsicValue(const char *intrinsic_name, double value) = 0;
556  virtual void setIntrinsicValue(const char *intrinsic_name, int value) = 0;
557  virtual void setIntrinsicValue(const char *intrinsic_name, int64 value) = 0;
558  virtual void setIntrinsicValue(
559  const char *intrinsic_name, const char *value) = 0;
560  virtual void setIntrinsicValue(
561  const char *intrinsic_name, const std::vector<double> &value) = 0;
562  virtual void setIntrinsicValue(
563  const char *intrinsic_name, const std::vector<int> &value) = 0;
564  virtual void setIntrinsicValue(
565  const char *intrinsic_name, const std::vector<int64> &value) = 0;
566  virtual void setIntrinsicValue(
567  const char *intrinsic_name, const std::vector<std::string> &value) = 0;
568 
569  virtual HOM_BinaryString data() = 0;
570  virtual void load(HOM_BinaryString data) = 0;
571 
572  virtual void saveToFile(const char *file_name) = 0;
573 
574  virtual void loadFromFile(const char *file_name) = 0;
575 
576  virtual void merge(HOM_Geometry &geometry, bool clone_data_ids=false) = 0;
577 
578  virtual void clear() = 0;
579 
580  SWIGOUT(%kwargs intersect;)
581  virtual int intersect(
582  const HOM_Vector3 &rayorig, const HOM_Vector3 &dir,
584  const char *pattern = nullptr, float min_hit=1e-2f, float max_hit=1e18f,
585  float tolerance=1e-2F) = 0;
586 
587  virtual std::vector<int> _orderedPoints(
588  const char *groupname,
589  const char *corner_groupname,
590  HOM_Vector2 &dimensions) = 0;
591 
592  virtual std::vector<HOM_ElemPtr<HOM_PointGroup> > pointGroups() = 0;
593 
594  SWIGOUT(%newobject findPointGroup;)
595  virtual HOM_PointGroup *findPointGroup(const char *name) = 0;
596 
597  SWIGOUT(%newobject createPointGroup;)
598  virtual HOM_PointGroup *createPointGroup(
599  const char *name, bool is_ordered=false) = 0;
600 
601 
602  virtual std::vector<HOM_ElemPtr<HOM_PrimGroup> > primGroups() = 0;
603 
604  SWIGOUT(%newobject findPrimGroup;)
605  virtual HOM_PrimGroup *findPrimGroup(const char *name) = 0;
606 
607  SWIGOUT(%newobject createPrimGroup;)
608  virtual HOM_PrimGroup *createPrimGroup(
609  const char *name, bool is_ordered=false) = 0;
610 
611  virtual std::vector<HOM_ElemPtr<HOM_EdgeGroup> > edgeGroups() = 0;
612 
613  SWIGOUT(%newobject findEdgeGroup;)
614  virtual HOM_EdgeGroup *findEdgeGroup(const char *name) = 0;
615 
616  SWIGOUT(%newobject createEdgeGroup;)
617  virtual HOM_EdgeGroup *createEdgeGroup(
618  const char *name) = 0;
619 
620  virtual std::vector<HOM_ElemPtr<HOM_VertexGroup> > vertexGroups() = 0;
621 
622  SWIGOUT(%newobject findVertexGroup;)
623  virtual HOM_VertexGroup *findVertexGroup(const char *name) = 0;
624 
625  SWIGOUT(%newobject createVertexGroup;)
626  virtual HOM_VertexGroup *createVertexGroup(
627  const char *name, bool is_ordered=false) = 0;
628 
629  SWIGOUT(%newobject findEdge;)
630  virtual HOM_Edge *findEdge(HOM_Point * p0, HOM_Point * p1) = 0;
631 
632  virtual HOM_BoundingBox boundingBox(HOM_Matrix4* transform = nullptr) = 0;
633  virtual HOM_BoundingBox pointBoundingBox(const char *ptgroup) = 0;
634  virtual HOM_BoundingBox primBoundingBox(const char *primgroup) = 0;
635 
636  virtual HOM_OrientedBoundingBox orientedBoundingBox() = 0;
637  virtual HOM_OrientedBoundingBox orientedPointBoundingBox(const char *ptgroup) = 0;
638  virtual HOM_OrientedBoundingBox orientedPrimBoundingBox(const char *primgroup) = 0;
639 
640  virtual UT_Tuple<HOM_ElemPtr<HOM_Prim>, double, double, double>
641  nearestPrim(const std::vector<double> &position) = 0;
642 
643  SWIGOUT(%newobject nearestPoint;)
644  SWIGOUT(%kwargs nearestPoint;)
645  virtual HOM_Point *
646  nearestPoint(const std::vector<double> &position,
647  const char *ptgroup = nullptr,
648  double max_radius = 1e+18f) = 0;
649 
650  SWIGOUT(%kwargs nearestPoints;)
651  virtual std::vector<HOM_ElemPtr<HOM_Point> >
652  nearestPoints(const std::vector<double> &position,
653  int64 max_points,
654  const char *ptgroup = nullptr,
655  double max_radius = 1e+18f) = 0;
656 
657  SWIGOUT(%kwargs primLoop;)
658  virtual std::vector<HOM_ElemPtr<HOM_Prim> >
659  primLoop(std::vector<HOM_Prim *> prims,
660  HOM_EnumValue &loop_type = HOM_componentLoopType::Partial) = 0;
661  SWIGOUT(%kwargs pointLoop;)
662  virtual std::vector<HOM_ElemPtr<HOM_Point> >
663  pointLoop(std::vector<HOM_Point *> points,
664  HOM_EnumValue &loop_type = HOM_componentLoopType::Partial) = 0;
665  SWIGOUT(%kwargs edgeLoop;)
666  virtual std::vector<HOM_ElemPtr<HOM_Edge> >
667  edgeLoop(std::vector<HOM_Edge *> edges,
668  HOM_EnumValue &loop_type = HOM_componentLoopType::Partial,
669  bool full_loop_per_edge = true,
670  bool force_ring = false,
671  bool allow_ring = true) = 0;
672 
673  virtual std::vector<HOM_Vector3>
674  pointNormals(const std::vector<HOM_Point *> &points) = 0;
675 
676  SWIGOUT(%newobject importLop;)
677  SWIGOUT(%kwargs importLop;)
678  virtual HOM_LopLockedStage *
679  importLop(
680  HOM_LopNode &lopnode,
681  HOM_LopSelectionRule &selection_rule,
682  const char *purpose = NULL,
683  const char *traversal = NULL,
684  const char *path_attrib_name = NULL,
685  const char *name_attrib_name = NULL,
686  bool strip_layers = false,
687  HOM_OptionalDouble frame = HOM_OptionalDouble()) = 0;
688 
689  SWIGOUT(%ignore importUsdStageOpaque;)
690  virtual void importUsdStageOpaque(
691  void *stage,
692  HOM_LopSelectionRule &selection_rule,
693  const char *purpose = NULL,
694  const char *traversal = NULL,
695  const char *path_attrib_name = NULL,
696  const char *name_attrib_name = NULL,
697  HOM_OptionalDouble frame = HOM_OptionalDouble()) = 0;
698 
699 #ifdef SWIG
700 %extend
701 {
702  %kwargs importUsdStage;
703  void importUsdStage(
704  InterpreterObject stage,
705  HOM_LopSelectionRule &selection_rule,
706  const char *purpose = NULL,
707  const char *traversal = NULL,
708  const char *path_attrib_name = NULL,
709  const char *name_attrib_name = NULL,
711  {
712  return self->importUsdStageOpaque(
713  stage, selection_rule, purpose, traversal,
714  path_attrib_name, name_attrib_name, frame);
715  }
716 }
717 #endif
718 
719  SWIGOUT(%newobject selection;)
720  virtual HOM_Selection *selection() = 0;
721 
722  // This method is not documented in the user documentation. See
723  // the comments in HOMF_Geometry.C for what it does.
724  SWIGOUT(%newobject _guDetailHandle;)
725  virtual HOM_GUDetailHandle *_guDetailHandle() = 0;
726 
727  // This method is not documented in the user documentation. See the
728  // comments in HOMF_Geometry.C for what it does.
729  virtual HOMF_GeometryHandle& _geometryHandle() = 0;
730 
731  virtual std::vector<int> vexAttribDataId() = 0;
732 
733  virtual int64 modificationCounter() = 0;
734  virtual void incrementModificationCounter() = 0;
735 
736  virtual void incrementAllDataIds() = 0;
737 
738  SWIGOUT(%kwargs incrementDataIdsForAddOrRemove;)
739  virtual void incrementDataIdsForAddOrRemove(
740  bool for_points=true, bool for_prims=true) = 0;
741 
742  SWIGOUT(%newobject primitiveIntrinsicsDataId;)
743  virtual HOM_AttribDataId *primitiveIntrinsicsDataId() = 0;
744  virtual void incrementPrimitiveIntrinsicsDataId() = 0;
745 
746  SWIGOUT(%newobject topologyDataId;)
747  virtual HOM_AttribDataId *topologyDataId() = 0;
748  virtual void incrementTopologyDataId() = 0;
749 
750  SWIGOUT(%kwargs generateAttribMenu;)
751  virtual std::vector<std::string> generateAttribMenu(
752  HOM_EnumValue *attrib_type = nullptr,
753  HOM_EnumValue *data_type = nullptr,
754  int min_size = 1,
755  int max_size = -1,
756  bool array_type = true,
757  bool scalar_type = true,
758  bool case_sensitive = true,
759  const char *pattern = "*",
760  bool decode_tokens = false) = 0;
761 
762  // Wrapped in houpythonportion to handle kwargs for an overloaded method.
763  virtual std::vector<std::string> _generateGroupMenu(
764  const std::vector<HOM_EnumValue *> &group_types,
765  bool include_selection,
766  bool include_name_attrib,
767  bool case_sensitive,
768  const char *pattern,
769  bool decode_tokens,
770  HOM_Parm *parm) = 0;
771 
772  virtual bool isReadOnly() = 0;
773 
774  virtual void _attribInfo( const char *name, int &attr_data_type, int &attr_size, bool &is_array_type) = 0;
775 };
776 
777 #endif
GT_API const UT_StringHolder selection
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1254
GLuint GLdouble GLdouble GLint GLint order
Definition: glew.h:3460
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:353
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual HOM_Geometry * newGeometry(HOM_Geometry *geo=nullptr, bool clone_data_ids=false)=0
GLuint buffer
Definition: glcorearb.h:660
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
GLuint GLenum GLenum transform
Definition: glew.h:15055
Definition: core.h:760
bool any(const vbool4 &v)
Definition: simd.h:3468
#define HOM_API
Definition: HOM_API.h:13
const GLint * attribs
Definition: glew.h:14698
HOM_Geometry(const HOM_Geometry &)
Definition: HOM_Geometry.h:69
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1253
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
long long int64
Definition: SYS_Types.h:116
GLfloat GLfloat p
Definition: glew.h:16656
hboost::optional< double > HOM_OptionalDouble
Definition: HOM_Defines.h:45
GLuint GLenum matrix
Definition: glew.h:15055
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glew.h:3460
GLdouble n
Definition: glcorearb.h:2008
GLubyte * pattern
Definition: glew.h:5741
GLboolean * data
Definition: glcorearb.h:131
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
GLuint index
Definition: glcorearb.h:786
IMATH_CONSTEXPR14 bool intersect(const Line3< T > &line, const Vec3< T > &v0, const Vec3< T > &v1, const Vec3< T > &v2, Vec3< T > &pt, Vec3< T > &barycentric, bool &front) IMATH_NOEXCEPT
Definition: ImathLineAlgo.h:80
GLfloat f
Definition: glcorearb.h:1926
Definition: core.h:1131
virtual ~HOM_Geometry()
Definition: HOM_Geometry.h:72
type
Definition: core.h:1059
HOM_API HOM_Module & HOM()
Definition: format.h:895