]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make "concealment" property disabled with disabling of the feature: to be able to...
authormpv <mpv@opencascade.com>
Wed, 3 Jun 2015 13:09:50 +0000 (16:09 +0300)
committermpv <mpv@opencascade.com>
Wed, 3 Jun 2015 13:09:50 +0000 (16:09 +0300)
src/GeomAPI/GeomAPI_Shape.cpp
src/Model/Model_Data.cpp

index 955fb123345d1151dc8d7bd4aa406bae5cf9d79a..f8139103c4729c638666cde2c0fa76395a8ce00d 100644 (file)
@@ -46,25 +46,25 @@ bool GeomAPI_Shape::isVertex() const
 bool GeomAPI_Shape::isEdge() const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
-  return aShape.ShapeType() == TopAbs_EDGE;
+  return !aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE;
 }
 
 bool GeomAPI_Shape::isFace() const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
-  return aShape.ShapeType() == TopAbs_FACE;
+  return !aShape.IsNull() && aShape.ShapeType() == TopAbs_FACE;
 }
 
 bool GeomAPI_Shape::isCompound() const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
-  return aShape.ShapeType() == TopAbs_COMPOUND;
+  return !aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPOUND;
 }
 
 bool GeomAPI_Shape::isSolid() const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
-  return aShape.ShapeType() == TopAbs_SOLID;
+  return !aShape.IsNull() && aShape.ShapeType() == TopAbs_SOLID;
 }
 
 bool GeomAPI_Shape::computeSize(double& theXmin, double& theYmin, double& theZmin,
index 0fff37fd710476360669b9c7ed63058c9db8bdf0..e3020d992e929c8f6d9d7577cf804bedec53809f 100644 (file)
@@ -309,7 +309,10 @@ void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID,
       ModelAPI_Session::get()->validators()->isConcealed(theFeature->getKind(), theAttrID)) {
     std::shared_ptr<ModelAPI_Result> aRes = 
       std::dynamic_pointer_cast<ModelAPI_Result>(myObject);
-    if (aRes) {
+    // the second condition is for history upper than concealment causer, so the feature result may
+    // be displayed and previewed; also for avoiding of quick show/hide on history
+    // moving deep down
+    if (aRes && !theFeature->isDisabled()) {
       aRes->setIsConcealed(true);
     }
   }