From a25c79f98900bfc3a83f747c03da79f56f000c93 Mon Sep 17 00:00:00 2001
From: Kerautret <bertrand.kerautret@univ-lyon2.fr>
Date: Sat, 29 Dec 2018 23:08:24 +0100
Subject: [PATCH] DEmo: ajout version

---
 Code/Seg/BlurredSegment/bsdetector.cpp |  8 +++++++-
 Code/Seg/BlurredSegment/bsdetector.h   | 16 +++++++++++++++-
 Code/Seg/BlurredSegment/bstracker.cpp  |  2 ++
 Code/Seg/IPOLdemo/mainIPOL.cpp         | 13 ++++++++++++-
 4 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/Code/Seg/BlurredSegment/bsdetector.cpp b/Code/Seg/BlurredSegment/bsdetector.cpp
index 7b23709..4b3ea6b 100755
--- a/Code/Seg/BlurredSegment/bsdetector.cpp
+++ b/Code/Seg/BlurredSegment/bsdetector.cpp
@@ -1,7 +1,7 @@
 #include "bsdetector.h"
 
 
-
+const string BSDetector::VERSION = "0.1";
 const int BSDetector::STEP_FINAL = 0;
 const int BSDetector::STEP_INITIAL = 1;
 const int BSDetector::STEP_PRELIM = 2;
@@ -748,3 +748,9 @@ void BSDetector::switchPreliminary ()
     if (bst1->orthoScansOn ()) bst0->switchOrthoScans ();
   }
 }
+
+
+std::string BSDetector::version ()
+{
+  return BSDetector::VERSION;
+}
diff --git a/Code/Seg/BlurredSegment/bsdetector.h b/Code/Seg/BlurredSegment/bsdetector.h
index bbfecdb..2b4d16e 100755
--- a/Code/Seg/BlurredSegment/bsdetector.h
+++ b/Code/Seg/BlurredSegment/bsdetector.h
@@ -17,6 +17,9 @@ class BSDetector
 
 public:
 
+  /** Version number  **/
+  static const string VERSION;
+
   /** Identifier for the final detection step. */
   static const int STEP_FINAL;
   /** Identifier for the initial detection step. */
@@ -138,7 +141,16 @@ public:
    * @param step Detection step.
    */
   BlurredSegment *getBlurredSegment (int step = STEP_FINAL) const;
-    
+
+  
+  /**
+   *  \brief Returns the current version of the detector.
+   * @return the current version.
+   */
+  std::string version();
+
+
+  
   /**
    * \brief Returns the list of detected blurred segments at final step.
    */
@@ -588,6 +600,7 @@ public:
    * \brief Toggles the detector used (between IWCIA '09 and present).
    */
   inline void switchDetector () { oldp = ! oldp; }
+  
 
 
 private :
@@ -716,5 +729,6 @@ private :
    */
   void freeMultiSelection ();
 
+  
 };
 #endif
diff --git a/Code/Seg/BlurredSegment/bstracker.cpp b/Code/Seg/BlurredSegment/bstracker.cpp
index 798b49a..cd364ec 100755
--- a/Code/Seg/BlurredSegment/bstracker.cpp
+++ b/Code/Seg/BlurredSegment/bstracker.cpp
@@ -449,3 +449,5 @@ void BSTracker::switchScanExtent ()
   maxScan = (maxScan == gMap->getHeightWidthMax () ?
              DEFAULT_MAX_SCAN : gMap->getHeightWidthMax ());
 }
+
+
diff --git a/Code/Seg/IPOLdemo/mainIPOL.cpp b/Code/Seg/IPOLdemo/mainIPOL.cpp
index ffc3360..8e7c2d8 100755
--- a/Code/Seg/IPOLdemo/mainIPOL.cpp
+++ b/Code/Seg/IPOLdemo/mainIPOL.cpp
@@ -19,13 +19,24 @@ void usage(std::string str)
 
 int main (int argc, char *argv[])
 {
+  for (int i = 1; i < argc; i++)
+  {
+    if (string(argv[i]) == "--version")
+    {
+       BSDetector detector;
+       std::cout << detector.version()<< std::endl;
+       return 0;
+    }
+  }
+
   if (argc < 4)
   {
     usage(argv[0]);
     exit(EXIT_FAILURE);
   }
 
-  
+      
+    
   // getting parameters:
   // - input image file
   string input_filename = argv[1];
-- 
GitLab