Salome HOME
DCQ:prepare 2.0.0
[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 #include CORBA_SERVER_HEADER(SALOME_GenericObj)
41         
42 class SMESH_subMesh_ptr;
43
44 class SMESHGUI_StudyAPI {
45
46   public:
47
48   SMESHGUI_StudyAPI ();
49
50   SMESHGUI_StudyAPI ( SALOMEDS::Study_ptr aStudy, SMESH::SMESH_Gen_ptr Gen);  
51
52   ~SMESHGUI_StudyAPI ();
53
54   // Adding in Study
55   CORBA::Object_ptr     StringToIOR(const char* IOR);
56
57   SALOMEDS::SObject_ptr AddNewMesh        (SMESH::SMESH_Mesh_ptr M);
58   
59   SALOMEDS::SObject_ptr AddNewHypothesis  (SMESH::SMESH_Hypothesis_ptr H);
60   SALOMEDS::SObject_ptr AddNewAlgorithms  (SMESH::SMESH_Hypothesis_ptr H);
61
62   SALOMEDS::SObject_ptr AddSubMeshOnShape (SALOMEDS::SObject_ptr SO_Mesh, SMESH::SMESH_subMesh_ptr SM, GEOM::shape_type ST);
63
64   SALOMEDS::SObject_ptr AddSubMeshOnShape (SALOMEDS::SObject_ptr SO_Mesh, SALOMEDS::SObject_ptr SO_GeomShape, SMESH::SMESH_subMesh_ptr SM, GEOM::shape_type ST);
65
66   void Update(SALOMEDS::Study_ptr aStudy);
67
68   void ModifiedMesh( SALOMEDS::SObject_ptr MorSM, bool right);
69
70
71   void SetShape  (SALOMEDS::SObject_ptr SO_Mesh_Or_SubMesh, SALOMEDS::SObject_ptr SO_GeomShape);
72   GEOM::GEOM_Shape_ptr GetShapeOnMeshOrSubMesh(SALOMEDS::SObject_ptr SO_Mesh_Or_SubMesh);
73
74   void SetHypothesis     (SALOMEDS::SObject_ptr SO_Mesh_Or_SubMesh, SALOMEDS::SObject_ptr SO_Hypothesis);
75   void SetAlgorithms     (SALOMEDS::SObject_ptr SO_Mesh_Or_SubMesh, SALOMEDS::SObject_ptr SO_Algorithms);
76
77   void UnSetHypothesis    (SALOMEDS::SObject_ptr SO_Applied_Hypothesis);
78   void UnSetAlgorithm     (SALOMEDS::SObject_ptr SO_Applied_Algorithm);
79
80   void SetTagHypothesisRoot();
81   
82   void SetName( SALOMEDS::SObject_ptr SO, const char* Name ) ;
83
84   //Exploration
85   
86   SALOMEDS::SObject_ptr GetMeshOrSubmesh  (SALOMEDS::SObject_ptr SO);
87
88   SALOMEDS::SObject_ptr FindObject(CORBA::Object_ptr theObject);
89
90   static void setOrb();
91
92   private:
93   //fields
94   SALOMEDS::Study_var        myStudy;
95   SALOMEDS::StudyBuilder_var myStudyBuilder;
96 };
97 #endif
98