Salome HOME
Nerge with PAL/SALOME 2.1.0d
[modules/smesh.git] / src / SMESHDS / SMESHDS_GroupBase.hxx
1 //  SMESH SMESHDS : management of mesh data and SMESH document
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   : SMESHDS_Group.hxx
24 //  Module : SMESH
25 //  $Header$
26
27 #ifndef _SMESHDS_GroupBase_HeaderFile
28 #define _SMESHDS_GroupBase_HeaderFile
29
30 #include <string>
31 #include "SMDSAbs_ElementType.hxx"
32 #include "SMDS_MeshElement.hxx"
33   
34 class SMESHDS_Mesh;
35
36 class SMESHDS_GroupBase
37 {
38  public:
39
40   SMESHDS_GroupBase (const int                 theID,
41                      const SMESHDS_Mesh*       theMesh,
42                      const SMDSAbs_ElementType theType);
43
44   int GetID() const { return myID; }
45
46   const SMESHDS_Mesh* GetMesh() const { return myMesh; }
47
48   virtual void SetType(SMDSAbs_ElementType theType);
49
50   SMDSAbs_ElementType GetType() const { return myType; }
51
52   void SetStoreName (const char* theName) { myStoreName = theName; }
53
54   const char* GetStoreName () const { return myStoreName.c_str(); }
55
56   virtual int Extent();
57
58   virtual bool IsEmpty();
59
60   virtual bool Contains (const int theID);
61
62   virtual SMDS_ElemIteratorPtr GetElements() = 0;
63
64   int GetID (const int theIndex);
65   // use it for iterations 1..Extent()
66
67   virtual ~SMESHDS_GroupBase() {}
68
69  protected:
70   const SMDS_MeshElement* findInMesh (const int theID) const;
71
72  private:
73   SMESHDS_GroupBase (const SMESHDS_GroupBase& theOther);
74   // prohibited copy constructor
75   SMESHDS_GroupBase& operator = (const SMESHDS_GroupBase& theOther);
76   // prohibited assign operator
77
78   int                  myID;
79   const SMESHDS_Mesh*  myMesh;
80   SMDSAbs_ElementType  myType;
81   std::string          myStoreName;
82   // for GetID()
83   int                  myCurIndex;
84   int                  myCurID;
85   SMDS_ElemIteratorPtr myIterator;
86
87 };
88
89 #endif