Salome HOME
Merge Dev_2.1.0 with PythonAPI branch
[modules/shaper.git] / src / ConnectorPlugin / ConnectorPlugin.py
1 ## @package Plugins
2 #  Python plugin for exporting entities into Salome's GEOM module
3 #  Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4
5 import ModelAPI
6
7 from ConnectorPlugin_ExportFeature import ExportFeature
8
9 ## @ingroup Plugins
10 #  The main class for management the construction features as plugin.
11 class ConnectorPlugin(ModelAPI.ModelAPI_Plugin):
12
13     ## The constructor.
14     def __init__(self):
15         ModelAPI.ModelAPI_Plugin.__init__(self)
16         pass
17
18     ## Creates the feature objects of this plugin by the feature string ID.
19     def createFeature(self, theFeatureID):
20         if theFeatureID == ExportFeature.ID():
21             return ExportFeature().__disown__()
22         else:
23             print "ConnectorPlugin: No such feature %s" % theFeatureID
24
25 ## The plugin created on module importing (from c++)
26 plugin = ConnectorPlugin()
27 ## Main session of the application
28 aSession = ModelAPI.ModelAPI_Session.get()
29 aSession.registerPlugin(plugin)