14 #ifndef __GU_Selection_h__
15 #define __GU_Selection_h__
43 mySelectedNormal(false)
48 { mySelectedNormal = selected_normal; }
51 {
return myBreakpoint; }
55 {
return myPrimitive; }
68 {
return myGroupType; }
70 {
return mySelectedNormal; }
75 mySelectedNormal =
false;
79 friend class GU_BreakpointSelection;
80 friend class GU_EdgeSelection;
81 friend class GU_PointSelection;
82 friend class GU_PrimSelection;
84 friend class GU_CookSelection;
127 bool mySelectedNormal;
179 virtual void assign(
const GU_Detail &src_gd,
202 virtual bool testSelect(
const GU_Detail &gd,
204 bool accept_existing,
224 float *u,
float *
v)
const = 0;
236 void modifyGroupToken(
const char *token,
242 void initGroupString(
const GU_Detail &gd,
244 const char *group_string);
248 {
return myGroupTokensValid; }
253 void setGroupTokensLock(
bool lock);
271 virtual bool modifyBreakpoint(
const GU_Detail &gd,
281 virtual bool selectAll(
const GU_Detail &gd) = 0;
285 virtual bool toggleAll(
const GU_Detail &gd) = 0;
289 virtual bool selectBoundary(
const GU_Detail &gd,
bool checkuv,
const UT_StringHolder &uvattribname =
"uv"_UTsh) = 0;
291 virtual bool shrinkSelection(
const GU_Detail &gd,
bool checkuv,
const UT_StringHolder &uvattribname =
"uv"_UTsh) = 0;
294 virtual bool filterByPrimitiveMask(
const GU_Detail &gd,
300 {
return uvSelectAllByWindingUsingClosure(gd,
true,
false, uvattribname); }
302 {
return uvSelectAllByWindingUsingClosure(gd,
false,
true, uvattribname); }
322 int v_index = -1)
const {
return false; }
335 virtual void clear();
336 virtual void clearAndDestroy();
339 virtual GA_Size entries()
const = 0;
343 virtual bool getBoundingBox(
const GU_Detail &gd,
345 virtual bool getBoundingBox(
const GU_Detail &gd,
351 virtual bool getBoundingBoxUV(
const GU_Detail &gd,
354 int isvertex)
const = 0;
361 void dump(std::ostream &os)
const;
374 bool generateSelectionString(
UT_String &sel_string,
377 bool collapse_where_possible,
378 bool use_ast_to_select_all,
388 bool generateElementString(
UT_String &sel_string,
413 int64 mem = inclusive ?
sizeof(*this) : 0;
414 mem += myGroupTokens.getMemoryUsage(
true);
425 virtual bool validate(
const GU_Detail &gd) = 0;
438 virtual bool uvSelectAllByWindingUsingClosure(
444 virtual bool modifyMatchingGroup(
const GU_Detail &gd,
453 if (!myGroupTokensLock && myGroupTokensValid)
455 myGroupTokensValid =
false;
456 myGroupTokens.clear();
463 myRevision = revision;
482 return static_cast<T &
>(getGroup(gd,
496 bool myGroupTokensValid;
497 bool myGroupTokensLock;
505 struct GroupCacheEntry
507 GroupCacheEntry() : myDetailId(-1), myRevision(-1), myElementCount(-1) {}
514 mutable GroupCache myGroupCache;
GLboolean GLboolean GLboolean b
void setSelectedNormal(bool selected_normal)
void forceSpecificRevision(int revision)
bool getSelectedNormal() const
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
const GU_Detail * getDetail() const
void clearOrdered()
Clear all order information, including any mixed entries.
JSON reader class which handles parsing of JSON or bJSON files.
virtual bool hasBreakpointIndexSet(GA_Index prim_index, int u_index, int v_index=-1) const
Class which writes ASCII or binary JSON streams.
GLuint const GLchar * name
GA_Offset getVertexOffset() const
static void setOrdered(GA_ElementGroup &g, bool ordered)
Convenience method to make/clear ordered status of a group.
UT_Lock & updateLock() const
UT_StringHolder pickPath() const
exint GA_Size
Defines the bit width for index and offset types in GA.
#define GA_INVALID_OFFSET
virtual ~GU_SelectFinishData()
GLubyte GLubyte GLubyte GLubyte w
GA_Offset getPointOffset() const
GLuint GLenum GLenum transform
virtual void setUsePrimEdges(bool)
GLint GLint GLsizei GLint GLenum GLenum type
virtual bool hasPointIndex(GA_Index index) const
vint4 select(const vbool4 &mask, const vint4 &a, const vint4 &b)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void set(const GA_Breakpoint &b, const GU_Detail *gdp)
const GA_Edge & getEdge() const
Type traits base class for group type traits.
const GA_Breakpoint & getBreakpoint() const
void setVertex(GA_Offset vtxoff, const GU_Detail *gdp)
bool uvSelectAllFrontFace(const GU_Detail &gd, const UT_StringHolder &uvattribname="uv"_UTsh)
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
virtual bool hasPrimitiveIndex(GA_Index index) const
UT_SharedPtr< GU_Selection > GU_SelectionHandle
T & getGroup(const GU_Detail &gd, bool &needs_update) const
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
GLenum GLuint GLenum GLsizei const GLchar * buf
bool getGroupTokensValid() const
const GA_Primitive * getPrimitive() const
void set(const GA_Edge &e, const GA_Primitive *prim, const GU_Detail *gdp)
virtual int64 getMemoryUsage(bool inclusive) const
Return an approximation of how much memory we use.
virtual bool hasEdgeIndexPair(GA_Index p0, GA_Index p1) const
void set(const GA_Primitive *prim, const GU_Detail *gdp)
virtual bool getUsePrimEdges() const
GA_GroupType
An ordinal enum for the different types of groups in GA.
int getId() const
Selection id and revision.
virtual bool hasVertexIndex(GA_Index index) const
GA_GroupType getSelectType() const
void setPickPath(const UT_StringHolder &p)
void setPoint(GA_Offset ptoff, const GU_Detail *gdp)
void setPickOrder(int pick_order)
virtual bool selectFinish(const GU_Detail &gd, GU_SelectionRule rule, GU_SelectResult &added, GU_SelectFinishData *finish_data)
virtual bool hasPrimEdgeIndexSet(GA_Index p0, GA_Index p1, GA_Index pr) const
bool uvSelectAllBackFace(const GU_Detail &gd, const UT_StringHolder &uvattribname="uv"_UTsh)