1 // Name : ConstructionAPI_Point.cpp
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "ConstructionAPI_Point.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelAPI_AttributeDouble.h>
11 #include <ModelAPI_Document.h>
12 #include <ModelAPI_Feature.h>
14 #include <ModelHighAPI_Double.h>
15 //--------------------------------------------------------------------------------------
16 ConstructionAPI_Point::ConstructionAPI_Point(
17 const std::shared_ptr<ModelAPI_Feature> & theFeature)
18 : ModelHighAPI_Interface(theFeature)
23 ConstructionAPI_Point::ConstructionAPI_Point(
24 const std::shared_ptr<ModelAPI_Feature> & theFeature,
25 const ModelHighAPI_Double & theX,
26 const ModelHighAPI_Double & theY,
27 const ModelHighAPI_Double & theZ)
28 : ModelHighAPI_Interface(theFeature)
31 setPoint(theX, theY, theZ);
34 ConstructionAPI_Point::~ConstructionAPI_Point()
39 //--------------------------------------------------------------------------------------
40 void ConstructionAPI_Point::setPoint(const ModelHighAPI_Double & theX,
41 const ModelHighAPI_Double & theY,
42 const ModelHighAPI_Double & theZ)
44 theX.fillAttribute(myx);
45 theY.fillAttribute(myy);
46 theZ.fillAttribute(myz);
51 //--------------------------------------------------------------------------------------
52 // TODO(spo): make add* as static functions of the class
54 const std::shared_ptr<ModelAPI_Document> & thePart,
55 const ModelHighAPI_Double& theX,
56 const ModelHighAPI_Double& theY,
57 const ModelHighAPI_Double& theZ)
59 // TODO(spo): check that thePart is not empty
60 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ConstructionAPI_Point::ID());
61 return PointPtr(new ConstructionAPI_Point(aFeature, theX, theY, theZ));