From: dbv Date: Fri, 12 Aug 2016 08:50:22 +0000 (+0300) Subject: Issue #1648: Dump Python in the High Level Parameterized Geometry API X-Git-Tag: V_2.5.0~137^2~60 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e27b6a5068103b531008ff9cb324ae19c7d892d5;p=modules%2Fshaper.git Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for FeaturesAPI_Partition --- diff --git a/src/FeaturesAPI/FeaturesAPI_Partition.cpp b/src/FeaturesAPI/FeaturesAPI_Partition.cpp index 2b4515fc2..3580a0997 100644 --- a/src/FeaturesAPI/FeaturesAPI_Partition.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Partition.cpp @@ -6,6 +6,7 @@ #include "FeaturesAPI_Partition.h" +#include #include //================================================================================================== @@ -39,6 +40,17 @@ void FeaturesAPI_Partition::setBase(const std::list& the execute(); } +//================================================================================================== +void FeaturesAPI_Partition::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + const std::string& aDocName = theDumper.name(aBase->document()); + + AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID()); + + theDumper << aBase << " = model.addPartition(" << aDocName << ", " << anAttrObjects << ")" << std::endl; +} + //================================================================================================== PartitionPtr addPartition(const std::shared_ptr& thePart, const std::list& theBaseObjects) diff --git a/src/FeaturesAPI/FeaturesAPI_Partition.h b/src/FeaturesAPI/FeaturesAPI_Partition.h index c88047899..cc7831d8f 100644 --- a/src/FeaturesAPI/FeaturesAPI_Partition.h +++ b/src/FeaturesAPI/FeaturesAPI_Partition.h @@ -14,6 +14,7 @@ #include #include +class ModelHighAPI_Dumper; class ModelHighAPI_Selection; /// \class FeaturesAPI_Partition @@ -41,6 +42,10 @@ public: /// Modify base attribute of the feature. FEATURESAPI_EXPORT void setBase(const std::list& theBaseObjects); + + /// Dump wrapped feature + FEATURESAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; /// Pointer on Partition object.