Home | History | Annotate | Download | only in src
      1 #ifndef CSVREADER_H
      2 #define	CSVREADER_H
      3 
      4 #include <iostream>
      5 #include <fstream>
      6 #include <opencv2/core/core.hpp>
      7 #include "Utils.h"
      8 
      9 using namespace std;
     10 using namespace cv;
     11 
     12 class CsvReader {
     13 public:
     14   /**
     15   * The default constructor of the CSV reader Class.
     16   * The default separator is ' ' (empty space)
     17   *
     18   * @param path - The path of the file to read
     19   * @param separator - The separator character between words per line
     20   * @return
     21   */
     22   CsvReader(const string &path, const char &separator = ' ');
     23 
     24   /**
     25   * Read a plane text file with .ply format
     26   *
     27   * @param list_vertex - The container of the vertices list of the mesh
     28   * @param list_triangle - The container of the triangles list of the mesh
     29   * @return
     30   */
     31   void readPLY(vector<Point3f> &list_vertex, vector<vector<int> > &list_triangles);
     32 
     33 private:
     34   /** The current stream file for the reader */
     35   ifstream _file;
     36   /** The separator character between words for each line */
     37   char _separator;
     38 };
     39 
     40 #endif
     41