HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdSelection Class Reference

#include <selection.h>

Classes

struct  PrimSelectionState
 

Public Types

enum  HighlightMode { HighlightModeSelect = 0, HighlightModeLocate, HighlightModeCount }
 Selection modes allow differentiation in selection highlight behavior. More...
 

Public Member Functions

 HdSelection ()=default
 
virtual HD_API ~HdSelection ()
 
HD_API void AddRprim (HighlightMode const &mode, SdfPath const &renderIndexPath)
 ---------------------— Population API -----------------------------— More...
 
HD_API void AddInstance (HighlightMode const &mode, SdfPath const &renderIndexPath, VtIntArray const &instanceIndex=VtIntArray())
 
HD_API void AddElements (HighlightMode const &mode, SdfPath const &renderIndexPath, VtIntArray const &elementIndices)
 
HD_API void AddEdges (HighlightMode const &mode, SdfPath const &renderIndexPath, VtIntArray const &edgeIndices)
 
HD_API void AddPoints (HighlightMode const &mode, SdfPath const &renderIndexPath, VtIntArray const &pointIndices)
 
HD_API void AddPoints (HighlightMode const &mode, SdfPath const &renderIndexPath, VtIntArray const &pointIndices, GfVec4f const &pointColor)
 
HD_API PrimSelectionState constGetPrimSelectionState (HighlightMode const &mode, SdfPath const &renderIndexPath) const
 -------------------------— Query API ------------------------------— More...
 
HD_API SdfPathVector GetAllSelectedPrimPaths () const
 
HD_API SdfPathVector GetSelectedPrimPaths (HighlightMode const &mode) const
 
HD_API std::vector< GfVec4f >
const
GetSelectedPointColors () const
 
HD_API bool IsEmpty () const
 

Protected Types

typedef std::unordered_map
< SdfPath, PrimSelectionState,
SdfPath::Hash
_PrimSelectionStateMap
 

Protected Attributes

_PrimSelectionStateMap _selMap [HighlightModeCount]
 
std::vector< GfVec4f_selectedPointColors
 

Detailed Description

HdSelection holds a collection of selected items per selection mode. The items may be rprims, instances of an rprim and subprimitives of an rprim, such as elements (faces for meshes, individual curves for basis curves), edges & points. Each item is referred to by the render index path.

It current supports active and rollover selection modes, and may be inherited for customization.

Definition at line 52 of file selection.h.

Member Typedef Documentation

Definition at line 156 of file selection.h.

Member Enumeration Documentation

Selection modes allow differentiation in selection highlight behavior.

Enumerator
HighlightModeSelect 
HighlightModeLocate 
HighlightModeCount 

Definition at line 55 of file selection.h.

Constructor & Destructor Documentation

HdSelection::HdSelection ( )
default
virtual HD_API HdSelection::~HdSelection ( )
virtual

Member Function Documentation

HD_API void HdSelection::AddEdges ( HighlightMode const mode,
SdfPath const renderIndexPath,
VtIntArray const edgeIndices 
)
HD_API void HdSelection::AddElements ( HighlightMode const mode,
SdfPath const renderIndexPath,
VtIntArray const elementIndices 
)
HD_API void HdSelection::AddInstance ( HighlightMode const mode,
SdfPath const renderIndexPath,
VtIntArray const instanceIndex = VtIntArray() 
)
HD_API void HdSelection::AddPoints ( HighlightMode const mode,
SdfPath const renderIndexPath,
VtIntArray const pointIndices 
)
HD_API void HdSelection::AddPoints ( HighlightMode const mode,
SdfPath const renderIndexPath,
VtIntArray const pointIndices,
GfVec4f const pointColor 
)
HD_API void HdSelection::AddRprim ( HighlightMode const mode,
SdfPath const renderIndexPath 
)

---------------------— Population API -----------------------------—

HD_API SdfPathVector HdSelection::GetAllSelectedPrimPaths ( ) const
HD_API PrimSelectionState const* HdSelection::GetPrimSelectionState ( HighlightMode const mode,
SdfPath const renderIndexPath 
) const

-------------------------— Query API ------------------------------—

HD_API std::vector<GfVec4f> const& HdSelection::GetSelectedPointColors ( ) const
HD_API SdfPathVector HdSelection::GetSelectedPrimPaths ( HighlightMode const mode) const
HD_API bool HdSelection::IsEmpty ( ) const

Member Data Documentation

std::vector<GfVec4f> HdSelection::_selectedPointColors
protected

Definition at line 161 of file selection.h.

_PrimSelectionStateMap HdSelection::_selMap[HighlightModeCount]
protected

Definition at line 158 of file selection.h.


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