X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FGeomData%2FGeomData_Dir.cpp;h=b1378d1710ac1a5839ffe32fc38dc45567151dcd;hb=65b511870adccd85f3cf65e1b80466045abc1608;hp=d36e8a8f5c84685b7b3d6fbc879ee6aa03ca2fa2;hpb=7bf19255421b34594c7b0a76d0ce28166d0ce895;p=modules%2Fshaper.git diff --git a/src/GeomData/GeomData_Dir.cpp b/src/GeomData/GeomData_Dir.cpp index d36e8a8f5..b1378d171 100644 --- a/src/GeomData/GeomData_Dir.cpp +++ b/src/GeomData/GeomData_Dir.cpp @@ -5,13 +5,12 @@ // Author: Mikhail PONIKAROV #include "GeomData_Dir.h" -#include "GeomAPI_Dir.h" +#include +#include #include #include #include -using namespace std; - void GeomData_Dir::setValue(const double theX, const double theY, const double theZ) { if (!myIsInitialized || myCoords->Value(0) != theX || myCoords->Value(1) != theY @@ -49,11 +48,23 @@ std::shared_ptr GeomData_Dir::dir() new GeomAPI_Dir(myCoords->Value(0), myCoords->Value(1), myCoords->Value(2))); } +std::shared_ptr GeomData_Dir::xyz() +{ + return std::shared_ptr( + new GeomAPI_XYZ(myCoords->Value(0), myCoords->Value(1), myCoords->Value(2))); +} + GeomData_Dir::GeomData_Dir(TDF_Label& theLabel) { - myIsInitialized = theLabel.FindAttribute(TDataStd_RealArray::GetID(), myCoords) == Standard_True; + myLab = theLabel; + reinit(); +} + +void GeomData_Dir::reinit() +{ + myIsInitialized = myLab.FindAttribute(TDataStd_RealArray::GetID(), myCoords) == Standard_True; if (!myIsInitialized) { // create attribute: not initialized by value yet, just zero - myCoords = TDataStd_RealArray::Set(theLabel, 0, 2); + myCoords = TDataStd_RealArray::Set(myLab, 0, 2); } }