]> SALOME platform Git repositories - modules/shaper.git/blob - src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp
Salome HOME
c60c022b4311028afd31a9c801159ed0d1158822
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Plugin.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #include "ConstructionPlugin_Plugin.h"
4 #include "ConstructionPlugin_Point.h"
5 #include "ConstructionPlugin_Axis.h"
6 #include "ConstructionPlugin_Plane.h"
7
8 #include <Config_PropManager.h>
9
10 #include <ModelAPI_Session.h>
11 #include <ModelAPI_Document.h>
12
13 using namespace std;
14
15 // the only created instance of this plugin
16 static ConstructionPlugin_Plugin* MY_CONSTRUCTION_INSTANCE = new ConstructionPlugin_Plugin();
17
18 ConstructionPlugin_Plugin::ConstructionPlugin_Plugin()
19 {
20   // register this plugin
21   ModelAPI_Session::get()->registerPlugin(this);
22
23   // register construction properties
24   Config_PropManager::registerProp("Visualization", "construction_plane_color", "Construction plane color",
25                                    Config_Prop::Color, ConstructionPlugin_Plane::DEFAULT_COLOR());
26 }
27
28 FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
29 {
30   if (theFeatureID == ConstructionPlugin_Point::ID()) {
31     return FeaturePtr(new ConstructionPlugin_Point);
32   }
33   else if (theFeatureID == ConstructionPlugin_Axis::ID()) {
34     return FeaturePtr(new ConstructionPlugin_Axis);
35   }
36   else if (theFeatureID == ConstructionPlugin_Plane::ID()) {
37     return FeaturePtr(new ConstructionPlugin_Plane);
38   }
39   // feature of such kind is not found
40   return FeaturePtr();
41 }