Go to the documentation of this file.
38 #ifndef PCL_GRAPH_POINT_CLOUD_GRAPH_H
39 #define PCL_GRAPH_POINT_CLOUD_GRAPH_H
41 #include <boost/graph/adjacency_list.hpp>
42 #include <boost/graph/subgraph.hpp>
44 #include <pcl/PointIndices.h>
45 #include <pcl/point_cloud.h>
46 #include <pcl/point_types.h>
296 template <
typename PointT,
297 typename OutEdgeListS = boost::vecS,
298 typename DirectedS = boost::undirectedS,
299 typename VertexProperty = boost::no_property,
300 typename EdgeProperty = boost::no_property,
301 typename EdgeListS = boost::listS>
303 public boost::detail::adj_list_gen<point_cloud_graph<PointT,
314 typename pcl::PointCloud<PointT>::Ptr,
320 public boost::graph::maybe_named_graph<
321 point_cloud_graph<PointT,
327 typename boost::adjacency_list_traits<OutEdgeListS, boost::vecS, DirectedS, EdgeListS>::
334 typedef typename boost::detail::adj_list_gen<
self,
340 typename pcl::PointCloud<PointT>::Ptr,
341 EdgeListS>::type Base;
443 this->clearing_graph();
488 template <
typename T>
510 return (boost::get(boost::vertex_bundle, *
this)[
v]);
516 return (boost::get(boost::vertex_bundle, *
this)[
v]);
522 return (boost::get(boost::edge_bundle, *
this)[e]);
528 return (boost::get(boost::edge_bundle, *
this)[e]);
540 template <
typename Graph>
556 template <
typename Graph>
566 template <
typename Graph>
568 public boost::put_get_helper<
569 typename std::iterator_traits<
570 typename point_cloud_graph_traits<Graph>::point_cloud_type::iterator>::reference,
571 point_cloud_property_map<Graph>>
575 typedef typename boost::property_traits<boost::identity_property_map>::key_type
key_type;
579 typedef typename std::iterator_traits<iterator>::reference
reference;
584 data(g->m_point_cloud), index(
boost::identity_property_map())
591 return (data->begin());
597 return (data->end());
603 return (data->begin());
609 return (data->end());
612 boost::identity_property_map&
618 const boost::identity_property_map&
627 return ((*data)[get(index,
v)]);
632 boost::identity_property_map index;
637 #define PCG_PARAMS typename P, typename OEL, typename D, typename VP, typename EP, typename EL
638 #define PCG pcl::graph::point_cloud_graph<P, OEL, D, VP, EP, EL>
649 template <PCG_PARAMS>
650 struct property_map<
PCG, vertex_bundle_t>
659 template <
typename Directed,
typename Vertex, PCG_PARAMS>
661 source(
const detail::edge_base<Directed, Vertex>& e,
const PCG&)
666 template <
typename Directed,
typename Vertex, PCG_PARAMS>
668 target(
const detail::edge_base<Directed, Vertex>& e,
const PCG&)
673 template <PCG_PARAMS>
674 struct graph_mutability_traits<
PCG>
688 template <PCG_PARAMS>
689 inline typename pcl::PointCloud<P>::Ptr
692 return (g.m_point_cloud);
699 template <PCG_PARAMS>
700 inline typename pcl::PointCloud<P>::ConstPtr
703 return (g.m_point_cloud);
715 template <PCG_PARAMS>
716 inline pcl::PointIndices::Ptr
719 pcl::PointIndices::Ptr
indices(
new pcl::PointIndices);
720 indices->indices.resize(g.m_point_cloud->size());
721 for (
size_t i = 0; i < g.m_point_cloud->size(); ++i)
737 template <PCG_PARAMS>
738 inline typename pcl::PointCloud<P>::Ptr
741 return (g.root().m_graph.m_point_cloud);
749 template <PCG_PARAMS>
750 inline typename pcl::PointCloud<P>::ConstPtr
753 return (g.root().m_graph.m_point_cloud);
766 template <PCG_PARAMS>
767 inline pcl::PointIndices::Ptr
774 pcl::PointIndices::Ptr
indices(
new pcl::PointIndices);
775 indices->indices.resize(boost::num_vertices(g));
776 for (
size_t i = 0; i < boost::num_vertices(g); ++i)
778 indices->indices[i] = g.m_global_vertex[i];
boost::identity_property_map & get_index_map()
reference operator[](const key_type &v) const
Base::vertex_descriptor vertex_descriptor
const vertex_bundled & operator[](vertex_descriptor v) const
pcl::graph::point_cloud_property_map< PCG > type
OutEdgeListS out_edge_list_selector
Base::edge_bundled edge_bundled
Base::vertices_size_type vertices_size_type
point_cloud_graph_traits< Graph >::point_cloud_type::const_iterator const_iterator
point_cloud_graph & operator=(const point_cloud_graph &x)
Assignment operator.
Vertex target(const detail::edge_base< Directed, Vertex > &e, const PCG &)
pcl::PointCloud< PointT >::Ptr graph_property_type
const_iterator storage_begin() const
point_cloud_ptr m_point_cloud
Storage for the internal cloud data.
edge_bundled & operator[](edge_descriptor e)
void removing_vertex(vertex_descriptor vertex)
Graph::point_cloud_type point_cloud_type
The type of PCL point cloud the graph can be viewed as.
pcl::PointCloud< PointT >::Ptr graph_bundled
Base::edge_property_type edge_property_type
boost::geometry::model::d2::point_xy< float > point_type
point_cloud_type::ConstPtr point_cloud_const_ptr
point_cloud_graph(const point_cloud_ptr &p=point_cloud_ptr(new point_cloud_type))
Construct a graph based on existing point cloud.
mutable_property_graph_tag category
std::shared_ptr< Value > value()
pcl::PointIndices::Ptr indices(const PCG &g)
Retrieve the indices of the points of the point cloud stored in a point cloud graph that actually bel...
Graph::point_cloud_ptr point_cloud_ptr
The type of a shared pointer to PCL point cloud the graph can be viewed as.
void added_vertex(vertex_descriptor)
Base::degree_size_type degree_size_type
PointT point_type
Type of PCL points bundled in graph vertices.
std::iterator_traits< iterator >::reference reference
point_cloud_graph_traits< Graph >::point_type value_type
boost::lvalue_property_map_tag category
Base::vertex_property_type vertex_property_type
pcl::PointCloud< P >::Ptr point_cloud(PCG &g)
Retrieve the point cloud stored in a point cloud graph.
boost::subgraph< CloudGraph > Graph
boost::property_traits< boost::identity_property_map >::key_type key_type
void removing_vertex(vertex_descriptor vertex, T)
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Graph::point_type point_type
The type of PCL points bundled in vertices.
EdgeListS edge_list_selector
point_cloud_graph(vertices_size_type num_vertices, const point_cloud_ptr &=point_cloud_ptr(new point_cloud_type))
Construct a graph with a given number of vertices.
Graph::point_cloud_const_ptr point_cloud_const_ptr
The type of a shared pointer to const PCL point cloud the graph can be viewed as.
void clear()
Remove all of the edges and vertices from the graph.
vertex_bundled & operator[](vertex_descriptor v)
double v(double t, double v0, double a0, double j)
const_iterator storage_end() const
point_cloud_graph(const point_cloud_graph &x)
Copy constructor.
const edge_bundled & operator[](edge_descriptor e) const
const boost::identity_property_map & get_index_map() const
Base::edge_descriptor edge_descriptor
Traits struct to access the types associated with point_cloud_graph.
point_cloud_property_map(const Graph *g, boost::vertex_bundle_t)
boost::vecS vertex_list_selector
point_cloud_graph_traits< Graph >::point_cloud_type::iterator iterator
DirectedS directed_selector
point_cloud_type::Ptr point_cloud_ptr
pcl::PointCloud< PointT > point_cloud_type
Base::stored_vertex stored_vertex
This class is to expose the point cloud stored in the point_cloud_graph as a vertex bundle property m...
Base::edges_size_type edges_size_type