Salome HOME
Sketch with the Fixed constraints only should be processed as usual sketch
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Placement.cpp
index f45264e14dc22ecf832f6dad7a6bc8bec9297926..9be8820ccc66cc2c256d7818dd670e0c74ac9e57 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "FeaturesAPI_Placement.h"
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
@@ -79,6 +80,25 @@ void FeaturesAPI_Placement::setCentering(const bool theCentering)
   execute();
 }
 
+//==================================================================================================
+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<ModelAPI_Document>& thePart,
                           const std::list<ModelHighAPI_Selection>& theObjects,