add convenience method to 3d viewer to disable selection

This commit is contained in:
wmayer
2019-11-07 17:13:20 +01:00
parent e8fec27b02
commit 11581294e5
2 changed files with 14 additions and 0 deletions

View File

@@ -1669,6 +1669,18 @@ const std::vector<SbVec2s>& View3DInventorViewer::getPolygon(SelectionRole* role
return navigation->getPolygon(role);
}
void View3DInventorViewer::setSelectionEnabled(const SbBool enable)
{
SoNode* root = getSceneGraph();
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(enable);
}
SbBool View3DInventorViewer::isSelectionEnabled(void) const
{
SoNode* root = getSceneGraph();
return static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.getValue();
}
SbVec2f View3DInventorViewer::screenCoordsOfPath(SoPath* path) const
{
// Generate a matrix (well, a SoGetMatrixAction) that

View File

@@ -236,6 +236,8 @@ public:
std::vector<SbVec2f> getGLPolygon(SelectionRole* role=0) const;
std::vector<SbVec2f> getGLPolygon(const std::vector<SbVec2s>&) const;
const std::vector<SbVec2s>& getPolygon(SelectionRole* role=0) const;
void setSelectionEnabled(const SbBool enable);
SbBool isSelectionEnabled(void) const;
//@}
/// Returns the screen coordinates of the origin of the path's tail object