#include "VisibilityEnvironment.h" #include "common.h" #include "Environment.h" namespace GtpVisibility { //----------------------------------------------------------------------- VisibilityEnvironment::VisibilityEnvironment() { // load debug stream GtpVisibilityPreprocessor::Debug.open("debug.log"); // load environment mEnvironment = new GtpVisibilityPreprocessor::Environment(); } //----------------------------------------------------------------------- VisibilityEnvironment::~VisibilityEnvironment() { DEL_PTR(mEnvironment); } //----------------------------------------------------------------------- bool VisibilityEnvironment::LoadEnvironment(string filename) { //-- parse filename into c-style argument list /*char argc = 2; char *argv[2]; argv[0] = ""; char fname[200]; sprintf(fname, "%s", filename.c_str()); argv[1] = fname; GtpVisibilityPreprocessor::Debug << "here4 loading environment from: " << argv[1] << endl; */ //-- parse environment return mEnvironment->ReadEnvFile(filename.c_str()); //return GtpVisibilityPreprocessor::environment->Parse(argc, argv, false); } //----------------------------------------------------------------------- std::string VisibilityEnvironment::getSceneFileName() { char str[200]; mEnvironment->GetStringValue("Scene.filename", str); return str; } //----------------------------------------------------------------------- std::string VisibilityEnvironment::getViewCellsFileName() { char str[200]; mEnvironment->GetStringValue("ViewCells.filename", str); return str; } //----------------------------------------------------------------------- GtpVisibilityPreprocessor::Environment *VisibilityEnvironment::GetPreprocessorEnvironment() { return mEnvironment; } } // namespace GtpVisibility