Salome HOME
Issue #2120: Crash when creating an arc passing through the arc connected to both...
[modules/shaper.git] / src / GDMLAPI / GDMLAPI_ConeSegment.cpp
index f37e931bd62342444c73aaef36f44d65a870477b..3bdfa66dad6051757f37d6a86ae9469c78ee86fb 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "GDMLAPI_ConeSegment.h"
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
@@ -33,7 +34,6 @@ GDMLAPI_ConeSegment::GDMLAPI_ConeSegment(const std::shared_ptr<ModelAPI_Feature>
 //==================================================================================================
 GDMLAPI_ConeSegment::~GDMLAPI_ConeSegment()
 {
-
 }
 
 //==================================================================================================
@@ -56,6 +56,28 @@ void GDMLAPI_ConeSegment::setAttributes(const ModelHighAPI_Double& theRMin1,
   execute();
 }
 
+//==================================================================================================
+void GDMLAPI_ConeSegment::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+  const std::string& aDocName = theDumper.name(aBase->document());
+
+  theDumper << aBase << " = model.addConeSegment(" << aDocName;
+
+  AttributeDoublePtr anAttrRMin1 = aBase->real(GDMLPlugin_ConeSegment::RMIN1_ID());
+  AttributeDoublePtr anAttrRMax1 = aBase->real(GDMLPlugin_ConeSegment::RMAX1_ID());
+  AttributeDoublePtr anAttrRMin2 = aBase->real(GDMLPlugin_ConeSegment::RMIN2_ID());
+  AttributeDoublePtr anAttrRMax2 = aBase->real(GDMLPlugin_ConeSegment::RMAX2_ID());
+  AttributeDoublePtr anAttrZ = aBase->real(GDMLPlugin_ConeSegment::Z_ID());
+  AttributeDoublePtr anAttrStartPhi = aBase->real(GDMLPlugin_ConeSegment::STARTPHI_ID());
+  AttributeDoublePtr anAttrDeltaPhi = aBase->real(GDMLPlugin_ConeSegment::DELTAPHI_ID());
+  theDumper << ", " << anAttrRMin1 << ", " << anAttrRMax1;
+  theDumper << ", " << anAttrRMin2 << ", " << anAttrRMax2;
+  theDumper << ", " << anAttrZ << ", " << anAttrStartPhi << " , " << anAttrDeltaPhi;
+
+  theDumper << ")" << std::endl;
+}
+
 //==================================================================================================
 ConeSegmentPtr addConeSegment(const std::shared_ptr<ModelAPI_Document>& thePart,
                               const ModelHighAPI_Double& theRMin1,