vision
Loading...
Searching...
No Matches
YarpCloudUtils.hpp
1// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3#ifndef __YARP_CLOUD_UTILS_HPP__
4#define __YARP_CLOUD_UTILS_HPP__
5
6#include <string>
7#include <vector>
8
9#include <yarp/os/Property.h>
10#include <yarp/os/Searchable.h>
11
12#include <yarp/sig/PointCloud.h>
13#include <yarp/sig/Vector.h>
14
24namespace roboticslab
25{
26
31namespace YarpCloudUtils
32{
33
45template <typename T>
46bool savePLY(const std::string & filename, const yarp::sig::PointCloud<T> & cloud, const yarp::sig::VectorOf<int> & indices, bool isBinary = true);
47
58template <typename T>
59bool savePLY(const std::string & filename, const yarp::sig::PointCloud<T> & cloud, bool isBinary = true)
60{
61 return savePLY(filename, cloud, {}, isBinary);
62}
63
77template <typename T>
78bool loadPLY(const std::string & filename, yarp::sig::PointCloud<T> & cloud, yarp::sig::VectorOf<int> & indices);
79
92template <typename T>
93bool loadPLY(const std::string & filename, yarp::sig::PointCloud<T> & cloud)
94{
95 yarp::sig::VectorOf<int> indices;
96 return loadPLY(filename, cloud, indices);
97}
98
113template <typename T1, typename T2 = T1>
114bool meshFromCloud(const yarp::sig::PointCloud<T1> & cloud,
115 yarp::sig::PointCloud<T2> & meshPoints,
116 yarp::sig::VectorOf<int> & meshIndices,
117 const std::vector<yarp::os::Property> & options);
118
134template <typename T1, typename T2 = T1>
135bool meshFromCloud(const yarp::sig::PointCloud<T1> & cloud,
136 yarp::sig::PointCloud<T2> & meshPoints,
137 yarp::sig::VectorOf<int> & meshIndices,
138 const yarp::os::Searchable & config,
139 const std::string & collection = "meshPipeline");
140
155template <typename T1, typename T2 = T1>
156bool processCloud(const yarp::sig::PointCloud<T1> & in,
157 yarp::sig::PointCloud<T2> & out,
158 const std::vector<yarp::os::Property> & options);
159
175template <typename T1, typename T2 = T1>
176bool processCloud(const yarp::sig::PointCloud<T1> & in,
177 yarp::sig::PointCloud<T2> & out,
178 const yarp::os::Searchable & config,
179 const std::string & collection = "cloudPipeline");
180
181} // namespace YarpCloudUtils
182
183} // namespace roboticslab
184
185#endif // __YARP_CLOUD_UTILS_HPP__
bool processCloud(const yarp::sig::PointCloud< T1 > &in, yarp::sig::PointCloud< T2 > &out, const std::vector< yarp::os::Property > &options)
Processes a cloud of points.
Definition YarpCloudUtils-pcl.cpp:361
bool loadPLY(const std::string &filename, yarp::sig::PointCloud< T > &cloud, yarp::sig::VectorOf< int > &indices)
Reads a triangular polygon mesh from file.
Definition YarpCloudUtils-ply-import.cpp:523
bool savePLY(const std::string &filename, const yarp::sig::PointCloud< T > &cloud, const yarp::sig::VectorOf< int > &indices, bool isBinary)
Writes a triangular polygon mesh to file.
Definition YarpCloudUtils-ply-export.cpp:368
bool meshFromCloud(const yarp::sig::PointCloud< T1 > &cloud, yarp::sig::PointCloud< T2 > &meshPoints, yarp::sig::VectorOf< int > &meshIndices, const std::vector< yarp::os::Property > &options)
Constructs a triangular polygon mesh from a point cloud.
Definition YarpCloudUtils-pcl.cpp:284
The main, catch-all namespace for Robotics Lab UC3M.
Definition groups.dox:5