Salome HOME
Color preferences for the imported feature.
[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_point_color", "Construction point color",
25                                    Config_Prop::Color, CONSTRUCTION_POINT_COLOR);
26   Config_PropManager::registerProp("Visualization", "construction_axis_color", "Construction axis color",
27                                    Config_Prop::Color, CONSTRUCTION_AXIS_COLOR);
28   Config_PropManager::registerProp("Visualization", "construction_plane_color", "Construction plane color",
29                                    Config_Prop::Color, CONSTRUCTION_PLANE_COLOR);
30 }
31
32 FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
33 {
34   if (theFeatureID == CONSTRUCTION_POINT_KIND) {
35     return FeaturePtr(new ConstructionPlugin_Point);
36   }
37   else if (theFeatureID == CONSTRUCTION_AXIS_KIND) {
38     return FeaturePtr(new ConstructionPlugin_Axis);
39   }
40   else if (theFeatureID == CONSTRUCTION_PLANE_KIND) {
41     return FeaturePtr(new ConstructionPlugin_Plane);
42   }
43   // feature of such kind is not found
44   return FeaturePtr();
45 }