Go to the documentation of this file.
52 if (
options.printUsage())
return 0;
54 std::cout <<
options << std::endl;
57 string inputFile =
options.inputFile();
58 string outputFile =
options.outputFile();
63 int numPoints = numLines - 1;
67 std::cout <<
timestamp <<
"File contains no points. Exiting." << std::endl;
71 bool readColor =
true;
77 bool readIntensity =
options.
i() >= 0;
81 std::cout <<
timestamp <<
"Read colors\t\t: " << readColor << std::endl;
82 std::cout <<
timestamp <<
"Read intensities\t\t: " << readIntensity << std::endl;
86 floatArr points(
new float[3 * numPoints]);
90 if(readColor || (readIntensity &&
convert))
97 intensities =
floatArr(
new float[numPoints]);
105 std::ifstream in(inputFile.c_str());
110 float* data =
new float[numEntries];
111 in.getline(buffer, 2048);
113 while(in.good() && c <= numPoints)
116 for(
int i = 0; i < numEntries; i++)
124 points[posPtr ] = data[
options.
x()];
125 points[posPtr + 1] = data[
options.
y()];
126 points[posPtr + 2] = data[
options.
z()];
156 pointBuffer->setPointArray(points, numPoints);
157 pointBuffer->setColorArray(
colors, numPoints);
158 pointBuffer->addFloatChannel(intensities,
"intensities", numPoints, 1);
165 std::cout <<
"Unable to open file for output: " << inputFile << std::endl;
168 std::cout << std::endl;
boost::shared_array< float > floatArr
int z() const
Returns the position of the x coordinate in the data.
static void saveModel(ModelPtr m, std::string file)
int g() const
Returns the position of the x coordinate in the data.
int x() const
Returns the position of the x coordinate in the data.
Read and write pointclouds from .pts and .3d files.
std::shared_ptr< PointBuffer > PointBufferPtr
static int getEntriesInLine(string filename)
Helper method. Returns the number of columns in the given file.
A class to handle point information with an arbitrarily large number of attribute channels....
string getElapsedTime() const
Returns a string representation of the current timer value.
int y() const
Returns the position of the x coordinate in the data.
const kaboom::Options * options
int i() const
Returns the position of the x coordinate in the data.
A class to parse the program options for the reconstruction executable.
void convert(COORD_SYSTEM from, COORD_SYSTEM to, float *point)
static size_t countLines(string filename)
TODO: Coordinate mapping for ascii files.
static Timestamp timestamp
A global time stamp object for program runtime measurement.
Datastructures for holding loaded data.
int main(int argc, char **argv)
Main entry point for the LSSR surface executable.
boost::shared_array< unsigned char > ucharArr
float sx() const
Returns the scaling factor for the x coordinates.
std::shared_ptr< Model > ModelPtr
int r() const
Returns the position of the x coordinate in the data.
float sy() const
Returns the scaling factor for the y coordinates.
float sz() const
Returns the scaling factor for the z coordinates.
int b() const
Returns the position of the x coordinate in the data.
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