1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Shape.cpp
4 // Created: 23 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #include<GeomAPI_Shape.h>
9 #include <TopoDS_Shape.hxx>
11 #define MY_SHAPE static_cast<TopoDS_Shape*>(myImpl)
13 GeomAPI_Shape::GeomAPI_Shape()
14 : GeomAPI_Interface(new TopoDS_Shape())
18 bool GeomAPI_Shape::isNull() const
20 return MY_SHAPE->IsNull() == Standard_True;
23 bool GeomAPI_Shape::isEqual(const std::shared_ptr<GeomAPI_Shape> theShape) const
26 return theShape->isNull();
27 if (theShape->isNull())
30 return MY_SHAPE->IsEqual(theShape->impl<TopoDS_Shape>()) == Standard_True;
33 bool GeomAPI_Shape::isVertex() const
35 const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
36 return !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX;
39 bool GeomAPI_Shape::isEdge() const
41 const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
42 return aShape.ShapeType() == TopAbs_EDGE;
45 bool GeomAPI_Shape::isFace() const
47 const TopoDS_Shape& aShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
48 return aShape.ShapeType() == TopAbs_FACE;