<div dir="ltr"><div><div><div><br clear="all"></div>Lets say I have a graph g (of type graph_t)<br></div><div><br></div><div>and a color map (boy I wish I had a colormap):<br></div><div><br></div><div>typedef boost::property_map&lt;graph_t, boost::vertex_color_t&gt;::type color_map_t;</div><div><br></div><div>or is it?</div><div><br></div><div>auto indexmap = boost::get(boost::vertex_index, g);<br></div><div>auto colors = boost::make_vector_property_map&lt;boost::default_color_type&gt;(indexmap);<br></div><div><br></div><div>or maybe?</div><div><br></div><div><div>auto indexmap = boost::get(boost::vertex_index, g);<br></div><div>auto colors = boost::make_vector_property_map&lt;boost::vertex_color_t&gt;(indexmap);<br></div><div><br></div><div>or possibly some goop found on the internet?</div></div><div><br></div><div>boost::make_iterator_property_map(color_map.begin(), boost::get(boost::vertex_index, data_-&gt;g), color_map[0])<br></div><br><div>or other internet goop?<br></div></div><div><br></div><div>typedef boost::property_map&lt;GraphType, boost::vertex_color_t&gt;::type color_map_t;<br>color_map_t colorMap;<br>boost::color_map(colorMap))</div><div><br></div><div>or other internet goop??<br></div><br>std::vector&lt;int&gt; colorMap(num_vertices(g), boost::white_color);<br><br>so confused... (certainly not surprised why bgl is not a part of stl)  Can someone help explain the various types and ways of specifying colormaps and the logic for each way and means?<br><div><div><br>and a function (if I could get that far without VS syntax highlighter going bonkers and gobs of compiler errors.. you know the type):<br></div><div><br></div><div>make_pretty(g, colormap ) <br></div><div><br></div><div>which colors the graph colormap<br><br></div><div><br></div><div>and a filter struct for boost::filtered_graph&lt;Graph, EdgePredicate, VertexPredicate&gt; (where I wonder why if I only want to filter vertices I have to set boost::keep_all for EdgePredicate... sigh... I know the answer... and also know how long it found me to find/figure out boost::keep_all - and if you are looking for boost::keep_all and found it here... your welcome ;-) )<br></div><div><br></div><div>and modifying (probably incorrectly) boost::filtered_graph example to:<br></div><div><br></div><div><br>template &lt;typename ColorMap&gt;<br>struct vertex_color_filter_eq {<br>    vertex_color_filter_eq() { }<br>    vertex_color_filter_eq(ColorMap colormap/*, boost::default_color_type c*/) : m_colormap(colormap)/*, m_c(c)*/ { }<br>    <br>    template &lt;typename Vertex&gt;<br>    bool operator()(const Vertex&amp; v) const {<br>        return 0 &lt; get(m_colormap, v);<br>        //return c &lt; get(m_colormap, v);<br>    }<br>    ColorMap m_colormap;<br>    //boost::default_color_type m_c;<br>};<br><br> </div><div>auto indexmap = boost::get(boost::vertex_index, g);<br>auto colors = boost::make_vector_property_map&lt;boost::default_color_type&gt;(indexmap);<br><br>// some where here I would call make_pretty(g, colors)<br><br><br>typedef property_map&lt;graph_t, boost::vertex_color_t&gt;::type ColorMap_t;<br>vertex_color_filter&lt;ColorMap_t&gt; filter(colors);<br><br>// boost::filtered_graph&lt;graph_t, boost::keep_all, VertexPredicate&gt;<br>boost::filtered_graph&lt;graph_t, boost::keep_all, vertex_color_filter&gt; fg(g, filter);<br><br><br>// Later say if I could get it compile and better if it compiled and worked I could move on and<br><br>auto color = boost::red_color;<br><br>typedef property_map&lt;graph_t, boost::vertex_color_t&gt;::type ColorMap_t;<br>vertex_color_filter&lt;ColorMap_t&gt; filter(colors, color);<br>boost::filtered_graph&lt;graph_t, boost::keep_all, vertex_color_filter&gt; fg(g, filter);<br><br><br></div><div>Maybe if I color them yellow, I can then reach the wizard pull back the curtain and ask how to create a color map... If I only had a color map.  </div><div><br></div><div><br></div><div><br></div><br><div><div><div class="gmail_signature"><br></div>
</div></div></div></div>