X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomData%2FGeomData_Point.cpp;h=61c92e12bbed4730cae31908d8eb7e781168efd0;hb=d22fc665c79c31c9eea0625e04c2e941adfdf7be;hp=da6299703174b694c2d95b179b905a738c2dfc23;hpb=98be939e3a6c58498b6dd763301d3e5fa50bf397;p=modules%2Fshaper.git diff --git a/src/GeomData/GeomData_Point.cpp b/src/GeomData/GeomData_Point.cpp index da6299703..61c92e12b 100644 --- a/src/GeomData/GeomData_Point.cpp +++ b/src/GeomData/GeomData_Point.cpp @@ -3,21 +3,20 @@ // Author: Mikhail PONIKAROV #include "GeomData_Point.h" -#include "Model_Events.h" -#include #include +#include +#include using namespace std; void GeomData_Point::setValue(const double theX, const double theY, const double theZ) { - if (myCoords->Value(0) != theX || myCoords->Value(1) != theY || myCoords->Value(2) != theZ) { + if (!myIsInitialized || myCoords->Value(0) != theX || myCoords->Value(1) != theY + || myCoords->Value(2) != theZ) { myCoords->SetValue(0, theX); myCoords->SetValue(1, theY); myCoords->SetValue(2, theZ); - static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED); - Model_FeatureUpdatedMessage aMsg(owner(), anEvent); - Events_Loop::loop()->send(aMsg); + owner()->data()->sendAttributeUpdated(this); } } @@ -43,15 +42,15 @@ double GeomData_Point::z() const boost::shared_ptr GeomData_Point::pnt() { - boost::shared_ptr aResult(new GeomAPI_Pnt( - myCoords->Value(0), myCoords->Value(1), myCoords->Value(2))); + boost::shared_ptr aResult( + new GeomAPI_Pnt(myCoords->Value(0), myCoords->Value(1), myCoords->Value(2))); return aResult; } GeomData_Point::GeomData_Point(TDF_Label& theLabel) { - // check the attribute could be already presented in this doc (after load document) - if (!theLabel.FindAttribute(TDataStd_RealArray::GetID(), myCoords)) { + myIsInitialized = theLabel.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); }