]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
authorsbh <sergey.belash@opencascade.com>
Wed, 29 Oct 2014 12:25:37 +0000 (15:25 +0300)
committersbh <sergey.belash@opencascade.com>
Wed, 29 Oct 2014 12:25:37 +0000 (15:25 +0300)
linux_env.sh
salome_run.sh
src/ModelAPI/ModelAPI_CompositeFeature.h
src/ModelAPI/ModelAPI_Feature.h
src/ModelAPI/ModelAPI_Object.h
src/ModuleBase/ModuleBase_Operation.h
src/ModuleBase/ModuleBase_ViewerFilters.cpp
src/PartSet/PartSet_Module.cpp
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchPlugin/SketchPlugin_Sketch.h

index f6bdf5dcecbfab0e09bbe355b1dd50e154061db9..fcbe77b868e98322647ced4401e595e1065a1a57 100644 (file)
@@ -35,9 +35,9 @@ export PATH=${CASROOT}:${PATH}
 ##
 
 #------ NewGEOM ------
-export NEW_GEOM_ROOT_DIR=${ROOT_DIR}/install
-export PATH=${NEW_GEOM_ROOT_DIR}/bin:${NEW_GEOM_ROOT_DIR}/plugins:${PATH}
-export PYTHONPATH=${NEW_GEOM_ROOT_DIR}/swig:${PYTHONPATH}
-export LD_LIBRARY_PATH=${NEW_GEOM_ROOT_DIR}/bin:${NEW_GEOM_ROOT_DIR}/swig:${NEW_GEOM_ROOT_DIR}/plugins:${LD_LIBRARY_PATH}
-export NEW_GEOM_CONFIG_FILE=${NEW_GEOM_ROOT_DIR}/plugins
-export NewGeomResources=${NEW_GEOM_ROOT_DIR}/resources
+export NEWGEOM_ROOT_DIR=${ROOT_DIR}/install
+export PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/plugins:${PATH}
+export PYTHONPATH=${NEWGEOM_ROOT_DIR}/swig:${PYTHONPATH}
+export LD_LIBRARY_PATH=${NEWGEOM_ROOT_DIR}/bin:${NEWGEOM_ROOT_DIR}/swig:${NEWGEOM_ROOT_DIR}/plugins:${LD_LIBRARY_PATH}
+export NEW_GEOM_CONFIG_FILE=${NEWGEOM_ROOT_DIR}/plugins
+export NewGeomResources=${NEWGEOM_ROOT_DIR}/resources
index 5ef39f4abd64642495e48aeb6b3f9b67ed30985c..78609177af1cff3586a7f2959390aced63849001 100755 (executable)
@@ -7,6 +7,7 @@ source ${ROOT_DIR}/sources/linux_env.sh
 
 # Correcting path which defined with error
 export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:${LD_LIBRARY_PATH}
-export LightAppConfig=${ROOT_DIR}/install/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
+export SalomeAppConfig=${ROOT_DIR}/install/share/salome/resources/newgeom:${GUI_ROOT_DIR}/share/salome/resources/gui
 
-SUITApp LightApp --modules=NewGeom
\ No newline at end of file
+${PYTHONBIN} "${KERNEL_ROOT_DIR}/bin/salome/envSalome.py"
+${PYTHONBIN} "${KERNEL_ROOT_DIR}/bin/salome/runSalome.py"
index 28c4d6d2a4847523a0e7ebe6da0b52d253d53382..878ca849fb5d0fe0cfe9900eeb17840ccd9b522e 100644 (file)
@@ -27,6 +27,9 @@ public:
 
   /// Returns the sub-feature unique identifier in this composite feature by zero-base index
   virtual int subFeatureId(const int theIndex) const = 0;
+
+  /// Returns true if feature or reuslt belong to this composite feature as subs
+  virtual bool isSub(ObjectPtr theObject) const = 0;
 };
 
 //! Pointer on the composite feature object
index 3dc6a3d5d956a1e6622a51cb37647b559a1f31c1..269471f84f9404277236c65c621970f087295e49 100644 (file)
@@ -51,7 +51,7 @@ class ModelAPI_Feature : public ModelAPI_Object
   }
 
   /// Returns document this feature belongs to
