00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GU_VertexSelection_h__
00022 #define __GU_VertexSelection_h__
00023
00024 #include "GU_API.h"
00025 #include <GB/GB_VertexGroup.h>
00026 #include "GU_Selection.h"
00027
00028
00029 class GEO_Vertex;
00030
00031 #define GU_vertexSelectName "selectedVertices"
00032
00033 class GU_API GU_VertexSelection : public GU_Selection
00034 {
00035 public:
00036
00037
00038 GU_VertexSelection(GU_Detail &gdp, const char *prefix = 0);
00039 virtual ~GU_VertexSelection(void);
00040
00041
00042
00043 virtual GU_Selection &operator=(GU_PointSelection &);
00044 virtual GU_Selection &operator=(GU_PrimSelection &);
00045 virtual GU_Selection &operator=(GU_EdgeSelection &);
00046 virtual GU_Selection &operator=(GU_BreakpointSelection &);
00047 virtual GU_Selection &operator=(GU_VertexSelection &);
00048 virtual GU_Selection &operator=(GU_PointGroupSelection &s)
00049 { return GU_Selection::operator=(s); }
00050 virtual GU_Selection &operator=(GU_PrimGroupSelection &s)
00051 { return GU_Selection::operator=(s); }
00052
00053
00054
00055 virtual int pickMask(void) const;
00056
00057
00058
00059 static int vertexPickMask(void);
00060
00061
00062
00063
00064
00065 virtual int selfSnapMask(void) const;
00066
00067
00068
00069
00070
00071 virtual int select(uint *pickbuf, long npicked,
00072 void *&added,
00073 GU_SelectionRule rule = GU_AddSelect,
00074 unsigned *pickid = 0,
00075 GU_LassoInfo *linfo = 0,
00076 const UT_IntArray *prfx = 0);
00077 virtual int selectEntireGeometry(uint *pickbuf,
00078 long npicked,
00079 void *&added,
00080 GU_SelectionRule rule = GU_AddSelect,
00081 unsigned *pickid = 0,
00082 GU_LassoInfo *linfo = 0,
00083 const UT_IntArray *prfx = 0);
00084
00085 virtual int selectBoundary(bool checkuv);
00086
00087 virtual int shrinkSelection(bool checkuv);
00088
00089 virtual int selectNext(void *&added,
00090 GU_SelectionRule rule = GU_AddSelect,
00091 int shiftstate = 0,
00092 int vstate = 0);
00093
00094 virtual int selectPrev(void *&added,
00095 GU_SelectionRule rule = GU_AddSelect,
00096 int shiftstate = 0,
00097 int vstate = 0);
00098
00099
00100
00101
00102
00103 virtual GU_SelectionResult selectEmpty(uint *pickbuf, long npicked,
00104 GU_SelectionRule rule = GU_AddSelect,
00105 unsigned *pickid = 0,
00106 GU_LassoInfo *linfo = 0,
00107 const UT_IntArray *prfx = 0) const;
00108
00109
00110
00111
00112 virtual void *siftThrough(uint *pickbuf, long npicked,
00113 int look_for_existing = 1,
00114 unsigned *pickid = 0,
00115 GU_LassoInfo *linfo = 0,
00116 const UT_IntArray *prfx = 0) const;
00117
00118
00119
00120
00121
00122
00123
00124
00125 virtual int selectionPoint(void *added, unsigned *pickid,
00126 UT_Vector3 &xsect) const;
00127 virtual int selectionPoint(void *added, unsigned *pickid,
00128 UT_Vector3 rayorig,
00129 UT_Vector3 &raydir,
00130 UT_Vector3 &xsect,
00131 int &normal,
00132 UT_Vector3 &vector,
00133 int accurate, float *u,
00134 float *v) const;
00135
00136
00137
00138
00139
00140 virtual int selectGroup(const GB_BaseGroup &group, int ref=0);
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 virtual int add(GEO_Point &point, int = 0);
00151 virtual int add(GEO_Primitive &prim, int = 0);
00152 virtual int add(GB_Edge &edge, int = 0);
00153 virtual int add(GEO_Breakpoint &bkp, int = 0);
00154 virtual int add(GB_VertexData &vtx, int = 0);
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 virtual int remove(GEO_Point &point, int = 0);
00165 virtual int remove(GEO_Primitive &prim, int = 0);
00166 virtual int remove(GB_Edge &edge, int = 0);
00167 virtual int remove(GEO_Breakpoint &bkp, int = 0);
00168 virtual int remove(GB_VertexData &vtx, int = 0);
00169
00170
00171
00172 virtual int removeLast(void);
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 virtual int toggle(GEO_Point &point, int = 0);
00183 virtual int toggle(GEO_Primitive &prim, int = 0);
00184 virtual int toggle(GB_Edge &edge, int = 0);
00185 virtual int toggle(GEO_Breakpoint &bkp, int = 0);
00186 virtual int toggle(GB_VertexData &vtx, int = 0);
00187
00188
00189
00190
00191
00192
00193
00194 virtual GB_PointGroup *updatePoints(void);
00195 virtual GB_PrimitiveGroup *updatePrimitives(void);
00196
00197
00198
00199 virtual void clear(void);
00200 virtual void clearAndDestroy(void);
00201
00202
00203
00204 virtual int destroyGeometry(void);
00205
00206
00207
00208 virtual int copyGeometry(int copies = 1, UT_Vector3 *delta = 0,
00209 const char *groupname = 0);
00210
00211
00212 virtual void reverse();
00213
00214
00215
00216
00217 GEO_Vertex *find(const GB_VertexData &vtx) const;
00218
00219
00220 virtual int entries(void) const;
00221
00222
00223
00224 virtual int getBoundingBox(UT_BoundingBox &bbox) const;
00225 virtual int getBoundingBox(UT_BoundingBox &bbox, const UT_Matrix4& transform ) const;
00226
00227
00228
00229 virtual int getBoundingBoxUV(UT_BoundingBox &bbox,
00230 const char *name,
00231 int isvertex) const;
00232
00233
00234 virtual int save(ostream &os, int binary) const;
00235 virtual bool load(UT_IStream &is);
00236
00237
00238 virtual GU_Detail *createGeometry();
00239
00240
00241 virtual int classType(void) const;
00242
00243
00244 virtual const GB_VertexGroup *vertices() const;
00245
00246 protected:
00247
00248 virtual GU_Selection *newSpecies(GU_Detail &gdp);
00249
00250 virtual const GB_BaseGroup *mainGroup() const { return &theSelection; }
00251
00252 protected:
00253
00254 GU_VertexSelection(GU_Detail &gdp, const GU_VertexSelection &s);
00255
00256
00257 virtual int selectAllUsingClosure(
00258 GU_PrimGroupClosure *closure,
00259 int how_to_treat_closure);
00260 virtual int toggleAllUsingClosure(
00261 GU_PrimGroupClosure *closure,
00262 int how_to_treat_closure);
00263
00264 GB_VertexGroup theSelection;
00265 };
00266
00267 #endif