]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1648: Dump Python in the High Level Parameterized Geometry API
authordbv <dbv@opencascade.com>
Mon, 15 Aug 2016 11:02:46 +0000 (14:02 +0300)
committerdbv <dbv@opencascade.com>
Mon, 15 Aug 2016 11:03:15 +0000 (14:03 +0300)
Dump for FeaturesAPI_RemoveSubShapes

src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp
src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h

index 4d0726effad4865eb9d5b1e15d591cfc3e7241e3..d7418c52bffac018a719cb7c9278525df1d64ab3 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "FeaturesAPI_RemoveSubShapes.h"
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
@@ -49,6 +50,19 @@ void FeaturesAPI_RemoveSubShapes::setSubShapesToKeep(const std::list<ModelHighAP
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_RemoveSubShapes::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+  const std::string& aDocName = theDumper.name(aBase->document());
+
+  AttributeSelectionPtr anAttrBaseShape = aBase->selection(FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID());
+  AttributeSelectionListPtr anAttrSubShapes = aBase->selectionList(FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID());
+
+  theDumper << aBase << " = model.addRemoveSubShapes(" << aDocName << ", " << anAttrBaseShape << ")" << std::endl;
+  theDumper << aDocName << ".setSubShapesToKeep(" << anAttrSubShapes << ")" << std::endl;
+}
+
 //==================================================================================================
 RemoveSubShapesPtr addRemoveSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
                                       const ModelHighAPI_Selection& theBase)
index d4de1dcc27d60e0585f834dcb58555d66874d4c0..b6e4d587e51b388db813042e72a807ddc09282c7 100644 (file)
@@ -14,6 +14,7 @@
 #include <ModelHighAPI_Interface.h>
 #include <ModelHighAPI_Macro.h>
 
+class ModelHighAPI_Dumper;
 class ModelHighAPI_Selection;
 
 /// \class FeaturesAPI_RemoveSubShapes
@@ -46,6 +47,10 @@ public:
   /// Modify tools attribute of the feature.
   FEATURESAPI_EXPORT
   void setSubShapesToKeep(const std::list<ModelHighAPI_Selection>& theSubShapes);
+
+  /// Dump wrapped feature
+  FEATURESAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
 };
 
 /// Pointer on RemoveSubShapes object.