24 #ifndef PXR_IMAGING_HD_SELECTION_H
25 #define PXR_IMAGING_HD_SELECTION_H
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/version.h"
30 #include "pxr/usd/sdf/path.h"
36 #include <unordered_map>
38 PXR_NAMESPACE_OPEN_SCOPE
40 using HdSelectionSharedPtr = std::shared_ptr<class HdSelection>;
56 HighlightModeSelect = 0,
70 SdfPath const &renderIndexPath);
75 VtIntArray
const &instanceIndex=VtIntArray());
80 VtIntArray
const &elementIndices);
85 VtIntArray
const &edgeIndices);
90 VtIntArray
const &pointIndices);
97 VtIntArray
const &pointIndices,
104 struct PrimSelectionState {
105 PrimSelectionState() : fullySelected(false) {}
111 std::vector<VtIntArray> instanceIndices;
112 std::vector<VtIntArray> elementIndices;
113 std::vector<VtIntArray> edgeIndices;
114 std::vector<VtIntArray> pointIndices;
115 std::vector<int> pointColorIndices;
123 PrimSelectionState
const *
125 SdfPath const &renderIndexPath)
const;
131 GetAllSelectedPrimPaths()
const;
139 std::vector<GfVec4f>
const& GetSelectedPointColors()
const;
143 bool IsEmpty()
const;
147 SdfPath const &renderIndexPath,
148 VtIntArray
const &pointIndices,
149 int pointColorIndex);
151 void _GetSelectionPrimPathsForMode(
HighlightMode const &mode,
152 SdfPathVector *paths)
const;
155 typedef std::unordered_map<SdfPath, PrimSelectionState, SdfPath::Hash>
156 _PrimSelectionStateMap;
158 _PrimSelectionStateMap _selMap[HighlightModeCount];
161 std::vector<GfVec4f> _selectedPointColors;
164 PXR_NAMESPACE_CLOSE_SCOPE
166 #endif //PXR_IMAGING_HD_SELECTION_H
HD_API void AddRprim(HighlightMode const &mode, SdfPath const &renderIndexPath)
---------------------— Population API -----------------------------—
HighlightMode
Selection modes allow differentiation in selection highlight behavior.
HD_API PrimSelectionState const * GetPrimSelectionState(HighlightMode const &mode, SdfPath const &renderIndexPath) const
-------------------------— Query API ------------------------------—
A path value used to locate objects in layers or scenegraphs.
Basic type for a vector of 4 float components.
HdSelection holds a collection of selected items per selection mode.