-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMeshTransport.h
72 lines (58 loc) · 1.65 KB
/
MeshTransport.h
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
//############################################################
//
// MeshTransport.h
//
// Matt Ginzton
// Tue Feb 9 16:38:33 CET 1999
//
// Wrapper class for sending geometry information, as one or
// more triangle meshes, from point a to b, managing memory
// issues along the way.
//
//############################################################
#ifndef _MESHTRANSPORT_H_
#define _MESHTRANSPORT_H_
#include <vector>
#ifdef WIN32
# include "winGLdecs.h"
#endif
#include <GL/gl.h>
#include "Pnt3.h"
#include "Xform.h"
#include "Bbox.h"
#include "defines.h"
class MeshTransport {
public:
MeshTransport();
~MeshTransport();
vector<const vector<Pnt3>*> vtx;
vector< Xform<float> > xf;
vector<Bbox> bbox;
vector<const vector<int>*> tri_inds;
vector<const vector<uchar>*> color;
static const GLenum normal_type;
#ifdef SCZ_NORMAL_FORCEFLOAT
vector<const vector<float>*> nrm;
#else
vector<const vector<short>*> nrm;
#endif
enum TransportMode { copy, share, steal };
void setVtx (const vector<Pnt3>* in, TransportMode mode,
const Xform<float>& xfBy = Xform<float>());
void setBbox (const Bbox& in);
void setNrm (const vector<short>* in, TransportMode mode);
void setTris (const vector<int>* in, TransportMode mode);
void setColor (const vector<uchar>* in, TransportMode mode);
void appendMT (MeshTransport* in,
const Xform<float>& xfBy = Xform<float>());
#ifdef SCZ_NORMAL_FORCEFLOAT
private:
void setNrm (const vector<float>* in, TransportMode mode);
#endif
private:
vector<bool> freeVtx;
vector<bool> freeNrm;
vector<bool> freeTris;
vector<bool> freeColor;
};
#endif // _MESHTRANSPORT_H_