]> SALOME platform Git repositories - plugins/gmshplugin.git/blob - src/GMSHPlugin/GMSHPlugin_i.cxx
Salome HOME
depot initial V7_2_0
[plugins/gmshplugin.git] / src / GMSHPlugin / GMSHPlugin_i.cxx
1 // Copyright (C) 2012-2013  ALNEOS
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.alneos.com/ or email : contact@alneos.fr
18 //
19 #include "utilities.h"
20
21 #include "GMSHPlugin_Hypothesis_i.hxx"
22 #include "GMSHPlugin_Hypothesis_2D_i.hxx"
23 #include "GMSHPlugin_GMSH_i.hxx"
24 #include "GMSHPlugin_GMSH_2D_i.hxx"
25
26 template <class T> class GMSHPlugin_Creator_i:public HypothesisCreator_i<T>
27 {
28   // as we have 'module GMSHPlugin' in GMSHPlugin_Algorithm.idl
29   virtual std::string GetModuleName() { return "GMSHPlugin"; }
30 };
31
32 //=============================================================================
33 /*!
34  *
35  */
36 //=============================================================================
37
38 extern "C"
39 {
40   GMSHPLUGIN_EXPORT
41   GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
42   {
43     MESSAGE("GetHypothesisCreator " << aHypName);
44
45     GenericHypothesisCreator_i* aCreator = 0;
46
47     // Hypotheses
48
49     // Algorithms
50     if (strcmp(aHypName, "GMSH") == 0)
51       aCreator = new GMSHPlugin_Creator_i<GMSHPlugin_GMSH_i>;
52     else if (strcmp(aHypName, "GMSH_2D") == 0)
53       aCreator = new GMSHPlugin_Creator_i<GMSHPlugin_GMSH_2D_i>;
54     // Hypotheses
55     else if (strcmp(aHypName, "GMSH_Parameters") == 0)
56       aCreator = new GMSHPlugin_Creator_i<GMSHPlugin_Hypothesis_i>;
57     else if (strcmp(aHypName, "GMSH_Parameters_2D") == 0)
58       aCreator = new GMSHPlugin_Creator_i<GMSHPlugin_Hypothesis_2D_i>;
59     else ;
60
61     return aCreator;
62   }
63 }