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>;
57 HighlightModeSelect = 0,
69 SdfPath const &renderIndexPath);
74 VtIntArray
const &instanceIndex=VtIntArray());
79 VtIntArray
const &elementIndices);
84 VtIntArray
const &edgeIndices);
89 VtIntArray
const &pointIndices);
96 VtIntArray
const &pointIndices,
103 struct PrimSelectionState {
104 PrimSelectionState() : fullySelected(false) {}
110 std::vector<VtIntArray> instanceIndices;
111 std::vector<VtIntArray> elementIndices;
112 std::vector<VtIntArray> edgeIndices;
113 std::vector<VtIntArray> pointIndices;
114 std::vector<int> pointColorIndices;
122 PrimSelectionState
const *
124 SdfPath const &renderIndexPath)
const;
130 GetAllSelectedPrimPaths()
const;
138 std::vector<GfVec4f>
const& GetSelectedPointColors()
const;
142 bool IsEmpty()
const;
146 HdSelectionSharedPtr Merge(
147 HdSelectionSharedPtr
const &,
148 HdSelectionSharedPtr
const &);
152 SdfPath const &renderIndexPath,
153 VtIntArray
const &pointIndices,
154 int pointColorIndex);
156 void _GetSelectionPrimPathsForMode(
HighlightMode const &mode,
157 SdfPathVector *paths)
const;
160 using _PrimSelectionStateMap =
161 std::unordered_map<SdfPath, PrimSelectionState, SdfPath::Hash>;
163 _PrimSelectionStateMap _selMap[HighlightModeCount];
166 std::vector<GfVec4f> _selectedPointColors;
169 PXR_NAMESPACE_CLOSE_SCOPE
171 #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.
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.
HD_API PrimSelectionState const * GetPrimSelectionState(HighlightMode const &mode, SdfPath const &renderIndexPath) const
-------------------------— Query API ------------------------------—