Salome HOME
ae27696a21b1bc98a1cb6080b587f8c6e83dc523
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_HypothesesUtils.h
1 // SMESH SMESHGUI : GUI for SMESH component
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 // File   : SMESHGUI_HypothesesUtils.h
22 // Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
23 //
24
25 #ifndef SMESHGUI_HYPOTHESESUTILS_H
26 #define SMESHGUI_HYPOTHESESUTILS_H
27
28 // SMESH includes
29 #include "SMESH_SMESHGUI.hxx"
30
31 // Qt includes
32 #include <QString>
33 #include <QStringList>
34
35 // SALOME GUI includes
36 #include <SALOME_InteractiveObject.hxx>
37
38 // SALOME KERNEL includes
39 #include <SALOMEDSClient_definitions.hxx>
40
41 // IDL includes
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(SMESH_Mesh)
44 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
45
46 // STL includes
47 #include <vector>
48
49 class HypothesisData;
50 class HypothesesSet;
51 class SMESHGUI_GenericHypothesisCreator;
52 class SALOMEDSClient_SObject;
53 class algo_error_array;
54
55 namespace SMESH
56 {
57   SMESHGUI_EXPORT
58   void InitAvailableHypotheses();
59
60   SMESHGUI_EXPORT
61   QStringList GetAvailableHypotheses( const bool, 
62                                       const int = -1, 
63                                       const bool = false,
64                                       const bool = true);
65   SMESHGUI_EXPORT
66   QStringList GetHypothesesSets();
67
68   SMESHGUI_EXPORT
69   HypothesesSet* GetHypothesesSet( const QString& );
70
71   SMESHGUI_EXPORT
72   HypothesisData* GetHypothesisData( const QString& );
73
74   SMESHGUI_EXPORT
75   bool IsAvailableHypothesis( const HypothesisData*,
76                               const QString&,
77                               bool& );
78
79   SMESHGUI_EXPORT
80   bool IsCompatibleAlgorithm( const HypothesisData*,
81                               const HypothesisData* );
82
83   SMESHGUI_EXPORT
84   SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
85
86   SMESHGUI_EXPORT
87   SMESH::SMESH_Hypothesis_ptr CreateHypothesis( const QString&,
88                                                 const QString&,
89                                                 const bool = false);
90
91   SMESHGUI_EXPORT
92   bool AddHypothesisOnMesh( SMESH::SMESH_Mesh_ptr, SMESH::SMESH_Hypothesis_ptr );
93
94   SMESHGUI_EXPORT
95   bool AddHypothesisOnSubMesh( SMESH::SMESH_subMesh_ptr, SMESH::SMESH_Hypothesis_ptr );
96
97   SMESHGUI_EXPORT
98   bool RemoveHypothesisOrAlgorithmOnMesh( const Handle(SALOME_InteractiveObject)& );
99
100   SMESHGUI_EXPORT
101   bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject),
102                                           SMESH::SMESH_Hypothesis_ptr );
103
104   typedef std::vector<_PTR(SObject)> SObjectList;
105   SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr );
106
107   SMESHGUI_EXPORT
108   QString GetMessageOnAlgoStateErrors( const algo_error_array& );
109 }
110
111 #endif // SMESHGUI_HYPOTHESESUTILS_H