X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionPlugin%2FConstructionPlugin_Point.cpp;h=c164e44a40225855d89111b0ed14b17be1a45e2e;hb=eef14b29d313b9dd16453d12f20aa02383ee139c;hp=5a879d49d7df64f9aaace7e1251898cdd8e9c7c7;hpb=ea1b22a9e8c01d6a0db25efc6a3a87735823dfdb;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index 5a879d49d..c164e44a4 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -1,9 +1,11 @@ +// 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" @@ -11,27 +13,45 @@ #include #include +#include + 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() +void ConstructionPlugin_Point::execute() { - boost::shared_ptr aPnt(new GeomAPI_Pnt( - data()->real(POINT_ATTR_X)->value(), - data()->real(POINT_ATTR_Y)->value(), - data()->real(POINT_ATTR_Z)->value())); + std::shared_ptr aPnt( + new GeomAPI_Pnt(data()->real(ConstructionPlugin_Point::X())->value(), + data()->real(ConstructionPlugin_Point::Y())->value(), + data()->real(ConstructionPlugin_Point::Z())->value())); - boost::shared_ptr aConstr = document()->createConstruction(data()); + std::shared_ptr aConstr = document()->createConstruction(data()); aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt)); setResult(aConstr); } + +bool ConstructionPlugin_Point::customisePresentation(ResultPtr theResult, + AISObjectPtr thePrs, + std::shared_ptr theDefaultPrs) +{ + bool isCustomized = theDefaultPrs.get() != NULL && + theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs); + //thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol + return true; +}