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  ~GU_VertexSelection() override;
25 
26  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) override;
31  bool selectFinish(
32  const GU_Detail &gd,
33  GU_SelectionRule rule,
34  GU_SelectResult &added,
35  GU_SelectFinishData *finish_data) override;
36  bool testSelect(const GU_Detail &gd,
37  uint prim_id, uint v_num, uint,
38  bool accept_existing,
39  bool accept_new,
40  GU_SelectResult &result) const override;
41 
42  bool selectionPoint(const GU_SelectResult &added,
43  UT_Vector3 &xsect) const override;
44  bool selectionPoint(const GU_SelectResult &added,
45  UT_Vector3 rayorig,
46  UT_Vector3 &raydir,
47  UT_Vector3 &xsect,
48  bool &normal,
49  UT_Vector3 &vector,
50  bool accurate,
51  float *u, float *v) const override;
52 
53  void assign(const GU_Detail &gd,
54  const GU_Selection &sel) override;
55 
56  bool selectAll(const GU_Detail &gd) override;
57  bool toggleAll(const GU_Detail &gd) override;
58 
59  bool validate(const GU_Detail &gd) override;
60 
61  bool selectBoundary(
62  const GU_Detail &gd,
63  bool checkuv,
64  const UT_StringHolder &uvattribname) override;
65  bool growSelection(
66  const GU_Detail &gd,
67  bool checkuv,
68  const UT_StringHolder &uvattribname) override;
69  bool shrinkSelection(
70  const GU_Detail &gd,
71  bool checkuv,
72  const UT_StringHolder &uvattribname) override;
73 
75  const GU_Detail &gd,
76  const GA_PrimitiveTypeMask &mask) override;
77 
78  bool modifyPoint(const GU_Detail &gd, GA_Offset ptoff,
79  GU_ModifyType type) override;
80 
81  bool modifyVertex(const GU_Detail &gd, GA_Offset vtxoff,
82  GU_ModifyType type) override;
83 
84  bool modifyPrimitive(const GU_Detail &gd, GA_Offset primoff,
85  GU_ModifyType type) override;
86 
87  bool modifyEdge(const GU_Detail &gd, const GA_Edge &edge,
88  const GEO_Primitive *prim,
89  GU_ModifyType type) override;
90 
91  bool modifyBreakpoint(const GU_Detail &gd,
92  const GA_Breakpoint &bkp,
93  GU_ModifyType type) override;
94 
95  const GA_PointGroup *points(const GU_Detail &gd) const override;
96  const GA_PrimitiveGroup *primitives(const GU_Detail &gd) const override;
97  const GA_VertexGroup *vertices(const GU_Detail &gd) const override;
98  const GA_EdgeGroup *edges(const GU_Detail &gd) const override;
100  const GU_Detail &gd) const override;
101  const GA_Group *mainGroup(const GU_Detail &gd) const override
102  { return vertices(gd); }
103 
104  bool hasVertexIndex(GA_Index index) const override;
105 
106 
107  void clear() override;
108  void clearAndDestroy() override;
109 
110  GA_Size entries() const override;
111 
112  bool getBoundingBox(
113  const GU_Detail &gd,
114  UT_BoundingBox &bbox) const override;
115  bool getBoundingBox(
116  const GU_Detail &gd,
117  UT_BoundingBox &bbox,
118  const UT_Matrix4R &transform) const override;
119 
120  bool getBoundingBoxUV(
121  const GU_Detail &gd,
122  UT_BoundingBox &bbox,
123  const char *name,
124  int isvertex) const override;
125 
126  GA_GroupType classType() const override;
127 
128  GU_Selection *clone() override;
129 
130  bool modifyMatchingGroup(const GU_Detail &gd,
131  const GA_Group &group,
132  GU_SelectionRule rule) override;
133 
134  int64 getMemoryUsage(bool inclusive) const override
135  {
136  int64 mem = inclusive ? sizeof(*this) : 0;
137  mem += GU_Selection::getMemoryUsage(false);
138  mem += myVertices.getMemoryUsage(false);
139  return mem;
140  }
141 
142 private:
144 
145  bool saveElements(UT_JSONWriter &w) const override;
146  bool loadElements(UT_JSONParser &p) override;
147 
148  friend struct VertexLoader;
150  OrderedVertexGroup myVertices;
151 };
152 
153 #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
const GLdouble * v
Definition: glcorearb.h:837
virtual const GA_BreakpointGroup * breakpoints(const GU_Detail &gd) const =0
GLdouble s
Definition: glad.h:3009
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
virtual bool loadElements(UT_JSONParser &p)=0
**But if you need a result
Definition: thread.h:613
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:236
GA_Size GA_Offset
Definition: GA_Types.h:646
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
const GA_Group * mainGroup(const GU_Detail &gd) const override
virtual const GA_PointGroup * points(const GU_Detail &gd) const =0
GLint GLuint mask
Definition: glcorearb.h:124
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
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
GLuint const GLchar * name
Definition: glcorearb.h:786
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:640
GA_API const UT_StringHolder transform
virtual void clearAndDestroy()
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:424
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:161
GLuint index
Definition: glcorearb.h:786
virtual bool hasVertexIndex(GA_Index index) const
Definition: GU_Selection.h:329
int64 getMemoryUsage(bool inclusive) const override
Return an approximation of how much memory we use.
virtual bool toggleAll(const GU_Detail &gd)=0
virtual bool validate(const GU_Detail &gd)=0
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
virtual bool modifyVertex(const GU_Detail &gd, GA_Offset vtxoff, GU_ModifyType type)=0
GU_ModifyType
Definition: GU_SelectType.h:59
type
Definition: core.h:1059
unsigned int uint
Definition: SYS_Types.h:45
virtual bool selectFinish(const GU_Detail &gd, GU_SelectionRule rule, GU_SelectResult &added, GU_SelectFinishData *finish_data)
Definition: GU_Selection.h:194
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