1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D -->
3 // File: GDMLAPI_ConeSegment.cpp
4 // Created: 29 Nov. 2016
5 // Author: Clarisse Genrault
7 #include "GDMLAPI_ConeSegment.h"
9 #include <ModelHighAPI_Tools.h>
11 //==================================================================================================
12 GDMLAPI_ConeSegment::GDMLAPI_ConeSegment(const std::shared_ptr<ModelAPI_Feature>& theFeature)
13 : ModelHighAPI_Interface(theFeature)
18 //==================================================================================================
19 GDMLAPI_ConeSegment::GDMLAPI_ConeSegment(const std::shared_ptr<ModelAPI_Feature>& theFeature,
20 const ModelHighAPI_Double& theRMin1,
21 const ModelHighAPI_Double& theRMax1,
22 const ModelHighAPI_Double& theRMin2,
23 const ModelHighAPI_Double& theRMax2,
24 const ModelHighAPI_Double& theZ,
25 const ModelHighAPI_Double& theStartPhi,
26 const ModelHighAPI_Double& theDeltaPhi)
27 : ModelHighAPI_Interface(theFeature)
30 setAttributes(theRMin1, theRMax1, theRMin2, theRMax2, theZ, theStartPhi, theDeltaPhi);
33 //==================================================================================================
34 GDMLAPI_ConeSegment::~GDMLAPI_ConeSegment()
39 //==================================================================================================
40 void GDMLAPI_ConeSegment::setAttributes(const ModelHighAPI_Double& theRMin1,
41 const ModelHighAPI_Double& theRMax1,
42 const ModelHighAPI_Double& theRMin2,
43 const ModelHighAPI_Double& theRMax2,
44 const ModelHighAPI_Double& theZ,
45 const ModelHighAPI_Double& theStartPhi,
46 const ModelHighAPI_Double& theDeltaPhi)
48 fillAttribute(theRMin1, rmin1());
49 fillAttribute(theRMax1, rmax1());
50 fillAttribute(theRMin2, rmin2());
51 fillAttribute(theRMax2, rmax2());
52 fillAttribute(theZ, z());
53 fillAttribute(theStartPhi, startphi());
54 fillAttribute(theDeltaPhi, deltaphi());
59 //==================================================================================================
60 ConeSegmentPtr addConeSegment(const std::shared_ptr<ModelAPI_Document>& thePart,
61 const ModelHighAPI_Double& theRMin1,
62 const ModelHighAPI_Double& theRMax1,
63 const ModelHighAPI_Double& theRMin2,
64 const ModelHighAPI_Double& theRMax2,
65 const ModelHighAPI_Double& theZ,
66 const ModelHighAPI_Double& theStartPhi,
67 const ModelHighAPI_Double& theDeltaPhi)
69 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(GDMLAPI_ConeSegment::ID());
70 return ConeSegmentPtr(new GDMLAPI_ConeSegment(aFeature, theRMin1, theRMax1, theRMin2, theRMax2,
71 theZ, theStartPhi, theDeltaPhi));