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