Loading...
Searching...
No Matches
CollapseInfoT.hh
Go to the documentation of this file.
/* ========================================================================= *
* *
* OpenMesh *
* Copyright (c) 2001-2025, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
* ========================================================================= */
//=============================================================================
//
// STRUCT CollpaseInfoT
//
//=============================================================================
#ifndef OPENMESH_DECIMATER_COLLAPSEINFOT_HH
#define OPENMESH_DECIMATER_COLLAPSEINFOT_HH
//== INCLUDES =================================================================
//== NAMESPACE ================================================================
namespace OpenMesh {
namespace Decimater {
//== CLASS DEFINITION =========================================================
template<class Mesh>
struct CollapseInfoT {
public:
CollapseInfoT(Mesh& _mesh, typename Mesh::HalfedgeHandle _heh);
Mesh& mesh;
typename Mesh::HalfedgeHandle v0v1;
typename Mesh::HalfedgeHandle v1v0;
typename Mesh::VertexHandle v0;
typename Mesh::VertexHandle v1;
typename Mesh::Point p0;
typename Mesh::Point p1;
typename Mesh::FaceHandle fl;
typename Mesh::FaceHandle fr;
typename Mesh::VertexHandle vl;
typename Mesh::VertexHandle vr;
typename Mesh::HalfedgeHandle vlv1, v0vl, vrv0, v1vr;
};
//-----------------------------------------------------------------------------
template<class Mesh>
inline CollapseInfoT<Mesh>::CollapseInfoT(Mesh& _mesh,
typename Mesh::HalfedgeHandle _heh) :
mesh(_mesh), v0v1(_heh), v1v0(_mesh.opposite_halfedge_handle(v0v1)), v0(
_mesh.to_vertex_handle(v1v0)), v1(_mesh.to_vertex_handle(v0v1)), p0(
_mesh.point(v0)), p1(_mesh.point(v1)), fl(_mesh.face_handle(v0v1)), fr(
_mesh.face_handle(v1v0))
{
// get vl
if (fl.is_valid()) {
vlv1 = mesh.next_halfedge_handle(v0v1);
v0vl = mesh.next_halfedge_handle(vlv1);
vl = mesh.to_vertex_handle(vlv1);
vlv1 = mesh.opposite_halfedge_handle(vlv1);
v0vl = mesh.opposite_halfedge_handle(v0vl);
}
// get vr
if (fr.is_valid()) {
vrv0 = mesh.next_halfedge_handle(v1v0);
v1vr = mesh.next_halfedge_handle(vrv0);
vr = mesh.to_vertex_handle(vrv0);
vrv0 = mesh.opposite_halfedge_handle(vrv0);
v1vr = mesh.opposite_halfedge_handle(v1vr);
}
}
//=============================================================================
}// END_NS_DECIMATER
} // END_NS_OPENMESH
//=============================================================================
#endif // OPENMESH_DECIMATER_COLLAPSEINFOT_HH defined
//=============================================================================
OpenMesh
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:59
OpenMesh::Decimater
Software related to mesh decimation.
OpenMesh::PolyMeshT< AttribKernel >::VertexHandle
AttribKernel::VertexHandle VertexHandle
Definition PolyMeshT.hh:136
OpenMesh::PolyMeshT< AttribKernel >::FaceHandle
AttribKernel::FaceHandle FaceHandle
Definition PolyMeshT.hh:139
OpenMesh::PolyMeshT< AttribKernel >::HalfedgeHandle
AttribKernel::HalfedgeHandle HalfedgeHandle
Definition PolyMeshT.hh:137
OpenMesh::PolyMeshT< AttribKernel >::Point
AttribKernel::Point Point
Definition PolyMeshT.hh:112
OpenMesh::Decimater::CollapseInfoT< MeshT >::vlv1
MeshT::HalfedgeHandle vlv1
Definition CollapseInfoT.hh:94
OpenMesh::Decimater::CollapseInfoT< MeshT >::fr
MeshT::FaceHandle fr
Definition CollapseInfoT.hh:87
OpenMesh::Decimater::CollapseInfoT::CollapseInfoT
CollapseInfoT(Mesh &_mesh, typename Mesh::HalfedgeHandle _heh)
Initializing constructor.
Definition CollapseInfoT.hh:127
OpenMesh::Decimater::CollapseInfoT< MeshT >::vl
MeshT::VertexHandle vl
Definition CollapseInfoT.hh:88
OpenMesh::Decimater::CollapseInfoT< MeshT >::p0
MeshT::Point p0
Definition CollapseInfoT.hh:84
OpenMesh::Decimater::CollapseInfoT< MeshT >::v0v1
MeshT::HalfedgeHandle v0v1
Definition CollapseInfoT.hh:80
OpenMesh::Decimater::CollapseInfoT< MeshT >::v1v0
MeshT::HalfedgeHandle v1v0
Definition CollapseInfoT.hh:81
OpenMesh::Decimater::CollapseInfoT< MeshT >::v1
MeshT::VertexHandle v1
Definition CollapseInfoT.hh:83
OpenMesh::Decimater::CollapseInfoT< MeshT >::p1
MeshT::Point p1
Definition CollapseInfoT.hh:85
OpenMesh::Decimater::CollapseInfoT< MeshT >::v0
MeshT::VertexHandle v0
Definition CollapseInfoT.hh:82
OpenMesh::Decimater::CollapseInfoT< MeshT >::fl
MeshT::FaceHandle fl
Definition CollapseInfoT.hh:86
OpenMesh::Decimater::CollapseInfoT< MeshT >::vr
MeshT::VertexHandle vr
Definition CollapseInfoT.hh:89