Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[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.com
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 "SMESH.hxx"
33
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Group)
36 #include CORBA_SERVER_HEADER(SMESH_Mesh)
37 #include CORBA_CLIENT_HEADER(GEOM_Gen)
38
39 #include "SALOME_GenericObj_i.hh"
40
41 class SMESH_Mesh_i;
42 class SMESH_Group;
43 class SMESHDS_GroupBase;
44
45 // ===========
46 // Group Base
47 // ===========
48 class SMESH_I_EXPORT SMESH_GroupBase_i:
49   public virtual POA_SMESH::SMESH_GroupBase,
50   public virtual SALOME::GenericObj_i
51 {
52  public:
53   SMESH_GroupBase_i(PortableServer::POA_ptr thePOA,
54                     SMESH_Mesh_i* theMeshServant,
55                     const int theLocalID );
56   virtual ~SMESH_GroupBase_i();
57
58   // CORBA interface implementation
59   void SetName(const char* name);
60   char* GetName();
61   SMESH::ElementType GetType();
62   CORBA::Long Size();
63   CORBA::Boolean IsEmpty();
64   CORBA::Boolean Contains(CORBA::Long elem_id);
65   CORBA::Long GetID(CORBA::Long elem_index);
66   SMESH::long_array* GetListOfID();
67   SMESH::SMESH_Mesh_ptr GetMesh();
68
69   // Inherited from SMESH_IDSource interface
70   virtual SMESH::long_array* GetIDs();
71
72   // Internal C++ interface
73   int GetLocalID() const { return myLocalID; }
74   SMESH_Mesh_i* GetMeshServant() const { return myMeshServant; }
75   SMESH_Group* GetSmeshGroup() const;
76   SMESHDS_GroupBase* GetGroupDS() const;
77
78   void SetColor(const SALOMEDS::Color& color);
79   SALOMEDS::Color GetColor();
80
81   void SetColorNumber(CORBA::Long color);
82   CORBA::Long GetColorNumber();
83
84 private:
85   SMESH_Mesh_i* myMeshServant;
86   int myLocalID;
87 };
88
89 // ======
90 // Group
91 // ======
92
93 class SMESH_I_EXPORT SMESH_Group_i:
94   public virtual POA_SMESH::SMESH_Group,
95   public SMESH_GroupBase_i
96 {
97  public:
98   SMESH_Group_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID );
99
100   // CORBA interface implementation
101   void Clear();
102   CORBA::Long Add( const SMESH::long_array& theIDs );
103   CORBA::Long Remove( const SMESH::long_array& theIDs );
104
105   CORBA::Long AddByPredicate( SMESH::Predicate_ptr thePredicate );
106   CORBA::Long RemoveByPredicate( SMESH::Predicate_ptr thePredicate );
107 };
108
109 // =========================
110 // Group linked to geometry
111 // =========================
112
113 class SMESH_I_EXPORT SMESH_GroupOnGeom_i:
114   public virtual POA_SMESH::SMESH_GroupOnGeom,
115   public SMESH_GroupBase_i
116 {
117  public:
118   SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID );
119
120   // CORBA interface implementation
121   GEOM::GEOM_Object_ptr GetShape();
122 };
123 #endif