From: Clarisse Genrault Date: Mon, 21 Nov 2016 09:47:14 +0000 (+0100) Subject: Supress whitespace. X-Git-Tag: V_2.6.0~80 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f4faac534a4f2386ce7231df79bb704de0e8fed;p=modules%2Fshaper.git Supress whitespace. --- diff --git a/src/PrimitivesAPI/PrimitivesAPI_Box.cpp b/src/PrimitivesAPI/PrimitivesAPI_Box.cpp index 2c2e016cb..3e3fb54c0 100644 --- a/src/PrimitivesAPI/PrimitivesAPI_Box.cpp +++ b/src/PrimitivesAPI/PrimitivesAPI_Box.cpp @@ -6,6 +6,7 @@ #include "PrimitivesAPI_Box.h" +#include #include //================================================================================================== @@ -66,6 +67,34 @@ void PrimitivesAPI_Box::setPoints(const ModelHighAPI_Selection& theFirstPoint, execute(); } +//================================================================================================== +void PrimitivesAPI_Box::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + const std::string& aDocName = theDumper.name(aBase->document()); + + theDumper << aBase << " = model.addBox(" << aDocName; + + std::string aCreationMethod = aBase->string(PrimitivesPlugin_Box::CREATION_METHOD())->value(); + + if(aCreationMethod == PrimitivesPlugin_Box::CREATION_METHOD_BY_DIMENSIONS()) { + AttributeDoublePtr anAttrDx = aBase->real(PrimitivesPlugin_Box::DX_ID()); + AttributeDoublePtr anAttrDy = aBase->real(PrimitivesPlugin_Box::DY_ID()); + AttributeDoublePtr anAttrDz = aBase->real(PrimitivesPlugin_Box::DZ_ID()); + + theDumper << ", " << anAttrDx << ", " << anAttrDy << ", " << anAttrDz; + } else if (aCreationMethod == PrimitivesPlugin_Box::CREATION_METHOD_BY_TWO_POINTS()) { + AttributeSelectionPtr anAttrFirstPnt = + aBase->selection(PrimitivesPlugin_Box::POINT_FIRST_ID()); + AttributeSelectionPtr anAttrSecondPnt = + aBase->selection(PrimitivesPlugin_Box::POINT_SECOND_ID()); + + theDumper << ", " << anAttrFirstPnt << ", " << anAttrSecondPnt; + } + + theDumper << ")" << std::endl; +} + //================================================================================================== BoxPtr addBox(const std::shared_ptr& thePart, const ModelHighAPI_Double& theDx, diff --git a/src/PrimitivesAPI/PrimitivesAPI_Box.h b/src/PrimitivesAPI/PrimitivesAPI_Box.h index 9dac5e2a8..17249ed29 100644 --- a/src/PrimitivesAPI/PrimitivesAPI_Box.h +++ b/src/PrimitivesAPI/PrimitivesAPI_Box.h @@ -68,6 +68,10 @@ public: PRIMITIVESAPI_EXPORT void setPoints(const ModelHighAPI_Selection& theFirstPoint, const ModelHighAPI_Selection& theSecondPoint); + + /// Dump wrapped feature + PRIMITIVESAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; /// Pointer on primitive Box object