43 #ifndef COLORATTRIB_HH_ 44 #define COLORATTRIB_HH_ 48 #include "../Core/OpenVolumeMeshHandle.hh" 49 #include "OpenVolumeMeshStatus.hh" 50 #include "../Core/PropertyDefines.hh" 51 #include "../Core/TopologyKernel.hh" 69 assert((
unsigned int)_h.idx() < kernel_.
n_vertices());
70 return vcolor_prop_[_h.idx()];
74 assert((
unsigned int)_h.idx() < kernel_.
n_vertices());
75 vertex_colors_available_ =
true;
76 return vcolor_prop_[_h.idx()];
82 const ColT& operator[](
const EdgeHandle& _h)
const {
83 assert((
unsigned int)_h.idx() < kernel_.
n_edges());
84 return ecolor_prop_[_h.idx()];
88 assert((
unsigned int)_h.idx() < kernel_.
n_edges());
89 edge_colors_available_ =
true;
90 return ecolor_prop_[_h.idx()];
97 assert((
unsigned int)_h.idx() < kernel_.
n_halfedges());
98 return hecolor_prop_[_h.idx()];
102 assert((
unsigned int)_h.idx() < kernel_.
n_halfedges());
103 halfedge_colors_available_ =
true;
104 return hecolor_prop_[_h.idx()];
110 const ColT& operator[](
const FaceHandle& _h)
const {
111 assert((
unsigned int)_h.idx() < kernel_.
n_faces());
112 return fcolor_prop_[_h.idx()];
116 assert((
unsigned int)_h.idx() < kernel_.
n_faces());
117 face_colors_available_ =
true;
118 return fcolor_prop_[_h.idx()];
125 assert((
unsigned int)_h.idx() < kernel_.
n_halffaces());
126 return hfcolor_prop_[_h.idx()];
130 assert((
unsigned int)_h.idx() < kernel_.
n_halffaces());
131 halfface_colors_available_ =
true;
132 return hfcolor_prop_[_h.idx()];
138 const ColT& operator[](
const CellHandle& _h)
const {
139 assert((
unsigned int)_h.idx() < kernel_.
n_cells());
140 return ccolor_prop_[_h.idx()];
144 assert((
unsigned int)_h.idx() < kernel_.
n_cells());
145 cell_colors_available_ =
true;
146 return ccolor_prop_[_h.idx()];
150 bool vertex_colors_available() {
return vertex_colors_available_; }
151 bool halfedge_colors_available() {
return halfedge_colors_available_; }
152 bool edge_colors_available() {
return edge_colors_available_; }
153 bool halfface_colors_available() {
return halfface_colors_available_; }
154 bool face_colors_available() {
return face_colors_available_; }
155 bool cell_colors_available() {
return cell_colors_available_; }
157 void clear_vertex_colors();
158 void clear_halfedge_colors();
159 void clear_edge_colors();
160 void clear_halfface_colors();
161 void clear_face_colors();
162 void clear_cell_colors();
176 bool vertex_colors_available_;
177 bool halfedge_colors_available_;
178 bool edge_colors_available_;
179 bool halfface_colors_available_;
180 bool face_colors_available_;
181 bool cell_colors_available_;
189 #if defined(INCLUDE_TEMPLATES) && !defined(COLORATTRIBT_CC) 190 #include "ColorAttribT.cc" virtual size_t n_faces() const
Get number of faces in mesh.
virtual size_t n_halfedges() const
Get number of halfedges in mesh.
virtual size_t n_halffaces() const
Get number of halffaces in mesh.
virtual size_t n_edges() const
Get number of edges in mesh.
virtual size_t n_cells() const
Get number of cells in mesh.
virtual size_t n_vertices() const
Get number of vertices in mesh.