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,
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);
}
}