HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Selection Class Referenceabstract

#include <GU_Selection.h>

+ Inheritance diagram for GU_Selection:

Public Member Functions

virtual ~GU_Selection ()
 
virtual void assign (const GU_Detail &src_gd, const GU_Selection &src_sel)=0
 
virtual bool select (const GU_Detail &gd, uint id1, uint id2, uint id3, GU_SelectionRule rule, GU_SelectResult &added, GU_SelectFinishData *&finish_data)=0
 
virtual bool selectFinish (const GU_Detail &gd, GU_SelectionRule rule, GU_SelectResult &added, GU_SelectFinishData *finish_data)
 
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 bool selectionPoint (const GU_SelectResult &added, UT_Vector3 &xsect) const =0
 
virtual bool selectionPoint (const GU_SelectResult &added, UT_Vector3 rayorig, UT_Vector3 &raydir, UT_Vector3 &xsect, bool &normal, UT_Vector3 &vector, bool accurate, float *u, float *v) const =0
 
bool modifyGroup (const GU_Detail &gd, const GA_Group &group, GU_SelectionRule rule)
 
void modifyGroupToken (const char *token, GU_SelectionRule rule)
 
void initGroupString (const GU_Detail &gd, const GA_Group &group, const char *group_string)
 
bool getGroupTokenString (UT_WorkBuffer &buf) const
 
bool getGroupTokensValid () const
 
void setGroupTokensLock (bool lock)
 
virtual bool modifyPoint (const GU_Detail &gd, GA_Offset ptoff, GU_ModifyType type)=0
 
virtual bool modifyVertex (const GU_Detail &gd, GA_Offset vtxoff, GU_ModifyType type)=0
 
virtual bool modifyPrimitive (const GU_Detail &gd, GA_Offset primoff, GU_ModifyType type)=0
 
virtual bool modifyEdge (const GU_Detail &gd, const GA_Edge &edge, const GEO_Primitive *prim, GU_ModifyType type)=0
 
virtual bool modifyBreakpoint (const GU_Detail &gd, const GA_Breakpoint &bkp, GU_ModifyType type)=0
 
void modifyDone (const GU_Detail &gd)
 Call this method once mass-modifications are finished with the above. More...
 
virtual bool selectAll (const GU_Detail &gd)=0
 
virtual bool toggleAll (const GU_Detail &gd)=0
 
virtual bool selectBoundary (const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname="uv"_UTsh)=0
 
virtual bool growSelection (const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname="uv"_UTsh)=0
 
virtual bool shrinkSelection (const GU_Detail &gd, bool checkuv, const UT_StringHolder &uvattribname="uv"_UTsh)=0
 
virtual bool filterByPrimitiveMask (const GU_Detail &gd, const GA_PrimitiveTypeMask &mask)=0
 
bool uvSelectAllFrontFace (const GU_Detail &gd, const UT_StringHolder &uvattribname="uv"_UTsh)
 
bool uvSelectAllBackFace (const GU_Detail &gd, const UT_StringHolder &uvattribname="uv"_UTsh)
 
virtual const GA_PointGrouppoints (const GU_Detail &gd) const =0
 
virtual const GA_PrimitiveGroupprimitives (const GU_Detail &gd) const =0
 
virtual const GA_VertexGroupvertices (const GU_Detail &gd) const =0
 
virtual const GA_EdgeGroupedges (const GU_Detail &gd) const =0
 
virtual const GA_BreakpointGroupbreakpoints (const GU_Detail &gd) const =0
 
virtual bool hasPointIndex (GA_Index index) const
 
virtual bool hasPrimitiveIndex (GA_Index index) const
 
virtual bool hasVertexIndex (GA_Index index) const
 
virtual bool hasEdgeIndexPair (GA_Index p0, GA_Index p1) const
 
virtual bool hasBreakpointIndexSet (GA_Index prim_index, int u_index, int v_index=-1) const
 
virtual const GA_GroupmainGroup (const GU_Detail &gd) const =0
 
const GA_Groupgroup (const GU_Detail &gd, GA_GroupType type)
 
virtual void clear ()
 
virtual void clearAndDestroy ()
 
virtual GA_Size entries () const =0
 
virtual bool getBoundingBox (const GU_Detail &gd, UT_BoundingBox &bbox) const =0
 
virtual bool getBoundingBox (const GU_Detail &gd, UT_BoundingBox &bbox, const UT_Matrix4R &transform) const =0
 
virtual bool getBoundingBoxUV (const GU_Detail &gd, UT_BoundingBox &bbox, const char *name, int isvertex) const =0
 
bool save (UT_JSONWriter &w) const
 Save/load the contents of the selection. More...
 
bool load (UT_JSONParser &p, bool restore_id_and_rev=true)
 
void dump (std::ostream &os) const
 
virtual GA_GroupType classType () const =0
 
