00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 #ifndef __MESHREGION_HXX__ 00021 #define __MESHREGION_HXX__ 00022 00023 #include "MeshElement.hxx" 00024 #include "BoundingBox.hxx" 00025 #include "NormalizedUnstructuredMesh.hxx" 00026 00027 #include <vector> 00028 00029 namespace INTERP_KERNEL 00030 { 00036 template<class ConnType> 00037 class MeshRegion 00038 { 00039 public: 00040 00041 MeshRegion(); 00042 00043 ~MeshRegion(); 00044 00045 template<class MyMeshType> 00046 void addElement(MeshElement<ConnType>* const element, const MyMeshType& mesh); 00047 00048 template<class MyMeshType> 00049 void split(MeshRegion<ConnType>& region1, MeshRegion<ConnType>& region2, BoundingBox::BoxCoord coord, const MyMeshType& mesh); 00050 00051 bool isDisjointWithElementBoundingBox(const MeshElement<ConnType>& elem) const; 00057 typename std::vector< MeshElement<ConnType>* >::const_iterator getBeginElements() const { return _elements.begin(); } 00058 00064 typename std::vector< MeshElement<ConnType>* >::const_iterator getEndElements() const { return _elements.end(); } 00065 00071 unsigned getNumberOfElements() const { return _elements.size(); } 00072 00073 private: 00074 00076 MeshRegion(const MeshRegion& m); 00077 00079 MeshRegion<ConnType>& operator=(const MeshRegion<ConnType>& m); 00080 00084 std::vector< MeshElement<ConnType>* > _elements; 00085 00087 BoundingBox* _box; 00088 00089 }; 00090 00091 } 00092 00093 #endif