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