Salome HOME
Copyright update 2022
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_HomardUtils.h
1 // Copyright (C) 2011-2022  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, or (at your option) any later version.
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 #ifndef SMESH_HOMARD_H_UTILS
21 #define SMESH_HOMARD_H_UTILS
22
23 #include "SMESH_SMESHGUI.hxx"
24
25 #include <SALOMEconfig.h>
26
27 #include <omniORB4/CORBA.h>
28 //#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
29 #include CORBA_CLIENT_HEADER(SMESH_Homard)
30
31 #include <SALOMEDSClient_definitions.hxx>
32 #include <SALOME_InteractiveObject.hxx>
33 #include <LightApp_DataOwner.h>
34 #include <SalomeApp_Application.h>
35 #include <SALOME_ListIO.hxx>
36 //#include <SALOME_Selection.h>
37 #include <SalomeApp_Module.h>
38
39 #include <med.h>
40
41 #include <qstring.h>
42 #include <vector>
43 #include <set>
44
45 class QString;
46 class QStringList;
47 class QComboBox;
48
49 class SUIT_ViewWindow;
50 class SUIT_Desktop;
51 class SUIT_Study;
52 class SUIT_ResourceMgr;
53
54 class CAM_Module;
55
56 class SALOMEDSClient_Study;
57 class SALOMEDSClient_SObject;
58
59 class SalomeApp_Study;
60 class SalomeApp_Module;
61 class LightApp_SelectionMgr;
62
63 namespace SMESH_HOMARD_UTILS {
64
65   SMESHGUI_EXPORT SUIT_Study* GetActiveStudy();
66   SMESHGUI_EXPORT _PTR(Study) getStudy();
67
68   SMESHGUI_EXPORT void updateObjBrowser();
69
70   // Function returns a list of SALOME_InteractiveObject's from
71   // selection manager in GUI
72   SMESHGUI_EXPORT const SALOME_ListIO& selectedIO();
73
74   // Function returns the number of selected objects
75   SMESHGUI_EXPORT int   IObjectCount();
76
77   // Function returns the first selected object in the list
78   // of selected objects
79   SMESHGUI_EXPORT Handle(SALOME_InteractiveObject) firstIObject() ;
80
81   // Function returns the last selected object in the list
82   // of selected objects
83   SMESHGUI_EXPORT Handle(SALOME_InteractiveObject) lastIObject() ;
84
85   SMESHGUI_EXPORT bool isBoundaryCAO(_PTR(SObject)  MonObj);
86   SMESHGUI_EXPORT bool isBoundaryAn(_PTR(SObject)  MonObj);
87   SMESHGUI_EXPORT bool isBoundaryDi(_PTR(SObject)  MonObj);
88   SMESHGUI_EXPORT bool isCase(_PTR(SObject)  MonObj);
89   SMESHGUI_EXPORT bool isHypo(_PTR(SObject)  MonObj);
90   SMESHGUI_EXPORT bool isIter(_PTR(SObject)  MonObj);
91   SMESHGUI_EXPORT bool isFileType(_PTR(SObject)  MonObj, QString TypeFile);
92   SMESHGUI_EXPORT bool isObject(_PTR(SObject)  MonObj, QString TypeObject, int option );
93
94   extern SALOME_ListIO mySelected;
95 }
96
97 namespace SMESH_HOMARD_QT_COMMUN
98 {
99     SMESHGUI_EXPORT QString PushNomFichier(bool avertir, QString TypeFichier="");
100     SMESHGUI_EXPORT QString LireNomMaillage(QString aFile);
101     SMESHGUI_EXPORT QString LireNomMaillage2(med_idt Medidt,int MeshId);
102
103     SMESHGUI_EXPORT med_idt OuvrirFichier(QString aFile);
104
105     SMESHGUI_EXPORT std::list<QString> GetListeChamps(QString aFile);
106     SMESHGUI_EXPORT std::list<QString> GetListeComposants(QString aFile, QString aChamp);
107
108     SMESHGUI_EXPORT QString SelectionArbreEtude(QString commentaire, int grave );
109     SMESHGUI_EXPORT QString SelectionCasEtude();
110 };
111
112 #endif // ifndef SMESH_HOMARD_H_UTILS