]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Temporary providing a compound shape type in selection and validation to provide...
authornds <natalia.donis@opencascade.com>
Tue, 26 May 2015 16:58:11 +0000 (19:58 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 26 May 2015 16:58:11 +0000 (19:58 +0300)
src/GeomAPI/GeomAPI_Shape.cpp
src/GeomAPI/GeomAPI_Shape.h
src/GeomValidators/GeomValidators_ShapeType.cpp
src/GeomValidators/GeomValidators_ShapeType.h

index 07d3ac09c7bfff111563a5620c749a1ff598b605..955fb123345d1151dc8d7bd4aa406bae5cf9d79a 100644 (file)
@@ -55,6 +55,12 @@ bool GeomAPI_Shape::isFace() const
   return 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;
+}
+
 bool GeomAPI_Shape::isSolid() const
 {
   const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
index e4e05c476fd6dc8b626688f6e3439a82977c485b..6f61d9f0f4bf5165d015852ab820cdea80834f9b 100644 (file)
@@ -36,6 +36,9 @@ class GEOMAPI_EXPORT GeomAPI_Shape : public GeomAPI_Interface
   /// Returns whether the shape is a face
   virtual bool isFace() const;
 
+  /// Returns whether the shape is a face
+  virtual bool isCompound() const;
+
   /// Returns whether the shape is a solid
   virtual bool isSolid() const;
 
index b8012aedfbe741faef85d0ccb70d0c2e3093ce54..2fbf7cad7ba16e2edd33b6adeade542d1e326ef6 100644 (file)
@@ -30,6 +30,7 @@ GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType(const
     MyEdgeTypes["circle"] = Circle;
     MyEdgeTypes["solid"] = Solid;
     MyEdgeTypes["face"]  = Face;
+    MyEdgeTypes["compound"] = Compound;
   }
   std::string aType = std::string(theType.c_str());
   if (MyEdgeTypes.find(aType) != MyEdgeTypes.end())
@@ -150,6 +151,9 @@ bool GeomValidators_ShapeType::isValidShape(const GeomShapePtr theShape,
       case Face:
         aValid = theShape->isFace();
         break;
+      case Compound:
+        aValid = theShape->isCompound();
+        break;
       default: break;
     }
   }
index c55c4535b5402caf14f37ae58c30771d19c8c572..de7fae9ba6575bec0ff18ab6243b30c0c9942a3a 100644 (file)
@@ -32,7 +32,8 @@ class GeomValidators_ShapeType : public ModelAPI_AttributeValidator
     Line,
     Circle,
     Solid,
-    Face
+    Face,
+    Compound
   };
 
  public: