blob: 84c3f9b09fe6bf8cc82253b67013f95e14853c34 (
plain)
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
|
/*
model/primitives.h
This file is part of the Osirion project and is distributed under
the terms of the GNU General Public License version 2
*/
#ifndef __INCLUDED_MODEL_PRIMITIVES_H__
#define __INCLUDED_MODEL_PRIMITIVES_H__
#include <list>
#include "math/vector3f.h"
#include "model/material.h"
#include "model/triangle.h"
#include "model/quad.h"
namespace model
{
/// a list of Triangle and Quad primitives with the same material, to be parsed into fragments
class Primitives
{
public:
/// type definition for a list of triangles
typedef std::list<Triangle *> Triangles;
/// type definition for a list of quads
typedef std::list<Quad *> Quads;
Primitives(Material *material);
~Primitives();
/// the material to be used for these primitives
inline const Material *material() const
{
return primitives_material;
}
/// list of triangles
inline Triangles & triangles()
{
return primitives_triangles;
}
/// list of quads
inline Quads & quads()
{
return primitives_quads;
}
/// add a Triangle primitive
void add_triangle(Triangle *triangle);
/// add a Quad primitive
void add_quad(Quad *quad);
private:
Triangles primitives_triangles;
Quads primitives_quads;
Material * primitives_material;
};
}
#endif
|