-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathParser.h
More file actions
49 lines (39 loc) · 1.18 KB
/
Parser.h
File metadata and controls
49 lines (39 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <iterator>
#include <algorithm>
#include <cctype>
#include <iostream>
#include <cstring>
#include <thread>
#include <future>
#include <memory>
#include "Math.hpp"
class Parser
{
private:
std::string DataPath;
std::vector<std::vector<Triangle>> TrianglesList;
std::vector<std::vector<Vector3>> VerticesList;
std::vector<std::vector<TriangleCombined>> CombinedList;
std::vector<std::vector<Triangle>> GetTriangles();
std::vector<std::vector<Vector3>> GetVertices();
template<typename T>
std::vector<T> ParseElements(const unsigned char* data, size_t dataSize);
template<typename T>
std::vector<std::vector<T>> ParseSection(const unsigned char* fileData, size_t fileSize, const std::string& sectionName);
void fetchTriangles() {
TrianglesList = GetTriangles();
}
void fetchVertices() {
VerticesList = GetVertices();
}
public:
Parser(const std::string& path);
const std::vector<std::vector<TriangleCombined>>& GetCombinedList() const {
return CombinedList;
}
};