43 #define COLORATTRIBT_CC 45 #include "ColorAttrib.hh" 50 ColorAttrib<ColT>::ColorAttrib(TopologyKernel& _kernel,
const ColT _def) :
51 vcolor_prop_(_kernel.request_vertex_property<ColT>(
"vertex_color", _def)),
52 ecolor_prop_(_kernel.request_edge_property<ColT>(
"edge_color", _def)),
53 hecolor_prop_(_kernel.request_halfedge_property<ColT>(
"halfedge_color", _def)),
54 fcolor_prop_(_kernel.request_face_property<ColT>(
"face_color", _def)),
55 hfcolor_prop_(_kernel.request_halfface_property<ColT>(
"halfface_color", _def)),
56 ccolor_prop_(_kernel.request_cell_property<ColT>(
"cell_color", _def)),
58 vertex_colors_available_(false),
59 halfedge_colors_available_(false),
60 edge_colors_available_(false),
61 halfface_colors_available_(false),
62 face_colors_available_(false),
63 cell_colors_available_(false),
70 ColorAttrib<ColT>::~ColorAttrib() {
75 void ColorAttrib<ColT>::clear_vertex_colors()
77 for (
const auto vh: kernel_.vertices()) {
78 vcolor_prop_[vh] = default_color_;
80 vertex_colors_available_ =
false;
84 void ColorAttrib<ColT>::clear_halfedge_colors()
86 for (
const auto heh: kernel_.halfedges()) {
87 hecolor_prop_[heh] = default_color_;
89 halfedge_colors_available_ =
false;
93 void ColorAttrib<ColT>::clear_edge_colors()
95 for (
const auto eh: kernel_.edges()) {
96 ecolor_prop_[eh] = default_color_;
98 edge_colors_available_ =
false;
101 template <
class ColT>
102 void ColorAttrib<ColT>::clear_halfface_colors()
104 for (
const auto hfh: kernel_.halffaces()) {
105 hfcolor_prop_[hfh] = default_color_;
107 halfface_colors_available_ =
false;
110 template <
class ColT>
111 void ColorAttrib<ColT>::clear_face_colors()
113 for (
const auto fh: kernel_.faces()) {
114 fcolor_prop_[fh] = default_color_;
116 face_colors_available_ =
false;
119 template <
class ColT>
120 void ColorAttrib<ColT>::clear_cell_colors()
122 for (
const auto ch: kernel_.cells()) {
123 ccolor_prop_[ch] = default_color_;
125 cell_colors_available_ =
false;