OpenMesh
|
00001 /*===========================================================================*\ 00002 * * 00003 * OpenMesh * 00004 * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen * 00005 * www.openmesh.org * 00006 * * 00007 *---------------------------------------------------------------------------* 00008 * This file is part of OpenMesh. * 00009 * * 00010 * OpenMesh is free software: you can redistribute it and/or modify * 00011 * it under the terms of the GNU Lesser General Public License as * 00012 * published by the Free Software Foundation, either version 3 of * 00013 * the License, or (at your option) any later version with the * 00014 * following exceptions: * 00015 * * 00016 * If other files instantiate templates or use macros * 00017 * or inline functions from this file, or you compile this file and * 00018 * link it with other files to produce an executable, this file does * 00019 * not by itself cause the resulting executable to be covered by the * 00020 * GNU Lesser General Public License. This exception does not however * 00021 * invalidate any other reasons why the executable file might be * 00022 * covered by the GNU Lesser General Public License. * 00023 * * 00024 * OpenMesh is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU Lesser General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU LesserGeneral Public * 00030 * License along with OpenMesh. If not, * 00031 * see <http://www.gnu.org/licenses/>. * 00032 * * 00033 \*===========================================================================*/ 00034 00035 /*===========================================================================*\ 00036 * * 00037 * $Revision: 460 $ * 00038 * $Date: 2011-11-16 10:45:08 +0100 (Mi, 16 Nov 2011) $ * 00039 * * 00040 \*===========================================================================*/ 00041 00047 //============================================================================= 00048 // 00049 // STRUCT CollpaseInfoT 00050 // 00051 //============================================================================= 00052 #ifndef OPENMESH_DECIMATER_COLLAPSEINFOT_HH 00053 #define OPENMESH_DECIMATER_COLLAPSEINFOT_HH 00054 00055 //== INCLUDES ================================================================= 00056 00057 //== NAMESPACE ================================================================ 00058 00059 namespace OpenMesh { 00060 namespace Decimater { 00061 00062 //== CLASS DEFINITION ========================================================= 00063 00072 template<class Mesh> 00073 struct CollapseInfoT { 00074 public: 00084 CollapseInfoT(Mesh& _mesh, typename Mesh::HalfedgeHandle _heh); 00085 00086 Mesh& mesh; 00087 00088 typename Mesh::HalfedgeHandle v0v1; 00089 typename Mesh::HalfedgeHandle v1v0; 00090 typename Mesh::VertexHandle v0; 00091 typename Mesh::VertexHandle v1; 00092 typename Mesh::Point p0; 00093 typename Mesh::Point p1; 00094 typename Mesh::FaceHandle fl; 00095 typename Mesh::FaceHandle fr; 00096 typename Mesh::VertexHandle vl; 00097 typename Mesh::VertexHandle vr; 00098 00099 00102 typename Mesh::HalfedgeHandle vlv1, v0vl, vrv0, v1vr; 00104 }; 00105 00106 //----------------------------------------------------------------------------- 00107 00127 template<class Mesh> 00128 inline CollapseInfoT<Mesh>::CollapseInfoT(Mesh& _mesh, 00129 typename Mesh::HalfedgeHandle _heh) : 00130 mesh(_mesh), v0v1(_heh), v1v0(_mesh.opposite_halfedge_handle(v0v1)), v0( 00131 _mesh.to_vertex_handle(v1v0)), v1(_mesh.to_vertex_handle(v0v1)), p0( 00132 _mesh.point(v0)), p1(_mesh.point(v1)), fl(_mesh.face_handle(v0v1)), fr( 00133 _mesh.face_handle(v1v0)) 00134 00135 { 00136 // get vl 00137 if (fl.is_valid()) { 00138 vlv1 = mesh.next_halfedge_handle(v0v1); 00139 v0vl = mesh.next_halfedge_handle(vlv1); 00140 vl = mesh.to_vertex_handle(vlv1); 00141 vlv1 = mesh.opposite_halfedge_handle(vlv1); 00142 v0vl = mesh.opposite_halfedge_handle(v0vl); 00143 } 00144 00145 // get vr 00146 if (fr.is_valid()) { 00147 vrv0 = mesh.next_halfedge_handle(v1v0); 00148 v1vr = mesh.next_halfedge_handle(vrv0); 00149 vr = mesh.to_vertex_handle(vrv0); 00150 vrv0 = mesh.opposite_halfedge_handle(vrv0); 00151 v1vr = mesh.opposite_halfedge_handle(v1vr); 00152 } 00153 } 00154 00155 //============================================================================= 00156 }// END_NS_DECIMATER 00157 } // END_NS_OPENMESH 00158 //============================================================================= 00159 #endif // OPENMESH_DECIMATER_COLLAPSEINFOT_HH defined 00160 //============================================================================= 00161