Salome HOME
yfr : merge 1.2
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_StudyAPI.h
1 //  SMESH SMESHGUI : GUI for SMESH component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SMESHGUI_StudyAPI.h
25 //  Author : Yves FRICAUD 
26 //  Module : SMESH
27 //  $Header: 
28
29 #ifndef _INCLUDE_SMESHGUI_StudyAPI_
30 #define _INCLUDE_SMESHGUI_StudyAPI_
31
32 // IDL Headers
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Gen)
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
36 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
37 #include CORBA_SERVER_HEADER(GEOM_Shape)
38 #include CORBA_SERVER_HEADER(SALOMEDS)
39 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
40         
41 class SMESH_subMesh_ptr;
42
43 class SMESHGUI_StudyAPI {
44
45   public:
46
47   SMESHGUI_StudyAPI ();
48
49   SMESHGUI_StudyAPI ( SALOMEDS::Study_ptr aStudy, SMESH::SMESH_Gen_ptr Gen);  
50
51   ~SMESHGUI_StudyAPI ();
52
53   // Adding in Study
54   CORBA::Object_ptr     StringToIOR(const char* IOR);
55
56   SALOMEDS::SObject_ptr AddNewMesh        (SMESH::SMESH_Mesh_ptr M);
57   
58   SALOMEDS::SObject_ptr AddNewHypothesis  (SMESH::SMESH_Hypothesis_ptr H);
59   SALOMEDS::SObject_ptr AddNewAlgorithms  (SMESH::SMESH_Hypothesis_ptr H);
60
61   SALOMEDS::SObject_ptr AddSubMeshOnShape (SALOMEDS::SObject_ptr SO_Mesh, SMESH::SMESH_subMesh_ptr SM, GEOM::shape_type ST);
62
63   SALOMEDS::SObject_ptr AddSubMeshOnShape (SALOMEDS::SObject_ptr SO_Mesh, SALOMEDS::SObject_ptr SO_GeomShape, SMESH::SMESH_subMesh_ptr SM, GEOM::shape_type ST);
64
65   void Update(SMESH::SMESH_Gen_ptr Gen);
66
67   void ModifiedMesh( SALOMEDS::SObject_ptr MorSM, bool right);
68
69
70   void SetShape  (SALOMEDS::SObject_ptr SO_Mesh_Or_SubMesh, SALOMEDS::SObject_ptr SO_GeomShape);
71   GEOM::GEOM_Shape_ptr GetShapeOnMeshOrSubMesh(SALOMEDS::SObject_ptr SO_Mesh_Or_SubMesh);
72
73   void SetHypothesis     (SALOMEDS::SObject_ptr SO_Mesh_Or_SubMesh, SALOMEDS::SObject_ptr SO_Hypothesis);
74   void SetAlgorithms     (SALOMEDS::SObject_ptr SO_Mesh_Or_SubMesh, SALOMEDS::SObject_ptr SO_Algorithms);
75
76   void UnSetHypothesis    (SALOMEDS::SObject_ptr SO_Applied_Hypothesis);
77   void UnSetAlgorithm     (SALOMEDS::SObject_ptr SO_Applied_Algorithm);
78
79   void SetTagHypothesisRoot();
80   
81   void SetName( SALOMEDS::SObject_ptr SO, const char* Name ) ;
82
83   //Exploration
84   
85   SALOMEDS::SObject_ptr GetMeshOrSubmesh  (SALOMEDS::SObject_ptr SO);
86
87   SALOMEDS::SObject_ptr FindMesh       (SMESH::SMESH_Mesh_ptr M);
88
89   SALOMEDS::SObject_ptr FindHypothesisOrAlgorithms (SMESH::SMESH_Hypothesis_ptr H);
90
91   SALOMEDS::SObject_ptr FindSubMesh    (SMESH::SMESH_subMesh_ptr SM);
92
93   //SALOMEDS::ListOfSObject_ptr FindMesh    (SALOMEDS_SObject_ptr SO_GeomShape);
94   //SALOMEDS_SObject_ptr        FindSubMesh (SALOMEDS_SObject_ptr SO_Mesh, SALOMEDS_SObject_ptr SO_GeomShape);
95     
96   static void setOrb();
97
98   private:
99   //fields
100   SALOMEDS::Study_var        myStudy;
101   SALOMEDS::StudyBuilder_var myStudyBuilder;
102   SALOMEDS::SComponent_var   mySComponentMesh;
103  
104 };
105 #endif
106