Salome HOME
Merging with WPdev
[modules/smesh.git] / src / StdMeshers_I / StdMeshers_i.cxx
1 //  SMESH StdMeshers : implementaion of SMESH idl descriptions
2 //
3 //  Copyright (C) 2003  CEA
4 // 
5 //  This library is free software; you can redistribute it and/or 
6 //  modify it under the terms of the GNU Lesser General Public 
7 //  License as published by the Free Software Foundation; either 
8 //  version 2.1 of the License. 
9 // 
10 //  This library is distributed in the hope that it will be useful, 
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 //  Lesser General Public License for more details. 
14 // 
15 //  You should have received a copy of the GNU Lesser General Public 
16 //  License along with this library; if not, write to the Free Software 
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 // 
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 //
22 //
23 //  File   : StdMeshers_i.cxx
24 //  Author : Julia DOROVSKIKH
25 //  Module : SMESH
26 //  $Header$
27
28 #include "SMESH_StdMeshers_I.hxx"
29
30 #include "SMESH_Gen_i.hxx"
31
32 #include "utilities.h"
33
34 #include "StdMeshers_LocalLength_i.hxx"
35 #include "StdMeshers_AutomaticLength_i.hxx"
36 #include "StdMeshers_StartEndLength_i.hxx"
37 #include "StdMeshers_Arithmetic1D_i.hxx"
38 #include "StdMeshers_NumberOfSegments_i.hxx"
39 #include "StdMeshers_Deflection1D_i.hxx"
40 #include "StdMeshers_Propagation_i.hxx"
41 #include "StdMeshers_LengthFromEdges_i.hxx"
42 #include "StdMeshers_QuadranglePreference_i.hxx"
43 #include "StdMeshers_QuadraticMesh_i.hxx"
44 #include "StdMeshers_MaxElementArea_i.hxx"
45 #include "StdMeshers_MaxElementVolume_i.hxx"
46 #include "StdMeshers_NotConformAllowed_i.hxx"
47
48 #include "StdMeshers_ProjectionSource3D_i.hxx"
49 #include "StdMeshers_ProjectionSource2D_i.hxx"
50 #include "StdMeshers_ProjectionSource1D_i.hxx"
51 #include "StdMeshers_NumberOfLayers_i.hxx"
52 #include "StdMeshers_LayerDistribution_i.hxx"
53
54 #include "StdMeshers_Regular_1D_i.hxx"
55 #include "StdMeshers_MEFISTO_2D_i.hxx"
56 #include "StdMeshers_Quadrangle_2D_i.hxx"
57 #include "StdMeshers_Hexa_3D_i.hxx"
58
59 #include "StdMeshers_Projection_1D_2D_3D_i.hxx"
60 #include "StdMeshers_Prism_3D_i.hxx"
61
62
63 template <class T> class StdHypothesisCreator_i:public HypothesisCreator_i<T>
64 {
65   // as we have 'module StdMeshers' in SMESH_BasicHypothesis.idl
66   virtual std::string GetModuleName() { return "StdMeshers"; }
67 };
68
69 //=============================================================================
70 /*!
71  *
72  */
73 //=============================================================================
74
75 extern "C"
76 {
77 STDMESHERS_I_EXPORT
78   GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
79   {
80     MESSAGE("Get HypothesisCreator for " << aHypName);
81
82     GenericHypothesisCreator_i* aCreator = 0;
83
84     // Hypotheses
85     if      (strcmp(aHypName, "LocalLength") == 0)
86       aCreator = new StdHypothesisCreator_i<StdMeshers_LocalLength_i>;
87     else if (strcmp(aHypName, "NumberOfSegments") == 0)
88       aCreator = new StdHypothesisCreator_i<StdMeshers_NumberOfSegments_i>;
89     else if (strcmp(aHypName, "LengthFromEdges") == 0)
90       aCreator = new StdHypothesisCreator_i<StdMeshers_LengthFromEdges_i>;
91     else if (strcmp(aHypName, "NotConformAllowed") == 0)
92       aCreator = new StdHypothesisCreator_i<StdMeshers_NotConformAllowed_i>;
93     else if (strcmp(aHypName, "Propagation") == 0)
94       aCreator = new StdHypothesisCreator_i<StdMeshers_Propagation_i>;
95     else if (strcmp(aHypName, "MaxElementArea") == 0)
96       aCreator = new StdHypothesisCreator_i<StdMeshers_MaxElementArea_i>;
97     else if (strcmp(aHypName, "MaxElementVolume") == 0)
98       aCreator = new StdHypothesisCreator_i<StdMeshers_MaxElementVolume_i>;
99     else if (strcmp(aHypName, "StartEndLength") == 0)
100       aCreator = new StdHypothesisCreator_i<StdMeshers_StartEndLength_i>;
101     else if (strcmp(aHypName, "Deflection1D") == 0)
102       aCreator = new StdHypothesisCreator_i<StdMeshers_Deflection1D_i>;
103     else if (strcmp(aHypName, "Arithmetic1D") == 0)
104       aCreator = new StdHypothesisCreator_i<StdMeshers_Arithmetic1D_i>;
105     else if (strcmp(aHypName, "AutomaticLength") == 0)
106       aCreator = new StdHypothesisCreator_i<StdMeshers_AutomaticLength_i>;
107     else if (strcmp(aHypName, "QuadranglePreference") == 0)
108       aCreator = new StdHypothesisCreator_i<StdMeshers_QuadranglePreference_i>;
109     else if (strcmp(aHypName, "QuadraticMesh") == 0)
110       aCreator = new StdHypothesisCreator_i<StdMeshers_QuadraticMesh_i>;
111     else if (strcmp(aHypName, "ProjectionSource3D") == 0)
112       aCreator = new StdHypothesisCreator_i<StdMeshers_ProjectionSource3D_i>;
113     else if (strcmp(aHypName, "ProjectionSource2D") == 0)
114       aCreator = new StdHypothesisCreator_i<StdMeshers_ProjectionSource2D_i>;
115     else if (strcmp(aHypName, "ProjectionSource1D") == 0)
116       aCreator = new StdHypothesisCreator_i<StdMeshers_ProjectionSource1D_i>;
117     else if (strcmp(aHypName, "NumberOfLayers") == 0)
118       aCreator = new StdHypothesisCreator_i<StdMeshers_NumberOfLayers_i>;
119     else if (strcmp(aHypName, "LayerDistribution") == 0)
120       aCreator = new StdHypothesisCreator_i<StdMeshers_LayerDistribution_i>;
121
122     // Algorithms
123     else if (strcmp(aHypName, "Regular_1D") == 0)
124       aCreator = new StdHypothesisCreator_i<StdMeshers_Regular_1D_i>;
125     else if (strcmp(aHypName, "MEFISTO_2D") == 0)
126       aCreator = new StdHypothesisCreator_i<StdMeshers_MEFISTO_2D_i>;
127     else if (strcmp(aHypName, "Quadrangle_2D") == 0)
128       aCreator = new StdHypothesisCreator_i<StdMeshers_Quadrangle_2D_i>;
129     else if (strcmp(aHypName, "Hexa_3D") == 0)
130       aCreator = new StdHypothesisCreator_i<StdMeshers_Hexa_3D_i>;
131     else if (strcmp(aHypName, "Projection_1D") == 0)
132       aCreator = new StdHypothesisCreator_i<StdMeshers_Projection_1D_i>;
133     else if (strcmp(aHypName, "Projection_2D") == 0)
134       aCreator = new StdHypothesisCreator_i<StdMeshers_Projection_2D_i>;
135     else if (strcmp(aHypName, "Projection_3D") == 0)
136       aCreator = new StdHypothesisCreator_i<StdMeshers_Projection_3D_i>;
137     else if (strcmp(aHypName, "Prism_3D") == 0)
138       aCreator = new StdHypothesisCreator_i<StdMeshers_Prism_3D_i>;
139     else if (strcmp(aHypName, "RadialPrism_3D") == 0)
140       aCreator = new StdHypothesisCreator_i<StdMeshers_RadialPrism_3D_i>;
141     else ;
142
143     return aCreator;
144   }
145 }