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 (VertexIter v_it = kernel_.vertices_begin(); v_it != kernel_.vertices_end(); ++v_it)
78 vcolor_prop_[v_it->idx()] = default_color_;
79 vertex_colors_available_ =
false;
83 void ColorAttrib<ColT>::clear_halfedge_colors()
85 for (HalfEdgeIter he_it = kernel_.halfedges_begin(); he_it != kernel_.halfedges_end(); ++he_it)
86 hecolor_prop_[he_it->idx()] = default_color_;
87 halfedge_colors_available_ =
false;
91 void ColorAttrib<ColT>::clear_edge_colors()
93 for (EdgeIter e_it = kernel_.edges_begin(); e_it != kernel_.edges_end(); ++e_it)
94 ecolor_prop_[e_it->idx()] = default_color_;
95 edge_colors_available_ =
false;
99 void ColorAttrib<ColT>::clear_halfface_colors()
101 for (HalfFaceIter hf_it = kernel_.halffaces_begin(); hf_it != kernel_.halffaces_end(); ++hf_it)
102 hfcolor_prop_[hf_it->idx()] = default_color_;
103 halfface_colors_available_ =
false;
106 template <
class ColT>
107 void ColorAttrib<ColT>::clear_face_colors()
109 for (FaceIter f_it = kernel_.faces_begin(); f_it != kernel_.faces_end(); ++f_it)
110 fcolor_prop_[f_it->idx()] = default_color_;
111 face_colors_available_ =
false;
114 template <
class ColT>
115 void ColorAttrib<ColT>::clear_cell_colors()
117 for (CellIter c_it = kernel_.cells_begin(); c_it != kernel_.cells_end(); ++c_it)
118 ccolor_prop_[c_it->idx()] = default_color_;
119 cell_colors_available_ =
false;