23 #ifndef _LIBS_PCL_UTILS_STORAGE_ADAPTER_H_
24 #define _LIBS_PCL_UTILS_STORAGE_ADAPTER_H_
26 #include <pcl/point_cloud.h>
27 #include <pcl_utils/transforms.h>
28 #include <pcl_utils/utils.h>
33 template <
typename Po
intT>
34 class PointCloudStorageAdapter;
42 template <
typename Po
intT>
45 template <
typename Po
intT>
50 virtual void transform(
const std::string & target_frame,
51 const Time & target_time,
52 const std::string & fixed_frame,
58 virtual unsigned int width()
const = 0;
59 virtual unsigned int height()
const = 0;
62 virtual std::string
frame_id()
const = 0;
66 template <
typename Po
intT>
93 return pcl_utils::cloudptr_from_refptr(
cloud);
102 return pcl_utils::cloudptr_from_refptr(
cloud);
107 virtual void transform(
const std::string &target_frame,
const tf::Transformer &transformer);
109 virtual void transform(
const std::string & target_frame,
110 const Time & target_time,
111 const std::string & fixed_frame,
117 return typeid(
this).name();
122 return sizeof(PointT);
132 return cloud->height;
137 return cloud->points.size();
142 return &
cloud->points[0];
147 return cloud->header.frame_id;
152 template <
typename Po
intT>
156 const PointCloudStorageAdapter<PointT> *pa =
157 dynamic_cast<const PointCloudStorageAdapter<PointT> *
>(
this);
161 template <
typename Po
intT>
162 PointCloudStorageAdapter<PointT> *
165 PointCloudStorageAdapter<PointT> *pa =
dynamic_cast<PointCloudStorageAdapter<PointT> *
>(
this);
167 throw Exception(
"PointCloud storage adapter is not of anticipated type");
172 template <
typename Po
intT>
174 PointCloudStorageAdapter<PointT>::clone()
const
179 template <
typename Po
intT>
183 pcl_utils::get_time(cloud, time);
186 template <
typename Po
intT>
188 PointCloudStorageAdapter<PointT>::transform(
const std::string & target_frame,
192 pcl_utils::transform_pointcloud(target_frame, **cloud, tmp, transformer);
196 template <
typename Po
intT>
198 PointCloudStorageAdapter<PointT>::transform(
const std::string & target_frame,
199 const Time & target_time,
200 const std::string & fixed_frame,
201 const tf::Transformer &transformer)
204 pcl_utils::transform_pointcloud(
205 target_frame, target_time, fixed_frame, **cloud, tmp, transformer);