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