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
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git]
/
src
/
GeomData
/
GeomData_Dir.cpp
diff --git
a/src/GeomData/GeomData_Dir.cpp
b/src/GeomData/GeomData_Dir.cpp
index 5090a06267f562b7ccc9bb141e6c9b829bf7f05e..d36e8a8f5c84685b7b3d6fbc879ee6aa03ca2fa2 100644
(file)
--- a/
src/GeomData/GeomData_Dir.cpp
+++ b/
src/GeomData/GeomData_Dir.cpp
@@
-1,3
+1,5
@@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: GeomData_Dir.cxx
// Created: 2 Apr 2014
// Author: Mikhail PONIKAROV
// File: GeomData_Dir.cxx
// Created: 2 Apr 2014
// Author: Mikhail PONIKAROV
@@
-5,23
+7,27
@@
#include "GeomData_Dir.h"
#include "GeomAPI_Dir.h"
#include <gp_Dir.hxx>
#include "GeomData_Dir.h"
#include "GeomAPI_Dir.h"
#include <gp_Dir.hxx>
-#include
"Model_Events.h"
-#include <
Events_Loop
.h>
+#include
<ModelAPI_Feature.h>
+#include <
ModelAPI_Data
.h>
using namespace std;
void GeomData_Dir::setValue(const double theX, const double theY, const double theZ)
{
using namespace std;
void GeomData_Dir::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(feature(), anEvent);
- Events_Loop::loop()->send(aMsg);
+ owner()->data()->sendAttributeUpdated(this);
}
}
}
}
+void GeomData_Dir::setValue(const std::shared_ptr<GeomAPI_Dir>& theDir)
+{
+ setValue(theDir->x(), theDir->y(), theDir->z());
+}
+
double GeomData_Dir::x() const
{
return myCoords->Value(0);
double GeomData_Dir::x() const
{
return myCoords->Value(0);
@@
-37,16
+43,16
@@
double GeomData_Dir::z() const
return myCoords->Value(2);
}
return myCoords->Value(2);
}
-
boost
::shared_ptr<GeomAPI_Dir> GeomData_Dir::dir()
+
std
::shared_ptr<GeomAPI_Dir> GeomData_Dir::dir()
{
{
- return
boost::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir
(
- myCoords->Value(0), myCoords->Value(1), myCoords->Value(2)));
+ return
std::shared_ptr<GeomAPI_Dir>
(
+
new GeomAPI_Dir(
myCoords->Value(0), myCoords->Value(1), myCoords->Value(2)));
}
GeomData_Dir::GeomData_Dir(TDF_Label& theLabel)
{
}
GeomData_Dir::GeomData_Dir(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);
}