-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRenderingParameters.h
More file actions
52 lines (44 loc) · 1.01 KB
/
RenderingParameters.h
File metadata and controls
52 lines (44 loc) · 1.01 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
#ifndef _RENDERINGPARAMETERS_H
#define _RENDERINGPARAMETERS_H
class RenderingParameters
{
public:
bool showEnvelopes; //show Tree Crown Envelopes on GUI
bool showLeaves; //show Tree Leaves on tree model
bool showBark; //show Bark texture on tree model
bool showGrass; //show grass on the ground
static const bool SHOWENVELOPE_DEFAULT=TRUE;
static const bool SHOWLEAVES_DEFAULT=TRUE;
static const bool SHOWBARK_DEFAULT=TRUE;
static const bool SHOWGRASS_DEFAULT=FALSE;
RenderingParameters() {
setDefault();
}
void setDefault()
{
showEnvelopes=SHOWENVELOPE_DEFAULT;
showLeaves=SHOWLEAVES_DEFAULT;
showBark=SHOWBARK_DEFAULT;
showGrass=SHOWGRASS_DEFAULT;
}
/* Serialization methods */
void save(ofstream &s)
{
#define SAVE(param) s<<param<<endl;
SAVE(showEnvelopes);
SAVE(showLeaves);
SAVE(showBark);
SAVE(showGrass);
#undef SAVE
}
void load(ifstream &s)
{
#define LOAD(param) s>>param;
LOAD(showEnvelopes);
LOAD(showLeaves);
LOAD(showBark);
LOAD(showGrass);
#undef LOAD
}
};
#endif