[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");
|
---|
| 13 |
|
---|
[59] | 14 | }
|
---|
[870] | 15 | VisibilityEnvironment::~VisibilityEnvironment()
|
---|
| 16 | {
|
---|
| 17 | // load debug stream
|
---|
| 18 | DEL_PTR(GtpVisibilityPreprocessor::environment);
|
---|
| 19 |
|
---|
| 20 | }
|
---|
[74] | 21 | //-----------------------------------------------------------------------
|
---|
[870] | 22 | void VisibilityEnvironment::LoadEnvironment(string filename)
|
---|
[59] | 23 | {
|
---|
[870] | 24 | // todo matt:
|
---|
| 25 | GtpVisibilityPreprocessor::environment = new GtpVisibilityPreprocessor::Environment;
|
---|
| 26 |
|
---|
| 27 | char argc = 2;
|
---|
| 28 | char *argv[2];
|
---|
| 29 | argv[0] = "";
|
---|
| 30 |
|
---|
| 31 | char fname[200];
|
---|
| 32 | sprintf(fname, "%s", filename.c_str());
|
---|
| 33 | argv[1] = fname;
|
---|
| 34 |
|
---|
| 35 | GtpVisibilityPreprocessor::Debug << "filename: " << argv[1] << endl;
|
---|
| 36 |
|
---|
| 37 | GtpVisibilityPreprocessor::environment->Parse(argc, argv, false);
|
---|
| 38 | //MeshKdTree::ParseEnvironment();
|
---|
[59] | 39 | }
|
---|
[925] | 40 | //-----------------------------------------------------------------------
|
---|
| 41 | std::string VisibilityEnvironment::getSceneFileName()
|
---|
| 42 | {
|
---|
| 43 | char str[200];
|
---|
| 44 | GtpVisibilityPreprocessor::environment->GetStringValue("Scene.filename", str);
|
---|
| 45 | return str;
|
---|
| 46 | }
|
---|
| 47 | //-----------------------------------------------------------------------
|
---|
| 48 | std::string VisibilityEnvironment::getViewCellsFileName()
|
---|
| 49 | {
|
---|
| 50 | char str[200];
|
---|
| 51 | GtpVisibilityPreprocessor::environment->GetStringValue("ViewCells.filename", str);
|
---|
| 52 | return str;
|
---|
| 53 | }
|
---|
[59] | 54 |
|
---|
| 55 | } // namespace GtpVisibility
|
---|