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