Salome HOME
Issue #2120: Crash when creating an arc passing through the arc connected to both...
[modules/shaper.git] / src / PrimitivesPlugin / PrimitivesPlugin_Plugin.cpp
1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D -->
2
3 // File:        PrimitivesPlugin_Plugin.hxx
4 // Created:     29 Mar 2016
5 // Author:      Clarisse Genrault (CEA)
6
7 #include <PrimitivesPlugin_Plugin.h>
8
9 #include <PrimitivesPlugin_Box.h>
10 #include <PrimitivesPlugin_Cylinder.h>
11 #include <ModelAPI_Session.h>
12
13 #include <string>
14 #include <memory>
15 #include <iostream>
16
17 // the only created instance of this plugin
18 static PrimitivesPlugin_Plugin* MY_PRIMITIVES_INSTANCE = new PrimitivesPlugin_Plugin();
19
20 PrimitivesPlugin_Plugin::PrimitivesPlugin_Plugin()
21 {
22   // register this plugin
23   ModelAPI_Session::get()->registerPlugin(this);
24 }
25
26 FeaturePtr PrimitivesPlugin_Plugin::createFeature(std::string theFeatureID)
27 {
28   if (theFeatureID == PrimitivesPlugin_Box::ID()) {
29     return FeaturePtr(new PrimitivesPlugin_Box);
30   } else if (theFeatureID == PrimitivesPlugin_Cylinder::ID()) {
31     return FeaturePtr(new PrimitivesPlugin_Cylinder);
32   }
33   // feature of such kind is not found
34   return FeaturePtr();
35 }