1 // File: GeomData_Dir.cxx
3 // Author: Mikhail PONIKAROV
5 #include "GeomData_Dir.h"
6 #include "GeomAPI_Dir.h"
11 void GeomData_Dir::setValue(const double theX, const double theY, const double theZ)
13 myCoords->SetValue(0, theX);
14 myCoords->SetValue(1, theY);
15 myCoords->SetValue(2, theZ);
18 double GeomData_Dir::x() const
20 return myCoords->Value(0);
23 double GeomData_Dir::y() const
25 return myCoords->Value(1);
28 double GeomData_Dir::z() const
30 return myCoords->Value(2);
33 boost::shared_ptr<GeomAPI_Dir> GeomData_Dir::dir()
35 return boost::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(
36 myCoords->Value(0), myCoords->Value(1), myCoords->Value(2)));
39 GeomData_Dir::GeomData_Dir(TDF_Label& theLabel)
41 // check the attribute could be already presented in this doc (after load document)
42 if (!theLabel.FindAttribute(TDataStd_RealArray::GetID(), myCoords)) {
43 // create attribute: not initialized by value yet, just zero
44 myCoords = TDataStd_RealArray::Set(theLabel, 0, 2);