#include "PrimitivesAPI_Box.h"
+#include <ModelHighAPI_Dumper.h>
#include <ModelHighAPI_Tools.h>
//==================================================================================================
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<ModelAPI_Document>& thePart,
const ModelHighAPI_Double& theDx,