]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
An attempt to use the feature kind instead of direct text. May be, later the dependen...
authornds <natalia.donis@opencascade.com>
Wed, 4 Jun 2014 11:25:58 +0000 (15:25 +0400)
committernds <natalia.donis@opencascade.com>
Wed, 4 Jun 2014 11:25:58 +0000 (15:25 +0400)
src/ModuleBase/ModuleBase_SelectorWidget.cpp
src/XGUI/CMakeLists.txt
src/XGUI/XGUI_ContextMenuMgr.cpp
src/XGUI/XGUI_Workshop.cpp

index 7ac7ba946800a96a837af5a71a3228c759fa8a80..728f7c6ab01ba0be0689e17a0b311f8326e0b261 100644 (file)
@@ -131,6 +131,7 @@ void ModuleBase_SelectorWidget::onSelectionChanged()
       return;
 
     // TODO: Check that the selection corresponds to selection type
+    // TODO: Use the feature kind definition like SKETCH_KIND instead of the direct text
     if (aFeature->getKind().compare("Sketch") != 0)
       return;
 
index c23054513853535c1e67e5273de6241612a07da0..1775cb1259fa8bdb1aaa53860868341af26aa758 100644 (file)
@@ -117,6 +117,7 @@ INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events
                                         ${PROJECT_SOURCE_DIR}/src/ModelAPI
                                         ${PROJECT_SOURCE_DIR}/src/Model
                                         ${PROJECT_SOURCE_DIR}/src/ModuleBase
+                                        ${PROJECT_SOURCE_DIR}/src/PartSetPlugin
                                         ${CAS_INCLUDE_DIRS})
 
 LINK_DIRECTORIES($ENV{PYTHON_LIB_DIR})
index 32c961026c0723a2e74c9d24244f313d66e97416..b114aa3157d40f89b315244fa07720e1a7da10b5 100644 (file)
@@ -5,6 +5,8 @@
 #include "XGUI_SelectionMgr.h"
 #include "XGUI_Displayer.h"
 
+#include "PartSetPlugin_Part.h"
+
 #include <ModelAPI_Data.h>
 #include <ModelAPI_AttributeDocRef.h>
 #include <ModelAPI_Object.h>
@@ -96,7 +98,7 @@ QMenu* XGUI_ContextMenuMgr::objectBrowserMenu() const
     FeaturePtr aFeature = aFeatures.first();
     //Process Feature
     if (aFeature) {
-      if (aFeature->getKind() == "Part") {
+      if (aFeature->getKind() == PARTSET_PART_KIND) {
         ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
         DocumentPtr aFeaDoc = aObject->featureRef()->data()->docRef("PartDocument")->value();
         if (aMgr->currentDocument() == aFeaDoc)
index dfe77c6f82b30f1fe13b7c77b18b15ceece383dd..25f3b5317528e8e98678770a61d32f44ed91989c 100644 (file)
@@ -29,6 +29,8 @@
 #include <ModelAPI_AttributeDocRef.h>
 #include <ModelAPI_Object.h>
 
+#include <PartSetPlugin_Part.h>
+
 #include <Events_Loop.h>
 #include <Events_Error.h>
 #include <ModuleBase_Operation.h>
@@ -228,7 +230,7 @@ void XGUI_Workshop::processEvent(const Events_Message* theMessage)
     bool aHasPart = false;
     for (aIt = aFeatures.begin(); aIt != aFeatures.end(); ++aIt) {
       FeaturePtr aFeature = (*aIt);
-      if (aFeature->getKind() == "Part") {
+      if (aFeature->getKind() == PARTSET_PART_KIND) {
         aHasPart = true;
         break;
       }
@@ -809,7 +811,7 @@ void XGUI_Workshop::deleteFeatures(QFeatureList theList)
     PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
     aMgr->rootDocument()->startOperation();
     foreach (FeaturePtr aFeature, theList) {
-      if (aFeature->getKind() == "Part") {
+      if (aFeature->getKind() == PARTSET_PART_KIND) {
         DocumentPtr aDoc;
         if (!XGUI_Tools::isModelObject(aFeature)) {
           aDoc = aFeature->data()->docRef("PartDocument")->value();