40 #ifndef PCL_IO_AUTO_IO_IMPL_H_
41 #define PCL_IO_AUTO_IO_IMPL_H_
43 #include <pcl/io/obj_io.h>
44 #include <pcl/io/pcd_io.h>
45 #include <pcl/io/ply_io.h>
46 #include <pcl/io/ifs_io.h>
47 #include <boost/filesystem.hpp>
53 template<
typename Po
intT>
int
56 boost::filesystem::path p (file_name.c_str ());
57 std::string extension = p.extension ().string ();
59 if (extension ==
".pcd")
61 else if (extension ==
".ply")
63 else if (extension ==
".ifs")
65 else if (extension ==
".obj")
69 PCL_ERROR (
"[pcl::io::load] Don't know how to handle file with extension %s\n", extension.c_str ());
75 template<
typename Po
intT>
int
78 boost::filesystem::path p (file_name.c_str ());
79 std::string extension = p.extension ().string ();
81 if (extension ==
".pcd")
83 else if (extension ==
".ply")
85 else if (extension ==
".ifs")
89 PCL_ERROR (
"[pcl::io::save] Don't know how to handle file with extension %s\n", extension.c_str ());
PointCloud represents the base class in PCL for storing collections of 3D points.
int loadIFSFile(const std::string &file_name, pcl::PCLPointCloud2 &cloud)
Load an IFS file into a PCLPointCloud2 blob type.
int saveIFSFile(const std::string &file_name, const pcl::PCLPointCloud2 &cloud)
Save point cloud data to an IFS file containing 3D points.
PCL_EXPORTS int load(const std::string &file_name, pcl::PCLPointCloud2 &blob)
Load a file into a PointCloud2 according to extension.
int loadOBJFile(const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation)
Load any OBJ file into a templated PointCloud type.
int savePCDFile(const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity(), const bool binary_mode=false)
Save point cloud data to a PCD file containing n-D points.
PCL_EXPORTS int save(const std::string &file_name, const pcl::PCLPointCloud2 &blob, unsigned precision=5)
Save point cloud data to a binary file when available else to ASCII.
int loadPLYFile(const std::string &file_name, pcl::PCLPointCloud2 &cloud)
Load a PLY v.6 file into a PCLPointCloud2 type.
int savePLYFile(const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity(), bool binary_mode=false, bool use_camera=true)
Save point cloud data to a PLY file containing n-D points.
int loadPCDFile(const std::string &file_name, pcl::PCLPointCloud2 &cloud)
Load a PCD v.6 file into a templated PointCloud type.