Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue #251. Append Export/Import NewGeom commands in the SALOME desktop.
[modules/shaper.git]
/
src
/
GeomData
/
GeomData_Point.cpp
diff --git
a/src/GeomData/GeomData_Point.cpp
b/src/GeomData/GeomData_Point.cpp
index da6299703174b694c2d95b179b905a738c2dfc23..61c92e12bbed4730cae31908d8eb7e781168efd0 100644
(file)
--- a/
src/GeomData/GeomData_Point.cpp
+++ b/
src/GeomData/GeomData_Point.cpp
@@
-3,21
+3,20
@@
// Author: Mikhail PONIKAROV
#include "GeomData_Point.h"
// Author: Mikhail PONIKAROV
#include "GeomData_Point.h"
-#include "Model_Events.h"
-#include <Events_Loop.h>
#include <GeomAPI_Pnt.h>
#include <GeomAPI_Pnt.h>
+#include <ModelAPI_Feature.h>
+#include <ModelAPI_Data.h>
using namespace std;
void GeomData_Point::setValue(const double theX, const double theY, const double theZ)
{
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);
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<GeomAPI_Pnt> GeomData_Point::pnt()
{
boost::shared_ptr<GeomAPI_Pnt> GeomData_Point::pnt()
{
- boost::shared_ptr<GeomAPI_Pnt> aResult(
new GeomAPI_Pnt(
- myCoords->Value(0), myCoords->Value(1), myCoords->Value(2)));
+ boost::shared_ptr<GeomAPI_Pnt> aResult(
+
new GeomAPI_Pnt(
myCoords->Value(0), myCoords->Value(1), myCoords->Value(2)));
return aResult;
}
GeomData_Point::GeomData_Point(TDF_Label& theLabel)
{
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);
}
// create attribute: not initialized by value yet, just zero
myCoords = TDataStd_RealArray::Set(theLabel, 0, 2);
}