]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Processing composilid like a solid in selection.
authornds <natalia.donis@opencascade.com>
Fri, 21 Aug 2015 05:39:25 +0000 (08:39 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 21 Aug 2015 05:39:25 +0000 (08:39 +0300)
src/GeomAPI/GeomAPI_Shape.cpp
src/GeomAPI/GeomAPI_Shape.h
src/GeomValidators/GeomValidators_ShapeType.cpp
src/PartSet/PartSet_Module.cpp

index a957eb3b6219ca18468d13cdc280234c189cdbcd..17e87d85c3cd3f668e7b1c1cdb3572b18a40a7a9 100644 (file)
@@ -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<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
+  return !aShape.IsNull() && aShape.ShapeType() == TopAbs_COMPSOLID;
+}
+
 GeomAPI_Shape::ShapeType GeomAPI_Shape::shapeType() const
 {
   const TopoDS_Shape& aShape = impl<TopoDS_Shape>();
index 13f000fa87f5314419c548d863fbe043fac29a27..8f31318d6304242add5d76b354418ba736716af5 100644 (file)
@@ -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;
index 97ad580284a106f53a75e7574af2160c560b610f..1bb88e0534b613383226db807735549fd896cb18 100644 (file)
@@ -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();
index 3f14bed770aa4cda632ee2ff46128b20d15ecab8..03b29dd75a50a4cc255b261bb270f8bd7b171b29 100755 (executable)
@@ -908,6 +908,8 @@ void PartSet_Module::processEvent(const std::shared_ptr<Events_Message>& 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();