Salome HOME
version 5_1_4 HOMARD_SRC
[modules/homard.git] / src / HOMARDGUI / HOMARDGUI_Utils.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 //  This library is free software; you can redistribute it and/or
5 //  modify it under the terms of the GNU Lesser General Public
6 //  License as published by the Free Software Foundation; either
7 //  version 2.1 of the License.
8 //
9 //  This library is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 //  Lesser General Public License for more details.
13 //
14 //  You should have received a copy of the GNU Lesser General Public
15 //  License along with this library; if not, write to the Free Software
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19
20 #ifndef HOMARD_H_UTILS
21 #define HOMARD_H_UTILS
22
23
24 #include <SALOMEconfig.h>
25
26 #include <CORBA.h>
27 #include CORBA_CLIENT_HEADER(HOMARD_Cas)
28 #include CORBA_CLIENT_HEADER(HOMARD_Gen)
29
30 #include "SALOMEDSClient_definitions.hxx"
31 #include "SALOME_InteractiveObject.hxx"
32 #include "LightApp_DataOwner.h"
33 #include "SalomeApp_Application.h"
34 #include <SALOME_ListIO.hxx>
35
36 class QString;
37 class QStringList;
38
39 class SUIT_ViewWindow;
40 class SUIT_Desktop;
41 class SUIT_Study;
42 class SUIT_ResourceMgr;
43
44 class CAM_Module;
45
46 class SALOMEDSClient_Study;
47 class SALOMEDSClient_SObject;
48
49 class SalomeApp_Study;
50 class SalomeApp_Module;
51 class LightApp_SelectionMgr;
52
53 namespace HOMARD_UTILS {
54   
55   _PTR(Study)
56   GetCStudy(const SalomeApp_Study* theStudy);
57   SUIT_Study* GetActiveStudy();
58   _PTR(Study) GetActiveStudyDocument();
59
60   void updateObjBrowser();
61   
62   const SALOME_ListIO& selectedIO();    // Function returns a list of SALOME_InteractiveObject's from
63                                         // selection manager in GUI
64
65   int   IObjectCount() ;                // Function returns the number of selected objects
66   
67   Handle(SALOME_InteractiveObject) firstIObject() ;
68                                         // Function returns the first selected object in the list
69                                         // of selected objects
70
71   Handle(SALOME_InteractiveObject) lastIObject() ;
72                                       // Function returns the last selected object in the list
73                                        // of selected objects
74
75   bool isXmgrace(_PTR(SObject)  MonObj);
76   bool isBoundaryDi(_PTR(SObject)  MonObj);
77   bool isZone(_PTR(SObject)  MonObj);
78   bool isHypo(_PTR(SObject)  MonObj);
79   bool isIter(_PTR(SObject)  MonObj);
80   bool isCase(_PTR(SObject)  MonObj);
81   bool isFileMess(_PTR(SObject)  MonObj);
82   bool isFileSummary(_PTR(SObject)  MonObj);
83   bool isObject(_PTR(SObject)  MonObj, QString TypeObject, int option );
84
85   QString ChercheFileDansSelection();
86   QStringList ChercheDansDir (QString direct, QString base, int numIter);
87   void RangeSousTag          (int Tag,QString FileName, int TagFichier, QString Comment,QString FileDir);
88
89   void PushOnHelp(QString monFichierAide);
90
91   QString Transforme(int num);
92
93   void AddNewRoot(int Tag, QString Racine);
94   extern SALOME_ListIO mySelected;
95 }
96
97 #endif // ifndef HOMARD_H_UTILS