PointCloud.cpp
/*
** printHead
** print the first n coordinates
*/
printHead
print the first n coordinates
printHead print the first n coordinates
void PointCloud::printHead(int n, bool longVerision) {
  char sep = ',';
  int prec = 3;
  assert(fileLoaded);
  if (!longVerision) {
    cout << "x" << sep << "y" << sep << "z" << endl;
    for (vector<Point>::iterator it = points.begin(); it != points.cbegin() + n;
         ++it) {
      cout << fixed << setprecision(prec) << it->x << sep << it->y << sep
           << it->z << endl;
    }
  } else {
    cout << "x" << sep << "y" << sep << "z" << sep << "intensity" << sep
         << "returnNum" << sep << "numOfReturns" << sep << "scanDirection"
         << sep << "edge" << sep << "class" << sep << "scanAngleRank" << sep
         << "userData" << sep << "pointSourceId" << sep << "gpsTime" << sep
         << "red" << sep << "green" << sep << "blue" << endl;
    for (vector<Point>::iterator it = points.begin(); it != points.cbegin() + n;
         ++it) {
      cout << fixed << setprecision(prec) << it->x << sep << it->y << sep
           << it->z << sep << it->intensity << sep << it->returnNum << sep
           << it->numOfReturns << sep << it->scanDirection << sep << it->edge
           << sep << it->classification << sep << it->scanAngleRank << sep
           << it->userData << sep << it->pointSourceId << sep << it->gpsTime
           << sep << it->red << sep << it->blue << sep << it->green << endl;
    }
  }
  cout << "maxsize: " << points.max_size() << endl;
}
void PointCloud :: printHead ( int n , bool longVerision ) { char sep = ' ' ; int prec = 3 ; assert ( fileLoaded ) ; if ( ! longVerision ) { cout << " " << sep << " " << sep << " " << endl ; for ( vector < Point > :: iterator it = points . begin ( ) ; it != points . cbegin ( ) + n ; ++ it ) { cout << fixed << setprecision ( prec ) << it -> x << sep << it -> y << sep << it -> z << endl ; } } else { cout << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << sep << " " << endl ; for ( vector < Point > :: iterator it = points . begin ( ) ; it != points . cbegin ( ) + n ; ++ it ) { cout << fixed << setprecision ( prec ) << it -> x << sep << it -> y << sep << it -> z << sep << it -> intensity << sep << it -> returnNum << sep << it -> numOfReturns << sep << it -> scanDirection << sep << it -> edge << sep << it -> classification << sep << it -> scanAngleRank << sep << it -> userData << sep << it -> pointSourceId << sep << it -> gpsTime << sep << it -> red << sep << it -> blue << sep << it -> green << endl ; } } cout << " " << points . max_size ( ) << endl ; }
printHead
print the first n coordinates
printHead print the first n coordinates