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