HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_VertexSelection.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  * NAME: GU_VertexSelection (C++)
7  *
8  * COMMENTS:
9  * Vertex selection.
10  *
11  */
12 
13 #ifndef __GU_VertexSelection_h__
14 #define __GU_VertexSelection_h__
15 
16 #include "GU_API.h"
17 #include "GU_Selection.h"
18 #include "GU_OrderedIndexGroup.h"
19 
21 {
22 public:
23  GU_VertexSelection(const GA_VertexGroup *vtx_group = NULL);
24  virtual ~GU_VertexSelection();
25 
26  virtual bool select(const GU_Detail &gd,
27  uint prim_id, uint v_num, uint,
28  GU_SelectionRule rule,
29  GU_SelectResult &added,
30  GU_SelectFinishData *&finish_data);
31  virtual bool testSelect(const GU_Detail &gd,
32  uint prim_id, uint v_num, uint,
33  bool accept_existing,
34  bool accept_new,
35  GU_SelectResult &result) const;
36 
37  virtual bool selectionPoint(const GU_SelectResult &added,
38  UT_Vector3 &xsect) const;
39  virtual bool selectionPoint(const GU_SelectResult &added,
40  UT_Vector3 rayorig,
41  UT_Vector3 &raydir,
42  UT_Vector3 &xsect,
43  bool &normal,
44  UT_Vector3 &vector,
45  bool accurate,
46  float *u, float *v) const;
47 
48  virtual void assign(const GU_Detail &gd, const GU_Selection &sel);
49 
50  virtual bool selectAll(const GU_Detail &gd);
51  virtual bool toggleAll(const GU_Detail &gd);
52 
53  virtual bool validate(const GU_Detail &gd);
54 
55  virtual bool selectBoundary(const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname);
56  virtual bool growSelection(const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname);
57  virtual bool shrinkSelection(const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname);
58 
59  virtual bool filterByPrimitiveMask(const GU_Detail &gd,
60  const GA_PrimitiveTypeMask &mask);
61 
62  virtual bool modifyPoint(const GU_Detail &gd, GA_Offset ptoff,
64 
65  virtual bool modifyVertex(const GU_Detail &gd, GA_Offset vtxoff,
66  GU_ModifyType type);
67 
68  virtual bool modifyPrimitive(const GU_Detail &gd, GA_Offset primoff,
69  GU_ModifyType type);
70 
71  virtual bool modifyEdge(const GU_Detail &gd, const GA_Edge &edge,
72  const GEO_Primitive *prim,
73  GU_ModifyType type);
74 
75  virtual bool modifyBreakpoint(const GU_Detail &gd,
76  const GA_Breakpoint &bkp,
77  GU_ModifyType type);
78 
79  virtual const GA_PointGroup *points(const GU_Detail &gd) const;
80  virtual const GA_PrimitiveGroup *primitives(const GU_Detail &gd) const;
81  virtual const GA_VertexGroup *vertices(const GU_Detail &gd) const;
82  virtual const GA_EdgeGroup *edges(const GU_Detail &gd) const;
83  virtual const GA_BreakpointGroup *breakpoints(const GU_Detail &gd) const;
84  virtual const GA_Group *mainGroup(const GU_Detail &gd) const
85  { return vertices(gd); }
86 
87  virtual bool hasVertexIndex(GA_Index index) const;
88 
89 
90  virtual void clear();
91  virtual void clearAndDestroy();
92 
93  virtual GA_Size entries() const;
94 
95  virtual bool getBoundingBox(const GU_Detail &gd,
96  UT_BoundingBox &bbox) const;
97  virtual bool getBoundingBox(const GU_Detail &gd,
98  UT_BoundingBox &bbox,
99  const UT_Matrix4R &transform) const;
100 
101  virtual bool getBoundingBoxUV(const GU_Detail &gd,
102  UT_BoundingBox &bbox,
103  const char *name,
104  int isvertex) const;
105 
106  virtual GA_GroupType classType() const;
107 
108  virtual GU_Selection *clone();
109 
110  virtual bool modifyMatchingGroup(const GU_Detail &gd,
111  const GA_Group &group,
112  GU_SelectionRule rule);
113 
114  virtual int64 getMemoryUsage(bool inclusive) const
115  {
116  int64 mem = inclusive ? sizeof(*this) : 0;
117  mem += GU_Selection::getMemoryUsage(false);
118  mem += myVertices.getMemoryUsage(false);
119  return mem;
120  }
121 
122 private:
124 
125  virtual bool saveElements(UT_JSONWriter &w) const;
126  virtual bool loadElements(UT_JSONParser &p);
127 
128  friend struct VertexLoader;
130  OrderedVertexGroup myVertices;
131 };
132 
133 #endif
virtual bool saveElements(UT_JSONWriter &w) const =0
virtual bool modifyMatchingGroup(const GU_Detail &gd, const GA_Group &group, GU_SelectionRule rule)=0
virtual bool getBoundingBox(const GU_Detail &gd, UT_BoundingBox &bbox) const =0
virtual void clear()
virtual GU_Selection * clone()=0
virtual void assign(const GU_Detail &src_gd, const GU_Selection &src_sel)=0
virtual bool filterByPrimitiveMask(const GU_Detail &gd, const GA_PrimitiveTypeMask &mask)=0
virtual const GA_BreakpointGroup * breakpoints(const GU_Detail &gd) const =0
const GLdouble * v
Definition: glcorearb.h:836
virtual int64 getMemoryUsage(bool inclusive) const
Return an approximation of how much memory we use.
GLint GLuint mask
Definition: glcorearb.h:123
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:75
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
virtual bool loadElements(UT_JSONParser &p)=0
virtual bool select(const GU_Detail &gd, uint id1, uint id2, uint id3, GU_SelectionRule rule, GU_SelectResult &added, GU_SelectFinishData *&finish_data)=0
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
GA_Size GA_Offset
Definition: GA_Types.h:617
long long int64
Definition: SYS_Types.h:107
virtual bool getBoundingBoxUV(const GU_Detail &gd, UT_BoundingBox &bbox, const char *name, int isvertex) const =0
virtual bool growSelection(const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname="uv"_UTsh)=0
GU_SelectionRule
Definition: GU_SelectType.h:40
virtual bool modifyEdge(const GU_Detail &gd, const GA_Edge &edge, const GEO_Primitive *prim, GU_ModifyType type)=0
virtual bool selectionPoint(const GU_SelectResult &added, UT_Vector3 &xsect) const =0
virtual const GA_PointGroup * points(const GU_Detail &gd) const =0
virtual const GA_EdgeGroup * edges(const GU_Detail &gd) const =0
virtual const GA_PrimitiveGroup * primitives(const GU_Detail &gd) const =0
virtual bool modifyPrimitive(const GU_Detail &gd, GA_Offset primoff, GU_ModifyType type)=0
virtual const GA_Group * mainGroup(const GU_Detail &gd) const
#define GU_API
Definition: GU_API.h:12
GLuint const GLchar * name
Definition: glcorearb.h:785
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:611
GA_API const UT_StringHolder transform
virtual void clearAndDestroy()
unsigned int uint
Definition: SYS_Types.h:40
virtual bool modifyPoint(const GU_Detail &gd, GA_Offset ptoff, GU_ModifyType type)=0
virtual bool shrinkSelection(const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname="uv"_UTsh)=0
virtual GA_GroupType classType() const =0
virtual bool selectBoundary(const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname="uv"_UTsh)=0
virtual bool testSelect(const GU_Detail &gd, uint id1, uint id2, uint id3, bool accept_existing, bool accept_new, GU_SelectResult &result) const =0
virtual int64 getMemoryUsage(bool inclusive) const
Return an approximation of how much memory we use.
Definition: GU_Selection.h:398
virtual bool selectAll(const GU_Detail &gd)=0
virtual GA_Size entries() const =0
GA_GroupType
An ordinal enum for the different types of groups in GA.
Definition: GA_Types.h:138
GLuint index
Definition: glcorearb.h:785
virtual bool hasVertexIndex(GA_Index index) const
Definition: GU_Selection.h:316
virtual bool toggleAll(const GU_Detail &gd)=0
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual bool validate(const GU_Detail &gd)=0
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
virtual bool modifyVertex(const GU_Detail &gd, GA_Offset vtxoff, GU_ModifyType type)=0
GU_ModifyType
Definition: GU_SelectType.h:59
virtual bool modifyBreakpoint(const GU_Detail &gd, const GA_Breakpoint &bkp, GU_ModifyType type)=0
virtual const GA_VertexGroup * vertices(const GU_Detail &gd) const =0