Salome HOME
GetElementType method added
[modules/smesh.git] / src / SMESH_I / SMESH_Group_i.hxx
1 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
2 //
3 //  Copyright (C) 2004  CEA
4 // 
5 //  This library is free software; you can redistribute it and/or 
6 //  modify it under the terms of the GNU Lesser General Public 
7 //  License as published by the Free Software Foundation; either 
8 //  version 2.1 of the License. 
9 // 
10 //  This library is distributed in the hope that it will be useful, 
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 //  Lesser General Public License for more details. 
14 // 
15 //  You should have received a copy of the GNU Lesser General Public 
16 //  License along with this library; if not, write to the Free Software 
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 // 
19 //  See http://www.salome-platform.org or email : webmaster.salome@opencascade.org 
20 //
21 //
22 //
23 //  File   : SMESH_Group_i.hxx
24 //  Author : Sergey ANIKIN, OCC
25 //  Module : SMESH
26 //  $Header$
27
28
29 #ifndef SMESH_Group_i_HeaderFile
30 #define SMESH_Group_i_HeaderFile
31
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Group)
34 #include CORBA_SERVER_HEADER(SMESH_Mesh)
35 #include CORBA_CLIENT_HEADER(GEOM_Gen)
36
37 #include "SALOME_GenericObj_i.hh"
38
39 class SMESH_Mesh_i;
40 class SMESH_Group;
41 class SMESHDS_GroupBase;
42
43 // ===========
44 // Group Base
45 // ===========
46 class SMESH_GroupBase_i:
47   public virtual POA_SMESH::SMESH_GroupBase,
48   public virtual SALOME::GenericObj_i
49 {
50  public:
51   SMESH_GroupBase_i(PortableServer::POA_ptr thePOA,
52                     SMESH_Mesh_i* theMeshServant,
53                     const int theLocalID );
54   virtual ~SMESH_GroupBase_i();
55
56   // CORBA interface implementation
57   void SetName(const char* name);
58   char* GetName();
59   SMESH::ElementType GetType();
60   CORBA::Long Size();
61   CORBA::Boolean IsEmpty();
62   CORBA::Boolean Contains(CORBA::Long elem_id);
63   CORBA::Long GetID(CORBA::Long elem_index);
64   SMESH::long_array* GetListOfID();
65   SMESH::SMESH_Mesh_ptr GetMesh();
66
67   // Inherited from SMESH_IDSource interface
68   virtual SMESH::long_array* GetIDs();
69
70   // Internal C++ interface
71   int GetLocalID() const { return myLocalID; }
72   SMESH_Mesh_i* GetMeshServant() const { return myMeshServant; }
73   SMESH_Group* GetSmeshGroup() const;
74   SMESHDS_GroupBase* GetGroupDS() const;
75
76 private:
77   SMESH_Mesh_i* myMeshServant;
78   int myLocalID;
79 };
80
81 // ======
82 // Group
83 // ======
84
85 class SMESH_Group_i:
86   public virtual POA_SMESH::SMESH_Group,
87   public SMESH_GroupBase_i
88 {
89  public:
90   SMESH_Group_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID );
91
92   // CORBA interface implementation
93   void Clear();
94   CORBA::Long Add( const SMESH::long_array& theIDs );
95   CORBA::Long Remove( const SMESH::long_array& theIDs );
96
97   CORBA::Long AddByPredicate( SMESH::Predicate_ptr thePredicate );
98   CORBA::Long RemoveByPredicate( SMESH::Predicate_ptr thePredicate );
99 };
100
101 // =========================
102 // Group linked to geometry
103 // =========================
104
105 class SMESH_GroupOnGeom_i:
106   public virtual POA_SMESH::SMESH_GroupOnGeom,
107   public SMESH_GroupBase_i
108 {
109  public:
110   SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID );
111
112   // CORBA interface implementation
113   GEOM::GEOM_Object_ptr GetShape();
114 };
115 #endif