X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI_Placement.cpp;h=9be8820ccc66cc2c256d7818dd670e0c74ac9e57;hb=e20a4ec83c24222f7a3b159111f15e87bce6370f;hp=e704114179d49c3ec5f7fdd076323663f5952fef;hpb=322b8d77ba294283a4703856c96321247e89fb9f;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_Placement.cpp b/src/FeaturesAPI/FeaturesAPI_Placement.cpp index e70411417..9be8820cc 100644 --- a/src/FeaturesAPI/FeaturesAPI_Placement.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Placement.cpp @@ -6,6 +6,7 @@ #include "FeaturesAPI_Placement.h" +#include #include //================================================================================================== @@ -79,7 +80,25 @@ void FeaturesAPI_Placement::setCentering(const bool theCentering) execute(); } -// TODO(spo): make add* as static functions of the class +//================================================================================================== +void FeaturesAPI_Placement::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + const std::string& aDocName = theDumper.name(aBase->document()); + + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Placement::OBJECTS_LIST_ID()); + AttributeSelectionPtr anAttrStartShape = + aBase->selection(FeaturesPlugin_Placement::START_SHAPE_ID()); + AttributeSelectionPtr anAttrEndShape = aBase->selection(FeaturesPlugin_Placement::END_SHAPE_ID()); + AttributeBooleanPtr anAttrReverse = aBase->boolean(FeaturesPlugin_Placement::REVERSE_ID()); + AttributeBooleanPtr anAttrCentering = aBase->boolean(FeaturesPlugin_Placement::CENTERING_ID()); + + theDumper << aBase << " = model.addPlacement(" << aDocName << ", " + << anAttrObjects << ", " << anAttrStartShape << ", " << anAttrEndShape << ", " + << anAttrReverse << ", " << anAttrCentering << ")" << std::endl; +} + //================================================================================================== PlacementPtr addPlacement(const std::shared_ptr& thePart, const std::list& theObjects,