Developer Documentation
Loading...
Searching...
No Matches
TetrahedralMeshIterators.hh
1#pragma once
2/*===========================================================================*\
3 * *
4 * OpenVolumeMesh *
5 * Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
6 * www.openvolumemesh.org *
7 * *
8 *---------------------------------------------------------------------------*
9 * This file is part of OpenVolumeMesh. *
10 * *
11 * OpenVolumeMesh is free software: you can redistribute it and/or modify *
12 * it under the terms of the GNU Lesser General Public License as *
13 * published by the Free Software Foundation, either version 3 of *
14 * the License, or (at your option) any later version with the *
15 * following exceptions: *
16 * *
17 * If other files instantiate templates or use macros *
18 * or inline functions from this file, or you compile this file and *
19 * link it with other files to produce an executable, this file does *
20 * not by itself cause the resulting executable to be covered by the *
21 * GNU Lesser General Public License. This exception does not however *
22 * invalidate any other reasons why the executable file might be *
23 * covered by the GNU Lesser General Public License. *
24 * *
25 * OpenVolumeMesh is distributed in the hope that it will be useful, *
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
28 * GNU Lesser General Public License for more details. *
29 * *
30 * You should have received a copy of the GNU LesserGeneral Public *
31 * License along with OpenVolumeMesh. If not, *
32 * see <http://www.gnu.org/licenses/>. *
33 * *
34\*===========================================================================*/
35
36#include <OpenVolumeMesh/Core/Iterators.hh>
37#include <OpenVolumeMesh/Config/Export.hh>
38
39#include <array>
40
41namespace OpenVolumeMesh {
42
43class TetrahedralMeshTopologyKernel;
44
45
53class OVM_EXPORT TetVertexIter : public BaseCirculator<CellHandle,
54 VertexHandle> {
55private:
58public:
61 int _max_laps = 1);
62
63 // Post increment/decrement operator
64 TetVertexIter operator++(int) {
65 TetVertexIter cpy = *this;
66 ++(*this);
67 return cpy;
68 }
69 TetVertexIter operator--(int) {
70 TetVertexIter cpy = *this;
71 --(*this);
72 return cpy;
73 }
74 TetVertexIter operator+(int _n) {
75 TetVertexIter cpy = *this;
76 for(int i = 0; i < _n; ++i) {
77 ++cpy;
78 }
79 return cpy;
80 }
81 TetVertexIter operator-(int _n) {
82 TetVertexIter cpy = *this;
83 for(int i = 0; i < _n; ++i) {
84 --cpy;
85 }
86 return cpy;
87 }
88 TetVertexIter& operator+=(int _n) {
89 for(int i = 0; i < _n; ++i) {
90 ++(*this);
91 }
92 return *this;
93 }
94 TetVertexIter& operator-=(int _n) {
95 for(int i = 0; i < _n; ++i) {
96 --(*this);
97 }
98 return *this;
99 }
100
101 TetVertexIter& operator++();
102 TetVertexIter& operator--();
103
104private:
105 std::array<VertexHandle, 4> vertices_;
106 size_t cur_index_;
107};
108
109} // Namespace OpenVolumeMesh
Iterate over all vertices of a tetrahedron in a specific order.
A data structure based on PolyhedralMesh with specializations for tetrahedra.