1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
24 // File : SMESH_Group_i.hxx
25 // Author : Sergey ANIKIN, OCC
28 #ifndef SMESH_Group_i_HeaderFile
29 #define SMESH_Group_i_HeaderFile
32 #include "SMESH_Mesh_i.hxx"
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)
39 #include "SALOME_GenericObj_i.hh"
42 class SMESHDS_GroupBase;
47 class SMESH_I_EXPORT SMESH_GroupBase_i:
48 public virtual POA_SMESH::SMESH_GroupBase,
49 public virtual SALOME::GenericObj_i
52 SMESH_GroupBase_i(PortableServer::POA_ptr thePOA,
53 SMESH_Mesh_i* theMeshServant,
54 const int theLocalID );
55 virtual ~SMESH_GroupBase_i();
57 // CORBA interface implementation
58 void SetName(const char* name);
60 SMESH::ElementType GetType();
62 CORBA::Boolean IsEmpty();
63 CORBA::Boolean Contains(CORBA::Long elem_id);
64 CORBA::Long GetID(CORBA::Long elem_index);
65 SMESH::long_array* GetListOfID();
66 SMESH::SMESH_Mesh_ptr GetMesh();
69 * Returns statistic of mesh elements
70 * Result array of number enityties
71 * Inherited from SMESH_IDSource
73 virtual SMESH::long_array* GetMeshInfo();
75 // Inherited from SMESH_IDSource interface
76 virtual SMESH::long_array* GetIDs();
78 // Internal C++ interface
79 int GetLocalID() const { return myLocalID; }
80 SMESH_Mesh_i* GetMeshServant() const { return myMeshServant; }
81 SMESH_Group* GetSmeshGroup() const;
82 SMESHDS_GroupBase* GetGroupDS() const;
84 void SetColor(const SALOMEDS::Color& color);
85 SALOMEDS::Color GetColor();
87 void SetColorNumber(CORBA::Long color);
88 CORBA::Long GetColorNumber();
91 SMESH_Mesh_i* myMeshServant;
94 void changeLocalId(int localId) { myLocalID = localId; }
95 friend void SMESH_Mesh_i::CheckGeomGroupModif();
102 class SMESH_I_EXPORT SMESH_Group_i:
103 public virtual POA_SMESH::SMESH_Group,
104 public SMESH_GroupBase_i
107 SMESH_Group_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID );
109 // CORBA interface implementation
111 CORBA::Long Add( const SMESH::long_array& theIDs );
112 CORBA::Long Remove( const SMESH::long_array& theIDs );
114 CORBA::Long AddByPredicate( SMESH::Predicate_ptr thePredicate );
115 CORBA::Long RemoveByPredicate( SMESH::Predicate_ptr thePredicate );
117 CORBA::Long AddFrom( SMESH::SMESH_IDSource_ptr theSource );
120 // =========================
121 // Group linked to geometry
122 // =========================
124 class SMESH_I_EXPORT SMESH_GroupOnGeom_i:
125 public virtual POA_SMESH::SMESH_GroupOnGeom,
126 public SMESH_GroupBase_i
129 SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID );
131 // CORBA interface implementation
132 GEOM::GEOM_Object_ptr GetShape();