X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionPlugin%2FConstructionPlugin_Plugin.cpp;h=c60c022b4311028afd31a9c801159ed0d1158822;hb=48a4bd38c2b9d1b6b51ebca992a5eab30e85d99b;hp=a825c5608e0a96cc95a2a453623bc65088706c6e;hpb=2e3e7b15bec99425564665f1e58fa8c013b6ec3c;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp index a825c5608..c60c022b4 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp @@ -1,28 +1,41 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + #include "ConstructionPlugin_Plugin.h" #include "ConstructionPlugin_Point.h" -#include "ConstructionPlugin_Extrusion.h" +#include "ConstructionPlugin_Axis.h" +#include "ConstructionPlugin_Plane.h" + +#include -#include +#include #include using namespace std; // the only created instance of this plugin -static ConstructionPlugin_Plugin* MY_INSTANCE = new ConstructionPlugin_Plugin(); +static ConstructionPlugin_Plugin* MY_CONSTRUCTION_INSTANCE = new ConstructionPlugin_Plugin(); -ConstructionPlugin_Plugin::ConstructionPlugin_Plugin() +ConstructionPlugin_Plugin::ConstructionPlugin_Plugin() { // register this plugin - ModelAPI_PluginManager::get()->registerPlugin(this); + ModelAPI_Session::get()->registerPlugin(this); + + // register construction properties + Config_PropManager::registerProp("Visualization", "construction_plane_color", "Construction plane color", + Config_Prop::Color, ConstructionPlugin_Plane::DEFAULT_COLOR()); } -boost::shared_ptr ConstructionPlugin_Plugin::createFeature(string theFeatureID) +FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID) { - if (theFeatureID == "Point") { - return boost::shared_ptr(new ConstructionPlugin_Point); - } else if (theFeatureID == "Extrusion") { - return boost::shared_ptr(new ConstructionPlugin_Extrusion); + if (theFeatureID == ConstructionPlugin_Point::ID()) { + return FeaturePtr(new ConstructionPlugin_Point); + } + else if (theFeatureID == ConstructionPlugin_Axis::ID()) { + return FeaturePtr(new ConstructionPlugin_Axis); + } + else if (theFeatureID == ConstructionPlugin_Plane::ID()) { + return FeaturePtr(new ConstructionPlugin_Plane); } // feature of such kind is not found - return boost::shared_ptr(); + return FeaturePtr(); }