MEPP2 Project
FEVV
Filters
PCL
pcl_point_cloud_writer.hpp
Go to the documentation of this file.
1
// Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2
// All rights reserved.
3
//
4
// This file is part of MEPP2; you can redistribute it and/or modify
5
// it under the terms of the GNU Lesser General Public License as
6
// published by the Free Software Foundation; either version 3 of
7
// the License, or (at your option) any later version.
8
//
9
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11
#pragma once
12
13
#include "
FEVV/DataStructures/DataStructures_pcl_point_cloud.h
"
14
#include "
FEVV/Wrappings/Wrappings_pcl_point_cloud.h
"
15
16
#include "
FEVV/Wrappings/properties.h
"
17
18
#include "
FEVV/Tools/IO/FileUtilities.hpp
"
// for FileUtils::has_extension()
19
20
#include <pcl/io/pcd_io.h>
21
#include <pcl/io/ply_io.h>
22
23
#include <stdexcept>
// for std::invalid_argument
24
25
26
namespace
FEVV
{
27
namespace
Filters {
28
29
37
inline
38
void
39
write_mesh
(
40
const
std::string &filename,
41
FEVV::PCLPointCloud
&g,
42
PMapsContainer
&
/*pmaps*/
)
43
{
44
bool
success =
false
;
45
46
if
(
FEVV::FileUtils::has_extension
(filename,
".pcd"
))
47
{
48
success = (pcl::io::savePCDFile(filename, g) >= 0);
49
}
50
else
if
(
FEVV::FileUtils::has_extension
(filename,
".ply"
))
51
{
52
success = (pcl::io::savePLYFile(filename, g) >= 0);
53
}
54
55
if
(! success)
56
{
57
throw
std::invalid_argument(
58
"write_mesh() error: failed to write mesh to file "
+ filename);
59
}
60
}
61
62
63
}
// namespace Filters
64
}
// namespace FEVV
65
FEVV::PCLPointCloud
pcl::PointCloud< PCLEnrichedPoint > PCLPointCloud
Definition:
DataStructures_pcl_point_cloud.h:28
FEVV::PMapsContainer
std::map< std::string, boost::any > PMapsContainer
Definition:
properties.h:99
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition:
Assert.h:16
DataStructures_pcl_point_cloud.h
Wrappings_pcl_point_cloud.h
FEVV::Filters::write_mesh
void write_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps)
Write mesh to file.
Definition:
cgal_point_set_writer.hpp:42
FEVV::FileUtils::has_extension
bool has_extension(const std::string &file_name)
Definition:
FileUtilities.hpp:58
properties.h
FileUtilities.hpp
Generated by
1.8.20