From 6df360fa0e2593dd3a8d45a0e6368ad60c88e681 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 13 Oct 2014 14:51:40 +0400 Subject: [PATCH] Add group operation icon, fix creation of Attribute selection, clear Selection in NewGeom module on deactivation. --- src/FeaturesPlugin/plugin-Features.xml | 2 +- src/Model/Model_Data.cpp | 4 +++- src/NewGeom/NewGeom_Module.cpp | 7 +++++++ src/NewGeom/NewGeom_SalomeViewer.cpp | 2 ++ src/PartSet/PartSet_icons.qrc | 1 + src/PartSet/icons/shape_group.png | Bin 0 -> 553 bytes 6 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 src/PartSet/icons/shape_group.png diff --git a/src/FeaturesPlugin/plugin-Features.xml b/src/FeaturesPlugin/plugin-Features.xml index bcd23c7e1..749941fca 100644 --- a/src/FeaturesPlugin/plugin-Features.xml +++ b/src/FeaturesPlugin/plugin-Features.xml @@ -12,7 +12,7 @@ + icon=":icons/shape_group.png"> diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index b9bb03a31..c76a2f26f 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -74,6 +74,8 @@ void Model_Data::addAttribute(const std::string& theID, const std::string theAtt anAttr = new Model_AttributeString(anAttrLab); } else if (theAttrType == ModelAPI_AttributeReference::type()) { anAttr = new Model_AttributeReference(anAttrLab); + } else if (theAttrType == ModelAPI_AttributeSelection::type()) { + anAttr = new Model_AttributeSelection(anAttrLab); } else if (theAttrType == ModelAPI_AttributeRefAttr::type()) { anAttr = new Model_AttributeRefAttr(anAttrLab); } else if (theAttrType == ModelAPI_AttributeRefList::type()) { diff --git a/src/NewGeom/NewGeom_Module.cpp b/src/NewGeom/NewGeom_Module.cpp index 412407827..831144290 100644 --- a/src/NewGeom/NewGeom_Module.cpp +++ b/src/NewGeom/NewGeom_Module.cpp @@ -157,6 +157,13 @@ bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy) aViewAct->setEnabled(false); } + // Delete selector because it has to be redefined on next activation + if (mySelector) { + myProxyViewer->setSelector(0); + delete mySelector; + mySelector = 0; + } + //myWorkshop->contextMenuMgr()->disconnectViewer(); return LightApp_Module::deactivateModule(theStudy); } diff --git a/src/NewGeom/NewGeom_SalomeViewer.cpp b/src/NewGeom/NewGeom_SalomeViewer.cpp index 9049d0cf6..d9ce85feb 100644 --- a/src/NewGeom/NewGeom_SalomeViewer.cpp +++ b/src/NewGeom/NewGeom_SalomeViewer.cpp @@ -51,6 +51,8 @@ void NewGeom_SalomeViewer::setSelector(NewGeom_OCCSelector* theSel) } } mySelector = theSel; + if (!mySelector) + return; OCCViewer_Viewer* aViewer = mySelector->viewer(); SUIT_ViewManager* aMgr = aViewer->getViewManager(); diff --git a/src/PartSet/PartSet_icons.qrc b/src/PartSet/PartSet_icons.qrc index 53d339a23..63e9b6e5e 100644 --- a/src/PartSet/PartSet_icons.qrc +++ b/src/PartSet/PartSet_icons.qrc @@ -25,5 +25,6 @@ icons/length.png icons/distance.png icons/radius_constr.png + icons/shape_group.png diff --git a/src/PartSet/icons/shape_group.png b/src/PartSet/icons/shape_group.png new file mode 100644 index 0000000000000000000000000000000000000000..bb2ff516d35dc9a92ed6ffdc79595d61513e65e3 GIT binary patch literal 553 zcmV+^0@nSBP)+TVU5_x7IrE&y4G<6LW)%R0m7z{{Dic2rZN9Q$X1&!1i?xJlHEd! zMb<)AaLd@37v7sQ$Kt*h-|9m$FwES`%*UCz+-Nu)o=e)5bUGLe9$*XW_xtbCG~Fk8 zS^==z>2yHy9=5bNj`w@L9^yE@UnO}mnM@vCy?#47TC5}hP9TpCzy*-N^X9b(0M_gE z+tFzB%*@_Lk^lflio(4eCs(C^W#d$;S65tM)myfdnARS}?B&nAG1Y9f~bPvTYI2|OiyFW_ORR02sPxSI|DVlF2 z(;aRKd!WOt1W+_H!3vT$JIHb~{vVJggjsddXjHaLhZC0-bi3U}k|cX1kEhe=697of zarXTeQU_=bBVa~2!_$6z^8&YCf03D;q1|q4Hk+y0Y)TTg@kXPe@p!CSt){5eY8@v@ r@|fhwd_LdX<~P>s_0MMZkmR@D2_>Rn5)Y(r00000NkvXXu0mjf$qDH! literal 0 HcmV?d00001 -- 2.39.2