Salome HOME
Update copyrights
[modules/shaper.git] / src / GDMLAPI / GDMLAPI_ConeSegment.cpp
index f37e931bd62342444c73aaef36f44d65a870477b..3492f7449025de96c57ca861503b3b1929bb31a6 100644 (file)
@@ -1,11 +1,25 @@
-// Copyright (C) 2014-2016 CEA/DEN, EDF R&D -->
-
-// File:        GDMLAPI_ConeSegment.cpp
-// Created:     29 Nov. 2016
-// Author:      Clarisse Genrault
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include "GDMLAPI_ConeSegment.h"
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
@@ -33,7 +47,6 @@ GDMLAPI_ConeSegment::GDMLAPI_ConeSegment(const std::shared_ptr<ModelAPI_Feature>
 //==================================================================================================
 GDMLAPI_ConeSegment::~GDMLAPI_ConeSegment()
 {
-
 }
 
 //==================================================================================================
@@ -56,6 +69,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,