Developer Documentation
Loading...
Searching...
No Matches
InterfaceAttrib.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/Properties/PropertyPtr.hh>
37#include <OpenVolumeMesh/Core/Handles.hh>
38#include <OpenVolumeMesh/Config/Export.hh>
39#include <OpenVolumeMesh/Core/TopologyKernel.hh>
40
41namespace OpenVolumeMesh {
42
43class TopologyKernel;
44
49class OVM_EXPORT InterfaceAttrib {
50 using boolref = std::vector<bool>::reference;
51public:
52 explicit InterfaceAttrib(TopologyKernel& _kernel);
53 ~InterfaceAttrib() = default;
54
55 bool operator[](const VertexHandle& _h) const {
56 return v_interface_[_h];
57 }
58
59 boolref operator[](const VertexHandle& _h) {
60 return v_interface_[_h];
61 }
62
63 bool operator[](const EdgeHandle& _h) const {
64 return e_interface_[_h];
65 }
66
67 boolref operator[](const EdgeHandle& _h) {
68 return e_interface_[_h];
69 }
70
71 bool operator[](const HalfEdgeHandle& _h) const {
72 return e_interface_[kernel_->edge_handle(_h)];
73 }
74
75 boolref operator[](const HalfEdgeHandle& _h) {
76 return e_interface_[kernel_->edge_handle(_h)];
77 }
78
79 bool operator[](const FaceHandle& _h) const {
80 return f_interface_[_h];
81 }
82
83 boolref operator[](const FaceHandle& _h) {
84 return f_interface_[_h];
85 }
86
87 bool operator[](const HalfFaceHandle& _h) const {
88 return f_interface_[kernel_->face_handle(_h)];
89 }
90
91 boolref operator[](const HalfFaceHandle& _h) {
92 return f_interface_[kernel_->face_handle(_h)];
93 }
94
95 const TopologyKernel* kernel_;
96
97 VertexPropertyT<bool> v_interface_;
98 EdgePropertyT<bool> e_interface_;
99 FacePropertyT<bool> f_interface_;
100};
101
102
103} // Namespace OpenVolumeMesh
InterfaceAttrib stores if an entity is part of an interface, e.g. an material boundary inside the vol...