From f6bb29e8f8375ff943760e611bc6d186727d2cc0 Mon Sep 17 00:00:00 2001
From: Mohcine Chraibi <m.chraibi@fz-juelich.de>
Date: Fri, 22 Feb 2019 09:14:59 +0100
Subject: [PATCH] init method I

---
 Analysis.cpp               | 16 +++++++++--
 general/ArgumentParser.cpp | 59 +++++++++++++++++++++++++++-----------
 general/ArgumentParser.h   |  2 ++
 3 files changed, 58 insertions(+), 19 deletions(-)

diff --git a/Analysis.cpp b/Analysis.cpp
index dadff1b4..17e4b904 100644
--- a/Analysis.cpp
+++ b/Analysis.cpp
@@ -140,7 +140,7 @@ void Analysis::InitArgs(ArgumentParser* args)
           }
      }
 
-     if(args ->GetIsMethodC()) {
+     if(args->GetIsMethodC()) {
           _DoesUseMethodC = true;
           vector<int> Measurement_Area_IDs = args->GetAreaIDforMethodC();
           for(unsigned int i=0; i<Measurement_Area_IDs.size(); i++)
@@ -150,7 +150,7 @@ void Analysis::InitArgs(ArgumentParser* args)
           _plotTimeseriesC=args->GetIsPlotTimeSeriesC();
      }
 
-     if(args ->GetIsMethodD()) {
+     if(args->GetIsMethodD()) {
           _DoesUseMethodD = true;
           vector<int> Measurement_Area_IDs = args->GetAreaIDforMethodD();
           for(unsigned int i=0; i<Measurement_Area_IDs.size(); i++)
@@ -162,6 +162,18 @@ void Analysis::InitArgs(ArgumentParser* args)
           _IndividualFDFlags = args->GetIndividualFDFlags();
           _plotTimeseriesD=args->GetIsPlotTimeSeriesD();
      }
+     if(args->GetIsMethodI()) {
+          _DoesUseMethodI = true;
+          vector<int> Measurement_Area_IDs = args->GetAreaIDforMethodI();
+          for(unsigned int i=0; i<Measurement_Area_IDs.size(); i++)
+          {
+               _areaForMethod_I.push_back(dynamic_cast<MeasurementArea_B*>( args->GetMeasurementArea(Measurement_Area_IDs[i])));
+          }
+          _StartFramesMethodI = args->GetStartFramesMethodI();
+          _StopFramesMethodI = args->GetStopFramesMethodI();
+          _IndividualFDFlags = args->GetIndividualFDFlags();
+          _plotTimeseriesI=args->GetIsPlotTimeSeriesI();
+     }
 
      _deltaF = args->GetDelatT_Vins();
      _cutByCircle = args->GetIsCutByCircle();
diff --git a/general/ArgumentParser.cpp b/general/ArgumentParser.cpp
index cc56aa26..63e52ecb 100644
--- a/general/ArgumentParser.cpp
+++ b/general/ArgumentParser.cpp
@@ -483,23 +483,6 @@ bool ArgumentParser::ParseIniFile(const string& inifile)
                {
                     areaB->_zPos=10000001.0;
                }
-               // get bounding box
-               // loading geometry is done in  analysis.cpp
-               // so this is done twice, which is not nice.
-               // For big geometries it could be slow.
-               Building*  building  = new Building();
-               building->LoadGeometry(GetGeometryFilename().string());
-               building->InitGeometry();
-               building->AddSurroundingRoom(); // this is a big reactagle
-                                               // slightly bigger than the
-                                               // geometry boundaries
-               double geo_minX = building->_xMin;
-               double geo_minY = building->_yMin;
-               double geo_maxX = building->_xMax;
-               double geo_maxY = building->_yMax;
-               Log->Write("INFO: \tBounding box:\n \t\tminX = %.2f\n \t\tmaxX = %.2f \n \t\tminY = %.2f \n\t\tmaxY = %.2f", geo_minX, geo_maxX, geo_minY, geo_maxY);
-
-
                std::map<int, polygon_2d> geoPoly;
                polygon_2d poly;
                Log->Write("INFO: \tMeasure area id  <%d> with type <%s>",areaB->_id, areaB->_type.c_str());
@@ -517,6 +500,24 @@ bool ArgumentParser::ParseIniFile(const string& inifile)
                if(num_verteces == 0) // big bounding box
                {
                     Log->Write("\tWARNING: NO measure area points given (%d). default BB!!", num_verteces);
+                    // get bounding box
+                    // loading geometry is done in  analysis.cpp
+                    // so this is done twice, which is not nice.
+                    // For big geometries it could be slow.
+                    Building*  building  = new Building();
+                    building->LoadGeometry(GetGeometryFilename().string());
+                    building->InitGeometry();
+                    building->AddSurroundingRoom(); // this is a big reactagle
+                    // slightly bigger than the
+                    // geometry boundaries
+                    double geo_minX = building->_xMin;
+                    double geo_minY = building->_yMin;
+                    double geo_maxX = building->_xMax;
+                    double geo_maxY = building->_yMax;
+                    Log->Write("INFO: \tBounding box:\n \t\tminX = %.2f\n \t\tmaxX = %.2f \n \t\tminY = %.2f \n\t\tmaxY = %.2f", geo_minX, geo_maxX, geo_minY, geo_maxY);
+
+
+
                     //1
                     double box_px = geo_minX*M2CM;
                     double box_py = geo_minY*M2CM;
@@ -1182,6 +1183,10 @@ bool ArgumentParser::GetIsMethodD() const
 {
      return _isMethodD;
 }
+bool ArgumentParser::GetIsMethodI() const
+{
+     return _isMethodI;
+}
 
 bool ArgumentParser::GetIsCutByCircle() const
 {
@@ -1227,6 +1232,11 @@ vector<bool> ArgumentParser::GetIsPlotTimeSeriesD() const
      return _isPlotTimeSeriesD;
 }
 
+vector<bool> ArgumentParser::GetIsPlotTimeSeriesI() const
+{
+     return _isPlotTimeSeriesI;
+}
+
 bool ArgumentParser::GetIsOneDimensional() const
 {
      return _isOneDimensional;
@@ -1278,16 +1288,31 @@ vector<int> ArgumentParser::GetAreaIDforMethodD() const
      return _areaIDforMethodD;
 }
 
+vector<int> ArgumentParser::GetAreaIDforMethodI() const
+{
+     return _areaIDforMethodI;
+}
+
 vector<int> ArgumentParser::GetStartFramesMethodD() const
 {
      return _start_frames_MethodD;
 }
 
+vector<int> ArgumentParser::GetStartFramesMethodI() const
+{
+     return _start_frames_MethodI;
+}
+
 vector<int> ArgumentParser::GetStopFramesMethodD() const
 {
      return _stop_frames_MethodD;
 }
 
+vector<int> ArgumentParser::GetStopFramesMethodI() const
+{
+     return _stop_frames_MethodI;
+}
+
 vector<bool> ArgumentParser::GetIndividualFDFlags() const
 {
      return _individual_FD_flags;
diff --git a/general/ArgumentParser.h b/general/ArgumentParser.h
index ebfa600d..e80d0f0e 100644
--- a/general/ArgumentParser.h
+++ b/general/ArgumentParser.h
@@ -136,10 +136,12 @@ public:
      bool GetIsMethodB() const;
      bool GetIsMethodC() const;
      bool GetIsMethodD() const;
+     bool GetIsMethodI() const;
      std::vector<int> GetAreaIDforMethodA() const;
      std::vector<int> GetAreaIDforMethodB() const;
      std::vector<int> GetAreaIDforMethodC() const;
      std::vector<int> GetAreaIDforMethodD() const;
+     std::vector<int> GetAreaIDforMethodI() const;
      std::vector<int> GetStartFramesMethodD() const;
      std::vector<int> GetStopFramesMethodD() const;
      std::vector<int> GetStartFramesMethodI() const;
-- 
GitLab