virtual GU_Selectionclone ()=0
 
bool generateSelectionString (UT_String &sel_string, const GU_Detail &gdp, bool ordered, bool collapse_where_possible, bool use_ast_to_select_all, bool force_numeric, GA_Index prim_offset=0, GA_Index point_offset=0) const
 
virtual void setUsePrimEdges (bool)
 
virtual bool getUsePrimEdges () const
 
void setPickPath (const UT_StringHolder &p)
 
UT_StringHolder pickPath () const
 
void setPickOrder (int pick_order)
 
int pickOrder () const
 
void resetPickOrder ()
 
int getId () const
 Selection id and revision. More...
 
int getRevision () const
 
virtual int64 getMemoryUsage (bool inclusive) const
 Return an approximation of how much memory we use. More...
 

Static Public Member Functions

static GU_SelectionHandle newSelection (GU_SelectionType stype)
 
static GU_SelectionHandle newSelection (GA_GroupType type)
 
static GU_SelectionHandle newSelection (const GU_Detail &dst_gdp, const GU_Detail &src_gdp, const GU_Selection &src_sel)
 
static GU_SelectionHandle newCookSelection (GU_Detail &gdp, GA_GroupType type, bool ordered)
 
static GU_SelectionHandle newCookSelection (GU_Detail &gdp, GA_Group &group)
 

Protected Member Functions

virtual bool validate (const GU_Detail &gd)=0
 
 GU_Selection (const GU_Selection &s)
 
virtual bool uvSelectAllByWindingUsingClosure (const GU_Detail &gd, bool front_facing, bool back_facing, const UT_StringHolder &uvattribname)
 
virtual bool modifyMatchingGroup (const GU_Detail &gd, const GA_Group &group, GU_SelectionRule rule)=0
 
void updateRevision ()
 
 GU_Selection ()
 
template<typename T >
TgetGroup (const GU_Detail &gd, bool &needs_update) const
 
UT_LockupdateLock () const
 
virtual bool saveElements (UT_JSONWriter &w) const =0
 
virtual bool loadElements (UT_JSONParser &p)=0
 

Static Protected Member Functions

static void setOrdered (GA_ElementGroup &g, bool ordered)
 Convenience method to make/clear ordered status of a group. More...
 
static const GA_PrimitiveGrouphiddenPrimitives (const GU_Detail &gd)
 
static GU_SelectionallocSelection (GA_GroupType type)
 

Detailed Description

Definition at line 139 of file GU_Selection.h.

Constructor & Destructor Documentation

virtual GU_Selection::~GU_Selection ( )
virtual
GU_Selection::GU_Selection ( const GU_Selection s)
protected
GU_Selection::GU_Selection ( )
protected

Member Function Documentation

static GU_Selection* GU_Selection::allocSelection ( GA_GroupType  type)
staticprotected
virtual void GU_Selection::assign ( const GU_Detail src_gd,
const GU_Selection src_sel 
)
pure virtual

Implemented in GU_VertexSelection.

virtual const GA_BreakpointGroup* GU_Selection::breakpoints ( const GU_Detail gd) const
pure virtual

Implemented in GU_VertexSelection.

virtual GA_GroupType GU_Selection::classType ( ) const
pure virtual

Implemented in GU_VertexSelection.

virtual void GU_Selection::clear ( )
virtual

Reimplemented in GU_VertexSelection.

virtual void GU_Selection::clearAndDestroy ( )
virtual

Reimplemented in GU_VertexSelection.

virtual GU_Selection* GU_Selection::clone ( )
pure virtual

Implemented in GU_VertexSelection.

void GU_Selection::dump ( std::ostream &  os) const
virtual const GA_EdgeGroup* GU_Selection::edges ( const GU_Detail gd) const
pure virtual

Implemented in GU_VertexSelection.

virtual GA_Size GU_Selection::entries ( ) const
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::filterByPrimitiveMask ( const GU_Detail gd,
const GA_PrimitiveTypeMask mask 
)
pure virtual

Implemented in GU_VertexSelection.

bool GU_Selection::generateSelectionString ( UT_String sel_string,
const GU_Detail gdp,
bool  ordered,
bool  collapse_where_possible,
bool  use_ast_to_select_all,
bool  force_numeric,
GA_Index  prim_offset = 0,
GA_Index  point_offset = 0 
) const
virtual bool GU_Selection::getBoundingBox ( const GU_Detail gd,
UT_BoundingBox bbox 
) const
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::getBoundingBox ( const GU_Detail gd,
UT_BoundingBox bbox,
const UT_Matrix4R transform 
) const
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::getBoundingBoxUV ( const GU_Detail gd,
UT_BoundingBox bbox,
const char *  name,
int  isvertex 
) const
pure virtual

Implemented in GU_VertexSelection.

