40 #ifndef PCL_IO_AUTO_IO_IMPL_H_
41 #define PCL_IO_AUTO_IO_IMPL_H_
43 #include <pcl/common/pcl_filesystem.h>
45 #include <pcl/io/obj_io.h>
46 #include <pcl/io/pcd_io.h>
47 #include <pcl/io/ply_io.h>
48 #include <pcl/io/ifs_io.h>
54 template<
typename Po
intT>
int
57 pcl_fs::path p (file_name.c_str ());
58 std::string extension = p.extension ().string ();
60 if (extension ==
".pcd")
62 else if (extension ==
".ply")
64 else if (extension ==
".ifs")
66 else if (extension ==
".obj")
70 PCL_ERROR (
"[pcl::io::load] Don't know how to handle file with extension %s\n", extension.c_str ());
76 template<
typename Po
intT>
int
79 pcl_fs::path p (file_name.c_str ());
80 std::string extension = p.extension ().string ();
82 if (extension ==
".pcd")
84 else if (extension ==
".ply")
86 else if (extension ==
".ifs")
90 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.