Skip to content

Commit

Permalink
add convenience method to 3d viewer to disable selection
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Nov 7, 2019
1 parent 9a07b12 commit dd120ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Gui/View3DInventorViewer.cpp
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/Gui/View3DInventorViewer.h
Expand Up @@ -236,6 +236,8 @@ class GuiExport View3DInventorViewer : public Quarter::SoQTQuarterAdaptor, publi
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
Expand Down

0 comments on commit dd120ef

Please sign in to comment.