template<typename T >
T& GU_Selection::getGroup ( const GU_Detail gd,
bool &  needs_update 
) const
inlineprotected

Definition at line 460 of file GU_Selection.h.

bool GU_Selection::getGroupTokenString ( UT_WorkBuffer buf) const
bool GU_Selection::getGroupTokensValid ( ) const
inline

Definition at line 247 of file GU_Selection.h.

int GU_Selection::getId ( ) const
inline

Selection id and revision.

Definition at line 394 of file GU_Selection.h.

virtual int64 GU_Selection::getMemoryUsage ( bool  inclusive) const
inlinevirtual

Return an approximation of how much memory we use.

Reimplemented in GU_VertexSelection.

Definition at line 398 of file GU_Selection.h.

int GU_Selection::getRevision ( ) const
inline

Definition at line 395 of file GU_Selection.h.

virtual bool GU_Selection::getUsePrimEdges ( ) const
inlinevirtual

Definition at line 384 of file GU_Selection.h.

const GA_Group* GU_Selection::group ( const GU_Detail gd,
GA_GroupType  type 
)

Returns a group for this selection, of the given group type. If the selection is not of that type, then the selection will return a best-case conversion of the selection from the original type.

virtual bool GU_Selection::growSelection ( const GU_Detail gd,
bool  checkuv,
const UT_StringHolder uvattribname = "uv"_UTsh 
)
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::hasBreakpointIndexSet ( GA_Index  prim_index,
int  u_index,
int  v_index = -1 
) const
inlinevirtual

Definition at line 319 of file GU_Selection.h.

virtual bool GU_Selection::hasEdgeIndexPair ( GA_Index  p0,
GA_Index  p1 
) const
inlinevirtual

Definition at line 317 of file GU_Selection.h.

virtual bool GU_Selection::hasPointIndex ( GA_Index  index) const
inlinevirtual

These functions provide a fast path to check for existence. They only work for the selection type their name indicates they should work for. No translation is done for other types and those will return false.

Definition at line 314 of file GU_Selection.h.

virtual bool GU_Selection::hasPrimitiveIndex ( GA_Index  index) const
inlinevirtual

Definition at line 315 of file GU_Selection.h.

virtual bool GU_Selection::hasVertexIndex ( GA_Index  index) const
inlinevirtual

Reimplemented in GU_VertexSelection.

Definition at line 316 of file GU_Selection.h.

static const GA_PrimitiveGroup* GU_Selection::hiddenPrimitives ( const GU_Detail gd)
staticprotected
void GU_Selection::initGroupString ( const GU_Detail gd,
const GA_Group group,
const char *  group_string 
)
bool GU_Selection::load ( UT_JSONParser p,
bool  restore_id_and_rev = true 
)
virtual bool GU_Selection::loadElements ( UT_JSONParser p)
protectedpure virtual

Save/load class specific data elements.

virtual const GA_Group* GU_Selection::mainGroup ( const GU_Detail gd) const
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::modifyBreakpoint ( const GU_Detail gd,
const GA_Breakpoint bkp,
GU_ModifyType  type 
)
pure virtual

Implemented in GU_VertexSelection.

void GU_Selection::modifyDone ( const GU_Detail gd)

Call this method once mass-modifications are finished with the above.

virtual bool GU_Selection::modifyEdge ( const GU_Detail gd,
const GA_Edge edge,
const GEO_Primitive prim,
GU_ModifyType  type 
)
pure virtual

Implemented in GU_VertexSelection.

bool GU_Selection::modifyGroup ( const GU_Detail gd,
const GA_Group group,
GU_SelectionRule  rule 
)
void GU_Selection::modifyGroupToken ( const char *  token,
GU_SelectionRule  rule 
)
virtual bool GU_Selection::modifyMatchingGroup ( const GU_Detail gd,
const GA_Group group,
GU_SelectionRule  rule 
)
protectedpure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::modifyPoint ( const GU_Detail gd,
GA_Offset  ptoff,
GU_ModifyType  type 
)
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::modifyPrimitive ( const GU_Detail gd,
GA_Offset  primoff,
GU_ModifyType  type 
)
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::modifyVertex ( const GU_Detail gd,
GA_Offset  vtxoff,
GU_ModifyType  type 
)
pure virtual

Implemented in GU_VertexSelection.

static GU_SelectionHandle GU_Selection::newCookSelection ( GU_Detail gdp,
GA_GroupType  type,
bool  ordered 
)
static
static GU_SelectionHandle GU_Selection::newCookSelection ( GU_Detail gdp,
GA_Group group 
)
static
static GU_SelectionHandle GU_Selection::newSelection ( GU_SelectionType  stype)
static
static GU_SelectionHandle GU_Selection::newSelection ( GA_GroupType  type)
static
static GU_SelectionHandle GU_Selection::newSelection ( const GU_Detail dst_gdp,
const GU_Detail src_gdp,
const GU_Selection src_sel 
)
static
int GU_Selection::pickOrder ( ) const
inline

