Salome HOME
Make the expressions in double attributes and points updated after the parameter...
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Point.cpp
index 9539004b7645ed5ff075cfa952fb4f46fc82753c..b31b3b55217d0b0bd94b538207392dc58d90ba14 100644 (file)
 #include <GeomAlgoAPI_PointBuilder.h>
 #include <GeomAPI_Pnt.h>
 
+#include <Config_PropManager.h>
+
 using namespace std;
 
 ConstructionPlugin_Point::ConstructionPlugin_Point()
 {
 }
 
+const std::string& ConstructionPlugin_Point::getKind()
+{
+  static std::string MY_KIND = ConstructionPlugin_Point::ID();
+  return MY_KIND;
+}
+
 void ConstructionPlugin_Point::initAttributes()
 {
-  data()->addAttribute(POINT_ATTR_X, ModelAPI_AttributeDouble::type());
-  data()->addAttribute(POINT_ATTR_Y, ModelAPI_AttributeDouble::type());
-  data()->addAttribute(POINT_ATTR_Z, ModelAPI_AttributeDouble::type());
+  data()->addAttribute(ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble::typeId());
 }
 
 void ConstructionPlugin_Point::execute()
 {
   std::shared_ptr<GeomAPI_Pnt> aPnt(
-      new GeomAPI_Pnt(data()->real(POINT_ATTR_X)->value(), data()->real(POINT_ATTR_Y)->value(),
-                      data()->real(POINT_ATTR_Z)->value()));
+      new GeomAPI_Pnt(data()->real(ConstructionPlugin_Point::X())->value(),
+                      data()->real(ConstructionPlugin_Point::Y())->value(),
+                      data()->real(ConstructionPlugin_Point::Z())->value()));
 
   std::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction(data());
   aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt));