X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionPlugin%2FConstructionPlugin_Point.cpp;h=b31b3b55217d0b0bd94b538207392dc58d90ba14;hb=f003def34d1a3dd56e87329920d1950f080c58d1;hp=ea613603b9d3a3417b05e78da8bdeb6841ad5db6;hpb=912b947536177180af5bd6d620d84e9ebc05be66;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index ea613603b..b31b3b552 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -1,12 +1,19 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ConstructionPlugin_Point.cxx // Created: 27 Mar 2014 // Author: Mikhail PONIKAROV #include "ConstructionPlugin_Point.h" -#include "ModelAPI_PluginManager.h" +#include "ModelAPI_Session.h" #include "ModelAPI_Document.h" #include "ModelAPI_Data.h" #include "ModelAPI_AttributeDouble.h" +#include +#include +#include + +#include using namespace std; @@ -14,18 +21,27 @@ 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()); } -// this is for debug only -#include -void ConstructionPlugin_Point::execute() +void ConstructionPlugin_Point::execute() { - // TODO: create a real shape for the point using OCC layer - cout<<"X="<real(POINT_ATTR_X)->value()<<" Y="<real(POINT_ATTR_Y)->value() - <<" Z="<real(POINT_ATTR_Z)->value()< aPnt( + new GeomAPI_Pnt(data()->real(ConstructionPlugin_Point::X())->value(), + data()->real(ConstructionPlugin_Point::Y())->value(), + data()->real(ConstructionPlugin_Point::Z())->value())); + + std::shared_ptr aConstr = document()->createConstruction(data()); + aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt)); + setResult(aConstr); }