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: OctreeMeshBuilder.hpp,v 1.2 2007/08/21 09:43:56 delpinux Exp $ 00019 00020 #ifndef OCTREE_MESH_BUILDER_HPP 00021 #define OCTREE_MESH_BUILDER_HPP 00022 00023 #include <Domain.hpp> 00024 #include <Mesh.hpp> 00025 #include <OctreeMesh.hpp> 00026 00036 class OctreeMeshBuilder 00037 { 00038 private: 00039 ConstReferenceCounting<Domain> 00040 __domain; 00042 ConstReferenceCounting<Mesh> 00043 __mesh; 00045 const size_t __maximumLevel; 00047 ConstReferenceCounting<OctreeMesh> 00048 __octreeMesh; 00054 OctreeMeshBuilder(const OctreeMeshBuilder&); 00055 00056 public: 00061 void buildMesh(); 00062 00068 ConstReferenceCounting<OctreeMesh> getOctreeMesh() const 00069 { 00070 return __octreeMesh; 00071 } 00072 00078 ConstReferenceCounting<Mesh> getBaseMesh() const 00079 { 00080 return static_cast<const OctreeMesh*>(__octreeMesh); 00081 } 00082 00090 OctreeMeshBuilder(ConstReferenceCounting<Domain> domain, 00091 ConstReferenceCounting<Mesh> mesh, 00092 const real_t& realLevel) 00093 : __domain(domain), 00094 __mesh(mesh), 00095 __maximumLevel(static_cast<size_t>(realLevel)) 00096 { 00097 if (realLevel<0) { 00098 throw ErrorHandler(__FILE__,__LINE__, 00099 "cannot use a negative level to build an octree mesh", 00100 ErrorHandler::normal); 00101 } 00102 } 00103 00108 ~OctreeMeshBuilder() 00109 { 00110 ; 00111 } 00112 }; 00113 00114 #endif // OCTREE_MESH_BUILDER_HPP
1.5.6