MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / loadDataSet

Function loadDataSet

tools/virtual_scanner.cpp:87–107  ·  view source on GitHub ↗

\brief Loads a 3D point cloud from a given fileName, and returns: a * vtkDataSet object containing the point cloud. * \param file_name the name of the file containing the dataset */

Source from the content-addressed store, hash-verified

85 * \param file_name the name of the file containing the dataset
86 */
87vtkPolyData*
88loadDataSet (const char* file_name)
89{
90 std::string extension = pcl_fs::path (file_name).extension ().string ();
91 if (extension == ".ply")
92 {
93 vtkPLYReader* reader = vtkPLYReader::New ();
94 reader->SetFileName (file_name);
95 reader->Update ();
96 return (reader->GetOutput ());
97 }
98 if (extension == ".vtk")
99 {
100 vtkPolyDataReader* reader = vtkPolyDataReader::New ();
101 reader->SetFileName (file_name);
102 reader->Update ();
103 return (reader->GetOutput ());
104 }
105 PCL_ERROR ("Needs a VTK/PLY file to continue.\n");
106 return (nullptr);
107}
108
109int
110main (int argc, char** argv)

Callers 1

mainFunction · 0.85

Calls 1

NewFunction · 0.85

Tested by

no test coverage detected