]> 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>
Wed, 10 Aug 2016 14:34:18 +0000 (17:34 +0300)
committerdbv <dbv@opencascade.com>
Wed, 10 Aug 2016 14:59:30 +0000 (17:59 +0300)
Fix for dump FeaturesAPI_Extrusion with nested sketch

src/FeaturesAPI/FeaturesAPI_Extrusion.cpp
src/FeaturesAPI/FeaturesAPI_Extrusion.h

index 75635c73d8ef18bfbb314971921933c0b1bc7a67..525bddd1c6dd5b891b183eb76153a30355727cff 100644 (file)
@@ -179,10 +179,13 @@ void FeaturesAPI_Extrusion::dump(ModelHighAPI_Dumper& theDumper) const
   FeaturePtr aBase = feature();
   const std::string& aDocName = theDumper.name(aBase->document());
 
+  AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_CompositeSketch::SKETCH_ID());
   AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID());
   AttributeSelectionPtr anAttrDirection = aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID());
 
-  theDumper << aBase << " = model.addExtrusion(" << aDocName << ", " << anAttrObjects << ", " << anAttrDirection;
+  theDumper << aBase << " = model.addExtrusion(" << aDocName << ", ";
+  anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects;
+  theDumper << ", " << anAttrDirection;
 
   std::string aCreationMethod = aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value();
 
@@ -202,7 +205,6 @@ void FeaturesAPI_Extrusion::dump(ModelHighAPI_Dumper& theDumper) const
 
   theDumper << ")" << std::endl;
 
-  AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_CompositeSketch::SKETCH_ID());
   if(anAttrSketch->isInitialized()) {
     theDumper << aBase << ".setNestedSketch(" << anAttrSketch << ")";
   }
index e4a31b18c0bcdc65cc2be47b2a0ae62adc7f32e6..9350d981737791046d7e3943c3b9108a8afe538d 100644 (file)
@@ -78,18 +78,17 @@ public:
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_Extrusion();
 
-  INTERFACE_11(FeaturesPlugin_Extrusion::ID(),
-               sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch object */,
+  INTERFACE_10(FeaturesPlugin_Extrusion::ID(),
+               sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
                baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
+               direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
                creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
                toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
                fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
                toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
                toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
                fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
-               fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
-               direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
-               sketchLauncher, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */)
+               fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */)
 
   /// Modify base attribute of the feature.
   FEATURESAPI_EXPORT