Go to the documentation of this file.
   54 #ifdef LVR2_USE_RIVLIB 
   58 #include <boost/filesystem.hpp> 
   71     boost::filesystem::path selectedFile( 
filename );
 
   72     std::string extension = selectedFile.extension().string();
 
   76     if(extension == 
".ply")
 
   80     else if(extension == 
".pts" || extension == 
".3d" || extension == 
".xyz" || extension == 
".txt")
 
   84 #ifdef LVR2_USE_RIVLIB 
   85     else if(extension == 
".rxp")
 
   90     else if (extension == 
".obj")
 
   94     else if (extension == 
".las")
 
   98     else if (extension ==
".dat")
 
  102     else if (extension ==
".h5")
 
  107     else if (extension == 
".pcd")
 
  112     else if (extension == 
"")
 
  114         bool found_3d = 
false;
 
  115         bool found_boctree = 
false;
 
  118         boost::filesystem::directory_iterator lastFile;
 
  120         for(boost::filesystem::directory_iterator it(
filename); it != lastFile; it++ )
 
  122             boost::filesystem::path 
p = it->path();
 
  125             if(
p.extension().string() == 
".3d")
 
  129                 if(sscanf(
p.filename().string().c_str(), 
"scan%3d", &num))
 
  136             if(
p.extension().string() == 
".oct")
 
  140                 if(sscanf(
p.filename().string().c_str(), 
"scan%3d", &num))
 
  142                     found_boctree = 
true;
 
  150         if(!found_boctree && found_3d)
 
  154         else if(found_boctree && found_3d)
 
  156             cout << 
timestamp << 
"Found 3d files and octrees. Loading octrees per default." << endl;
 
  159         else if(found_boctree && !found_3d)
 
  165             cout << 
timestamp << 
"Given directory does not contain " << endl;
 
  178             size_t n_points = points->numPoints();
 
  179             size_t n_normals = 0;
 
  183             floatArr n = points->getFloatArray(
"normals", n_normals, dummy);
 
  188                 assert(n_normals == n_points);
 
  195             for(
size_t i = 0; i < n_points; i++)
 
  203                 p[3 * i + 1]    = point[1];
 
  204                 p[3 * i + 2]    = point[2];
 
  211                     n[3 * i]         = normal[0];
 
  212                     n[3 * i + 1]    = normal[1];
 
  213                     n[3 * i + 2]    = normal[2];
 
  228     boost::filesystem::path selectedFile(
filename);
 
  229     std::string extension = selectedFile.extension().string();
 
  234     if(extension == 
".ply")
 
  238     else if (extension == 
".pts" || extension == 
".3d" || extension == 
".xyz" || extension == 
".txt")
 
  242     else if ( extension == 
".obj" )
 
  246     else if (extension == 
".stl")
 
  250     else if (extension == 
".h5")
 
  255     else if (extension == 
".pcd")
 
  269         cout << 
timestamp << 
"File format " << extension
 
  270             << 
" is currently not supported." << endl;
 
  
boost::shared_array< float > floatArr
static void saveModel(ModelPtr m, std::string file)
BaseHDF5IO::AddFeatures< lvr2::hdf5features::ScanProjectIO, lvr2::hdf5features::ArrayIO > HDF5IO
Read and write pointclouds from .pts and .3d files.
A import / export class for point cloud data in the PointCloudLibrary file format.
std::shared_ptr< PointBuffer > PointBufferPtr
virtual ModelPtr read(std::string filename)=0
Parse the given file and load supported elements.
An input class for laser scans in UOS 3d format.
Read and write point clouds from PCD files.
static CoordinateTransform< float > m_transform
static Timestamp timestamp
A global time stamp object for program runtime measurement.
A basic implementation of the obj file format.
IO class for binary laser scans.
IO-Class to import compressed octrees from slam6d.
virtual void save(std::string filename)=0
Save the loaded elements to the given file.
A class for input and output to ply files.
A import / export class for point cloud data in plain text formats. Currently the file extensions ....
I/O support for PLY files.
std::shared_ptr< Model > ModelPtr
static ModelPtr readModel(std::string filename)
Interface class to read laser scan data in .las-Format.
Interface specification for low-level io. All read elements are stored in linear arrays.
lvr2
Author(s): Thomas Wiemann 
, Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr 
autogenerated on Wed Mar 2 2022 00:37:24