1 // Name : ConstructionAPI_Point.cpp
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "ConstructionAPI_Point.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelHighAPI_Tools.h>
11 //--------------------------------------------------------------------------------------
12 ConstructionAPI_Point::ConstructionAPI_Point(
13 const std::shared_ptr<ModelAPI_Feature> & theFeature)
14 : ModelHighAPI_Interface(theFeature)
19 ConstructionAPI_Point::ConstructionAPI_Point(
20 const std::shared_ptr<ModelAPI_Feature> & theFeature,
21 const ModelHighAPI_Double & theX,
22 const ModelHighAPI_Double & theY,
23 const ModelHighAPI_Double & theZ)
24 : ModelHighAPI_Interface(theFeature)
27 setPoint(theX, theY, theZ);
30 ConstructionAPI_Point::~ConstructionAPI_Point()
35 //--------------------------------------------------------------------------------------
36 void ConstructionAPI_Point::setPoint(const ModelHighAPI_Double & theX,
37 const ModelHighAPI_Double & theY,
38 const ModelHighAPI_Double & theZ)
40 fillAttribute(theX, myx);
41 fillAttribute(theY, myy);
42 fillAttribute(theZ, myz);
47 //--------------------------------------------------------------------------------------
49 const std::shared_ptr<ModelAPI_Document> & thePart,
50 const ModelHighAPI_Double& theX,
51 const ModelHighAPI_Double& theY,
52 const ModelHighAPI_Double& theZ)
54 // TODO(spo): check that thePart is not empty
55 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ConstructionAPI_Point::ID());
56 return PointPtr(new ConstructionAPI_Point(aFeature, theX, theY, theZ));