+ fixes #0001945: selection out of sync with viewer

This commit is contained in:
wmayer 2015-02-13 22:26:04 +01:00
parent f54da66bd3
commit d89d1808b7

View File

@ -261,32 +261,30 @@ void SoFCUnifiedSelection::doAction(SoAction *action)
if (selaction->SelChange.Type == SelectionChanges::AddSelection ||
selaction->SelChange.Type == SelectionChanges::RmvSelection) {
// selection changes inside the 3d view are handled in handleEvent()
if (!currenthighlight) {
App::Document* doc = App::GetApplication().getDocument(selaction->SelChange.pDocName);
App::DocumentObject* obj = doc->getObject(selaction->SelChange.pObjectName);
ViewProvider*vp = Application::Instance->getViewProvider(obj);
if (vp && vp->useNewSelectionModel() && vp->isSelectable()) {
SoDetail* detail = vp->getDetail(selaction->SelChange.pSubName);
SoSelectionElementAction::Type type = SoSelectionElementAction::None;
if (selaction->SelChange.Type == SelectionChanges::AddSelection) {
if (detail)
type = SoSelectionElementAction::Append;
else
type = SoSelectionElementAction::All;
}
else {
if (detail)
type = SoSelectionElementAction::Remove;
else
type = SoSelectionElementAction::None;
}
SoSelectionElementAction action(type);
action.setColor(this->colorSelection.getValue());
action.setElement(detail);
action.apply(vp->getRoot());
delete detail;
App::Document* doc = App::GetApplication().getDocument(selaction->SelChange.pDocName);
App::DocumentObject* obj = doc->getObject(selaction->SelChange.pObjectName);
ViewProvider*vp = Application::Instance->getViewProvider(obj);
if (vp && vp->useNewSelectionModel() && vp->isSelectable()) {
SoDetail* detail = vp->getDetail(selaction->SelChange.pSubName);
SoSelectionElementAction::Type type = SoSelectionElementAction::None;
if (selaction->SelChange.Type == SelectionChanges::AddSelection) {
if (detail)
type = SoSelectionElementAction::Append;
else
type = SoSelectionElementAction::All;
}
else {
if (detail)
type = SoSelectionElementAction::Remove;
else
type = SoSelectionElementAction::None;
}
SoSelectionElementAction action(type);
action.setColor(this->colorSelection.getValue());
action.setElement(detail);
action.apply(vp->getRoot());
delete detail;
}
}
else if (selaction->SelChange.Type == SelectionChanges::ClrSelection ||