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"
7 #include "ConstructionPlugin_Validators.h"
9 #include <Config_PropManager.h>
11 #include <ModelAPI_Session.h>
12 #include <ModelAPI_Document.h>
16 // the only created instance of this plugin
17 static ConstructionPlugin_Plugin* MY_CONSTRUCTION_INSTANCE = new ConstructionPlugin_Plugin();
19 ConstructionPlugin_Plugin::ConstructionPlugin_Plugin()
21 SessionPtr aMgr = ModelAPI_Session::get();
22 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
23 aFactory->registerValidator("ConstructionPlugin_ValidatorPointLines",
24 new ConstructionPlugin_ValidatorPointLines());
26 // register this plugin
27 ModelAPI_Session::get()->registerPlugin(this);
29 // register construction properties
30 Config_PropManager::registerProp("Visualization", "construction_plane_color", "Construction plane color",
31 Config_Prop::Color, ConstructionPlugin_Plane::DEFAULT_COLOR());
34 FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
36 if (theFeatureID == ConstructionPlugin_Point::ID()) {
37 return FeaturePtr(new ConstructionPlugin_Point);
39 else if (theFeatureID == ConstructionPlugin_Axis::ID()) {
40 return FeaturePtr(new ConstructionPlugin_Axis);
42 else if (theFeatureID == ConstructionPlugin_Plane::ID()) {
43 return FeaturePtr(new ConstructionPlugin_Plane);
45 // feature of such kind is not found