Salome HOME
Length must not be zero or negative
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Plugin.cpp
index c433491f9f5a0e9fffd7b4dd10e94f9636a2f745..fd5db868fc7443bf50cd3b982f2a15c7b5fa291f 100644 (file)
@@ -1,6 +1,7 @@
 #include "ConstructionPlugin_Plugin.h"
 #include "ConstructionPlugin_Point.h"
-#include <ModelAPI_PluginManager.h>
+
+#include <ModelAPI_Session.h>
 #include <ModelAPI_Document.h>
 
 using namespace std;
@@ -8,17 +9,17 @@ using namespace std;
 // the only created instance of this plugin
 static ConstructionPlugin_Plugin* MY_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);
 }
 
-shared_ptr<ModelAPI_Feature> ConstructionPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
 {
-  if (theFeatureID == "Point") {
-    return shared_ptr<ModelAPI_Feature>(new ConstructionPlugin_Point);
+  if (theFeatureID == CONSTRUCTION_POINT_KIND) {
+    return FeaturePtr(new ConstructionPlugin_Point);
   }
   // feature of such kind is not found
-  return shared_ptr<ModelAPI_Feature>();
+  return FeaturePtr();
 }