Salome HOME
Merge from V6_main 01/04/2013
[modules/med.git] / src / MEDOP / gui / factory.cxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // Author : Guillaume Boulant (EDF) 
21
22 /*!
23  * IMPORTANT NOTE: this file implements the factory interface required
24  * to specify the SALOME GUI part of a module.
25  *
26  * The GUI part of a module is an implementation of the generic class
27  * CAM_Module and must be returned here by a factory function called
28  * createModule().
29  *
30  * The function createModule can be designed to switch between several
31  * configurations, but generally the configuration is statically
32  * defined (at build step). The default configuration could be DefaultGui. The
33  * configuration below is MEDOPModule.
34  */
35
36 #include <MED_version.h>
37 #include "MEDOPModule.hxx"
38 #include "MEDOPGUI.hxx"
39
40 #ifdef __WITH_MEDMEMGUI__
41 #include "MEDGUI.h"
42 #endif
43
44 extern "C" {
45
46   /*! This function is the factory for the GUI Module */
47   MEDOPGUI_EXPORT CAM_Module* createModule()
48   {
49     CAM_Module * medModule;
50
51 #ifdef __WITH_MEDMEMGUI__
52     medModule = new MedGUI();
53 #else    
54     medModule = new MEDOPModule();
55 #endif
56
57     return medModule;
58   }
59
60   /*! This function specifies the version of the module to be displayed in the about dialog box */
61   MEDOPGUI_EXPORT char* getModuleVersion() {
62     return (char*)SALOMEMED_VERSION_STR;
63   }
64
65 }