00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: SurfaceMesh.hpp,v 1.12 2007/11/20 22:00:05 delpinux Exp $ 00019 00020 #ifndef SURFACEMESH_HPP 00021 #define SURFACEMESH_HPP 00022 00023 #include <Mesh.hpp> 00024 00034 class SurfaceMesh 00035 : public Mesh 00036 { 00037 public: 00038 enum { 00039 family = Mesh::surface 00040 }; 00041 00042 protected: 00043 const Mesh* __backgroundMesh; 00045 template <typename CellType> 00046 void __computesFictitiousCells(const Vector<CellType>& cells) const 00047 { 00048 for (size_t i=0; i<cells.size(); ++i) { 00049 cells[i].setFictitious(cells[i].mother().isFictitious()); 00050 } 00051 } 00052 00053 SurfaceMesh(const SurfaceMesh& s); 00054 public: 00055 00060 void buildFaces() 00061 { 00062 this->buildEdges(); 00063 } 00064 00070 virtual void computesFictitiousCells() const = 0; 00071 00079 bool isAssociatedTo(const Mesh& m) const 00080 { 00081 return &m == __backgroundMesh; 00082 } 00083 00089 void setBackgroundMesh(const Mesh* m) 00090 { 00091 __backgroundMesh = m; 00092 } 00093 00099 const Mesh* backgroundMesh() const 00100 { 00101 return __backgroundMesh; 00102 } 00103 00110 SurfaceMesh(const Mesh::Type t) 00111 : Mesh(t, Mesh::surface, 0), 00112 __backgroundMesh(0) 00113 { 00114 ; 00115 } 00116 00122 inline bool hasFaces() const 00123 { 00124 return __edgesSet != 0; 00125 } 00126 00133 inline const size_t& numberOfFaces() const 00134 { 00135 return __edgesSet->numberOfEdges(); 00136 } 00137 00146 SurfaceMesh(const Mesh::Type t, 00147 ReferenceCounting<VerticesSet> vertices, 00148 ReferenceCounting<VerticesCorrespondance> correspondances) 00149 : Mesh(t, 00150 Mesh::surface, 00151 vertices, 00152 correspondances), 00153 __backgroundMesh(0) 00154 { 00155 ; 00156 } 00157 00162 virtual ~SurfaceMesh() 00163 { 00164 ; 00165 } 00166 }; 00167 00168 #endif // SURFACEMESH_HPP 00169
1.5.6