-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathBaseModel.cpp
53 lines (39 loc) · 1.17 KB
/
BaseModel.cpp
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
// +------------------------------------------------------------+
// | University Racer |
// | Projekt do PGR a GMU, FIT VUT v Brne, 2011 |
// +------------------------------------------------------------+
// | Autori: Tomáš Kimer, [email protected] |
// | Tomáš Sychra, [email protected] |
// | David Šabata, [email protected] |
// +------------------------------------------------------------+
#include "BaseModel.h"
#include <iostream>
#include <string>
#ifdef _DEBUG
#define new MYDEBUG_NEW
#endif
using namespace std;
BaseModel::~BaseModel()
{
// uvolnit z pameti vsechny meshe
for (vector<Mesh*>::iterator it = meshes.begin(); it != meshes.end(); it++)
{
delete (*it);
}
}
void BaseModel::setMeshes(vector<Mesh*> meshes)
{
this->meshes = meshes;
vertexCount = 0;
faceCount = 0;
// spocitat vrcholy a facy
for (vector<Mesh*>::iterator it = meshes.begin(); it != meshes.end(); it++)
{
vertexCount += (*it)->getVertices().size();
faceCount += (*it)->getFaces().size();
}
}
vector<Mesh*> &BaseModel::getMeshes()
{
return meshes;
}