]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' of newgeom:newgeom
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 2 Jun 2014 05:41:50 +0000 (09:41 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 2 Jun 2014 05:41:50 +0000 (09:41 +0400)
1  2 
src/XGUI/XGUI_Workshop.cpp

index b21bc9e12be38e40d1e01aa1673d01bccd7e9136,f42b21c69a41f8fdcf26aea258a334b97feaafe2..980b8c8e0f28243771c285ceab2c4f9e74a423d9
@@@ -737,7 -737,7 +737,7 @@@ void XGUI_Workshop::changeCurrentDocume
    PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
    if (thePart) {
      DocumentPtr aFeaDoc;
-     if (thePart->data()) {
+     if (!XGUI_Tools::isModelObject(thePart)) {
        aFeaDoc = thePart->data()->docRef("PartDocument")->value();
      } else {
        ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(thePart);
@@@ -773,10 -773,6 +773,10 @@@ void XGUI_Workshop::onContextMenuComman
      activatePart(FeaturePtr());
    else if (theId == "DELETE_CMD")
      deleteFeatures(aFeatures);
 +  else if (theId == "SHOW_CMD")
 +    showFeatures(aFeatures, true);
 +  else if (theId == "HIDE_CMD")
 +    showFeatures(aFeatures, false);
  }
  
  //**************************************************************
@@@ -808,7 -804,7 +808,7 @@@ void XGUI_Workshop::deleteFeatures(QFea
      foreach (FeaturePtr aFeature, theList) {
        if (aFeature->getKind() == "Part") {
          DocumentPtr aDoc;
-         if (aFeature->data()) {
+         if (!XGUI_Tools::isModelObject(aFeature)) {
            aDoc = aFeature->data()->docRef("PartDocument")->value();
          } else {
            ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
            aDoc->close();
          }
        } else {
-         if (!aFeature->data()) {
+         if (XGUI_Tools::isModelObject(aFeature)) {
            ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
            aFeature = aObject->featureRef();
          }
      aMgr->rootDocument()->finishOperation();
    }
  }
 +
 +//**************************************************************
 +void XGUI_Workshop::showFeatures(QFeatureList theList, bool isVisible)
 +{
 +//  foreach (FeaturePtr aFeature, theList) {
 +//  }
 +}