Developer Documentation

SmartHandles.cc
1 /* ========================================================================= *
2 * *
3 * OpenMesh *
4 * Copyright (c) 2001-2019, 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
43 //== INCLUDES =================================================================
44
45 #include <OpenMesh/Core/Mesh/PolyConnectivity.hh>
46 #include "SmartHandles.hh"
47
48
49 //== NAMESPACES ===============================================================
50
51 namespace OpenMesh {
52
53 //TODO: I was not able to leave those in the header. If you find a way to do that, please do.
54
55 PolyConnectivity::ConstVertexFaceRange SmartVertexHandle::faces() const
56 {
57 assert(mesh() != nullptr);
58 return mesh()->vf_range(*this);
59 }
60
61 PolyConnectivity::ConstVertexEdgeRange SmartVertexHandle::edges() const
62 {
63 assert(mesh() != nullptr);
64 return mesh()->ve_range(*this);
65 }
66
67 PolyConnectivity::ConstVertexVertexRange SmartVertexHandle::vertices() const
68 {
69 assert(mesh() != nullptr);
70 return mesh()->vv_range(*this);
71 }
72
73 PolyConnectivity::ConstVertexIHalfedgeRange SmartVertexHandle::incoming_halfedges() const
74 {
75 assert(mesh() != nullptr);
76 return mesh()->vih_range(*this);
77 }
78
79 PolyConnectivity::ConstVertexOHalfedgeRange SmartVertexHandle::outgoing_halfedges() const
80 {
81 assert(mesh() != nullptr);
82 return mesh()->voh_range(*this);
83 }
84
85
86 PolyConnectivity::ConstFaceVertexRange SmartFaceHandle::vertices() const
87 {
88 assert(mesh() != nullptr);
89 return mesh()->fv_range(*this);
90 }
91
92 PolyConnectivity::ConstFaceHalfedgeRange SmartFaceHandle::halfedges() const
93 {
94 assert(mesh() != nullptr);
95 return mesh()->fh_range(*this);
96 }
97
98 PolyConnectivity::ConstFaceEdgeRange SmartFaceHandle::edges() const
99 {
100 assert(mesh() != nullptr);
101 return mesh()->fe_range(*this);
102 }
103
104 PolyConnectivity::ConstFaceFaceRange SmartFaceHandle::faces() const
105 {
106 assert(mesh() != nullptr);
107 return mesh()->ff_range(*this);
108 }
109
110
111 //=============================================================================
112 } // namespace OpenMesh
113 //=============================================================================
114
115 //=============================================================================
OpenMesh::PolyConnectivity::voh_range
ConstVertexOHalfedgeRange voh_range(VertexHandle _vh) const
Definition: PolyConnectivity_inline_impl.hh:139
OpenMesh::PolyConnectivity::ve_range
ConstVertexEdgeRange ve_range(VertexHandle _vh) const
Definition: PolyConnectivity_inline_impl.hh:143
OpenMesh::SmartBaseHandle::mesh
const PolyConnectivity * mesh() const
Get the underlying mesh of this handle.
Definition: SmartHandles.hh:74
OpenMesh::SmartVertexHandle::faces
PolyConnectivity::ConstVertexFaceRange faces() const
Returns a range of faces incident to the vertex (PolyConnectivity::vf_range())
Definition: SmartHandles.cc:55
OpenMesh::SmartFaceHandle::vertices
PolyConnectivity::ConstFaceVertexRange vertices() const
Returns a range of vertices incident to the face (PolyConnectivity::fv_range())
Definition: SmartHandles.cc:86
OpenMesh::PolyConnectivity::vf_range
ConstVertexFaceRange vf_range(VertexHandle _vh) const
Definition: PolyConnectivity_inline_impl.hh:147
OpenMesh::SmartFaceHandle::faces
PolyConnectivity::ConstFaceFaceRange faces() const
Returns a range adjacent faces of the face (PolyConnectivity::ff_range())
Definition: SmartHandles.cc:104
OpenMesh
Definition: MeshItems.hh:59
OpenMesh::SmartVertexHandle::vertices
PolyConnectivity::ConstVertexVertexRange vertices() const
Returns a range of vertices adjacent to the vertex (PolyConnectivity::vv_range()) ...
Definition: SmartHandles.cc:67
OpenMesh::PolyConnectivity::vih_range
ConstVertexIHalfedgeRange vih_range(VertexHandle _vh) const
Definition: PolyConnectivity_inline_impl.hh:135
OpenMesh::CirculatorRange
Generic class for iterator ranges.
Definition: PolyConnectivity.hh:86
OpenMesh::SmartVertexHandle::outgoing_halfedges
PolyConnectivity::ConstVertexOHalfedgeRange outgoing_halfedges() const
Returns a range of incoming halfedges incident to the vertex (PolyConnectivity::vih_range()) ...
Definition: SmartHandles.cc:79
OpenMesh::SmartVertexHandle::edges
PolyConnectivity::ConstVertexEdgeRange edges() const
Returns a range of edges incident to the vertex (PolyConnectivity::ve_range())
Definition: SmartHandles.cc:61
OpenMesh::PolyConnectivity::vv_range
ConstVertexVertexRange vv_range(VertexHandle _vh) const
Definition: PolyConnectivity_inline_impl.hh:131
OpenMesh::SmartVertexHandle::incoming_halfedges
PolyConnectivity::ConstVertexIHalfedgeRange incoming_halfedges() const
Returns a range of outgoing halfedges incident to the vertex (PolyConnectivity::voh_range()) ...
Definition: SmartHandles.cc:73
OpenMesh::SmartFaceHandle::edges
PolyConnectivity::ConstFaceEdgeRange edges() const
Returns a range of edges of the face (PolyConnectivity::fv_range())
Definition: SmartHandles.cc:98
OpenMesh::SmartFaceHandle::halfedges
PolyConnectivity::ConstFaceHalfedgeRange halfedges() const
Returns a range of halfedges of the face (PolyConnectivity::fh_range())
Definition: SmartHandles.cc:92
OpenMesh::PolyConnectivity::fe_range
ConstFaceEdgeRange fe_range(FaceHandle _fh) const
Definition: PolyConnectivity_inline_impl.hh:159
OpenMesh::PolyConnectivity::ff_range
ConstFaceFaceRange ff_range(FaceHandle _fh) const
Definition: PolyConnectivity_inline_impl.hh:163
OpenMesh::PolyConnectivity::fh_range
ConstFaceHalfedgeRange fh_range(FaceHandle _fh) const
Definition: PolyConnectivity_inline_impl.hh:155
OpenMesh::PolyConnectivity::fv_range
ConstFaceVertexRange fv_range(FaceHandle _fh) const
Definition: PolyConnectivity_inline_impl.hh:151