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

Revision 938, 1.8 KB checked in by mattausch, 19 years ago (diff)
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{
[870]11        // load debug stream
12        GtpVisibilityPreprocessor::Debug.open("debug.log");
[938]13
14        // load environment
15        mEnvironment = new GtpVisibilityPreprocessor::Environment();     
[59]16}
[938]17//-----------------------------------------------------------------------
[870]18VisibilityEnvironment::~VisibilityEnvironment()
19{
[938]20        DEL_PTR(mEnvironment);   
[870]21}
[74]22//-----------------------------------------------------------------------
[938]23bool VisibilityEnvironment::LoadEnvironment(string filename)
24{       
25        //-- parse filename into c-style argument list
26        /*char argc = 2;
[870]27        char *argv[2];
28        argv[0] = "";
29       
30        char fname[200];
31        sprintf(fname, "%s", filename.c_str());
32        argv[1] = fname;
33
[938]34        GtpVisibilityPreprocessor::Debug << "here4 loading environment from: " << argv[1] << endl;
35*/
36                //-- parse environment
37        return mEnvironment->ReadEnvFile(filename.c_str());
38        //return GtpVisibilityPreprocessor::environment->Parse(argc, argv, false);
[59]39}
[925]40//-----------------------------------------------------------------------
41std::string VisibilityEnvironment::getSceneFileName()
42{
43        char str[200];
[938]44        mEnvironment->GetStringValue("Scene.filename", str);
[925]45        return str;
46}
47//-----------------------------------------------------------------------
48std::string VisibilityEnvironment::getViewCellsFileName()
49{
50        char str[200];
[938]51        mEnvironment->GetStringValue("ViewCells.filename", str);
[925]52        return str;
53}
[938]54//-----------------------------------------------------------------------
55GtpVisibilityPreprocessor::Environment *VisibilityEnvironment::GetPreprocessorEnvironment()
56{
57        return mEnvironment;
58}
[59]59} // namespace GtpVisibility
Note: See TracBrowser for help on using the repository browser.