Definition at line 390 of file GU_Selection.h.

UT_StringHolder GU_Selection::pickPath ( ) const
inline

Definition at line 387 of file GU_Selection.h.

virtual const GA_PointGroup* GU_Selection::points ( const GU_Detail gd) const
pure virtual

Implemented in GU_VertexSelection.

virtual const GA_PrimitiveGroup* GU_Selection::primitives ( const GU_Detail gd) const
pure virtual

Implemented in GU_VertexSelection.

void GU_Selection::resetPickOrder ( )
inline

Definition at line 391 of file GU_Selection.h.

bool GU_Selection::save ( UT_JSONWriter w) const

Save/load the contents of the selection.

virtual bool GU_Selection::saveElements ( UT_JSONWriter w) const
protectedpure virtual

Save/load class specific data elements.

virtual bool GU_Selection::select ( const GU_Detail gd,
uint  id1,
uint  id2,
uint  id3,
GU_SelectionRule  rule,
GU_SelectResult added,
GU_SelectFinishData *&  finish_data 
)
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::selectAll ( const GU_Detail gd)
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::selectBoundary ( const GU_Detail gd,
bool  checkuv,
const UT_StringHolder uvattribname = "uv"_UTsh 
)
pure virtual

This method is used to select the boundary. Not valid for all selection types.

Implemented in GU_VertexSelection.

virtual bool GU_Selection::selectFinish ( const GU_Detail gd,
GU_SelectionRule  rule,
GU_SelectResult added,
GU_SelectFinishData finish_data 
)
inlinevirtual

Definition at line 194 of file GU_Selection.h.

virtual bool GU_Selection::selectionPoint ( const GU_SelectResult added,
UT_Vector3 xsect 
) const
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::selectionPoint ( const GU_SelectResult added,
UT_Vector3  rayorig,
UT_Vector3 raydir,
UT_Vector3 xsect,
bool &  normal,
UT_Vector3 vector,
bool  accurate,
float *  u,
float *  v 
) const
pure virtual

Implemented in GU_VertexSelection.

void GU_Selection::setGroupTokensLock ( bool  lock)
static void GU_Selection::setOrdered ( GA_ElementGroup g,
bool  ordered 
)
inlinestaticprotected

Convenience method to make/clear ordered status of a group.

Definition at line 415 of file GU_Selection.h.

void GU_Selection::setPickOrder ( int  pick_order)
inline

Definition at line 389 of file GU_Selection.h.

void GU_Selection::setPickPath ( const UT_StringHolder p)
inline

Definition at line 386 of file GU_Selection.h.

virtual void GU_Selection::setUsePrimEdges ( bool  )
inlinevirtual

Definition at line 383 of file GU_Selection.h.

virtual bool GU_Selection::shrinkSelection ( const GU_Detail gd,
bool  checkuv,
const UT_StringHolder uvattribname = "uv"_UTsh 
)
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::testSelect ( const GU_Detail gd,
uint  id1,
uint  id2,
uint  id3,
bool  accept_existing,
bool  accept_new,
GU_SelectResult result 
) const
pure virtual

Implemented in GU_VertexSelection.

virtual bool GU_Selection::toggleAll ( const GU_Detail gd)
pure virtual

Implemented in GU_VertexSelection.

UT_Lock& GU_Selection::updateLock ( ) const
inlineprotected

Definition at line 467 of file GU_Selection.h.

void GU_Selection::updateRevision ( )
inlineprotected

Definition at line 437 of file GU_Selection.h.

bool GU_Selection::uvSelectAllBackFace ( const GU_Detail gd,
const UT_StringHolder uvattribname = "uv"_UTsh 
)
inline

Definition at line 301 of file GU_Selection.h.

virtual bool GU_Selection::uvSelectAllByWindingUsingClosure ( const GU_Detail gd,
bool  front_facing,
bool  back_facing,
const UT_StringHolder uvattribname 
)
protectedvirtual
bool GU_Selection::uvSelectAllFrontFace ( const GU_Detail gd,
const UT_StringHolder uvattribname = "uv"_UTsh 
)
inline

Definition at line 299 of file GU_Selection.h.

virtual bool GU_Selection::validate ( const GU_Detail gd)
protectedpure virtual

Validate the current selection against the given detail. This will prune out any selection components that are invalid against the detail given. Call this prior to, or after, a mass modification via calls to modify*(). Those calls do not do any verification of the current selection, for performance reasons. Returns true if the selection was already valid and no entries were eliminated.

Implemented in GU_VertexSelection.

virtual const GA_VertexGroup* GU_Selection::vertices ( const GU_Detail gd) const
pure virtual

Implemented in GU_VertexSelection.


The documentation for this class was generated from the following file: