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 SMESHDS : management of mesh data and SMESH document 00024 // File : SMESHDS_Group.hxx 00025 // Module : SMESH 00026 // $Header: /home/server/cvs/SMESH/SMESH_SRC/src/SMESHDS/SMESHDS_GroupBase.hxx,v 1.9.20.2.6.1 2011-06-02 05:57:26 vsr Exp $ 00027 // 00028 #ifndef _SMESHDS_GroupBase_HeaderFile 00029 #define _SMESHDS_GroupBase_HeaderFile 00030 00031 #include "SMESH_SMESHDS.hxx" 00032 00033 #include <string> 00034 #include "SMDSAbs_ElementType.hxx" 00035 #include "SMDS_MeshElement.hxx" 00036 00037 #include <Quantity_Color.hxx> 00038 00039 class SMESHDS_Mesh; 00040 00041 class SMESHDS_EXPORT SMESHDS_GroupBase 00042 { 00043 public: 00044 00045 SMESHDS_GroupBase (const int theID, 00046 const SMESHDS_Mesh* theMesh, 00047 const SMDSAbs_ElementType theType); 00048 00049 int GetID() const { return myID; } 00050 00051 const SMESHDS_Mesh* GetMesh() const { return myMesh; } 00052 00053 virtual void SetType(SMDSAbs_ElementType theType); 00054 00055 SMDSAbs_ElementType GetType() const { return myType; } 00056 00057 void SetStoreName (const char* theName) { myStoreName = theName; } 00058 00059 const char* GetStoreName () const { return myStoreName.c_str(); } 00060 00061 virtual int Extent(); 00062 00063 virtual bool IsEmpty(); 00064 00065 virtual bool Contains (const int theID); 00066 00067 virtual bool Contains (const SMDS_MeshElement* elem); 00068 00069 virtual SMDS_ElemIteratorPtr GetElements() const = 0; 00070 00071 int GetID (const int theIndex); 00072 // use it for iterations 1..Extent() 00073 00074 virtual ~SMESHDS_GroupBase() {} 00075 00076 void SetColor (const Quantity_Color& theColor) 00077 { myColor = theColor;} 00078 00079 Quantity_Color GetColor() const 00080 { return myColor;} 00081 00082 void SetColorGroup (int theColorGroup); 00083 00084 int GetColorGroup() const; 00085 00086 protected: 00087 const SMDS_MeshElement* findInMesh (const int theID) const; 00088 void resetIterator(); 00089 00090 private: 00091 SMESHDS_GroupBase (const SMESHDS_GroupBase& theOther); 00092 // prohibited copy constructor 00093 SMESHDS_GroupBase& operator = (const SMESHDS_GroupBase& theOther); 00094 // prohibited assign operator 00095 00096 int myID; 00097 const SMESHDS_Mesh* myMesh; 00098 SMDSAbs_ElementType myType; 00099 std::string myStoreName; 00100 // for GetID() 00101 int myCurIndex; 00102 int myCurID; 00103 SMDS_ElemIteratorPtr myIterator; 00104 Quantity_Color myColor; 00105 }; 00106 00107 #endif