| OpenMesh

CollapseInfoT.hh
Go to the documentation of this file.
1 /* ========================================================================= *
2 * *
3 * OpenMesh *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openmesh.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenMesh. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 * ========================================================================= */
41
42
48 //=============================================================================
49 //
50 // STRUCT CollpaseInfoT
51 //
52 //=============================================================================
53 #ifndef OPENMESH_DECIMATER_COLLAPSEINFOT_HH
54 #define OPENMESH_DECIMATER_COLLAPSEINFOT_HH
55
56 //== INCLUDES =================================================================
57
58 //== NAMESPACE ================================================================
59
60 namespace OpenMesh {
61 namespace Decimater {
62
63 //== CLASS DEFINITION =========================================================
64
73 template<class Mesh>
74 struct CollapseInfoT {
75 public:
85 CollapseInfoT(Mesh& _mesh, typename Mesh::HalfedgeHandle _heh);
86
87 Mesh& mesh;
88
89 typename Mesh::HalfedgeHandle v0v1;
90 typename Mesh::HalfedgeHandle v1v0;
91 typename Mesh::VertexHandle v0;
92 typename Mesh::VertexHandle v1;
93 typename Mesh::Point p0;
94 typename Mesh::Point p1;
95 typename Mesh::FaceHandle fl;
96 typename Mesh::FaceHandle fr;
97 typename Mesh::VertexHandle vl;
98 typename Mesh::VertexHandle vr;
99
100
103 typename Mesh::HalfedgeHandle vlv1, v0vl, vrv0, v1vr;
105 };
106
107 //-----------------------------------------------------------------------------
108
128 template<class Mesh>
129 inline CollapseInfoT<Mesh>::CollapseInfoT(Mesh& _mesh,
130 typename Mesh::HalfedgeHandle _heh) :
131 mesh(_mesh), v0v1(_heh), v1v0(_mesh.opposite_halfedge_handle(v0v1)), v0(
132 _mesh.to_vertex_handle(v1v0)), v1(_mesh.to_vertex_handle(v0v1)), p0(
133 _mesh.point(v0)), p1(_mesh.point(v1)), fl(_mesh.face_handle(v0v1)), fr(
134 _mesh.face_handle(v1v0))
135
136 {
137 // get vl
138 if (fl.is_valid()) {
139 vlv1 = mesh.next_halfedge_handle(v0v1);
140 v0vl = mesh.next_halfedge_handle(vlv1);
141 vl = mesh.to_vertex_handle(vlv1);
142 vlv1 = mesh.opposite_halfedge_handle(vlv1);
143 v0vl = mesh.opposite_halfedge_handle(v0vl);
144 }
145
146 // get vr
147 if (fr.is_valid()) {
148 vrv0 = mesh.next_halfedge_handle(v1v0);
149 v1vr = mesh.next_halfedge_handle(vrv0);
150 vr = mesh.to_vertex_handle(vrv0);
151 vrv0 = mesh.opposite_halfedge_handle(vrv0);
152 v1vr = mesh.opposite_halfedge_handle(v1vr);
153 }
154 }
155
156 //=============================================================================
157 }// END_NS_DECIMATER
158 } // END_NS_OPENMESH
159 //=============================================================================
160 #endif // OPENMESH_DECIMATER_COLLAPSEINFOT_HH defined
161 //=============================================================================
162
OpenMesh::Decimater::CollapseInfoT::fl
Mesh::FaceHandle fl
Left face.
Definition: CollapseInfoT.hh:95
OpenMesh::Decimater::CollapseInfoT::vl
Mesh::VertexHandle vl
Left vertex.
Definition: CollapseInfoT.hh:97
OpenMesh::Decimater::CollapseInfoT::v1
Mesh::VertexHandle v1
Remaining vertex.
Definition: CollapseInfoT.hh:92
OpenMesh::Decimater::CollapseInfoT::v1v0
Mesh::HalfedgeHandle v1v0
Reverse halfedge.
Definition: CollapseInfoT.hh:90
OpenMesh::Decimater::CollapseInfoT::v0v1
Mesh::HalfedgeHandle v0v1
Halfedge to be collapsed.
Definition: CollapseInfoT.hh:89
OpenMesh::Decimater::CollapseInfoT::vlv1
Mesh::HalfedgeHandle vlv1
Outer remaining halfedge of diamond spanned by v0, v1, vl, and vr.
Definition: CollapseInfoT.hh:103
OpenMesh::Decimater::CollapseInfoT::p0
Mesh::Point p0
Position of removed vertex.
Definition: CollapseInfoT.hh:93
OpenMesh::Decimater::CollapseInfoT::vr
Mesh::VertexHandle vr
Right vertex.
Definition: CollapseInfoT.hh:98
OpenMesh::Decimater::CollapseInfoT::v1vr
Mesh::HalfedgeHandle v1vr
Outer remaining halfedge of diamond spanned by v0, v1, vl, and vr.
Definition: CollapseInfoT.hh:103
OpenMesh::Decimater::CollapseInfoT::CollapseInfoT
CollapseInfoT(Mesh &_mesh, typename Mesh::HalfedgeHandle _heh)
Initializing constructor.
Definition: CollapseInfoT.hh:129
OpenMesh::Decimater::CollapseInfoT::fr
Mesh::FaceHandle fr
Right face.
Definition: CollapseInfoT.hh:96
OpenMesh::Decimater::CollapseInfoT::p1
Mesh::Point p1
Positions of remaining vertex.
Definition: CollapseInfoT.hh:94
OpenMesh::Decimater::CollapseInfoT::vrv0
Mesh::HalfedgeHandle vrv0
Outer remaining halfedge of diamond spanned by v0, v1, vl, and vr.
Definition: CollapseInfoT.hh:103
OpenMesh::Decimater::CollapseInfoT::v0vl
Mesh::HalfedgeHandle v0vl
Outer remaining halfedge of diamond spanned by v0, v1, vl, and vr.
Definition: CollapseInfoT.hh:103
OpenMesh::PolyMeshT::Point
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:112
OpenMesh
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
OpenMesh::PolyMeshT::VertexHandle
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition: PolyMeshT.hh:136
OpenMesh::Decimater::CollapseInfoT
Stores information about a halfedge collapse.
Definition: CollapseInfoT.hh:74
OpenMesh::Decimater::CollapseInfoT::v0
Mesh::VertexHandle v0
Vertex to be removed.
Definition: CollapseInfoT.hh:91