Salome HOME
Sketch line feature based on points attributes
[modules/shaper.git] / src / GeomData / GeomData_Point2D.cpp
1 // File:        GeomData_Point2D.cxx
2 // Created:     24 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #include "GeomData_Point2D.h"
6
7 using namespace std;
8
9 void GeomData_Point2D::setValue(const double theX, const double theY)
10 {
11   myCoords->SetValue(0, theX);
12   myCoords->SetValue(1, theY);
13 }
14
15 double GeomData_Point2D::x() const
16 {
17   return myCoords->Value(0);
18 }
19
20 double GeomData_Point2D::y() const
21 {
22   return myCoords->Value(1);
23 }
24
25 GeomData_Point2D::GeomData_Point2D(TDF_Label& theLabel)
26 {
27   // check the attribute could be already presented in this doc (after load document)
28   if (!theLabel.FindAttribute(TDataStd_RealArray::GetID(), myCoords)) {
29     // create attribute: not initialized by value yet, just zero
30     myCoords = TDataStd_RealArray::Set(theLabel, 0, 1);
31   }
32 }