OpenVolumeMesh
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Variables
Typedefs
Pages
StatusAttrib.hh
1
/*===========================================================================*\
2
* *
3
* OpenVolumeMesh *
4
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
5
* www.openvolumemesh.org *
6
* *
7
*---------------------------------------------------------------------------*
8
* This file is part of OpenVolumeMesh. *
9
* *
10
* OpenVolumeMesh 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
* OpenVolumeMesh 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 OpenVolumeMesh. If not, *
31
* see <http://www.gnu.org/licenses/>. *
32
* *
33
\*===========================================================================*/
34
35
/*===========================================================================*\
36
* *
37
* $Revision: 198 $ *
38
* $Date: 2012-05-16 12:52:10 +0200 (Wed, 16 May 2012) $ *
39
* $LastChangedBy: kremer $ *
40
* *
41
\*===========================================================================*/
42
43
#ifndef STATUSATTRIB_HH_
44
#define STATUSATTRIB_HH_
45
46
#include <cassert>
47
48
#include "../Core/OpenVolumeMeshHandle.hh"
49
#include "OpenVolumeMeshStatus.hh"
50
#include "../Core/PropertyDefines.hh"
51
52
namespace
OpenVolumeMesh {
53
54
// Forward declaration
55
class
TopologyKernel;
56
57
class
StatusAttrib
{
58
public
:
59
explicit
StatusAttrib
(
TopologyKernel
& _kernel);
60
~
StatusAttrib
();
61
62
const
OpenVolumeMeshStatus
& operator[](
const
VertexHandle
& _h)
const
{
63
return
v_status_[_h.idx()];
64
}
65
66
OpenVolumeMeshStatus
& operator[](
const
VertexHandle
& _h) {
67
return
v_status_[_h.idx()];
68
}
69
70
const
OpenVolumeMeshStatus
& operator[](
const
EdgeHandle
& _h)
const
{
71
return
e_status_[_h.idx()];
72
}
73
74
OpenVolumeMeshStatus
& operator[](
const
EdgeHandle
& _h) {
75
return
e_status_[_h.idx()];
76
}
77
78
const
OpenVolumeMeshStatus
& operator[](
const
HalfEdgeHandle
& _h)
const
{
79
return
he_status_[_h.idx()];
80
}
81
82
OpenVolumeMeshStatus
& operator[](
const
HalfEdgeHandle
& _h) {
83
return
he_status_[_h.idx()];
84
}
85
86
const
OpenVolumeMeshStatus
& operator[](
const
FaceHandle
& _h)
const
{
87
return
f_status_[_h.idx()];
88
}
89
90
OpenVolumeMeshStatus
& operator[](
const
FaceHandle
& _h) {
91
return
f_status_[_h.idx()];
92
}
93
94
const
OpenVolumeMeshStatus
& operator[](
const
HalfFaceHandle
& _h)
const
{
95
return
hf_status_[_h.idx()];
96
}
97
98
OpenVolumeMeshStatus
& operator[](
const
HalfFaceHandle
& _h) {
99
return
hf_status_[_h.idx()];
100
}
101
102
const
OpenVolumeMeshStatus
& operator[](
const
CellHandle
& _h)
const
{
103
return
c_status_[_h.idx()];
104
}
105
106
OpenVolumeMeshStatus
& operator[](
const
CellHandle
& _h) {
107
return
c_status_[_h.idx()];
108
}
109
110
const
OpenVolumeMeshStatus
& mesh_status()
const
{
111
OpenVolumeMeshHandle
h(0);
112
return
m_status_[h.idx()];
113
}
114
115
OpenVolumeMeshStatus
& mesh_status() {
116
OpenVolumeMeshHandle
h(0);
117
return
m_status_[h.idx()];
118
}
119
120
typedef
VertexPropertyT<OpenVolumeMeshStatus>::const_iterator
const_vstatus_iterator;
121
typedef
VertexPropertyT<OpenVolumeMeshStatus>::iterator
vstatus_iterator;
122
typedef
EdgePropertyT<OpenVolumeMeshStatus>::const_iterator
const_estatus_iterator;
123
typedef
EdgePropertyT<OpenVolumeMeshStatus>::iterator
estatus_iterator;
124
typedef
HalfEdgePropertyT<OpenVolumeMeshStatus>::const_iterator
const_hestatus_iterator;
125
typedef
HalfEdgePropertyT<OpenVolumeMeshStatus>::iterator
hestatus_iterator;
126
typedef
FacePropertyT<OpenVolumeMeshStatus>::const_iterator
const_fstatus_iterator;
127
typedef
FacePropertyT<OpenVolumeMeshStatus>::iterator
fstatus_iterator;
128
typedef
HalfFacePropertyT<OpenVolumeMeshStatus>::const_iterator
const_hfstatus_iterator;
129
typedef
HalfFacePropertyT<OpenVolumeMeshStatus>::iterator
hfstatus_iterator;
130
typedef
CellPropertyT<OpenVolumeMeshStatus>::const_iterator
const_cstatus_iterator;
131
typedef
CellPropertyT<OpenVolumeMeshStatus>::iterator
cstatus_iterator;
132
133
// Iterator access
134
VertexPropertyT<OpenVolumeMeshStatus>::const_iterator
vstatus_begin()
const
{
135
return
v_status_.begin();
136
}
137
VertexPropertyT<OpenVolumeMeshStatus>::iterator
vstatus_begin() {
138
return
v_status_.begin();
139
}
140
VertexPropertyT<OpenVolumeMeshStatus>::const_iterator
vstatus_end()
const
{
141
return
v_status_.end();
142
}
143
VertexPropertyT<OpenVolumeMeshStatus>::iterator
vstatus_end() {
144
return
v_status_.end();
145
}
146
147
EdgePropertyT<OpenVolumeMeshStatus>::const_iterator
estatus_begin()
const
{
148
return
e_status_.begin();
149
}
150
EdgePropertyT<OpenVolumeMeshStatus>::iterator
estatus_begin() {
151
return
e_status_.begin();
152
}
153
EdgePropertyT<OpenVolumeMeshStatus>::const_iterator
estatus_end()
const
{
154
return
e_status_.end();
155
}
156
EdgePropertyT<OpenVolumeMeshStatus>::iterator
estatus_end() {
157
return
e_status_.end();
158
}
159
160
HalfEdgePropertyT<OpenVolumeMeshStatus>::const_iterator
hestatus_begin()
const
{
161
return
he_status_.begin();
162
}
163
HalfEdgePropertyT<OpenVolumeMeshStatus>::iterator
hestatus_begin() {
164
return
he_status_.begin();
165
}
166
HalfEdgePropertyT<OpenVolumeMeshStatus>::const_iterator
hestatus_end()
const
{
167
return
he_status_.end();
168
}
169
HalfEdgePropertyT<OpenVolumeMeshStatus>::iterator
hestatus_end() {
170
return
he_status_.end();
171
}
172
173
FacePropertyT<OpenVolumeMeshStatus>::const_iterator
fstatus_begin()
const
{
174
return
f_status_.begin();
175
}
176
FacePropertyT<OpenVolumeMeshStatus>::iterator
fstatus_begin() {
177
return
f_status_.begin();
178
}
179
FacePropertyT<OpenVolumeMeshStatus>::const_iterator
fstatus_end()
const
{
180
return
f_status_.end();
181
}
182
FacePropertyT<OpenVolumeMeshStatus>::iterator
fstatus_end() {
183
return
f_status_.end();
184
}
185
186
HalfFacePropertyT<OpenVolumeMeshStatus>::const_iterator
hfstatus_begin()
const
{
187
return
hf_status_.begin();
188
}
189
HalfFacePropertyT<OpenVolumeMeshStatus>::iterator
hfstatus_begin() {
190
return
hf_status_.begin();
191
}
192
HalfFacePropertyT<OpenVolumeMeshStatus>::const_iterator
hfstatus_end()
const
{
193
return
hf_status_.end();
194
}
195
HalfFacePropertyT<OpenVolumeMeshStatus>::iterator
hfstatus_end() {
196
return
hf_status_.end();
197
}
198
199
CellPropertyT<OpenVolumeMeshStatus>::const_iterator
cstatus_begin()
const
{
200
return
c_status_.begin();
201
}
202
CellPropertyT<OpenVolumeMeshStatus>::iterator
cstatus_begin() {
203
return
c_status_.begin();
204
}
205
CellPropertyT<OpenVolumeMeshStatus>::const_iterator
cstatus_end()
const
{
206
return
c_status_.end();
207
}
208
CellPropertyT<OpenVolumeMeshStatus>::iterator
cstatus_end() {
209
return
c_status_.end();
210
}
211
228
void
garbage_collection
(
bool
_preserveManifoldness =
false
);
229
230
private
:
231
232
void
mark_higher_dim_entities();
233
234
TopologyKernel
& kernel_;
235
236
VertexPropertyT<OpenVolumeMeshStatus>
v_status_;
237
EdgePropertyT<OpenVolumeMeshStatus>
e_status_;
238
HalfEdgePropertyT<OpenVolumeMeshStatus>
he_status_;
239
FacePropertyT<OpenVolumeMeshStatus>
f_status_;
240
HalfFacePropertyT<OpenVolumeMeshStatus>
hf_status_;
241
CellPropertyT<OpenVolumeMeshStatus>
c_status_;
242
MeshPropertyT<OpenVolumeMeshStatus>
m_status_;
243
};
244
245
}
// Namespace OpenVolumeMesh
246
247
#endif
/* STATUSATTRIB_HH_ */
Project
OpenVolumeMesh
, Computer Graphics Group Aachen,
RWTH Aachen