HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Selection.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_Selection_h__
10 #define __HOM_Selection_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_Module.h"
16 #include "HOM_Geometry.h"
17 #include "HOM_PtrOrNull.h"
18 #include <string>
19 
20 SWIGOUT(%rename(Selection) HOM_Selection;)
21 // Force SWIG to output an __init__ method even though it determines this
22 // class is abstract.
23 SWIGOUT(%feature("notabstract") HOM_Selection;)
24 
26 {
27 public:
28 #ifdef SWIG
29 %extend
30 {
31  HOM_Selection(HOM_EnumValue &selection_type)
32  { return HOM().newSelection(selection_type, NULL, NULL); }
34  HOM_EnumValue &selection_type,
35  const char *selection_string)
36  { return HOM().newSelection(selection_type, &geo, selection_string); }
38  const std::vector<HOM_EnumValue *> &selection_types,
39  const char *selection_string)
40  { return HOM().newSelection(selection_types, &geo, selection_string); }
41  HOM_Selection(const std::vector<HOM_Prim *> &prims)
42  { return HOM().newSelection(prims); }
43  HOM_Selection(const std::vector<HOM_Point *> &points)
44  { return HOM().newSelection(points); }
45  HOM_Selection(const std::vector<HOM_Vertex *> &vertices)
46  { return HOM().newSelection(vertices); }
47  HOM_Selection(const std::vector<HOM_Edge *> &edges)
48  { return HOM().newSelection(edges); }
49 }
50 #else
52  { HOM_CONSTRUCT_OBJECT(this) }
53 #endif
54 
55  virtual ~HOM_Selection()
56  { HOM_DESTRUCT_OBJECT(this) }
57 
58  virtual std::string __repr__() = 0;
59 
60  SWIGOUT(%newobject freeze;)
61  virtual HOM_Selection *freeze() = 0;
62  SWIGOUT(%kwargs invert;)
63  virtual void invert(HOM_Geometry &geo) = 0;
64  SWIGOUT(%kwargs convert;)
65  virtual void convert(HOM_Geometry &geo,
66  HOM_EnumValue &selection_type, bool select_only_whole=false) = 0;
67  SWIGOUT(%kwargs boundary;)
68  virtual void boundary(HOM_Geometry &geo,
69  bool uv_connectivity = false) = 0;
70  SWIGOUT(%kwargs grow;)
71  virtual void grow(HOM_Geometry &geo,
72  bool uv_connectivity = false) = 0;
73  SWIGOUT(%kwargs shrink;)
74  virtual void shrink(HOM_Geometry &geo,
75  bool uv_connectivity = false) = 0;
76  SWIGOUT(%kwargs combine;)
77  virtual void combine(HOM_Geometry &geo,
79  HOM_EnumValue &modifier) = 0;
80  virtual void clear() = 0;
81 
82  virtual HOM_EnumValue &selectionType() = 0;
83  virtual int numSelected() = 0;
84 
85  virtual std::vector<HOM_ElemPtr<HOM_Prim> > prims(HOM_Geometry &geo) = 0;
86  virtual std::vector<HOM_ElemPtr<HOM_Point> > points(HOM_Geometry &geo) = 0;
87  virtual std::vector<HOM_ElemPtr<HOM_Vertex> > vertices(HOM_Geometry &geo) = 0;
88  virtual std::vector<HOM_ElemPtr<HOM_Edge> > edges(HOM_Geometry &geo) = 0;
89 
90  SWIGOUT(%kwargs selectionString;)
91  virtual std::string selectionString(HOM_Geometry &geo,
92  bool force_numeric = false,
93  bool collapse_where_possible = true,
94  bool asterisk_to_select_all = false) = 0;
95 };
96 
97 #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 invert
Definition: glcorearb.h:549
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:352
Tto convert(const Tfrom &source)
virtual ~HOM_Selection()
Definition: HOM_Selection.h:55
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1290
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
virtual HOM_Selection * newSelection(HOM_EnumValue &selection_type, HOM_Geometry *geo, const char *selection_string)=0
HOM_API HOM_Module & HOM()