+ respect Selectable property in SoFCUnifiedSelection node
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5136 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
parent
1ca9395fd9
commit
73dd4ab9eb
|
@ -250,7 +250,7 @@ void SoFCUnifiedSelection::doAction(SoAction *action)
|
|||
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()) {
|
||||
if (vp && vp->useNewSelectionModel() && vp->isSelectable()) {
|
||||
SoSelectionElementAction::Type type = SoSelectionElementAction::None;
|
||||
if (selaction->SelChange.Type == SelectionChanges::AddSelection)
|
||||
type = SoSelectionElementAction::All;
|
||||
|
@ -269,7 +269,7 @@ void SoFCUnifiedSelection::doAction(SoAction *action)
|
|||
for (std::vector<ViewProvider*>::iterator it = vps.begin(); it != vps.end(); ++it) {
|
||||
ViewProviderDocumentObject* vpd = static_cast<ViewProviderDocumentObject*>(*it);
|
||||
if (vpd->useNewSelectionModel()) {
|
||||
if (Selection().isSelected(vpd->getObject())) {
|
||||
if (Selection().isSelected(vpd->getObject()) && vpd->isSelectable()) {
|
||||
SoSelectionElementAction action(SoSelectionElementAction::All);
|
||||
action.setColor(this->colorSelection.getValue());
|
||||
action.apply(vpd->getRoot());
|
||||
|
|
|
@ -68,6 +68,8 @@ public:
|
|||
void updateData(const App::Property*);
|
||||
|
||||
SoFCSelection* getHighlightNode() const { return pcHighlight; }
|
||||
bool isSelectable(void) const {return Selectable.getValue();}
|
||||
|
||||
/**
|
||||
* Returns a list of picked points from the geometry under \a pcHighlight.
|
||||
* If \a pickAll is false (the default) only the intersection point closest to the camera will be picked, otherwise
|
||||
|
|
|
@ -1012,6 +1012,14 @@ Base::Vector3d ViewProviderSketch::seekConstraintPosition(const Base::Vector3d &
|
|||
return freePos;
|
||||
}
|
||||
|
||||
bool ViewProviderSketch::isSelectable(void) const
|
||||
{
|
||||
if (isEditing())
|
||||
return false;
|
||||
else
|
||||
return PartGui::ViewProvider2DObject::isSelectable();
|
||||
}
|
||||
|
||||
void ViewProviderSketch::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
{
|
||||
// are we in edit?
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
void drawEdit(const std::vector<Base::Vector2D> &EditCurve);
|
||||
|
||||
/// Is the view provider selectable
|
||||
bool isSelectable(void) const {return !isEditing();}
|
||||
bool isSelectable(void) const;
|
||||
/// Observer message from the Selection
|
||||
virtual void onSelectionChanged(const Gui::SelectionChanges& msg);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user