Point Cloud Viewer  1.00
A Viewer to display point clouds with phong shading by converting them to splats.
fileloader.h
1 #ifndef FILELOADER_H
2 #define FILELOADER_H
3 
4 #include "entityoctreecontainer.h"
5 
6 #include <vector>
7 #include <string>
8 
12 class FileLoader {
13 public:
20  static bool load(std::string &path, EntityOctreeContainer &into);
21 
25  static void init();
26 private:
27  static std::vector<std::string> sizeKeywords, attrKeywords, dataKeywords, attrNames[11];
28  //usedIndizes: x y z xNormal yNormal zNormal [color / r g b / grayscale]
29  static int size, usedIndizes[11];
30  static bool initialized;
31  static std::vector<unsigned char> *sizeKeywordPos;
32  static std::vector<unsigned char> *attrKeywordPos;
33  static std::vector<unsigned char> *dataKeywordPos;
34  static std::vector<std::vector<std::string>> *sizeExtracted;
35  static std::vector<std::vector<std::string>> *attrExtracted;
36  static std::vector<std::vector<std::string>> *dataExtracted;
37 
38  FileLoader();
39  static bool considerNextChar(char c, std::string keyword, std::vector<unsigned char> &keywordPos, std::vector<std::vector<std::string>> &extracted);
40  static bool getFirstNumber(std::vector<std::vector<std::string>> *extracted, int arrayLength, int &number);
41  static void getUsedIndizes();
42  static void readData(std::ifstream &file, EntityOctreeContainer &into);
43  static void split(std::string s, std::vector<float> &parts, char separator = ' ');
44 };
45 
46 #endif // FILELOADER_H
static bool load(std::string &path, EntityOctreeContainer &into)
Loads an ascii encoded point cloud file.
Definition: fileloader.cpp:31
Stores an entity octree.
Definition: entityoctreecontainer.h:9
Provides a static method for loading a point cloud file into an octree.
Definition: fileloader.h:12
static void init()
Initializes the loader. Must only be called once before the first call to load(). ...
Definition: fileloader.cpp:11