HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 <vector>
18 class HOM_Geometry;
20 
21 SWIGOUT(%rename(PointGroup) HOM_PointGroup;)
22 
24 {
25 public:
27  { HOM_CONSTRUCT_OBJECT(this) }
29  { HOM_CONSTRUCT_OBJECT(this) }
30  virtual ~HOM_PointGroup()
31  { HOM_DESTRUCT_OBJECT(this) }
32 
33  virtual bool operator==(HOM_PtrOrNull<HOM_PointGroup> point_group) = 0;
34  virtual bool operator!=(HOM_PtrOrNull<HOM_PointGroup> point_group) = 0;
35 
36  virtual int __hash__() = 0;
37  virtual std::string __repr__() = 0;
38 
39  SWIGOUT(%newobject geometry;)
40  virtual HOM_Geometry *geometry() = 0;
41 
42  virtual std::string name() = 0;
43 
44  virtual std::vector<HOM_ElemPtr<HOM_Point> > points() = 0;
45 
46  virtual bool contains(HOM_Point &point) = 0;
47 
48  virtual bool isOrdered() = 0;
49 
50  virtual void add(HOM_Point &point) = 0;
51 
52  virtual void add(const std::vector<HOM_Point *> &points) = 0;
53 
54  virtual void add(HOM_PointGroup &point_group) = 0;
55 
56  virtual void remove(HOM_Point &point) = 0;
57 
58  virtual void remove(const std::vector<HOM_Point *> &points) = 0;
59 
60  virtual void remove(HOM_PointGroup &point_group) = 0;
61 
62  virtual void clear() = 0;
63 
64  virtual void destroy() = 0;
65 
66 #ifndef SWIG
67  // Helper class necessary for getRawOptions[RO\RW]() calls to manage locks
68  // that must be held for the duration of the reference to the UT_Options
69  // object.
71  {
72  public:
74  {
75  public:
76  virtual ~ImplBase() {}
77  protected:
78  ImplBase() {}
79  };
80 
81  OptionAutoLocks() : myImpl(0) {}
82  ~OptionAutoLocks() { delete myImpl; }
83 
84  void setImpl(ImplBase *impl) { myImpl = impl; }
85  private:
86  ImplBase *myImpl;
87  };
88 #endif
89 
90  // These methods return the UT_Options object associated with the attribute
91  // and are not wrapped by swig. The lock argument is present to ensure the
92  // caller holds the locks necessary to work with a reference to an object
93  // owned by the attribute.
94  SWIGOUT(%ignore getRawOptionsRO;)
95  virtual const GA_AttributeOptions &getRawOptionsRO(OptionAutoLocks &locks) = 0;
96  SWIGOUT(%ignore getRawOptionsRW;)
97  virtual GA_AttributeOptions &getRawOptionsRW(OptionAutoLocks &locks) = 0;
98 
99  // Get the data type of a particular option.
100  // TODO: We could implement here, but we need HOMFoptionTypeToEnumValue().
101  virtual HOM_EnumValue &optionType(const char *option_name) = 0;
102 
103  // Set an option value. The type_hint is used when the value type mapping
104  // to a UT_OptionType is ambiguous.
105  virtual void setOption(const char *name, HOM_UTOptionAny value,
106  HOM_EnumValue &type_hint =HOM_fieldType::NoSuchField) = 0;
107 
108  // Remove an option from the attribute's UT_Options object.
109  virtual void removeOption(const char *name) = 0;
110 
111 #ifdef SWIG
112 %extend
113 {
114  InterpreterObject options()
115  {
117  const GA_AttributeOptions &attriboptions = self->getRawOptionsRO(locks);
118  UT_Options options;
119  attriboptions.buildFullOptions(options);
120  return HOMoptionsToInterpreterObject(options);
121  }
122 
123  InterpreterObject option(const char *option_name)
124  {
126  const GA_AttributeOptions &attriboptions = self->getRawOptionsRO(locks);
127  UT_Options options;
128  attriboptions.buildFullOptions(options);
129  const UT_OptionEntry *entry = options.getOptionEntry(option_name);
130  return entry ? HOMoptionEntryToInterpreterObject(*entry)
131  : SWIG_Py_Void();
132  }
133 }
134 #endif
135 };
136 
137 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:973
void buildFullOptions(UT_Options &fulloptions) const
hboost::any HOM_UTOptionAny
Definition: HOM_Defines.h:37
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
#define HOM_API
Definition: HOM_API.h:13
void setImpl(ImplBase *impl)
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:972
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:610
GLuint const GLchar * name
Definition: glcorearb.h:785
GLsizei const GLfloat * value
Definition: glcorearb.h:823
A map of string to various well defined value types.
Definition: UT_Options.h:42
virtual ~HOM_PointGroup()
HOM_PointGroup(const HOM_PointGroup &)
void clear()
Reset to default.
const UT_OptionEntry * getOptionEntry(const UT_StringRef &name) const
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:596