1 | #include "VisibilityEnvironment.h"
|
---|
2 | #include "common.h"
|
---|
3 | #include "Environment.h"
|
---|
4 |
|
---|
5 |
|
---|
6 | namespace GtpVisibility {
|
---|
7 |
|
---|
8 | //-----------------------------------------------------------------------
|
---|
9 | VisibilityEnvironment::VisibilityEnvironment()
|
---|
10 | {
|
---|
11 | // HACK: loading debug stream should not happen here
|
---|
12 | GtpVisibilityPreprocessor::Debug.open("debug.log");
|
---|
13 | // load environment
|
---|
14 | //Environment::GetSingleton() = new GtpVisibilityPreprocessor::Environment::GetSingleton();
|
---|
15 | }
|
---|
16 | //-----------------------------------------------------------------------
|
---|
17 | VisibilityEnvironment::~VisibilityEnvironment()
|
---|
18 | {
|
---|
19 | GtpVisibilityPreprocessor::Environment::DelSingleton();
|
---|
20 | }
|
---|
21 | //-----------------------------------------------------------------------
|
---|
22 | bool VisibilityEnvironment::LoadEnvironment(std::string filename)
|
---|
23 | {
|
---|
24 | //-- parse environment
|
---|
25 | return GtpVisibilityPreprocessor::Environment::GetSingleton()->ReadEnvFile(filename.c_str());
|
---|
26 | }
|
---|
27 | //-----------------------------------------------------------------------
|
---|
28 | std::string VisibilityEnvironment::getSceneFileName()
|
---|
29 | {
|
---|
30 | char str[200];
|
---|
31 | GtpVisibilityPreprocessor::Environment::GetSingleton()->GetStringValue("Scene.filename", str);
|
---|
32 | return str;
|
---|
33 | }
|
---|
34 | //-----------------------------------------------------------------------
|
---|
35 | std::string VisibilityEnvironment::getViewCellsFileName()
|
---|
36 | {
|
---|
37 | char str[200];
|
---|
38 | GtpVisibilityPreprocessor::Environment::GetSingleton()->GetStringValue("ViewCells.filename", str);
|
---|
39 |
|
---|
40 | return str;
|
---|
41 | }
|
---|
42 | //-----------------------------------------------------------------------
|
---|
43 | GtpVisibilityPreprocessor::Environment *VisibilityEnvironment::GetPreprocessorEnvironment()
|
---|
44 | {
|
---|
45 | return GtpVisibilityPreprocessor::Environment::GetSingleton();
|
---|
46 | }
|
---|
47 | } // namespace GtpVisibility
|
---|