-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathparser.cpp
More file actions
74 lines (72 loc) · 1.29 KB
/
parser.cpp
File metadata and controls
74 lines (72 loc) · 1.29 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <sstream>
#include <vector>
#include <iterator>
#include <algorithm>
#include <assert.h>
#include "vertex.h"
#include "triangle.h"
#include "parser.h"
#include "diamond.h"
using namespace std;
//
//class Parser
//{
//public:
// string file_name;
// vector<Triangle> triangles;
// ifstream fin;
//
// Parser(string f)
// {
// file_name = f;
// }
//
// void parse()
// {
// fin.open(file_name);
// cout<<"----------------"<<endl;
// if(fin.fail())
// {
// cout<<"Could not open file"<<endl;
// exit(1);
// }
//
// string buffer;
// vector<float> v;
// while(!fin.eof())
// {
// getline(fin,buffer);
// istringstream buf(buffer);
// for(string token; getline(buf, token,' '); )
// {
// if (token=="triangle")
// continue;
//
// if(token=="T" || token=="D")
// {
// assert(v.size()>=9 || v.size()==0);
// if(v.size()==0)
// break;
//
// Vertex v1,v2,v3;
//
// v1 = Vertex (v[0],v[1],v[2]);
// v2 = Vertex (v[3],v[4],v[5]);
// v3 = Vertex (v[6],v[7],v[8]);
//
// Triangle tri = Triangle(v1,v2,v3);
// triangles.push_back(tri);
// v.clear();
// continue;
// }
// v.push_back(stof(token));
// }
// }
// }
//
//
//};