Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] visitors.hpp:138: error: no type named 'event_filter' in 'class dijkstra_custom_visitor'
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-11-21 10:55:41


On Thu, 21 Nov 2013, The Maschine wrote:

> Hi, Im trying to use a custom visitor but I get this error.
> My custom visitor is:
>
> class dijkstra_custom_visitor : public boost::default_dijkstra_visitor
> {
> public:
> dijkstra_threshold(glm::dvec3 source, double threshold): s(source), threshold(threshold) {}
> struct hit_threshold {};
> void examine_vertex(boost::graph_traits <unGraph>::vertex_descriptor v, const unGraph& g) {
> glm::dvec3 dest = boost::get(&VertexProperties::m_mid_point, g, v);
> if( glm::distance(s,dest) > threshold ) throw hit_threshold();
> }
> double threshold;
> glm::dvec3 s;
> };

(snip)

> boost::dijkstra_shortest_paths(m_ugraph, *vertex_iterator_begin, boost::predecessor_map(predecessorMap).distanc
> e_map(distanceMap).visitor(boost::make_dijkstra_visitor(dijkstra_custom_visitor(s_mid,thres))));
>
> What do you think is the problem?

If you write a visitor with all of the members (and
default_dijkstra_visitor fills in those that you didn't), you don't need
to use make_dijkstra_visitor. Just use
.visitor(dijkstra_custom_visitor(s_mid,thres)) in your call and see if
it works.

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net