00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes 00024 // File : SMESH_Group_i.hxx 00025 // Author : Sergey ANIKIN, OCC 00026 // Module : SMESH 00027 // 00028 #ifndef SMESH_Group_i_HeaderFile 00029 #define SMESH_Group_i_HeaderFile 00030 00031 #include "SMESH.hxx" 00032 #include "SMESH_Mesh_i.hxx" 00033 00034 #include <SALOMEconfig.h> 00035 #include CORBA_SERVER_HEADER(SMESH_Group) 00036 #include CORBA_SERVER_HEADER(SMESH_Mesh) 00037 #include CORBA_CLIENT_HEADER(GEOM_Gen) 00038 00039 #include "SALOME_GenericObj_i.hh" 00040 00041 class SMESH_Group; 00042 class SMESHDS_GroupBase; 00043 00044 // =========== 00045 // Group Base 00046 // =========== 00047 class SMESH_I_EXPORT SMESH_GroupBase_i: 00048 public virtual POA_SMESH::SMESH_GroupBase, 00049 public virtual SALOME::GenericObj_i 00050 { 00051 public: 00052 SMESH_GroupBase_i(PortableServer::POA_ptr thePOA, 00053 SMESH_Mesh_i* theMeshServant, 00054 const int theLocalID ); 00055 virtual ~SMESH_GroupBase_i(); 00056 00057 // CORBA interface implementation 00058 void SetName(const char* name); 00059 char* GetName(); 00060 SMESH::ElementType GetType(); 00061 CORBA::Long Size(); 00062 CORBA::Boolean IsEmpty(); 00063 CORBA::Boolean Contains(CORBA::Long elem_id); 00064 CORBA::Long GetID(CORBA::Long elem_index); 00065 SMESH::long_array* GetListOfID(); 00066 SMESH::SMESH_Mesh_ptr GetMesh(); 00067 00073 virtual SMESH::long_array* GetMeshInfo(); 00074 00075 // Inherited from SMESH_IDSource interface 00076 virtual SMESH::long_array* GetIDs(); 00077 00082 virtual SMESH::array_of_ElementType* GetTypes(); 00083 00084 // Internal C++ interface 00085 int GetLocalID() const { return myLocalID; } 00086 SMESH_Mesh_i* GetMeshServant() const { return myMeshServant; } 00087 SMESH_Group* GetSmeshGroup() const; 00088 SMESHDS_GroupBase* GetGroupDS() const; 00089 00090 void SetColor(const SALOMEDS::Color& color); 00091 SALOMEDS::Color GetColor(); 00092 00093 void SetColorNumber(CORBA::Long color); 00094 CORBA::Long GetColorNumber(); 00095 00096 private: 00097 SMESH_Mesh_i* myMeshServant; 00098 int myLocalID; 00099 00100 void changeLocalId(int localId) { myLocalID = localId; } 00101 friend class SMESH_Mesh_i; 00102 }; 00103 00104 // ====== 00105 // Group 00106 // ====== 00107 00108 class SMESH_I_EXPORT SMESH_Group_i: 00109 public virtual POA_SMESH::SMESH_Group, 00110 public SMESH_GroupBase_i 00111 { 00112 public: 00113 SMESH_Group_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID ); 00114 00115 // CORBA interface implementation 00116 void Clear(); 00117 CORBA::Long Add( const SMESH::long_array& theIDs ); 00118 CORBA::Long Remove( const SMESH::long_array& theIDs ); 00119 00120 CORBA::Long AddByPredicate( SMESH::Predicate_ptr thePredicate ); 00121 CORBA::Long RemoveByPredicate( SMESH::Predicate_ptr thePredicate ); 00122 00123 CORBA::Long AddFrom( SMESH::SMESH_IDSource_ptr theSource ); 00124 }; 00125 00126 // ========================= 00127 // Group linked to geometry 00128 // ========================= 00129 00130 class SMESH_I_EXPORT SMESH_GroupOnGeom_i: 00131 public virtual POA_SMESH::SMESH_GroupOnGeom, 00132 public SMESH_GroupBase_i 00133 { 00134 public: 00135 SMESH_GroupOnGeom_i( PortableServer::POA_ptr thePOA, SMESH_Mesh_i* theMeshServant, const int theLocalID ); 00136 00137 // CORBA interface implementation 00138 GEOM::GEOM_Object_ptr GetShape(); 00139 }; 00140 #endif