X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FConstructionPlugin%2FConstructionPlugin_Point.cpp;h=231e54fb2cddaa70bbcfbeb0b7d9f0adfe269791;hb=ec9278ffafa6d20d7efd4f9e5be9bdcfa1d6ed0d;hp=9539004b7645ed5ff075cfa952fb4f46fc82753c;hpb=7bf19255421b34594c7b0a76d0ce28166d0ce895;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index 9539004b7..231e54fb2 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -13,26 +13,43 @@ #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::type()); + data()->addAttribute(ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble::type()); + data()->addAttribute(ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble::type()); } void ConstructionPlugin_Point::execute() { std::shared_ptr 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 aConstr = document()->createConstruction(data()); aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt)); setResult(aConstr); } + +void ConstructionPlugin_Point::customisePresentation(AISObjectPtr thePrs) +{ + std::vector aRGB = Config_PropManager::color("Visualization", "construction_point_color", + ConstructionPlugin_Point::DEFAULT_COLOR()); + thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]); + thePrs->redisplay(); +}