|
Point Cloud Library (PCL)
1.6.0
|
00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Point Cloud Library (PCL) - www.pointclouds.org 00005 * Copyright (c) 2011, Dirk Holz, University of Bonn. 00006 * Copyright (c) 2012-, Open Perception, Inc. 00007 * 00008 * All rights reserved. 00009 * 00010 * Redistribution and use in source and binary forms, with or without 00011 * modification, are permitted provided that the following conditions 00012 * are met: 00013 * 00014 * * Redistributions of source code must retain the above copyright 00015 * notice, this list of conditions and the following disclaimer. 00016 * * Redistributions in binary form must reproduce the above 00017 * copyright notice, this list of conditions and the following 00018 * disclaimer in the documentation and/or other materials provided 00019 * with the distribution. 00020 * * Neither the name of the copyright holder(s) nor the names of its 00021 * contributors may be used to endorse or promote products derived 00022 * from this software without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00025 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00026 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00027 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00028 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00029 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00030 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00031 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00032 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00033 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00034 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00035 * POSSIBILITY OF SUCH DAMAGE. 00036 * 00037 * $Id: vtk_lib_io.h 6141 2012-07-04 20:28:01Z rusu $ 00038 * 00039 */ 00040 00041 #ifndef PCL_IO_VTK_LIB_IO_H_ 00042 #define PCL_IO_VTK_LIB_IO_H_ 00043 00044 #include <boost/filesystem.hpp> 00045 #include <pcl/point_types.h> 00046 #include <pcl/point_cloud.h> 00047 #include <pcl/PolygonMesh.h> 00048 #include <pcl/pcl_macros.h> 00049 #include <pcl/ros/conversions.h> 00050 #include <pcl/io/pcd_io.h> 00051 #include <pcl/range_image/range_image_planar.h> 00052 00053 // Ignore warnings in the above headers 00054 #ifdef __GNUC__ 00055 #pragma GCC system_header 00056 #endif 00057 #include <vtkSmartPointer.h> 00058 #include <vtkStructuredGrid.h> 00059 #include <vtkPoints.h> 00060 #include <vtkPointData.h> 00061 #include <vtkCellArray.h> 00062 #include <vtkUnsignedCharArray.h> 00063 #include <vtkFloatArray.h> 00064 #include <vtkPolyDataReader.h> 00065 #include <vtkPolyDataWriter.h> 00066 #include <vtkPLYReader.h> 00067 #include <vtkPLYWriter.h> 00068 #include <vtkOBJReader.h> 00069 #include <vtkSTLReader.h> 00070 #include <vtkSTLWriter.h> 00071 00072 namespace pcl 00073 { 00074 namespace io 00075 { 00081 PCL_EXPORTS int 00082 vtk2mesh (const vtkSmartPointer<vtkPolyData>& poly_data, 00083 pcl::PolygonMesh& mesh); 00084 00090 PCL_EXPORTS int 00091 mesh2vtk (const pcl::PolygonMesh& mesh, 00092 vtkSmartPointer<vtkPolyData>& poly_data); 00093 00099 PCL_EXPORTS int 00100 loadPolygonFile (const std::string &file_name, 00101 pcl::PolygonMesh& mesh); 00102 00108 PCL_EXPORTS int 00109 savePolygonFile (const std::string &file_name, 00110 const pcl::PolygonMesh& mesh); 00111 00117 PCL_EXPORTS int 00118 loadPolygonFileVTK (const std::string &file_name, 00119 pcl::PolygonMesh& mesh); 00120 00126 PCL_EXPORTS int 00127 loadPolygonFilePLY (const std::string &file_name, 00128 pcl::PolygonMesh& mesh); 00129 00135 PCL_EXPORTS int 00136 loadPolygonFileOBJ (const std::string &file_name, 00137 pcl::PolygonMesh& mesh); 00138 00144 PCL_EXPORTS int 00145 loadPolygonFileSTL (const std::string &file_name, 00146 pcl::PolygonMesh& mesh); 00147 00153 PCL_EXPORTS int 00154 savePolygonFileVTK (const std::string &file_name, 00155 const pcl::PolygonMesh& mesh); 00156 00162 PCL_EXPORTS int 00163 savePolygonFilePLY (const std::string &file_name, 00164 const pcl::PolygonMesh& mesh); 00165 00171 PCL_EXPORTS int 00172 savePolygonFileSTL (const std::string &file_name, 00173 const pcl::PolygonMesh& mesh); 00174 00180 PCL_EXPORTS void 00181 saveRangeImagePlanarFilePNG (const std::string &file_name, 00182 const pcl::RangeImagePlanar& range_image); 00183 00189 template <typename PointT> void 00190 pointCloudTovtkPolyData (const pcl::PointCloud<PointT>& cloud, 00191 vtkPolyData* const polydata); 00192 00198 template <typename PointT> void 00199 pointCloudTovtkStructuredGrid (const pcl::PointCloud<PointT>& cloud, 00200 vtkStructuredGrid* const structured_grid); 00201 00207 template <typename PointT> void 00208 vtkPolyDataToPointCloud (vtkPolyData* const polydata, 00209 pcl::PointCloud<PointT>& cloud); 00210 00216 template <typename PointT> void 00217 vtkStructuredGridToPointCloud (vtkStructuredGrid* const structured_grid, 00218 pcl::PointCloud<PointT>& cloud); 00219 00220 } 00221 } 00222 00223 #endif /* PLC_IO_VTK_LIB_IO_H_ */
1.7.6.1