HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_PointGroup.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_PointGroup_h__
10 #define __HOM_PointGroup_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Module.h"
14 #include "HOM_EnumModules.h"
15 #include "HOM_Point.h"
16 #include "HOM_PtrOrNull.h"
17 #include "HOM_IterableList.h"
18 #include <vector>
19 
20 class HOM_AttribDataId;
21 class HOM_Geometry;
23 
24 SWIGOUT(%rename(PointGroup) HOM_PointGroup;)
25 
27 {
28 public:
30  { HOM_CONSTRUCT_OBJECT(this) }
32  { HOM_CONSTRUCT_OBJECT(this) }
33  virtual ~HOM_PointGroup()
34  { HOM_DESTRUCT_OBJECT(this) }
35 
36  virtual bool operator==(HOM_PtrOrNull<HOM_PointGroup> point_group) = 0;
37  virtual bool operator!=(HOM_PtrOrNull<HOM_PointGroup> point_group) = 0;
38 
39  virtual int __hash__() = 0;
40  virtual std::string __repr__() = 0;
41 
42  SWIGOUT(%newobject geometry;)
43  virtual HOM_Geometry *geometry() = 0;
44 
45  virtual std::string name() = 0;
46 
47  SWIGOUT(%newobject iterPoints;)
48  virtual HOM_IterableList<HOM_Point> *iterPoints() = 0;
49 
50  virtual std::vector<HOM_ElemPtr<HOM_Point> > points() = 0;
51 
52  virtual bool contains(HOM_Point &point) = 0;
53 
54  virtual bool containsNumber(int index) = 0;
55 
56  virtual bool isOrdered() = 0;
57 
58  virtual void add(HOM_Point &point) = 0;
59 
60  virtual void add(const std::vector<HOM_Point *> &points) = 0;
61 
62  virtual void add(HOM_PointGroup &point_group) = 0;
63 
64  virtual void remove(HOM_Point &point) = 0;
65 
66  virtual void remove(const std::vector<HOM_Point *> &points) = 0;
67 
68  virtual void remove(HOM_PointGroup &point_group) = 0;
69 
70  virtual void clear() = 0;
71 
72  virtual void destroy() = 0;
73 
74  virtual int64 pointCount() = 0;
75 
76 #ifndef SWIG
77  // Helper class necessary for getRawOptions[RO\RW]() calls to manage locks
78  // that must be held for the duration of the reference to the UT_Options
79  // object.
81  {
82  public:
84  {
85  public:
86  virtual ~ImplBase() {}
87  protected:
88  ImplBase() {}
89  };
90 
91  OptionAutoLocks() : myImpl(0) {}
92  ~OptionAutoLocks() { delete myImpl; }
93 
94  void setImpl(ImplBase *impl) { myImpl = impl; }
95  private:
96  ImplBase *myImpl;
97  };
98 #endif
99 
100  // These methods return the UT_Options object associated with the attribute
101  // and are not wrapped by swig. The lock argument is present to ensure the
102  // caller holds the locks necessary to work with a reference to an object
103  // owned by the attribute.
104  SWIGOUT(%ignore getRawOptionsRO;)
105  virtual const GA_AttributeOptions &getRawOptionsRO(OptionAutoLocks &locks) = 0;
106  SWIGOUT(%ignore getRawOptionsRW;)
107  virtual GA_AttributeOptions &getRawOptionsRW(OptionAutoLocks &locks) = 0;
108 
109  // Get the data type of a particular option.
110  // TODO: We could implement here, but we need HOMFoptionTypeToEnumValue().
111  virtual HOM_EnumValue &optionType(const char *option_name) = 0;
112 
113  // Set an option value. The type_hint is used when the value type mapping
114  // to a UT_OptionType is ambiguous.
115  virtual void setOption(const char *name, HOM_UTOptionAny value,
116  HOM_EnumValue &type_hint =HOM_fieldType::NoSuchField) = 0;
117 
118  // Remove an option from the attribute's UT_Options object.
119  virtual void removeOption(const char *name) = 0;
120 
121  SWIGOUT(%newobject dataId;)
122  virtual HOM_AttribDataId *dataId() = 0;
123 
124  virtual void incrementDataId() = 0;
125 
126 #ifdef SWIG
127 %extend
128 {
129  InterpreterObject options()
130  {
132  const GA_AttributeOptions &attriboptions = self->getRawOptionsRO(locks);
133  UT_Options options;
134  attriboptions.buildFullOptions(options);
135  return HOMoptionsToInterpreterObject(options);
136  }
137 
138  InterpreterObject option(const char *option_name)
139  {
141  const GA_AttributeOptions &attriboptions = self->getRawOptionsRO(locks);
142  UT_Options options;
143  attriboptions.buildFullOptions(options);
144  const UT_OptionEntry *entry = options.getOptionEntry(option_name);
145  return entry ? HOMoptionEntryToInterpreterObject(*entry)
146  : SWIG_Py_Void();
147  }
148 }
149 #endif
150 };
151 
152 #endif
__hostdev__ uint64_t pointCount() const
Definition: NanoVDB.h:5974
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1398
void buildFullOptions(UT_Options &fulloptions) const
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
hboost::any HOM_UTOptionAny
Definition: HOM_Defines.h:37
GLsizei const GLfloat * value
Definition: glcorearb.h:824
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:312
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
void setImpl(ImplBase *impl)
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1397
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:556
long long int64
Definition: SYS_Types.h:116
GLuint const GLchar * name
Definition: glcorearb.h:786
A map of string to various well defined value types.
Definition: UT_Options.h:87
virtual ~HOM_PointGroup()
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
GLuint index
Definition: glcorearb.h:786
HOM_PointGroup(const HOM_PointGroup &)
void clear()
Reset to default.
const UT_OptionEntry * getOptionEntry(const UT_StringRef &name) const
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542