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,
290 { updateRevision(); }
294 virtual bool selectAll(
const GU_Detail &gd) = 0;
298 virtual bool toggleAll(
const GU_Detail &gd) = 0;
302 virtual bool selectBoundary(
const GU_Detail &gd,
bool checkuv,
const UT_StringHolder &uvattribname =
"uv"_UTsh) = 0;
304 virtual bool shrinkSelection(
const GU_Detail &gd,
bool checkuv,
const UT_StringHolder &uvattribname =
"uv"_UTsh) = 0;
307 virtual bool filterByPrimitiveMask(
const GU_Detail &gd,
313 {
return uvSelectAllByWindingUsingClosure(gd,
true,
false, uvattribname); }
315 {
return uvSelectAllByWindingUsingClosure(gd,
false,
true, uvattribname); }
335 int v_index = -1)
const {
return false; }
348 virtual void clear();
349 virtual void clearAndDestroy();
352 virtual GA_Size entries()
const = 0;
356 virtual bool getBoundingBox(
const GU_Detail &gd,
358 virtual bool getBoundingBox(
const GU_Detail &gd,
364 virtual bool getBoundingBoxUV(
const GU_Detail &gd,
367 int isvertex)
const = 0;
374 void dump(std::ostream &os)
const;
387 bool generateSelectionString(
UT_String &sel_string,
390 bool collapse_where_possible,
391 bool use_ast_to_select_all,
401 bool generateElementString(
UT_String &sel_string,
426 int64 mem = inclusive ?
sizeof(*this) : 0;
427 mem += myGroupTokens.getMemoryUsage(
true);
438 virtual bool validate(
const GU_Detail &gd) = 0;
451 virtual bool uvSelectAllByWindingUsingClosure(
457 virtual bool modifyMatchingGroup(
const GU_Detail &gd,
466 if (!myGroupTokensLock && myGroupTokensValid)
468 myGroupTokensValid =
false;
469 myGroupTokens.clear();
476 myRevision = revision;
495 return static_cast<T &
>(getGroup(gd,
509 bool myGroupTokensValid;
510 bool myGroupTokensLock;
518 struct GroupCacheEntry
520 GroupCacheEntry() : myDetailId(-1), myRevision(-1), myElementCount(-1) {}
527 mutable GroupCache myGroupCache;
GLenum GLuint GLenum GLsizei const GLchar * buf
void setSelectedNormal(bool selected_normal)
GLdouble GLdouble GLint GLint const GLdouble * points
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.
**But if you need a result
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()
GA_Offset getPointOffset() const
virtual bool appendElem(GA_Index id1, GA_Index id2=GA_INVALID_INDEX, GA_Index id3=GA_INVALID_INDEX, GA_Index id4=GA_INVALID_INDEX)
virtual void setUsePrimEdges(bool)
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)
GLuint const GLchar * name
GLboolean GLboolean GLboolean b
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
GA_API const UT_StringHolder transform
virtual bool hasPrimitiveIndex(GA_Index index) const
UT_SharedPtr< GU_Selection > GU_SelectionHandle
T & getGroup(const GU_Detail &gd, bool &needs_update) const
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
GLubyte GLubyte GLubyte GLubyte w
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)