1 // File: GeomData_Point.cxx
2 // Created: 24 Apr 2014
3 // Author: Mikhail PONIKAROV
5 #include "GeomData_Point.h"
6 #include "Model_Events.h"
7 #include <Events_Loop.h>
11 void GeomData_Point::setValue(const double theX, const double theY, const double theZ)
13 if (myCoords->Value(0) != theX || myCoords->Value(1) != theY || myCoords->Value(2) != theZ) {
14 myCoords->SetValue(0, theX);
15 myCoords->SetValue(1, theY);
16 myCoords->SetValue(2, theZ);
17 static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
18 Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
19 Events_Loop::loop()->send(aMsg);
23 double GeomData_Point::x() const
25 return myCoords->Value(0);
28 double GeomData_Point::y() const
30 return myCoords->Value(1);
33 double GeomData_Point::z() const
35 return myCoords->Value(2);
38 GeomData_Point::GeomData_Point(TDF_Label& theLabel)
40 // check the attribute could be already presented in this doc (after load document)
41 if (!theLabel.FindAttribute(TDataStd_RealArray::GetID(), myCoords)) {
42 // create attribute: not initialized by value yet, just zero
43 myCoords = TDataStd_RealArray::Set(theLabel, 0, 2);