Salome HOME
This commit was generated by cvs2git to create branch 'IMPORT'.
[modules/smesh.git] / src / SMESH_I / SMESH_subMesh_i.cxx
1 using namespace std;
2 //=============================================================================
3 // File      : SMESH_subMesh_i.cxx
4 // Created   : jeu mai 30 10:01:12 CEST 2002
5 // Author    : Paul RASCLE, EDF
6 // Project   : SALOME
7 // Copyright : EDF 2002
8 // $Header$
9 //=============================================================================
10 using namespace std;
11
12 #include "SMESH_subMesh_i.hxx"
13 #include "SMESH_Gen_i.hxx"
14 #include "SMESH_Mesh_i.hxx"
15
16 #include "Utils_CorbaException.hxx"
17 #include "utilities.h"
18 #include "OpUtil.hxx"
19
20 //=============================================================================
21 /*!
22  *  
23  */
24 //=============================================================================
25
26 SMESH_subMesh_i::SMESH_subMesh_i()
27 {
28   MESSAGE("SMESH_subMesh_i::SMESH_subMesh_i default, not for use");
29     ASSERT(0);
30 }
31
32 //=============================================================================
33 /*!
34  *  
35  */
36 //=============================================================================
37
38 SMESH_subMesh_i::SMESH_subMesh_i(SMESH_Gen_i* gen_i,
39                                  SMESH_Mesh_i* mesh_i,
40                                  int localId)
41 {
42   MESSAGE("SMESH_subMesh_i::SMESH_subMesh_i");
43   _gen_i = gen_i;
44   _mesh_i = mesh_i;
45   _localId = localId;
46   // ****
47 }
48 //=============================================================================
49 /*!
50  *  
51  */
52 //=============================================================================
53
54 SMESH_subMesh_i::~SMESH_subMesh_i()
55 {
56   MESSAGE("SMESH_subMesh_i::~SMESH_subMesh_i");
57   // ****
58 }
59
60 //=============================================================================
61 /*!
62  *  
63  */
64 //=============================================================================
65
66 CORBA::Long SMESH_subMesh_i::GetNumberOfElements()
67   throw (SALOME::SALOME_Exception)
68 {
69   MESSAGE("SMESH_subMesh_i::GetNumberOfElements");
70   // ****
71 }
72
73 //=============================================================================
74 /*!
75  *  
76  */
77 //=============================================================================
78
79 CORBA::Long SMESH_subMesh_i::GetNumberOfNodes()
80   throw (SALOME::SALOME_Exception)
81 {
82   MESSAGE("SMESH_subMesh_i::GetNumberOfNodes");
83   // ****
84 }
85
86 //=============================================================================
87 /*!
88  *  
89  */
90 //=============================================================================
91   
92 SMESH::long_array* SMESH_subMesh_i::GetElementsId()
93   throw (SALOME::SALOME_Exception)
94 {
95   MESSAGE("SMESH_subMesh_i::GetElementsId");
96   // ****
97 }
98
99 //=============================================================================
100 /*!
101  *  
102  */
103 //=============================================================================
104   
105 SMESH::long_array* SMESH_subMesh_i::GetNodesId()
106   throw (SALOME::SALOME_Exception)
107 {
108   MESSAGE("SMESH_subMesh_i::GetNodesId");
109   // ****
110 }
111
112 //=============================================================================
113 /*!
114  *  
115  */
116 //=============================================================================
117   
118 SMESH::SMESH_Mesh_ptr SMESH_subMesh_i::GetFather()
119   throw (SALOME::SALOME_Exception)
120 {
121   MESSAGE("SMESH_subMesh_i::GetFather");
122   SMESH::SMESH_Mesh_var meshIor = _mesh_i->GetIor();
123   return SMESH::SMESH_Mesh::_duplicate(meshIor);
124 }
125
126 //=============================================================================
127 /*!
128  *  
129  */
130 //=============================================================================
131   
132 CORBA::Long SMESH_subMesh_i::GetId()
133 {
134   MESSAGE("SMESH_subMesh_i::GetId");
135   return _localId;
136 }
137
138 //=============================================================================
139 /*!
140  *  
141  */
142 //=============================================================================
143 SALOME_MED::FAMILY_ptr SMESH_subMesh_i::GetFamily()
144   throw (SALOME::SALOME_Exception)
145 {
146   SALOME_MED::MESH_var MEDMesh = GetFather()->GetMEDMesh();
147
148   SALOME_MED::Family_array_var families = 
149     MEDMesh->getFamilies(SALOME_MED::MED_NODE);
150     
151   for ( int i = 0; i < families->length(); i++ ) {
152     if ( families[i]->getIdentifier() == ( _localId ) )
153       return families[i];
154   }
155 }