1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #include "ConstructionPlugin_Plugin.h"
4 #include "ConstructionPlugin_Point.h"
5 #include "ConstructionPlugin_Axis.h"
6 #include "ConstructionPlugin_Plane.h"
8 #include <Config_PropManager.h>
10 #include <ModelAPI_Session.h>
11 #include <ModelAPI_Document.h>
15 // the only created instance of this plugin
16 static ConstructionPlugin_Plugin* MY_CONSTRUCTION_INSTANCE = new ConstructionPlugin_Plugin();
18 ConstructionPlugin_Plugin::ConstructionPlugin_Plugin()
20 // register this plugin
21 ModelAPI_Session::get()->registerPlugin(this);
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);
32 FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
34 if (theFeatureID == CONSTRUCTION_POINT_KIND) {
35 return FeaturePtr(new ConstructionPlugin_Point);
37 else if (theFeatureID == CONSTRUCTION_AXIS_KIND) {
38 return FeaturePtr(new ConstructionPlugin_Axis);
40 else if (theFeatureID == CONSTRUCTION_PLANE_KIND) {
41 return FeaturePtr(new ConstructionPlugin_Plane);
43 // feature of such kind is not found