X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Shape.cpp;h=78d5105ee98e9e55bd110eba04b3445c85033c0c;hb=ce9008bdda3fa14d6fa6c61360541249ccf43ce0;hp=6cb6f74c4b8b0dcbf7a31ce122f9c0177442deac;hpb=0e81819f07355dfbaf79fed0fd8e649900f2af40;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index 6cb6f74c4..78d5105ee 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -9,6 +9,9 @@ #include #include #include +#include + +#include #define MY_SHAPE static_cast(myImpl) @@ -24,6 +27,8 @@ bool GeomAPI_Shape::isNull() const bool GeomAPI_Shape::isEqual(const std::shared_ptr theShape) const { + if (!theShape.get()) + return false; if (isNull()) return theShape->isNull(); if (theShape->isNull()) @@ -60,4 +65,12 @@ bool GeomAPI_Shape::computeSize(double& theXmin, double& theYmin, double& theZmi BRepBndLib::Add(aShape, aBndBox); aBndBox.Get(theXmin, theYmin, theZmin, theXmax, theYmax, theZmax); return true; -} \ No newline at end of file +} + +std::string GeomAPI_Shape::getShapeStream() const +{ + std::ostringstream aStream; + const TopoDS_Shape& aShape = const_cast(this)->impl(); + BRepTools::Write(aShape, aStream); + return aStream.str(); +}