source: GTP/trunk/Lib/Vis/OnlineCullingCHC/src/VisibilityEnvironment.cpp @ 1004

Revision 1004, 1.7 KB checked in by mattausch, 18 years ago (diff)

environment as a singleton

Line 
1#include "VisibilityEnvironment.h"
2#include "common.h"
3#include "Environment.h"
4
5
6namespace GtpVisibility {
7
8//-----------------------------------------------------------------------
9VisibilityEnvironment::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//-----------------------------------------------------------------------
17VisibilityEnvironment::~VisibilityEnvironment()
18{
19        //DEL_PTR(Environment::GetSingleton());
20        GtpVisibilityPreprocessor::Environment::DelSingleton();
21}
22//-----------------------------------------------------------------------
23bool VisibilityEnvironment::LoadEnvironment(string filename)
24{               
25        //-- parse environment
26        return GtpVisibilityPreprocessor::Environment::GetSingleton()->ReadEnvFile(filename.c_str());
27}
28//-----------------------------------------------------------------------
29std::string VisibilityEnvironment::getSceneFileName()
30{
31        char str[200];
32        GtpVisibilityPreprocessor::Environment::GetSingleton()->GetStringValue("Scene.filename", str);
33        return str;
34}
35//-----------------------------------------------------------------------
36std::string VisibilityEnvironment::getViewCellsFileName()
37{
38        char str[200];
39        GtpVisibilityPreprocessor::Environment::GetSingleton()->GetStringValue("ViewCells.filename", str);
40       
41        return str;
42}
43//-----------------------------------------------------------------------
44GtpVisibilityPreprocessor::Environment *VisibilityEnvironment::GetPreprocessorEnvironment()
45{
46        return GtpVisibilityPreprocessor::Environment::GetSingleton();
47}
48} // namespace GtpVisibility
Note: See TracBrowser for help on using the repository browser.