Do not use a view provider's bounding box node when handling BoundBox selection style because it leads to some inconsistent behaviour.

Instead let SoBoxSelectionRenderAction render the bounding box.
This commit is contained in:
wmayer
2018-10-26 00:39:15 +02:00
parent b11ed19f8d
commit 41ca90d223
5 changed files with 173 additions and 40 deletions

View File

@@ -54,6 +54,7 @@
#include "SoFCSelectionAction.h"
#include "SoFCSelection.h"
#include "SoFCUnifiedSelection.h"
#include <Inventor/bundles/SoMaterialBundle.h>
#include <Inventor/elements/SoSwitchElement.h>
#include "Selection.h"
@@ -1235,6 +1236,20 @@ SoBoxSelectionRenderAction::apply(SoNode * node)
}
}
PRIVATE(this)->searchaction->reset();
// Search for selections of SoFCUnifiedSelection
PRIVATE(this)->searchaction->setType(SoFCUnifiedSelection::getClassTypeId());
PRIVATE(this)->searchaction->setInterest(SoSearchAction::FIRST);
PRIVATE(this)->searchaction->apply(node);
SoFullPath * path = static_cast<SoFullPath *>(PRIVATE(this)->searchaction->getPath());
if (path) {
SoFCUnifiedSelection * selection = static_cast<SoFCUnifiedSelection *>(path->getTail());
if (selection->getNumSelected()) {
PRIVATE(this)->basecolor->rgb.setValue(selection->colorSelection.getValue());
this->drawBoxes(path, selection->getList());
}
}
PRIVATE(this)->searchaction->reset();
}
}