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