vtk_lib_io.h
Go to the documentation of this file.
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$
00038  *
00039  */
00040 
00041 #ifndef PCL_IO_VTK_LIB_IO_H_
00042 #define PCL_IO_VTK_LIB_IO_H_
00043 
00044 #include <pcl/point_types.h>
00045 #include <pcl/point_cloud.h>
00046 #include <pcl/PolygonMesh.h>
00047 #include <pcl/TextureMesh.h>
00048 #include <pcl/pcl_macros.h>
00049 #include <pcl/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 #include <vtkPNGReader.h>
00072 #include <vtkImageData.h>
00073 #include <vtkPolyDataNormals.h>
00074 
00075 namespace pcl
00076 {
00077   namespace io
00078   {
00084     PCL_EXPORTS int
00085     vtk2mesh (const vtkSmartPointer<vtkPolyData>& poly_data, 
00086               pcl::PolygonMesh& mesh);
00087 
00095     PCL_EXPORTS int
00096     vtk2mesh (const vtkSmartPointer<vtkPolyData>& poly_data,
00097               pcl::TextureMesh& mesh);
00098 
00099 
00105     PCL_EXPORTS int
00106     mesh2vtk (const pcl::PolygonMesh& mesh, 
00107               vtkSmartPointer<vtkPolyData>& poly_data);
00108 
00114     PCL_EXPORTS int
00115     loadPolygonFile (const std::string &file_name, 
00116                      pcl::PolygonMesh& mesh);
00117 
00123     PCL_EXPORTS int
00124     savePolygonFile (const std::string &file_name, 
00125                      const pcl::PolygonMesh& mesh);
00126 
00132     PCL_EXPORTS int
00133     loadPolygonFileVTK (const std::string &file_name, 
00134                         pcl::PolygonMesh& mesh);
00135 
00141     PCL_EXPORTS int
00142     loadPolygonFilePLY (const std::string &file_name, 
00143                         pcl::PolygonMesh& mesh);
00144 
00150     PCL_EXPORTS int
00151     loadPolygonFileOBJ (const std::string &file_name, 
00152                         pcl::PolygonMesh& mesh);
00153 
00162     PCL_EXPORTS int
00163     loadPolygonFileOBJ (const std::string &file_name,
00164                         pcl::TextureMesh& mesh);
00165 
00166 
00172     PCL_EXPORTS int
00173     loadPolygonFileSTL (const std::string &file_name, 
00174                         pcl::PolygonMesh& mesh);
00175 
00181     PCL_EXPORTS int
00182     savePolygonFileVTK (const std::string &file_name, 
00183                         const pcl::PolygonMesh& mesh);
00184 
00190     PCL_EXPORTS int
00191     savePolygonFilePLY (const std::string &file_name, 
00192                         const pcl::PolygonMesh& mesh);
00193 
00199     PCL_EXPORTS int
00200     savePolygonFileSTL (const std::string &file_name, 
00201                         const pcl::PolygonMesh& mesh);
00202 
00208     PCL_EXPORTS void
00209     saveRangeImagePlanarFilePNG (const std::string &file_name,
00210                                  const pcl::RangeImagePlanar& range_image);
00211 
00217     template <typename PointT> void
00218     pointCloudTovtkPolyData (const pcl::PointCloud<PointT>& cloud, 
00219                              vtkPolyData* const polydata);
00220 
00226     PCL_EXPORTS void
00227     pointCloudTovtkPolyData(const pcl::PCLPointCloud2Ptr& cloud, vtkSmartPointer<vtkPolyData>& poly_data);
00228 
00234     template <typename PointT> void
00235     pointCloudTovtkStructuredGrid (const pcl::PointCloud<PointT>& cloud, 
00236                                    vtkStructuredGrid* const structured_grid);
00237 
00243     template <typename PointT> void
00244     vtkPolyDataToPointCloud (vtkPolyData* const polydata, 
00245                              pcl::PointCloud<PointT>& cloud);
00246 
00252     template <typename PointT> void
00253     vtkStructuredGridToPointCloud (vtkStructuredGrid* const structured_grid, 
00254                                    pcl::PointCloud<PointT>& cloud);
00255 
00256   }
00257 }
00258 
00259 #include <pcl/io/impl/vtk_lib_io.hpp>
00260 
00261 #endif /* PLC_IO_VTK_LIB_IO_H_ */


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:38:41