]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
authornds <natalia.donis@opencascade.com>
Wed, 25 Mar 2015 13:24:25 +0000 (16:24 +0300)
committernds <natalia.donis@opencascade.com>
Wed, 25 Mar 2015 13:24:25 +0000 (16:24 +0300)
.gitignore
src/GeomAPI/GeomAPI_Edge.cpp
src/GeomAPI/GeomAPI_Vertex.cpp
src/Model/Model_AttributeSelection.cpp
src/Model/Model_ResultConstruction.cpp
src/Model/Model_Update.cpp

index f55ecf287870a46e890ed9032633c95acc3311ab..b3e5bb13fb16b3cafc9c15e28bdc11ef91562fb4 100644 (file)
@@ -28,3 +28,5 @@ start.bat
 *.orig
 *~
 /.project
+*DFBrowser*
+
index f9572daa79949e4da668fc374466dc078f598de2..b5736f4b618d70b52ad2e8c786c8db1ba4d20ff6 100644 (file)
@@ -131,6 +131,8 @@ std::shared_ptr<GeomAPI_Lin> GeomAPI_Edge::line()
 
 bool GeomAPI_Edge::isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const
 {
+  if (!theEdge.get() || ! theEdge->isEdge())
+    return false;
   const TopoDS_Shape& aMyShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
   const TopoDS_Shape& aInShape = theEdge->impl<TopoDS_Shape>();
 
index d881d79b5bf0ea0cbbb7106bc0d3507f9aa05384..b917837a09cfcaa4e9589598625f7a4d4f63765e 100644 (file)
@@ -37,6 +37,8 @@ std::shared_ptr<GeomAPI_Pnt> GeomAPI_Vertex::point()
 
 bool GeomAPI_Vertex::isEqual(const std::shared_ptr<GeomAPI_Shape> theVert) const
 {
+  if (!theVert.get() || ! theVert->isVertex())
+    return false;
   const TopoDS_Shape& aMyShape = const_cast<GeomAPI_Vertex*>(this)->impl<TopoDS_Shape>();
   const TopoDS_Shape& aInShape = theVert->impl<TopoDS_Shape>();
 
index 625ee19da88204244684dc98935c06435a38c162..9133794ae94460375cf53c75b966de982345e221 100644 (file)
@@ -226,9 +226,10 @@ bool Model_AttributeSelection::update()
     // take the face that more close by the indexes
     ResultConstructionPtr aConstructionContext = 
       std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+    FeaturePtr aContextFeature = aContext->document()->feature(aContext);
     // sketch sub-element
     if (aConstructionContext && 
-        std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContext).get())
+        std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContextFeature).get())
     {
       TDF_Label aLab = myRef.myRef->Label();
       // getting a type of selected shape
@@ -243,10 +244,9 @@ bool Model_AttributeSelection::update()
       bool aNoIndexes = 
         !aLab.FindAttribute(TDataStd_IntPackedMap::GetID(), aSubIds) || aSubIds->Extent() == 0;
       // for now working only with composite features
-      FeaturePtr aContextFeature = aContext->document()->feature(aContext);
       CompositeFeaturePtr aComposite = 
         std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aContextFeature);
-      if (!aComposite || aComposite->numberOfSubs() == 0) {
+      if (!aComposite.get() || aComposite->numberOfSubs() == 0) {
         return false;
       }
 
index 17b20df98dc4eff497b1eb03ed3bfbbbbaf72e09..2998e9f2db8a4879186ed9cbb458051d027100d1 100644 (file)
@@ -28,9 +28,9 @@ void Model_ResultConstruction::colorConfigInfo(std::string& theSection, std::str
 
 void Model_ResultConstruction::setShape(std::shared_ptr<GeomAPI_Shape> theShape)
 {
-  if (myShape != theShape) {
+  if (myShape != theShape && (!theShape.get() || !theShape->isEqual(myShape))) {
     myShape = theShape;
-    if (theShape.get() && (!myShape.get() || !theShape->isEqual(myShape))) {
+    if (theShape.get()) {
       myFacesUpToDate = false;
       myFaces.clear();
     }
index 51eba966c182977e5787340582512cc134b426e3..1b1a3d626820cb2aa587b421d0e357f76c80d930 100644 (file)
@@ -105,11 +105,14 @@ void Model_Update::processEvent(const std::shared_ptr<Events_Message>& theMessag
       {
         FeaturePtr aF = std::dynamic_pointer_cast<ModelAPI_Feature>(*aFIter);
         if (aF && aF->getKind() == "Extrusion") {
-          if (aF->selection("extrusion_face")) {
-            ResultPtr aSketchRes = aF->selection("extrusion_face")->context();
-            if (aSketchRes) {
-              static Events_ID HIDE_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE);
-              ModelAPI_EventCreator::get()->sendUpdated(aSketchRes, HIDE_DISP);
+          AttributeSelectionListPtr aBase = aF->selectionList("base");
+          if (aBase.get()) {
+            for(int a = aBase->size() - 1; a >= 0; a--) {
+              ResultPtr aSketchRes = aBase->value(a)->context();
+              if (aSketchRes) {
+                static Events_ID HIDE_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE);
+                ModelAPI_EventCreator::get()->sendUpdated(aSketchRes, HIDE_DISP);
+              }
             }
           }
         }