From 99673369151fabf8166f1a5c8f2d83e8d84038c2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 6 Nov 2013 13:40:41 +0100 Subject: [PATCH] + Implement box highlighting for view providers using SoFCSelection --- src/Gui/SoFCSelectionAction.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Gui/SoFCSelectionAction.cpp b/src/Gui/SoFCSelectionAction.cpp index 6145488ed..462814328 100644 --- a/src/Gui/SoFCSelectionAction.cpp +++ b/src/Gui/SoFCSelectionAction.cpp @@ -1038,6 +1038,27 @@ SoBoxSelectionRenderAction::apply(SoNode * node) } PRIVATE(this)->selectsearch->reset(); } + else if (selection->isHighlighted() && + selection->selected.getValue() == SoFCSelection::NOTSELECTED && + selection->style.getValue() == SoFCSelection::BOX) { + PRIVATE(this)->basecolor->rgb.setValue(selection->colorHighlight.getValue()); + + if (PRIVATE(this)->selectsearch == NULL) { + PRIVATE(this)->selectsearch = new SoSearchAction; + } + PRIVATE(this)->selectsearch->setType(SoShape::getClassTypeId()); + PRIVATE(this)->selectsearch->setInterest(SoSearchAction::FIRST); + PRIVATE(this)->selectsearch->apply(selection); + SoPath* shapepath = PRIVATE(this)->selectsearch->getPath(); + if (shapepath) { + SoPathList list; + list.append(shapepath); + PRIVATE(this)->highlightPath = path; + PRIVATE(this)->highlightPath->ref(); + this->drawBoxes(path, &list); + } + PRIVATE(this)->selectsearch->reset(); + } } } PRIVATE(this)->searchaction->reset();