X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Shape.cpp;h=0e5bcb010afce528fa68654ab66f867f918af232;hb=93310e00f0ac95395137c842108790bf62e6425e;hp=e662ea2548c0c26cb72e81cd89b65684cb874a0c;hpb=de0f49686ec6655ddc5816c8fa5383964662aec4;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index e662ea254..0e5bcb010 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -4,10 +4,38 @@ #include -#include +#include -#define MY_PNT static_cast(myImpl) +#define MY_SHAPE static_cast(myImpl) GeomAPI_Shape::GeomAPI_Shape() - : GeomAPI_Interface(new TopoDS_Shape()) -{} + : GeomAPI_Interface(new TopoDS_Shape()) +{ +} + +bool GeomAPI_Shape::isNull() const +{ + return MY_SHAPE->IsNull() == Standard_True; +} + +bool GeomAPI_Shape::isEqual(const boost::shared_ptr theShape) const +{ + if (isNull()) + return theShape->isNull(); + if (theShape->isNull()) + return false; + + return MY_SHAPE->IsEqual(theShape->impl()) == Standard_True; +} + +bool GeomAPI_Shape::isVertex() const +{ + const TopoDS_Shape& aShape = const_cast(this)->impl(); + return !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX; +} + +bool GeomAPI_Shape::isEdge() const +{ + const TopoDS_Shape& aShape = const_cast(this)->impl(); + return aShape.ShapeType() == TopAbs_EDGE; +}