Easy3D 2.5.3
point_cloud_io.h
1/********************************************************************
2 * Copyright (C) 2015 Liangliang Nan <liangliang.nan@gmail.com>
3 * https://3d.bk.tudelft.nl/liangliang/
4 *
5 * This file is part of Easy3D. If it is useful in your research/work,
6 * I would be grateful if you show your appreciation by citing it:
7 * ------------------------------------------------------------------
8 * Liangliang Nan.
9 * Easy3D: a lightweight, easy-to-use, and efficient C++ library
10 * for processing and rendering 3D data.
11 * Journal of Open Source Software, 6(64), 3255, 2021.
12 * ------------------------------------------------------------------
13 *
14 * Easy3D is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License Version 3
16 * as published by the Free Software Foundation.
17 *
18 * Easy3D is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 ********************************************************************/
26
27#ifndef EASY3D_FILEIO_POINT_CLOUD_IO_H
28#define EASY3D_FILEIO_POINT_CLOUD_IO_H
29
30#include <iostream>
31#include <vector>
32
33
34namespace easy3d {
35
36
37 class PointCloud;
38
44 {
45 public:
52 static PointCloud* load(const std::string& file_name);
53
64 static bool save(const std::string& file_name, const PointCloud* cloud);
65 };
66
67
68 namespace io {
69
73 bool load_bin(const std::string& file_name, PointCloud* cloud);
77 bool save_bin(const std::string& file_name, const PointCloud* cloud);
78
82 bool load_xyz(const std::string& file_name, PointCloud* cloud);
83 bool save_xyz(const std::string& file_name, const PointCloud* cloud);
85 bool load_bxyz(const std::string& file_name, PointCloud* cloud);
87 bool save_bxyz(const std::string& file_name, const PointCloud* cloud);
88
90 bool load_ply(const std::string& file_name, PointCloud* cloud);
92 bool save_ply(const std::string& file_name, const PointCloud* cloud, bool binary = true);
93
96 bool load_las(const std::string &file_name, PointCloud *cloud);
99 bool save_las(const std::string& file_name, const PointCloud* cloud);
100
101 } // namespace io
102
103
104} // namespace easy3d
105
106
107#endif // EASY3D_FILEIO_POINT_CLOUD_IO_H
A data structure for point clouds.
Definition: point_cloud.h:45
Implementation of file input/output operations for PointCloud.
Definition: point_cloud_io.h:44
static bool save(const std::string &file_name, const PointCloud *cloud)
Saves a point_cloud to a file.
Definition: point_cloud_io.cpp:83
static PointCloud * load(const std::string &file_name)
Reads a point cloud from file file_name.
Definition: point_cloud_io.cpp:37
bool load_bxyz(const std::string &file_name, PointCloud *cloud)
Reads point cloud from a binary xyz format file.
bool load_bin(const std::string &file_name, PointCloud *cloud)
Reads point cloud from a bin format file.
Definition: point_cloud_io_bin.cpp:42
bool load_xyz(const std::string &file_name, PointCloud *cloud)
Reads point cloud from an xyz format file.
bool load_las(const std::string &file_name, PointCloud *cloud)
Reads point cloud from an las/laz format file. Internally the method uses the LASlib of martin....
bool save_ply(const std::string &file_name, const Graph *graph, bool binary=true)
Saves graph into a PLY file file_name.
Definition: graph_io_ply.cpp:245
bool save_bin(const std::string &file_name, const PointCloud *cloud)
Saves a point cloud to a bin format file.
Definition: point_cloud_io_bin.cpp:113
bool load_ply(const std::string &file_name, Graph *graph)
Loads graph from a PLY file file_name.
Definition: graph_io_ply.cpp:89
bool save_bxyz(const std::string &file_name, const PointCloud *cloud)
Saves a point cloud to a binary xyz format file.
bool save_las(const std::string &file_name, const PointCloud *cloud)
Saves a point cloud to an LAS/LAS format file.
Definition: collider.cpp:182