Salome HOME
"Initialization" plugin: plugin and it's features stubs created
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Plugin.cpp
index 5c1f39f2f8de2dfc5bc87f1df52371d2fbb9dff3..f06bd7635440f443c99e3bb42532f58711b33bb4 100644 (file)
@@ -1,24 +1,35 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 #include "ConstructionPlugin_Plugin.h"
 #include "ConstructionPlugin_Point.h"
-#include <ModelAPI_PluginManager.h>
+#include "ConstructionPlugin_Axis.h"
+#include "ConstructionPlugin_Plane.h"
+
+#include <ModelAPI_Session.h>
 #include <ModelAPI_Document.h>
 
 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);
 }
 
-boost::shared_ptr<ModelAPI_Feature> ConstructionPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
 {
-  if (theFeatureID == "Point") {
-    return boost::shared_ptr<ModelAPI_Feature>(new ConstructionPlugin_Point);
+  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<ModelAPI_Feature>();
+  return FeaturePtr();
 }