-  virtual boost::shared_ptr<ModelAPI_Document> document()
+  virtual boost::shared_ptr<ModelAPI_Document> document() const
   {
     return ModelAPI_Object::document();
   }
index f6e3c6c3228d6b34867361e7ab06a8060b3c06d5..7ac6696f5ad5b0433b2d662bd2c5917f6858372f 100644 (file)
@@ -46,7 +46,7 @@ class ModelAPI_Object
   }
 
   /// Returns document this feature belongs to
-  virtual boost::shared_ptr<ModelAPI_Document> document()
+  virtual boost::shared_ptr<ModelAPI_Document> document() const
   {
     return myDoc;
   }
index 80f18f35bc460d5ced2726b28331a905f50a8a80..9d1a1c04ad2e3310c2040d0ac03ccbedddc93b0d 100644 (file)
@@ -17,7 +17,6 @@
 #include <QObject>
 #include <QString>
 #include <QStringList>
-#include <list>
 
 class ModuleBase_ModelWidget;
 class ModuleBase_OperationDescription;
index 4b6e571dfb1aa6b4fc9f696ea8117da97e2f1138..b10437101a851b008480626dab1abd86a57e9dae 100644 (file)
@@ -74,8 +74,10 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(const Handle(SelectMgr_Enti
           return aD1 && aD2 && aD3;
         }
       }
+    } else {
+      // This is not object controlled by the filter
+      return Standard_True;
     }
   }
-  // This is not object controlled by the filter
-  return Standard_True;
+  return Standard_False;
 }
index 658dbff6cf60a2af127d0e1da8e40b0ea24b50ff..f38381ef85160fcedbbb5b29dd2744766a84d947 100644 (file)
@@ -366,13 +366,14 @@ void PartSet_Module::setSketchingMode(const gp_Pln& thePln)
   // Clear standard selection modes
   aDisplayer->setSelectionModes(aModes);
   aDisplayer->openLocalContext();
-  // Get default selection modes
-  aModes = sketchSelectionModes(ObjectPtr());
-  aDisplayer->activateObjectsOutOfContext(aModes);
 
   // Set filter
   mySketchFilter = new ModuleBase_ShapeInPlaneFilter(thePln);
   aDisplayer->addSelectionFilter(mySketchFilter);
+
+  // Get default selection modes
+  aModes = sketchSelectionModes(ObjectPtr());
+  aDisplayer->activateObjectsOutOfContext(aModes);
 }
 
 void PartSet_Module::onFeatureConstructed(ObjectPtr theFeature, int theMode)
index a66bd9ffb1b6a3040a79c005147862739e5db233..5429b2b605668573097dbc9bd76ff09713971433 100644 (file)
@@ -131,6 +131,25 @@ int SketchPlugin_Sketch::subFeatureId(const int theIndex) const
   return subFeature(theIndex)->data()->featureId();
 }
 
+bool SketchPlugin_Sketch::isSub(ObjectPtr theObject) const
+{
+  // check is this feature of result
+  FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(theObject);
+  if (!aFeature) {
+    ResultPtr aRes = boost::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+    if (aRes)
+      aFeature = document()->feature(aRes);
+  }
+  if (aFeature) {
+    list<ObjectPtr> aSubs = data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->list();
+    for(list<ObjectPtr>::iterator aSubIt = aSubs.begin(); aSubIt != aSubs.end(); aSubIt++) {
+      if (*aSubIt == aFeature)
+        return true;
+    }
+  }
+  return false;
+}
+
 boost::shared_ptr<GeomAPI_Pnt> SketchPlugin_Sketch::to3D(const double theX, const double theY)
 {
   boost::shared_ptr<GeomDataAPI_Point> aC = boost::dynamic_pointer_cast<GeomDataAPI_Point>(
index 79b478f7cb1df43f693d667e37760ffb293de962..23147d97f612f11077809ff5b8b773ad7d7f2690 100644 (file)
@@ -126,6 +126,9 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_IPr
   /// Returns the sub-feature unique identifier in this composite feature by zero-base index
   SKETCHPLUGIN_EXPORT virtual int subFeatureId(const int theIndex) const;
 
+  /// Returns true if feature or reuslt belong to this composite feature as subs
+  SKETCHPLUGIN_EXPORT virtual bool isSub(ObjectPtr theObject) const;
+
   /// Construction result is allways recomuted on the fly
   SKETCHPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}