[59] | 1 | #include "VisibilityEnvironment.h"
|
---|
[870] | 2 | #include "common.h"
|
---|
| 3 | #include "Environment.h"
|
---|
[59] | 4 |
|
---|
[870] | 5 |
|
---|
[59] | 6 | namespace GtpVisibility {
|
---|
[100] | 7 |
|
---|
[74] | 8 | //-----------------------------------------------------------------------
|
---|
[59] | 9 | VisibilityEnvironment::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] | 18 | VisibilityEnvironment::~VisibilityEnvironment()
|
---|
| 19 | {
|
---|
[938] | 20 | DEL_PTR(mEnvironment);
|
---|
[870] | 21 | }
|
---|
[74] | 22 | //-----------------------------------------------------------------------
|
---|
[938] | 23 | bool 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 | //-----------------------------------------------------------------------
|
---|
| 41 | std::string VisibilityEnvironment::getSceneFileName()
|
---|
| 42 | {
|
---|
| 43 | char str[200];
|
---|
[938] | 44 | mEnvironment->GetStringValue("Scene.filename", str);
|
---|
[925] | 45 | return str;
|
---|
| 46 | }
|
---|
| 47 | //-----------------------------------------------------------------------
|
---|
| 48 | std::string VisibilityEnvironment::getViewCellsFileName()
|
---|
| 49 | {
|
---|
| 50 | char str[200];
|
---|
[938] | 51 | mEnvironment->GetStringValue("ViewCells.filename", str);
|
---|
[925] | 52 | return str;
|
---|
| 53 | }
|
---|
[938] | 54 | //-----------------------------------------------------------------------
|
---|
| 55 | GtpVisibilityPreprocessor::Environment *VisibilityEnvironment::GetPreprocessorEnvironment()
|
---|
| 56 | {
|
---|
| 57 | return mEnvironment;
|
---|
| 58 | }
|
---|
[59] | 59 | } // namespace GtpVisibility
|
---|