All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  *
9  * Vertex selection.
10  *
11  */
13 #ifndef __GU_VertexSelection_h__
14 #define __GU_VertexSelection_h__
16 #include "GU_API.h"
17 #include "GU_Selection.h"
18 #include "GU_OrderedIndexGroup.h"
21 {
22 public:
23  GU_VertexSelection(const GA_VertexGroup *vtx_group = NULL);
24  ~GU_VertexSelection() override;
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 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 override;
37  bool selectionPoint(const GU_SelectResult &added,
38  UT_Vector3 &xsect) const override;
39  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 override;
48  void assign(const GU_Detail &gd,
49  const GU_Selection &sel) override;
51  bool selectAll(const GU_Detail &gd) override;
52  bool toggleAll(const GU_Detail &gd) override;
54  bool validate(const GU_Detail &gd) override;
56  bool selectBoundary(
57  const GU_Detail &gd,
58  bool checkuv,
59  const UT_StringHolder &uvattribname) override;
60  bool growSelection(
61  const GU_Detail &gd,
62  bool checkuv,
63  const UT_StringHolder &uvattribname) override;
64  bool shrinkSelection(
65  const GU_Detail &gd,
66  bool checkuv,
67  const UT_StringHolder &uvattribname) override;
70  const GU_Detail &gd,
71  const GA_PrimitiveTypeMask &mask) override;
73  bool modifyPoint(const GU_Detail &gd, GA_Offset ptoff,
74  GU_ModifyType type) override;
76  bool modifyVertex(const GU_Detail &gd, GA_Offset vtxoff,
77  GU_ModifyType type) override;
79  bool modifyPrimitive(const GU_Detail &gd, GA_Offset primoff,
80  GU_ModifyType type) override;
82  bool modifyEdge(const GU_Detail &gd, const GA_Edge &edge,
83  const GEO_Primitive *prim,
84  GU_ModifyType type) override;
86  bool modifyBreakpoint(const GU_Detail &gd,
87  const GA_Breakpoint &bkp,
88  GU_ModifyType type) override;
90  const GA_PointGroup *points(const GU_Detail &gd) const override;
91  const GA_PrimitiveGroup *primitives(const GU_Detail &gd) const override;
92  const GA_VertexGroup *vertices(const GU_Detail &gd) const override;
93  const GA_EdgeGroup *edges(const GU_Detail &gd) const override;
95  const GU_Detail &gd) const override;
96  const GA_Group *mainGroup(const GU_Detail &gd) const override
97  { return vertices(gd); }
99  bool hasVertexIndex(GA_Index index) const override;
102  void clear() override;
103  void clearAndDestroy() override;
105  GA_Size entries() const override;
107  bool getBoundingBox(
108  const GU_Detail &gd,
109  UT_BoundingBox &bbox) const override;
110  bool getBoundingBox(
111  const GU_Detail &gd,
112  UT_BoundingBox &bbox,
113  const UT_Matrix4R &transform) const override;
115  bool getBoundingBoxUV(
116  const GU_Detail &gd,
117  UT_BoundingBox &bbox,
118  const char *name,
119  int isvertex) const override;
121  GA_GroupType classType() const override;
123  GU_Selection *clone() override;
125  bool modifyMatchingGroup(const GU_Detail &gd,
126  const GA_Group &group,
127  GU_SelectionRule rule) override;
129  int64 getMemoryUsage(bool inclusive) const override
130  {
131  int64 mem = inclusive ? sizeof(*this) : 0;
132  mem += GU_Selection::getMemoryUsage(false);
133  mem += myVertices.getMemoryUsage(false);
134  return mem;
135  }
137 private:
140  bool saveElements(UT_JSONWriter &w) const override;
141  bool loadElements(UT_JSONParser &p) override;
143  friend struct VertexLoader;
145  OrderedVertexGroup myVertices;
146 };
148 #endif
GLdouble s
Definition: glew.h:1390
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()
GLuint const GLchar * name
Definition: glew.h:1814
virtual GU_Selection * clone()=0
GLuint GLenum GLenum transform
Definition: glew.h:14742
virtual void assign(const GU_Detail &src_gd, const GU_Selection &src_sel)=0
GLuint index
Definition: glew.h:1814
virtual bool filterByPrimitiveMask(const GU_Detail &gd, const GA_PrimitiveTypeMask &mask)=0
virtual const GA_BreakpointGroup * breakpoints(const GU_Detail &gd) const =0
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:76
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:34
const GLdouble * v
Definition: glew.h:1391
virtual bool loadElements(UT_JSONParser &p)=0
GLenum GLint GLuint mask
Definition: glew.h:1845
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:233
GA_Size GA_Offset
Definition: GA_Types.h:639
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
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
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
const GA_Group * mainGroup(const GU_Detail &gd) const override
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
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition: GA_Types.h:633
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
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
GLfloat GLfloat p
Definition: glew.h:16321
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:411
virtual bool selectAll(const GU_Detail &gd)=0
virtual GA_Size entries() const =0
An ordinal enum for the different types of groups in GA.
Definition: GA_Types.h:159
virtual bool hasVertexIndex(GA_Index index) const
Definition: GU_Selection.h:316
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
GLuint64EXT * result
Definition: glew.h:14007
virtual bool modifyVertex(const GU_Detail &gd, GA_Offset vtxoff, GU_ModifyType type)=0
Definition: GU_SelectType.h:59
unsigned int uint
Definition: SYS_Types.h:45
virtual bool modifyBreakpoint(const GU_Detail &gd, const GA_Breakpoint &bkp, GU_ModifyType type)=0
GLboolean GLuint group
Definition: glew.h:2745
virtual const GA_VertexGroup * vertices(const GU_Detail &gd) const =0