From: nds Date: Fri, 21 Aug 2015 05:39:25 +0000 (+0300) Subject: Processing composilid like a solid in selection. X-Git-Tag: V_1.4.0_beta4~299 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ead1bc12b11c3252a0c120f6ce4ff9d18af76642;p=modules%2Fshaper.git Processing composilid like a solid in selection. --- diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index a957eb3b6..17e87d85c 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -82,6 +82,12 @@ bool GeomAPI_Shape::isSolid() const return !aShape.IsNull() && aShape.ShapeType() == TopAbs_SOLID; } +bool GeomAPI_Shape::isCompSolid() const +{ + const TopoDS_Shape& aShape = const_cast(this)->impl(); + return !aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPSOLID; +} + GeomAPI_Shape::ShapeType GeomAPI_Shape::shapeType() const { const TopoDS_Shape& aShape = impl(); diff --git a/src/GeomAPI/GeomAPI_Shape.h b/src/GeomAPI/GeomAPI_Shape.h index 13f000fa8..8f31318d6 100644 --- a/src/GeomAPI/GeomAPI_Shape.h +++ b/src/GeomAPI/GeomAPI_Shape.h @@ -62,6 +62,10 @@ public: GEOMAPI_EXPORT virtual bool isSolid() const; + /// Returns whether the shape is a compsolid + GEOMAPI_EXPORT + virtual bool isCompSolid() const; + /// Returns the shape type GEOMAPI_EXPORT virtual ShapeType shapeType() const; diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp index 97ad58028..1bb88e053 100644 --- a/src/GeomValidators/GeomValidators_ShapeType.cpp +++ b/src/GeomValidators/GeomValidators_ShapeType.cpp @@ -160,7 +160,8 @@ bool GeomValidators_ShapeType::isValidShape(const GeomShapePtr theShape, aValid = theShape->isVertex(); break; case Solid: - aValid = theShape->isSolid() || theShape->isCompoundOfSolids(); + aValid = theShape->isSolid() || theShape->isCompSolid() || + theShape->isCompoundOfSolids(); break; case Face: aValid = theShape->isFace(); diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 3f14bed77..03b29dd75 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -908,6 +908,8 @@ void PartSet_Module::processEvent(const std::shared_ptr& theMess } } #else + // Problem with MPV: At first time on creation it doesn't work because Part feature + // creation event will be sent after if (aActivePartIndex.isValid()) aTreeView->setExpanded(aActivePartIndex, false); XGUI_DataModel* aDataModel = aWorkshop->objectBrowser()->dataModel();