7#ifndef PXR_IMAGING_HD_SELECTION_H
8#define PXR_IMAGING_HD_SELECTION_H
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/usd/sdf/path.h"
19#include <unordered_map>
21PXR_NAMESPACE_OPEN_SCOPE
23using HdSelectionSharedPtr = std::shared_ptr<class HdSelection>;
40 HighlightModeSelect = 0,
52 SdfPath const &renderIndexPath);
57 VtIntArray
const &instanceIndex=VtIntArray());
62 VtIntArray
const &elementIndices);
67 VtIntArray
const &edgeIndices);
72 VtIntArray
const &pointIndices);
79 VtIntArray
const &pointIndices,
86 struct PrimSelectionState {
87 PrimSelectionState() : fullySelected(false) {}
93 std::vector<VtIntArray> instanceIndices;
94 std::vector<VtIntArray> elementIndices;
95 std::vector<VtIntArray> edgeIndices;
96 std::vector<VtIntArray> pointIndices;
97 std::vector<int> pointColorIndices;
105 PrimSelectionState
const *
107 SdfPath const &renderIndexPath)
const;
113 GetAllSelectedPrimPaths()
const;
121 std::vector<GfVec4f>
const& GetSelectedPointColors()
const;
125 bool IsEmpty()
const;
129 HdSelectionSharedPtr Merge(
130 HdSelectionSharedPtr
const &,
131 HdSelectionSharedPtr
const &);
135 SdfPath const &renderIndexPath,
136 VtIntArray
const &pointIndices,
137 int pointColorIndex);
139 void _GetSelectionPrimPathsForMode(
HighlightMode const &mode,
140 SdfPathVector *paths)
const;
143 using _PrimSelectionStateMap =
144 std::unordered_map<SdfPath, PrimSelectionState, SdfPath::Hash>;
146 _PrimSelectionStateMap _selMap[HighlightModeCount];
149 std::vector<GfVec4f> _selectedPointColors;
152PXR_NAMESPACE_CLOSE_SCOPE
Basic type for a vector of 4 float components.
HdSelection holds a collection of selected items per selection mode.
HD_API void AddRprim(HighlightMode const &mode, SdfPath const &renderIndexPath)
---------------------— Population API -----------------------------—
HD_API PrimSelectionState const * GetPrimSelectionState(HighlightMode const &mode, SdfPath const &renderIndexPath) const
-------------------------— Query API ------------------------------—
HighlightMode
Selection modes allow differentiation in selection highlight behavior.
A path value used to locate objects in layers or scenegraphs.