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