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

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