00001 /*===========================================================================*\ 00002 * * 00003 * IsoEx * 00004 * Copyright (C) 2002 by Computer Graphics Group, RWTH Aachen * 00005 * www.rwth-graphics.de * 00006 * * 00007 *---------------------------------------------------------------------------* 00008 * * 00009 * License * 00010 * * 00011 * This library is free software; you can redistribute it and/or modify it * 00012 * under the terms of the GNU Library General Public License as published * 00013 * by the Free Software Foundation, version 2. * 00014 * * 00015 * This library is distributed in the hope that it will be useful, but * 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00018 * Library General Public License for more details. * 00019 * * 00020 * You should have received a copy of the GNU Library General Public * 00021 * License along with this library; if not, write to the Free Software * 00022 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00023 * * 00024 \*===========================================================================*/ 00025 00026 //============================================================================= 00027 // 00028 // CLASS ImplicitMesh 00029 // 00030 //============================================================================= 00031 00032 00033 #ifndef ISOEX_IMPLICITMESH_HH 00034 #define ISOEX_IMPLICITMESH_HH 00035 00036 00037 //== INCLUDES ================================================================= 00038 00039 #include <IsoEx/Implicits/Implicit.hh> 00040 #include <mb_base/Geometry/BSP/TriangleBSPT.hh> 00041 00042 00043 //== NAMESPACES =============================================================== 00044 00045 namespace IsoEx { 00046 00047 00048 //== CLASS DEFINITION ========================================================= 00049 00050 00051 template <class Mesh> 00052 class ImplicitMesh : public Implicit 00053 { 00054 public: 00055 00057 ImplicitMesh(const Mesh& _mesh); 00059 ~ImplicitMesh() {} 00060 00061 00062 float scalar_distance(const OpenMesh::Vec3f& _point) const; 00063 00064 bool is_inside(const OpenMesh::Vec3f& _point) const 00065 { return scalar_distance(_point) < 0.0; } 00066 00067 bool directed_distance(const OpenMesh::Vec3f& _p0, 00068 const OpenMesh::Vec3f& _p1, 00069 OpenMesh::Vec3f& _point, 00070 OpenMesh::Vec3f& _normal, 00071 float& _distance) const 00072 { return false; } 00073 00074 00075 private: 00076 00077 const Mesh& mesh_; 00078 typedef OpenMeshTriangleBSPT<Mesh> BSP; 00079 BSP bsp_; 00080 }; 00081 00082 00083 //============================================================================= 00084 } // namespace IsoEx 00085 //============================================================================= 00086 #if defined(INCLUDE_TEMPLATES) && !defined(ISOEX_IMPLICITMESH_C) 00087 #define ISOEX_IMPLICITMESH_TEMPLATES 00088 #include "ImplicitMesh.cc" 00089 #endif 00090 //============================================================================= 00091 #endif // ISOEX_IMPLICITMESH_HH defined 00092 //============================================================================= 00093