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