OpenMesh

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CollapseInfoT.hh
Go to the documentation of this file.
1 /*===========================================================================*\
2 * *
3 * OpenMesh *
4 * Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
5 * www.openmesh.org *
6 * *
7 *---------------------------------------------------------------------------*
8 * This file is part of OpenMesh. *
9 * *
10 * OpenMesh is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenMesh is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenMesh. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34
35 /*===========================================================================*\
36 * *
37 * $Revision: 990 $ *
38 * $Date: 2014-02-05 10:01:07 +0100 (Mi, 05. Feb 2014) $ *
39 * *
40 \*===========================================================================*/
41
47 //=============================================================================
48 //
49 // STRUCT CollpaseInfoT
50 //
51 //=============================================================================
52 #ifndef OPENMESH_DECIMATER_COLLAPSEINFOT_HH
53 #define OPENMESH_DECIMATER_COLLAPSEINFOT_HH
54
55 //== INCLUDES =================================================================
56
57 //== NAMESPACE ================================================================
58
59 namespace OpenMesh {
60 namespace Decimater {
61
62 //== CLASS DEFINITION =========================================================
63
72 template<class Mesh>
73 struct CollapseInfoT {
74 public:
84 CollapseInfoT(Mesh& _mesh, typename Mesh::HalfedgeHandle _heh);
85
86 Mesh& mesh;
87
88 typename Mesh::HalfedgeHandle v0v1;
89 typename Mesh::HalfedgeHandle v1v0;
90 typename Mesh::VertexHandle v0;
91 typename Mesh::VertexHandle v1;
92 typename Mesh::Point p0;
93 typename Mesh::Point p1;
94 typename Mesh::FaceHandle fl;
95 typename Mesh::FaceHandle fr;
96 typename Mesh::VertexHandle vl;
97 typename Mesh::VertexHandle vr;
98
99
102 typename Mesh::HalfedgeHandle vlv1, v0vl, vrv0, v1vr;
104 };
105
106 //-----------------------------------------------------------------------------
107
127 template<class Mesh>
128 inline CollapseInfoT<Mesh>::CollapseInfoT(Mesh& _mesh,
129 typename Mesh::HalfedgeHandle _heh) :
130 mesh(_mesh), v0v1(_heh), v1v0(_mesh.opposite_halfedge_handle(v0v1)), v0(
131 _mesh.to_vertex_handle(v1v0)), v1(_mesh.to_vertex_handle(v0v1)), p0(
132 _mesh.point(v0)), p1(_mesh.point(v1)), fl(_mesh.face_handle(v0v1)), fr(
133 _mesh.face_handle(v1v0))
134
135 {
136 // get vl
137 if (fl.is_valid()) {
138 vlv1 = mesh.next_halfedge_handle(v0v1);
139 v0vl = mesh.next_halfedge_handle(vlv1);
140 vl = mesh.to_vertex_handle(vlv1);
141 vlv1 = mesh.opposite_halfedge_handle(vlv1);
142 v0vl = mesh.opposite_halfedge_handle(v0vl);
143 }
144
145 // get vr
146 if (fr.is_valid()) {
147 vrv0 = mesh.next_halfedge_handle(v1v0);
148 v1vr = mesh.next_halfedge_handle(vrv0);
149 vr = mesh.to_vertex_handle(vrv0);
150 vrv0 = mesh.opposite_halfedge_handle(vrv0);
151 v1vr = mesh.opposite_halfedge_handle(v1vr);
152 }
153 }
154
155 //=============================================================================
156 }// END_NS_DECIMATER
157 } // END_NS_OPENMESH
158 //=============================================================================
159 #endif // OPENMESH_DECIMATER_COLLAPSEINFOT_HH defined
160 //=============================================================================
161
OpenMesh::Decimater::CollapseInfoT::v1v0
Mesh::HalfedgeHandle v1v0
Reverse halfedge.
Definition: CollapseInfoT.hh:89
OpenMesh::Decimater::CollapseInfoT::v0v1
Mesh::HalfedgeHandle v0v1
Halfedge to be collapsed.
Definition: CollapseInfoT.hh:88
OpenMesh::Decimater::CollapseInfoT
Stores information about a halfedge collapse.
Definition: CollapseInfoT.hh:73
OpenMesh::Decimater::CollapseInfoT::vlv1
Mesh::HalfedgeHandle vlv1
Outer remaining halfedge of diamond spanned by v0, v1, vl, and vr.
Definition: CollapseInfoT.hh:102
OpenMesh::Decimater::CollapseInfoT::vr
Mesh::VertexHandle vr
Right vertex.
Definition: CollapseInfoT.hh:97
OpenMesh::Decimater::CollapseInfoT::v1
Mesh::VertexHandle v1
Remaining vertex.
Definition: CollapseInfoT.hh:91
OpenMesh::Decimater::CollapseInfoT::p0
Mesh::Point p0
Position of removed vertex.
Definition: CollapseInfoT.hh:92
OpenMesh::Decimater::CollapseInfoT::vrv0
Mesh::HalfedgeHandle vrv0
Outer remaining halfedge of diamond spanned by v0, v1, vl, and vr.
Definition: CollapseInfoT.hh:102
OpenMesh::Decimater::CollapseInfoT::v1vr
Mesh::HalfedgeHandle v1vr
Outer remaining halfedge of diamond spanned by v0, v1, vl, and vr.
Definition: CollapseInfoT.hh:102
OpenMesh::Decimater::CollapseInfoT::CollapseInfoT
CollapseInfoT(Mesh &_mesh, typename Mesh::HalfedgeHandle _heh)
Initializing constructor.
Definition: CollapseInfoT.hh:128
OpenMesh::Decimater::CollapseInfoT::v0
Mesh::VertexHandle v0
Vertex to be removed.
Definition: CollapseInfoT.hh:90
OpenMesh::Decimater::CollapseInfoT::p1
Mesh::Point p1
Positions of remaining vertex.
Definition: CollapseInfoT.hh:93
OpenMesh::Decimater::CollapseInfoT::fl
Mesh::FaceHandle fl
Left face.
Definition: CollapseInfoT.hh:94
OpenMesh::Decimater::CollapseInfoT::fr
Mesh::FaceHandle fr
Right face.
Definition: CollapseInfoT.hh:95
OpenMesh::Decimater::CollapseInfoT::v0vl
Mesh::HalfedgeHandle v0vl
Outer remaining halfedge of diamond spanned by v0, v1, vl, and vr.
Definition: CollapseInfoT.hh:102
OpenMesh::Decimater::CollapseInfoT::vl
Mesh::VertexHandle vl
Left vertex.
Definition: CollapseInfoT.hh:96