X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FGeomAPI%2FGeomAPI_Shape.cpp;h=78a10ac3c5ffb0bb6940a29828e1a07dca6c034d;hb=645e2cb70c0e40290725f28fdc5fec8a93338d28;hp=ce7788b54eacc00f2339011271663f62e27b0435;hpb=7d4237b5694f5b41f69282f52ef19fbd7c3cba88;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index ce7788b54..78a10ac3c 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -638,11 +639,17 @@ GeomPointPtr GeomAPI_Shape::middlePoint() const } // LCOV_EXCL_START -std::string GeomAPI_Shape::getShapeStream() const +std::string GeomAPI_Shape::getShapeStream(const bool theWithTriangulation) const { std::ostringstream aStream; const TopoDS_Shape& aShape = const_cast(this)->impl(); - BRepTools::Write(aShape, aStream); + if (!theWithTriangulation) { // make a copy of shape without triangulation + BRepBuilderAPI_Copy aCopy(aShape, Standard_False, Standard_False); + const TopoDS_Shape& aCopyShape = aCopy.Shape(); + BRepTools::Write(aCopyShape, aStream); + } else { + BRepTools::Write(aShape, aStream); + } return aStream.str(); } // LCOV_EXCL_STOP