From a6eb2e10b3233f452bb930dd1dcdff42518250ca Mon Sep 17 00:00:00 2001
From: Francois Trahay <francois.trahay@telecom-sudparis.eu>
Date: Wed, 22 Jan 2014 12:53:34 +0000
Subject: [PATCH] revert commit #1406

---
 CMakeLists.txt                                |  26 +++-
 src/core/Core.cpp                             |  55 ++-----
 src/core/Core.hpp                             |  22 +--
 src/interface/Interface_graphic.cpp           |  74 +++++----
 src/interface/Interface_graphic.hpp           |  13 +-
 src/parser/PajeParser/PajeDefinition.hpp      |   4 -
 src/parser/PajeParser/PajeFileManager.cpp     |  19 ---
 src/parser/PajeParser/PajeFileManager.hpp     |  61 +++-----
 .../PajeParser/ParserDefinitionPaje.cpp       |  10 +-
 src/parser/PajeParser/ParserEventPaje.cpp     | 145 +-----------------
 src/parser/PajeParser/ParserEventPaje.hpp     |  24 ++-
 src/parser/PajeParser/ParserPaje.cpp          |  54 ++-----
 src/parser/PajeParser/ParserPaje.hpp          |  27 ++--
 src/parser/PajeParser/ParserVite.cpp          |   2 +-
 src/parser/ParserFactory.cpp                  |   7 +-
 src/parser/ParserFactory.hpp                  |   6 +-
 src/render/Hook_event.cpp                     |  47 +++---
 src/render/Hook_event.hpp                     |   2 +-
 18 files changed, 193 insertions(+), 405 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b646912..dbdcea85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,10 +31,26 @@ include (CheckLibraryExists)
 include (CMakeDependentOption)
 
 ### Required Packages
-find_package(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
-set(QT_USE_QTUITOOLS ON)
-set(QT_USE_QTOPENGL ON)
-include(${QT_USE_FILE})
+# Try to find Qt5 : http://forum.openscenegraph.org/viewtopic.php?t=11431
+set(USE_QT5 OFF)
+# QUIET option disables messages if the package cannot be found.
+find_package(Qt5Widgets QUIET)
+if(Qt5Widgets_FOUND)
+# CMake 2.8.8 or greater required for qt5 use
+ if("${CMAKE_VERSION}" VERSION_GREATER 2.8.7)
+   set(USE_QT5 ON)
+ endif()
+endif()
+
+if(USE_QT5)
+  set(CMAKE_AUTOMOC ON)
+  find_package(Qt5 COMPONENTS Core Xml Widgets OpenGL UiTools REQUIRED)
+else(USE_QT5) # Try Qt4
+  find_package(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
+  set(QT_USE_QTUITOOLS ON)
+  set(QT_USE_QTOPENGL ON)
+  include(${QT_USE_FILE})
+endif(USE_QT5)
 
 #find_package(OpenGL)
 find_package(GLU)
@@ -96,7 +112,7 @@ check_include_files(string.h HAVE_STRING_H)
 #    Components : filesystem, iostreams, programoptions, python, regex,
 #                 serialization, signals, system, thread, wave
 if(VITE_ENABLE_SERIALIZATION)
-  find_package( Boost COMPONENTS serialization thread iostreams)
+  find_package( Boost COMPONENTS serialization thread iostreams system)
 endif(VITE_ENABLE_SERIALIZATION)
 
 if(VITE_ENABLE_VBO)
diff --git a/src/core/Core.cpp b/src/core/Core.cpp
index eca4d398..ff084487 100644
--- a/src/core/Core.cpp
+++ b/src/core/Core.cpp
@@ -102,6 +102,7 @@
 #include "trace/EntityValue.hpp"
 #include "trace/EntityTypes.hpp"
 #include "trace/Entitys.hpp"
+//#include "trace/tree/Interval.hpp"
 #include "trace/Trace.hpp"
 #include "trace/DrawTree.hpp"
 #include "trace/DrawTrace.hpp"
@@ -112,13 +113,9 @@
 /* -- */
 #include "statistics/Stats_window.hpp"
 /* -- */
-#include "../parser/PajeParser/PajeFileManager.hpp"
-
 #include "interface/Node_select.hpp"
 #include "interface/Interface_graphic.hpp"
 #include "core/Core.hpp"
-#include "../parser/PajeParser/ParserEventPaje.hpp"
-#include "../parser/PajeParser/PajeFileManager.hpp"
 /* -- */
 #ifdef WITH_VBO
 #include "render/Render_alternate.hpp"
@@ -163,8 +160,9 @@ Core::Core(int &argc, char ** argv)
     console_app = NULL;
 
     /* Qt uses the default system encoding for QString (used when opening a file) */
+#if QT_VERSION < 0x050000
     QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
-
+#endif
     /*
      * Store application name and current directory 
      */
@@ -487,7 +485,7 @@ bool Core::draw_trace(const string & filename, const int format) {
     parser = NULL;
     DrawTrace  drawing_ogl;
     bool killed=false;
-//    bool use_exact_values= true;
+
 #ifdef WITH_VBO
     Render<Render_alternate>render(_render_opengl) ;
 #else
@@ -500,7 +498,7 @@ bool Core::draw_trace(const string & filename, const int format) {
     int           time_buf = 0;
 
     // Select the Parser in function of the file's extension
-    if(! ParserFactory::create(&parser, filename,_use_exact_values)){
+    if(! ParserFactory::create(&parser, filename)){
         *Message::get_instance() << QObject::tr("Error : parser not found for input file").toStdString() << Message::ende;
         return false;
     }
@@ -515,6 +513,9 @@ bool Core::draw_trace(const string & filename, const int format) {
         Session::add_recent_file(QFileInfo(filename.c_str()).absoluteFilePath());
         _main_window->update_recent_files_menu();
     }
+
+    if (NULL == _trace) { /* no trace is loaded, parse the file */
+
         /* Init data */
         Info::Entity::x_min          = 0;
         Info::Entity::x_max          = 0;
@@ -717,11 +718,7 @@ bool Core::draw_trace(const string & filename, const int format) {
         thread.wait();
 
         Error::print_numbers();
-        std::string file_path =((QFileInfo(filename.c_str()).absoluteFilePath()).toStdString());
-        std::string fname = filename.substr( filename.find_last_of("/") + 1 );
-        std::string result= file_path.erase ((filename.find_last_of("/") + 1 ), strlen(fname.c_str()));
-
-        Error::flush(result+"log.txt");
+        Error::flush("log.txt");
 
         // Wait for the end of the thread
         //while(!thread.wait()) {
@@ -733,7 +730,10 @@ bool Core::draw_trace(const string & filename, const int format) {
 
         delete parser;
         parser=NULL;
-
+    }
+    else if ( _file_opened != filename) {/* just check if execution is normal */
+        *Message::get_instance() << "Try to use file: " << filename << " instead of a previous parsed file: " << _file_opened << Message::ende;
+    }
     if(_trace!=NULL && !killed){
         if (Info::Render::_x_min_visible == Info::Render::_x_max_visible){// first time
             _trace->set_interval_constrained(new Interval(0,_trace->get_max_date()));
@@ -830,12 +830,9 @@ int Core::run(){
         return EXIT_SUCCESS;
     }
 }
-//    default:/* like _STATE_UNKNOWN */
-//        display_help();
-//        warning(string("Cannot determine the arguments past. Please check the correct syntax."));
 
-//    }
-//}
+
+
 
 void Core::launch_action(int state, void* arg) {
 
@@ -1224,32 +1221,14 @@ void Core::launch_action(int state, void* arg) {
 
         break;
     }
-        case _ZOOM_IN_PATTERN:
-    {
-        if(_use_exact_values==false){
-            _use_exact_values =true;
-            launch_action(Core:: _STATE_CLEAN_RENDER_AREA);
-            draw_trace(get_filename(),Core::_DRAW_OPENGL);
-        }
-    }
-        break;
-
-        case _ZOOM_OUT_PATTERN:
-    {
-        if(_use_exact_values==true){
-            _use_exact_values =false;
-            launch_action(Core:: _STATE_CLEAN_RENDER_AREA);
-            draw_trace(get_filename(),Core::_DRAW_OPENGL);
-        }
-    }
-        break;
-
     default:/* like _STATE_UNKNOWN */
         display_help();
         warning(string("Cannot determine the arguments past. Please check the correct syntax."));
+
     }
 }
 
+
 void Core::display_help(){
     cout << endl
          << "Usage: vite [OPTION...] [[-f] inputfile] [-e outputfile] " << endl
diff --git a/src/core/Core.hpp b/src/core/Core.hpp
index 4ccb3239..f827186d 100644
--- a/src/core/Core.hpp
+++ b/src/core/Core.hpp
@@ -49,6 +49,7 @@
 
 
 //#define WITH_VBO
+
 class Core;
 class Interface_graphic;
 
@@ -67,21 +68,14 @@ class QString;
 class QMutex;
 class Parser;
 class QWaitCondition ;
-class PajeFileManager;
-class ParserPaje;
-class ParserEventPaje;
 #include <interface/Interface_graphic.hpp>
 #include <QObject>
 #ifdef USE_MPI
 #include <boost/mpi/environment.hpp>
 #include <boost/mpi/communicator.hpp>
 #endif
-
-#include "parser/Parser.hpp"
-/* -- */
-#include "parser/PajeParser/PajeDefinition.hpp"
-#include "../parser/PajeParser/ParserPaje.hpp"
-
+//#include "render/Render.hpp"
+//#include "interface/Interface.hpp"
 
 /*!
  *\brief This class is an terminal interface, it inherited from the Interface interface.
@@ -89,7 +83,6 @@ class ParserEventPaje;
 class Core : public QObject, public Interface {
     Q_OBJECT
     public:
-//    ParserEventPaje _ParserEvent;
 
     /***********************************
      *
@@ -240,10 +233,6 @@ class Core : public QObject, public Interface {
 
     static const int _STATE_UPDATE_VARVALUES = 30;
 
-    static const int _ZOOM_IN_PATTERN = 31;
-
-    static const int _ZOOM_OUT_PATTERN = 32;
-
     /*!
      * \brief Launch an action according to the argument state value.
      * \param state An integer corresponding to a kind of action which must be executed.
@@ -334,11 +323,13 @@ protected:
     /*!
      * \brief Contains the trace instance.
      */
-    Trace*          _trace;
+    Trace* _trace;
+
     QMutex*         _mutex;
     Parser*         parser;
     QWaitCondition* _finished;
     QWaitCondition* _closed;
+
     /*!
      *\brief This attributes contains the launching current directory (_run_env[0]) and the first argument of the running command (_run_env[1]).
      */
@@ -430,7 +421,6 @@ public:
      */
     bool draw_trace(const std::string & filename, const int format);
 
-    bool _use_exact_values=false;
     /*!
      * \brief This function launch Qt event loop.
      */
diff --git a/src/interface/Interface_graphic.cpp b/src/interface/Interface_graphic.cpp
index 780cd219..6c3f7ab6 100644
--- a/src/interface/Interface_graphic.cpp
+++ b/src/interface/Interface_graphic.cpp
@@ -57,11 +57,11 @@
 #include <QtUiTools>/* for the run-time loading .ui file */
 #include <QCloseEvent>
 #include <QDir>
-#include <QtGui/QFileDialog>
-#include <QtGui/QRadioButton>
-#include <QtGui/QTextEdit>
-#include <QtGui/QCheckBox>
-#include <QtGui/QMessageBox>
+#include <QFileDialog>
+#include <QRadioButton>
+#include <QTextEdit>
+#include <QCheckBox>
+#include <QMessageBox>
 #include <QProgressDialog>
 /* -- */
 #include "interface/resource.hpp"
@@ -205,7 +205,7 @@ void Interface_graphic::load_windows(){
     if ( file_counter_to_export.exists() ) {
         file_counter_to_export.open(QFile::ReadOnly);
         CKFP(_ui_counter_choice_to_export = loader.load(&file_counter_to_export, this), "Cannot open the .ui file : " << ":/window/list_of_counter_to_export.ui");
-        CKFP(_counter_list_names = qFindChild<QComboBox*>(_ui_counter_choice_to_export, "combobox"), "Cannot find the svg export button in the .ui file");
+        CKFP(_counter_list_names = _ui_counter_choice_to_export->findChild<QComboBox*>("combobox"), "Cannot find the svg export button in the .ui file");
         file_counter_to_export.close();
     } else {
         cerr << __FILE__ << ":" << __LINE__ << ": The following .ui file doesn't exist: " << ":/window/list_of_counter_to_export.ui" << endl;
@@ -225,9 +225,9 @@ void Interface_graphic::load_windows(){
     /* Load the export combo box choice from a .ui file */
     /*    file_kind_of_export.open(QFile::ReadOnly);
         CKFP(_ui_kind_of_export_choice = loader.load(&file_kind_of_export, this), "Cannot open the .ui file : " << ":/window/kind_of_export.ui");
-    CKFP(_ui_svg_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "svg_export"), "Cannot find the svg export button in the .ui file");
-    CKFP(_ui_png_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "png_export"), "Cannot find the png export button in the .ui file");
-     CKFP(_ui_counter_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "counter_export"), "Cannot find the svg export button in the .ui file");   
+    CKFP(_ui_svg_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "svg_export"), "Cannot find the svg export button in the .ui file");
+    CKFP(_ui_png_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "png_export"), "Cannot find the png export button in the .ui file");
+     CKFP(_ui_counter_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "counter_export"), "Cannot find the svg export button in the .ui file");   
     file_kind_of_export.close();*/
     
     /* Set some windows properties */
@@ -235,26 +235,26 @@ void Interface_graphic::load_windows(){
     _ui_time_selection_export->setWindowFlags(_ui_time_selection_export->windowFlags() | Qt::WindowStaysOnTopHint);
    
     /* Load widget from the .ui file */
-    CKFP(_ui_render_area_layout = qFindChild<QVBoxLayout*>(this, "render_area_layout"), "Cannot find the render_area layout in the .ui file");   
+    CKFP(_ui_render_area_layout = this->findChild<QVBoxLayout*>("render_area_layout"), "Cannot find the render_area layout in the .ui file");   
     
-    CKFP(_ui_fullscreen_menu = qFindChild<QAction*>(this, "fullscreen"), "Cannot find the fullscreen menu in the .ui file");
-    CKFP(_ui_info_trace_text = qFindChild<QTextEdit*>(_ui_info_window, "info_trace_text"), "Cannot find the info_trace_text QTextEdit widget in the .ui file");
-    CKFP(_ui_info_selection_text = qFindChild<QTextEdit*>(_ui_info_window, "info_selection_text"), "Cannot find the info_selection_text QTextEdit widget in the .ui file");
-    CKFP(_ui_toolbar = qFindChild<QToolBar*>(this, "toolBar"), "Cannot find the tool bar in the .ui file");   
+    CKFP(_ui_fullscreen_menu = this->findChild<QAction*>("fullscreen"), "Cannot find the fullscreen menu in the .ui file");
+    CKFP(_ui_info_trace_text = _ui_info_window->findChild<QTextEdit*>("info_trace_text"), "Cannot find the info_trace_text QTextEdit widget in the .ui file");
+    CKFP(_ui_info_selection_text = _ui_info_window->findChild<QTextEdit*>("info_selection_text"), "Cannot find the info_selection_text QTextEdit widget in the .ui file");
+    CKFP(_ui_toolbar = this->findChild<QToolBar*>("toolBar"), "Cannot find the tool bar in the .ui file");   
 
-    CKFP(_ui_x_scroll = qFindChild<QScrollBar*>(this, "x_scroll"), "Cannot find the horizontal scroll bar in the .ui file");
-    CKFP(_ui_y_scroll = qFindChild<QScrollBar*>(this, "y_scroll"), "Cannot find the vertical scroll bar in the .ui file");
+    CKFP(_ui_x_scroll = this->findChild<QScrollBar*>("x_scroll"), "Cannot find the horizontal scroll bar in the .ui file");
+    CKFP(_ui_y_scroll = this->findChild<QScrollBar*>("y_scroll"), "Cannot find the vertical scroll bar in the .ui file");
 
-    CKFP(_ui_zoom_box = qFindChild<QComboBox*>(this, "zoom_box"), "Cannot find the zoom box in the .ui file");   
+    CKFP(_ui_zoom_box = this->findChild<QComboBox*>("zoom_box"), "Cannot find the zoom box in the .ui file");   
 
-    CKFP(_ui_recent_files_menu = qFindChild<QMenu*>(this, "menuRecent_Files"), "Cannot find the button \"menuRecent_Files\" in the .ui file");   
+    CKFP(_ui_recent_files_menu = this->findChild<QMenu*>("menuRecent_Files"), "Cannot find the button \"menuRecent_Files\" in the .ui file");   
 
-    //  CKFP(Info::Render::_ui_render_min_value = qFindChild<QLabel*>(this, "render_min_value"), "Cannot find the render_min_value label in the .ui file");
-    // CKFP(Info::Render::_ui_render_max_value = qFindChild<QLabel*>(this, "render_max_value"), "Cannot find the render_max_value label in the .ui file");
+    //  CKFP(Info::Render::_ui_render_min_value = this->findChild<QLabel*>("render_min_value"), "Cannot find the render_min_value label in the .ui file");
+    // CKFP(Info::Render::_ui_render_max_value = this->findChild<QLabel*>("render_max_value"), "Cannot find the render_max_value label in the .ui file");
 
 
     /* Help window */
-    CKFP(_ui_help_ok_button = qFindChild<QPushButton*>(_ui_help_window, "help_ok"), "Cannot find the ok push button in the help dialog .ui file");     
+ CKFP(_ui_help_ok_button = _ui_help_window->findChild<QPushButton*>("help_ok"), "Cannot find the ok push button in the help dialog .ui file");     
  
 
     connect(_ui_counter_choice_to_export, SIGNAL(accepted()),
@@ -366,6 +366,7 @@ void Interface_graphic::selection_information(const string &s) const{
  **********************************/
 
 void Interface_graphic::opening_file(const string &path){
+    
     information(string("File opened: ")+ path);
     
     _trace_path = path;
@@ -374,15 +375,15 @@ void Interface_graphic::opening_file(const string &path){
     
     QApplication::setOverrideCursor(Qt::WaitCursor);
    
-     if (_core->draw_trace(path,Core::_DRAW_OPENGL)==false){
+    /* if (_core->draw_trace(path)==false){
        error("Draw trace failed");
-       }
+       }*/
 
     //  _ui_render_area->build();
 
     _is_rendering_trace = true;
         
-       _ui_render_area->updateGL();
+    //   _ui_render_area->updateGL();  
 
     QApplication::restoreOverrideCursor();   
 
@@ -638,7 +639,6 @@ void Interface_graphic::on_export_file_triggered(){
 }
 
 void Interface_graphic::on_reload_triggered() {
-    _core->_use_exact_values=false;
     if(_is_rendering_trace) {
          Element_pos zoom[2]={Info::Splitter::_x_min,Info::Splitter::_x_max};
          if(_reload_type)
@@ -646,14 +646,19 @@ void Interface_graphic::on_reload_triggered() {
         else
         _core->launch_action(Core::_STATE_CLEAN_RENDER_AREA);
         _core->draw_trace(_trace_path, Core::_DRAW_OPENGL);
-		if(Info::Splitter::_x_max!=0.0)_core->launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom);		
+        
+       
+		if(Info::Splitter::_x_max!=0.0)_core->launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom);
+		
 		_core->launch_action(Core:: _STATE_RENDER_UPDATE);
+		//reset the slider to its original value
+		scale_container_state->setValue(20);
 
-        //reset the slider to its original value
-        scale_container_state->setValue(20);
-           //update the interval selection display
-        if(_ui_interval_selection!=NULL)_ui_interval_selection->update_values();
+		   //update the interval selection display 
+		if(_ui_interval_selection!=NULL)_ui_interval_selection->update_values();
     }
+
+
 }
 
 void Interface_graphic::open_recent_file() {
@@ -673,12 +678,14 @@ void Interface_graphic::on_clear_recent_files_triggered() {
 }
 
 void Interface_graphic::counter_choosed_triggered() {
+    // Il faut faire choisir le nom du fichier! et enfin on peut lancer l'action !
   // const QString path_by_default = QString(_trace_path.substr(0, _trace_path.find_last_of('.')).c_str()) + ".txt";
   //QString filename = QFileDialog::getSaveFileName(this, QObject::tr("Export File"),
   //                                                path_by_default,
   //                                                QObject::tr("All files"));
 
     Variable *temp = _all_variables[_counter_list_names->currentText().toStdString()];
+    //    _core->export_variable(temp, filename.toStdString());
     _core->export_variable(temp, _export_filename.toStdString());
 }
 
@@ -1021,7 +1028,11 @@ void Interface_graphic::on_show_all_trace_triggered(){
     _core->launch_action(Core::_STATE_RENDER_AREA_REGISTERED_TRANSLATE, &id);
 }
 
-void Interface_graphic::on_zoom_box_textChanged(QString s){
+#if QT_VERSION < 0x050000
+void Interface_graphic::on_zoom_box_textChanged(const QString &s){
+#else
+void Interface_graphic::on_zoom_box_currentTextChanged(const QString &s){
+#endif
     QRegExp reg_exp_number("^(\\d+)");
     QString result;
     Element_pos d;
@@ -1039,6 +1050,7 @@ void Interface_graphic::on_zoom_box_textChanged(QString s){
         d = 0.01*result.toDouble();
         if (0 == d)/* if zoom is null ignore it */
             return;
+        
         _core->launch_action(Core::_STATE_RENDER_AREA_REPLACE_SCALE, &d);
     }
 
diff --git a/src/interface/Interface_graphic.hpp b/src/interface/Interface_graphic.hpp
index 183251d4..77c26776 100644
--- a/src/interface/Interface_graphic.hpp
+++ b/src/interface/Interface_graphic.hpp
@@ -58,9 +58,9 @@ class QProgressDialog;
 
 /* Includes needed by the moc */
 #include <QGLWidget>
-#include <QtGui/QTextEdit>
-#include <QtGui/QRadioButton>
-#include <QtGui/QPushButton>
+#include <QTextEdit>
+#include <QRadioButton>
+#include <QPushButton>
 /* -- */
 #include "common/common.hpp"
 #include "common/Session.hpp"
@@ -685,7 +685,11 @@ protected slots:
      *
      * \param s The new string value of the zoom box.
      */
-    void on_zoom_box_textChanged(QString s);
+#if QT_VERSION < 0x050000
+    void on_zoom_box_textChanged(const QString &s);
+#else
+    void on_zoom_box_currentTextChanged(const QString &s);
+#endif
 
     /*!
      * \brief Change the x position of camera view for state drawing area.
@@ -708,6 +712,7 @@ protected slots:
      * \brief Says to the concerned classes that settings has been changed.
      */
     void update_settings();
+
 };
 
 #endif
diff --git a/src/parser/PajeParser/PajeDefinition.hpp b/src/parser/PajeParser/PajeDefinition.hpp
index 99889838..d316246b 100644
--- a/src/parser/PajeParser/PajeDefinition.hpp
+++ b/src/parser/PajeParser/PajeDefinition.hpp
@@ -73,10 +73,6 @@ typedef enum paje_eventdef_e {
     _PajeSubVariable,
     _PajeStartLink,
     _PajeEndLink,
-    _PajeStartPattern,
-    _PajeEndPattern,
-    _PajeDefinePattern,
-    _PajeEndDefPattern,
     PAJE_EVENTDEF_SIZE
 } paje_eventdef_t;
 
diff --git a/src/parser/PajeParser/PajeFileManager.cpp b/src/parser/PajeParser/PajeFileManager.cpp
index a00fee13..c78faae9 100644
--- a/src/parser/PajeParser/PajeFileManager.cpp
+++ b/src/parser/PajeParser/PajeFileManager.cpp
@@ -256,22 +256,3 @@ void PajeFileManager::print_line() {
     cout << "===========================================" << endl;
 
 }
-
-void PajeFileManager::duplicate_line(PajeLine *line,PajeLine *line_duplicate){
-    (*line_duplicate)._id=line->_id;
-    (*line_duplicate)._nbtks=line->_nbtks;
-    line_duplicate->_tokens = new char*[_PAJE_NBMAXTKS];
-    for(int j=0;j<line_duplicate->_nbtks;j++){
-         char *ptr;
-         if (ptr != NULL) {
-             ptr= new char[_PAJE_NBMAXTKS*2];
-         }
-         strcpy(ptr,line->_tokens[j]);
-         line_duplicate->_tokens[j] = ptr;
-    }
-}
-
-void PajeFileManager::create_pattern(Pattern *pattern,PajeLine *line_duplicate){
-    (pattern->_events_list).push_back(*line_duplicate);
-    pattern->_nb_events++;
-}
diff --git a/src/parser/PajeParser/PajeFileManager.hpp b/src/parser/PajeParser/PajeFileManager.hpp
index ba654fc5..038dafb2 100644
--- a/src/parser/PajeParser/PajeFileManager.hpp
+++ b/src/parser/PajeParser/PajeFileManager.hpp
@@ -6,13 +6,13 @@
 ** use, modify and/or redistribute the software under the terms of the
 ** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
 ** URL: "http://www.cecill.info".
-**
+** 
 ** As a counterpart to the access to the source code and rights to copy,
 ** modify and redistribute granted by the license, users are provided
 ** only with a limited warranty and the software's author, the holder of
 ** the economic rights, and the successive licensors have only limited
 ** liability.
-**
+** 
 ** In this respect, the user's attention is drawn to the risks associated
 ** with loading, using, modifying and/or developing or reproducing the
 ** software by the user in light of its specific status of free software,
@@ -23,7 +23,7 @@
 ** their requirements in conditions enabling the security of their
 ** systems and/or data to be ensured and, more generally, to use and
 ** operate it in the same conditions as regards security.
-**
+** 
 ** The fact that you are presently reading this means that you have had
 ** knowledge of the CeCILL-A license and that you accept its terms.
 **
@@ -37,13 +37,13 @@
 **        - MARCOUEILLE Jule
 **        - NOISETTE Pascal
 **        - REDONDY Arthur
-**        - VUCHENER Clément
+**        - VUCHENER Clément 
 **
 */
-
+  
 /**
  * \file    PajeFileManager.hpp
- *  Visual Trace Explorer
+ *  Visual Trace Explorer 
  *
  *  Release Date: January, 2nd 2010
  *  ViTE is a software to vivisualize execution trace provided by
@@ -57,53 +57,45 @@
  * @author  Jule Marcoueille
  * @author  Pascal Noisette
  * @author  Arthur Redondy
- * @author  Clément Vuchener
+ * @author  Clément Vuchener 
  * @date    2010-01-02
  *
  **/
-
+  
 #ifndef FILE_HPP
 #define FILE_HPP
-
+ 
 #include <string.h>
-#include <list>
-#define _PAJE_NBMAXTKS  1000
+
+#define _PAJE_NBMAXTKS  16
+
 /**
- * \struct PajeLine
+ * \struct PajeLine 
  *
- * Brief structure to store informations read
+ * Brief structure to store informations read 
  * on each line
  *
  * \param _id Line number
  * \param _nbtks Number of tokens found on the line
  * \param _tokens Pointers on the found tokens
- *
+ * 
  */
 typedef struct PajeLine {
     int    _id;
     int    _nbtks;
     char **_tokens;
+    
     PajeLine() {}
 } PajeLine_t;
 
 
-
-typedef struct Pattern {
-    std::string						_name;
-    int								_nb_events;
-    double							_duration;
-    std::list<PajeLine> 			_events_list;
-    Pattern() {}
-} Pattern_t;
-
-
 /**
  *  \class PajeFileManager
- *
+ *  
  *  File manager to read files using Paje syntax.
- *  Each line is read one after one and stored in
+ *  Each line is read one after one and stored in 
  *  the PajeLine structure associated to the class.
- *
+ * 
  * \sa Parser
  * \sa ParserPaje
  * \sa ParserVite
@@ -120,25 +112,25 @@ private:
     std::string           _line;
 
     PajeFileManager(const PajeFileManager &);
-
+    
 public:
     /*!
      *  \brief Constructor for the file
      */
     PajeFileManager();
-
+    
     /*!
      *  \brief  Constructor for the file
      *  \param  filename : a filename
      */
     PajeFileManager(const char * filename, ios_base::openmode mode = ios_base::in );
-
+      
     /*!
      *  \brief Destructor
      *  Destroy the file
      */
     ~PajeFileManager();
-
+        
     /*!
      *  \fn open(const char * filename, ios_base::openmode mode)
      *  \brief Open the file
@@ -164,7 +156,7 @@ public:
      *  \return The size already loaded
      */
     long long get_size_loaded();
-
+    
     /*!
      *  \fn get_percent_loaded()
      *  \return The percent of the file loaded (between 0 and 1).
@@ -184,11 +176,6 @@ public:
      *  \brief Print the current line for debug
      */
     void print_line();
-
-
-    void duplicate_line(PajeLine *line,PajeLine *line_duplicate);
-
-    void create_pattern(Pattern *pattern,PajeLine *line_duplicate);
 };
 
 #endif // FILE_HPP
diff --git a/src/parser/PajeParser/ParserDefinitionPaje.cpp b/src/parser/PajeParser/ParserDefinitionPaje.cpp
index 2cb262bf..507bb23b 100644
--- a/src/parser/PajeParser/ParserDefinitionPaje.cpp
+++ b/src/parser/PajeParser/ParserDefinitionPaje.cpp
@@ -84,6 +84,7 @@ using namespace std;
         i++;						\
     }
 
+
 std::map<std::string, int> ParserDefinitionPaje::_EvDefStr2Id;
 std::map<std::string, int> ParserDefinitionPaje::_FTypeStr2Code;
 bool                       ParserDefinitionPaje::_initialized = false;
@@ -118,10 +119,6 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
         _EvDefStr2Id.insert(pair<string, int>("PajeSubVariable"        , _PajeSubVariable         ));
         _EvDefStr2Id.insert(pair<string, int>("PajeStartLink"          , _PajeStartLink           ));
         _EvDefStr2Id.insert(pair<string, int>("PajeEndLink"            , _PajeEndLink             ));
-        _EvDefStr2Id.insert(pair<string, int>("PajeStartPattern"            , _PajeStartPattern             ));
-        _EvDefStr2Id.insert(pair<string, int>("PajeEndPattern"            , _PajeEndPattern             ));
-        _EvDefStr2Id.insert(pair<string, int>("PajeDefinePattern"            , _PajeDefinePattern             ));
-        _EvDefStr2Id.insert(pair<string, int>("PajeEndDefPattern"            , _PajeEndDefPattern             ));
 
         // Initialize the list of types available for field in EventDef declaration
         _FTypeStr2Code.insert(pair<string, int>("int"   ,_FieldType_Int    ));
@@ -186,11 +183,6 @@ ParserDefinitionPaje::ParserDefinitionPaje() {
     INSERT_EVENT(PajeSubVariable        , CODE2(Time) | CODE2(Type)  | CODE2(Container) | CODE2(Value) );
     INSERT_EVENT(PajeStartLink          , CODE2(Time) | CODE2(Type)  | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(StartContainer) );
     INSERT_EVENT(PajeEndLink            , CODE2(Time) | CODE2(Type)  | CODE2(Container) | CODE2(Value) | CODE2(Key) | CODE2(EndContainer) );
-    INSERT_EVENT(PajeStartPattern            , CODE2(Time) | CODE2(Alias)  | CODE2(Key) );
-    INSERT_EVENT(PajeEndPattern            , CODE2(Time) | CODE2(Alias)  | CODE2(Key)  );
-    INSERT_EVENT(PajeDefinePattern            , CODE2(Time) | CODE2(Alias)  | CODE2(Container) );
-    INSERT_EVENT(PajeEndDefPattern            ,CODE2(Time) | CODE2(Alias)  | CODE2(Container) );
-
 }
 
 ParserDefinitionPaje::~ParserDefinitionPaje() {
diff --git a/src/parser/PajeParser/ParserEventPaje.cpp b/src/parser/PajeParser/ParserEventPaje.cpp
index 07ac966b..424a1c20 100644
--- a/src/parser/PajeParser/ParserEventPaje.cpp
+++ b/src/parser/PajeParser/ParserEventPaje.cpp
@@ -1,7 +1,4 @@
-
 /*
- *
- *
  ** This file is part of the ViTE project.
  **
  ** This software is governed by the CeCILL-A license under French law
@@ -43,17 +40,11 @@
  **        - VUCHENER Clément
  **
  */
-#include <stdio.h>
-#include <stdlib.h>
 #include <string>
 #include <map>
 #include <set>
 #include <queue>
 #include <list>
-#include <iostream>
-#include <QDir>
-#include <QFileInfo>
-#include "cmath"
 /* -- */
 #include "common/Errors.hpp"
 /* -- */
@@ -83,8 +74,8 @@ ParserEventPaje::~ParserEventPaje(){
     _containers.clear();
 }
 
-void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
-                                  Trace          &trace,bool use_exact_values) {
+void ParserEventPaje::store_event(const PajeLine *line,
+                                  Trace          &trace) {
     string fvalue;
     string alias;
     string name;
@@ -97,7 +88,7 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
     Double value_double;
     String start_container;
     String end_container;
-    string key;
+    String key;
     Name   alias_name;
 
 
@@ -109,6 +100,7 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
     int                    i, trid;
     int                    defsize;
     int                    idname, idtype;
+
     // We check if we have an event identifier
     if(sscanf(line->_tokens[0], "%u", &trid) != 1){
         Error::set(Error::VITE_ERR_EXPECT_ID_DEF, line->_id, Error::VITE_ERRCODE_WARNING);
@@ -252,8 +244,9 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
             extra_fields[(*FNames)[idname]._name] = value;
         }
     }
+
     if ( (alias != "") && (name == "" ) ){
-    name = alias;
+        name = alias;
     }
     if ( (name != "") && (alias == "") ) {
         alias = name;
@@ -261,104 +254,7 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
     alias_name.set_alias(alias);
     alias_name.set_name(name);
 
-    static char *d_62= new char[_PAJE_NBMAXTKS];
-            static double d_63=0;
-    static std::string nom_pattern;
     switch( def->_id ) {
-            case _PajeDefinePattern :
-            {
-            //instancier un pattern
-            occ_list.clear();
-            Pattern *pattern = new Pattern();
-            pattern->_nb_events++;
-            nom_pattern =(line->_tokens[2]);
-            pattern->_name = (line->_tokens[2]);
-            memcpy(d_62,line->_tokens[1],strlen(line->_tokens[1])+1);
-            //remplir la liste d'evènements
-            while((strncmp(line->_tokens[0],"63",2)!=0)){
-                if((line->_nbtks ==0) || (strncmp(line->_tokens[0],"%",1)==0)){
-                }
-                else if((strncmp(line->_tokens[0],"60",2)==0) || (strncmp(line->_tokens[0],"61",2)==0)){
-                    ParserEventPaje::store(_file,line, trace,use_exact_values);
-                }
-                else{
-                PajeLine *line_duplicate=new PajeLine();
-                 _file->duplicate_line(line,line_duplicate);
-                 _file->create_pattern(pattern,line_duplicate);
-                 delete [] line_duplicate;
-                }
-                 _file->get_line(line);
-            }
-            //ajouter la ligne 63 sinon faut trouver une autre condition d'arret
-            d_63=atof(line->_tokens[1]);
-            PajeLine *line_end_pattern=new PajeLine();
-            _file->duplicate_line(line,line_end_pattern);
-           (pattern->_events_list).push_back(*line_end_pattern);
-           //forcer le passage dans _PajeEndDefPattern
-            pattern->_duration=abs(d_63-atof(d_62));
-            _Patterns.insert ( std::pair<std::string ,Pattern>(pattern->_name,*pattern) );
-            delete pattern;
-            ParserEventPaje::store(_file,line_end_pattern, trace,use_exact_values);
-            delete [] line_end_pattern;
-           }
-           break;
-
-           case _PajeEndDefPattern :
-           {
-           while(!(_file->eof())){
-               _file->get_line(line);
-               PajeLine *line_duplicate=new PajeLine();
-               _file->duplicate_line(line,line_duplicate);
-               if (line_duplicate->_nbtks != 0) {
-                   _Occurrences.insert ( std::pair<std::string ,PajeLine>(nom_pattern,*line_duplicate) );
-                   delete [] line_duplicate;
-               }
-           }
-           }
-
-           break;
-
-          case _PajeStartPattern :
-          {
-        occ_list.clear();
-        _pattern_selec=((_Patterns.find(alias))->second);
-        std::multimap<std::string,PajeLine>::iterator it_Occurrences;
-          for(it_Occurrences=_Occurrences.begin();it_Occurrences!=_Occurrences.end();it_Occurrences++){
-              if((it_Occurrences->first).compare(0,alias.size(),alias.c_str(),alias.size())==0){
-                  string temp=(it_Occurrences->second)._tokens[0];
-                  char *a=new char[temp.size()+1];
-                  a[temp.size()]=0;
-                  memcpy(a,temp.c_str(),temp.size());
-                  occ_list.insert(std::pair<std::string,PajeLine>(a,it_Occurrences->second));
-                  delete [] a;
-             }
-         }
-         }
-         break;
-
-         case _PajeEndPattern :
-         {
-         PajeLine ligne_selec;
-         ligne_selec= (occ_list.find(key))->second;
-         if(occ_list.find(key)==occ_list.end()){
-             return;
-         }
-         else{
-        ParserEventPaje::store_pattern_average(_file,trace,_pattern_selec,ligne_selec,use_exact_values);
-         }
-        }
-        break;
-
-            default :
-            ParserEventPaje::store_event(line, trace, def->_id,fvalue,alias,name,type,start_container_type,end_container_type,time,container,value_string,value_double,
-                        start_container,end_container, key, alias_name,extra_fields);
-    }
-}
-    void ParserEventPaje::store_event( PajeLine_t *line, Trace &trace, int defId,string fvalue,string alias,string name,String type,
-    String start_container_type,String end_container_type,Date time,String container,String value_string,Double value_double,
-    String start_container,String end_container,String key, Name alias_name,map<std::string, Value *> extra_fields){
-
-    switch( defId) {
     case _PajeDefineContainerType :
     {
         ContainerType *temp_container_type = trace.search_container_type(type);
@@ -369,7 +265,6 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
         else{
             trace.define_container_type(alias_name, temp_container_type, extra_fields);
         }
-
     }
     break;
 
@@ -765,33 +660,7 @@ void ParserEventPaje::store(PajeFileManager *_file, PajeLine *line,
     break;
 
     default:
-       // Error::set(Error::VITE_ERR_UNKNOWN_EVENT_DEF + def->_name, line->_id, Error::VITE_ERRCODE_WARNING);
+        Error::set(Error::VITE_ERR_UNKNOWN_EVENT_DEF + def->_name, line->_id, Error::VITE_ERRCODE_WARNING);
         return;
     }
 }
-
-
-void ParserEventPaje::store_pattern(PajeFileManager *_file,Trace &trace,Pattern _pattern_selec,PajeLine_t ligne_selec){
-         int nb=1;
-         std::list<PajeLine>::iterator it_events_list;
-         for(it_events_list=(_pattern_selec._events_list).begin();it_events_list!=(_pattern_selec._events_list).end();it_events_list++){
-                 it_events_list->_tokens[1]=ligne_selec._tokens[nb];
-                 nb++;
-            if(( strncmp(it_events_list->_tokens[0],"62",2)!=0) && (strncmp(it_events_list->_tokens[0],"63",2)!=0)){
-                ParserEventPaje::store(_file,&*it_events_list, trace,false);
-            }
-        }
-}
-void ParserEventPaje::store_pattern_average(PajeFileManager *_file,Trace &trace,Pattern _pattern_selec,PajeLine_t ligne_selec,bool use_exact_values){
-    if(!use_exact_values){
-            std::list<PajeLine>::iterator it_events_list;
-        for(it_events_list=(_pattern_selec._events_list).begin();it_events_list!=(_pattern_selec._events_list).end();it_events_list++){
-           if(( strncmp(it_events_list->_tokens[0],"62",2)!=0) && (strncmp(it_events_list->_tokens[0],"63",2)!=0)){
-               ParserEventPaje::store(_file,&*it_events_list, trace,use_exact_values);
-           }
-       }
-    }
-    else{
-        ParserEventPaje::store_pattern(_file,trace,_pattern_selec, ligne_selec);
-    }
-}
diff --git a/src/parser/PajeParser/ParserEventPaje.hpp b/src/parser/PajeParser/ParserEventPaje.hpp
index f336c657..0fbe4e45 100644
--- a/src/parser/PajeParser/ParserEventPaje.hpp
+++ b/src/parser/PajeParser/ParserEventPaje.hpp
@@ -6,13 +6,13 @@
 ** use, modify and/or redistribute the software under the terms of the
 ** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
 ** URL: "http://www.cecill.info".
-**
+** 
 ** As a counterpart to the access to the source code and rights to copy,
 ** modify and redistribute granted by the license, users are provided
 ** only with a limited warranty and the software's author, the holder of
 ** the economic rights, and the successive licensors have only limited
 ** liability.
-**
+** 
 ** In this respect, the user's attention is drawn to the risks associated
 ** with loading, using, modifying and/or developing or reproducing the
 ** software by the user in light of its specific status of free software,
@@ -23,7 +23,7 @@
 ** their requirements in conditions enabling the security of their
 ** systems and/or data to be ensured and, more generally, to use and
 ** operate it in the same conditions as regards security.
-**
+** 
 ** The fact that you are presently reading this means that you have had
 ** knowledge of the CeCILL-A license and that you accept its terms.
 **
@@ -37,7 +37,7 @@
 **        - MARCOUEILLE Jule
 **        - NOISETTE Pascal
 **        - REDONDY Arthur
-**        - VUCHENER Clément
+**        - VUCHENER Clément 
 **
 */
 /*!
@@ -53,19 +53,18 @@
  * \brief Reads Hash Table to find fill the Str
  *
  */
-using namespace std;
+
 class ParserEventPaje{
 private:
     ParserDefinitionPaje *_Definitions;
+
     std::map <const String, Container *, String::less_than> _containers;
+
     ParserEventPaje(const ParserEventPaje &);
 
 public:
-    std::map<std::string,Pattern> _Patterns;
-    std::multimap<std::string,PajeLine> _Occurrences;
-    Pattern _pattern_selec;
-    std::map<std::string,PajeLine> occ_list;
     ParserEventPaje(ParserDefinitionPaje *Defs);
+    
     ~ParserEventPaje();
 
     /*!
@@ -73,11 +72,6 @@ public:
      *  \param line the line containing the event.
      *  \param trace where we store the event.
      */
-    void store(PajeFileManager *_file, PajeLine *line, Trace &trace,bool use_exact_values);
-    void store_event( PajeLine_t *line, Trace &trace, int defId,string fvalue,string alias,string name,String type,
-    String start_container_type,String end_container_type,Date time,String container,String value_string,Double value_double,
-    String start_container,String end_container,String key, Name alias_name,map<std::string, Value *> extra_fields);
-    void store_pattern(PajeFileManager *_file,Trace &trace,Pattern pattern_selec,PajeLine_t ligne_selec);
-    void store_pattern_average(PajeFileManager *_file,Trace &trace,Pattern _pattern_selec,PajeLine_t ligne_selec,bool flag);
+    void store_event(const PajeLine_t *line, Trace &trace);
 };
 #endif // PARSEREVENTPAJE_HPP
diff --git a/src/parser/PajeParser/ParserPaje.cpp b/src/parser/PajeParser/ParserPaje.cpp
index cb071947..b185834a 100644
--- a/src/parser/PajeParser/ParserPaje.cpp
+++ b/src/parser/PajeParser/ParserPaje.cpp
@@ -63,19 +63,14 @@
 #include "parser/PajeParser/ParserEventPaje.hpp"
 #include "parser/PajeParser/ParserPaje.hpp"
 /* -- */
-#include <QDir>
-#include <QFileInfo>
 using namespace std;
 
 ParserPaje::ParserPaje() : _ParserDefinition(new ParserDefinitionPaje()),
-                           _ParserEvent(new ParserEventPaje(_ParserDefinition)), _file(NULL), _file2(NULL){}
+                           _ParserEvent(new ParserEventPaje(_ParserDefinition)), _file(NULL){}
 
-ParserPaje::ParserPaje(const string &filename,bool _use_exact_values_flag) : Parser(filename),
+ParserPaje::ParserPaje(const string &filename) : Parser(filename),
                                                  _ParserDefinition(new ParserDefinitionPaje()),
-                                                 _ParserEvent(new ParserEventPaje(_ParserDefinition)), _file(NULL),_file2(NULL) {
-    _flag=_use_exact_values_flag;
-
-}
+                                                 _ParserEvent(new ParserEventPaje(_ParserDefinition)), _file(NULL) {}
 
 ParserPaje::~ParserPaje() {
     delete _ParserDefinition;
@@ -106,14 +101,6 @@ void ParserPaje::parse(Trace &trace,
         Error::set(Error::VITE_ERR_OPEN, 0, Error::VITE_ERRCODE_WARNING);
         return;
     }
-        parse(trace,_file_to_parse,_file, true);
-}
-
-void ParserPaje::parse(Trace &trace,std::string filename, PajeFileManager* _file,
-                       bool   finish_trace_after_parse) {
-    PajeLine_t     line;
-    std::string nom_ss_fichier;
-    const char* include="Include";
 
     while( (!(_file->eof())) && !(_is_canceled) ) {
 
@@ -137,38 +124,23 @@ void ParserPaje::parse(Trace &trace,std::string filename, PajeFileManager* _file
         if (line._nbtks == 0) {
             continue;
         }
-        // The line starts by a '%' : it's a definition or an "include" statement
-        else if(strncmp(line._tokens[1], include, 7) == 0){
-            //get the filename
-            nom_ss_fichier=line._tokens[2];
-            QString          absdir = QFileInfo(_file_to_parse.c_str()).absolutePath();
-                        try {
-                        //get _file_to_parse to point to the subfile
-                        _file_to_parse=(absdir + QDir::separator() + nom_ss_fichier.c_str()).toStdString() ;
-                        //open the new file with PajeFileManager
-                        _file2 = new PajeFileManager(_file_to_parse.c_str());
-                        //parse the subfile and don't finish the trace after parsing it
-                        parse(trace,nom_ss_fichier,_file2,false);
-                        } catch (const char *) {
-                            delete _file2;
-                            _file2 = NULL;
-                            _is_canceled = true;
-                            finish();
-                            trace.finish();
-                            std::cerr <<  "Cannot open file " <<  nom_ss_fichier.c_str() << std::endl;
-                            Error::set(Error::VITE_ERR_OPEN, 0, Error::VITE_ERRCODE_WARNING);
-                            return;
-                        }
-            }
-        //else it's a definition
+        // The line starts by a '%' : it's a definition
         else if(line._tokens[0][0] == '%') {
             _ParserDefinition->store_definition(&line);
         }
         // It's an event
         else {
-            _ParserEvent->store(_file,&line, trace,_flag);
+            _ParserEvent->store_event(&line, trace);
         }
     }
+
+    if(finish_trace_after_parse) {
+        finish();
+        trace.finish();
+    }
+
+    delete _file;
+    _file = NULL;
 }
 
 
diff --git a/src/parser/PajeParser/ParserPaje.hpp b/src/parser/PajeParser/ParserPaje.hpp
index 433a725d..6d137b59 100644
--- a/src/parser/PajeParser/ParserPaje.hpp
+++ b/src/parser/PajeParser/ParserPaje.hpp
@@ -6,13 +6,13 @@
 ** use, modify and/or redistribute the software under the terms of the
 ** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
 ** URL: "http://www.cecill.info".
-**
+** 
 ** As a counterpart to the access to the source code and rights to copy,
 ** modify and redistribute granted by the license, users are provided
 ** only with a limited warranty and the software's author, the holder of
 ** the economic rights, and the successive licensors have only limited
 ** liability.
-**
+** 
 ** In this respect, the user's attention is drawn to the risks associated
 ** with loading, using, modifying and/or developing or reproducing the
 ** software by the user in light of its specific status of free software,
@@ -23,7 +23,7 @@
 ** their requirements in conditions enabling the security of their
 ** systems and/or data to be ensured and, more generally, to use and
 ** operate it in the same conditions as regards security.
-**
+** 
 ** The fact that you are presently reading this means that you have had
 ** knowledge of the CeCILL-A license and that you accept its terms.
 **
@@ -37,7 +37,7 @@
 **        - MARCOUEILLE Jule
 **        - NOISETTE Pascal
 **        - REDONDY Arthur
-**        - VUCHENER Clément
+**        - VUCHENER Clément 
 **
 */
 /*!
@@ -49,7 +49,6 @@
 #define PARSERPAJE_HPP
 
 #include <cstdio>
-#include "../../core/Core.hpp"
 
 class ParserDefinitionPaje;
 class ParserEventPaje;
@@ -66,14 +65,13 @@ private:
     ParserDefinitionPaje *_ParserDefinition;
     ParserEventPaje      *_ParserEvent;
     PajeFileManager      *_file;
-    PajeFileManager      *_file2;
 public:
-    bool _flag ;
+
     /*!
      *  \fn ParserPaje()
      */
     ParserPaje();
-    ParserPaje(const std::string &filename,bool _use_exact_values_flag);
+    ParserPaje(const std::string &filename);
 
     /*!
      *  \fn ~ParserPaje()
@@ -85,16 +83,9 @@ public:
      *  \param trace : the structure of data to fill
      *  \param finish_trace_after_parse boolean set if we do not have to finish the trace after parsing
      */
-    void parse(Trace &trace,
-           bool   finish_trace_after_parse = true);
-    /*!
-     * \brief parse: parse the events
-     * \param trace : the structure of data to fill
-     * \param filename : name of the file to be parsed
-     * \param finish_trace_after_parse boolean set if we do not have to finish the trace after parsing
-     */
-    void parse(Trace &trace,std::string filename, PajeFileManager* _file,
-                           bool   finish_trace_after_parse);
+    void parse(Trace &trace, 
+	       bool   finish_trace_after_parse = true);
+    
     /*!
      *  \fn get_percent_loaded() const
      *  \brief return the size of the file already read.
diff --git a/src/parser/PajeParser/ParserVite.cpp b/src/parser/PajeParser/ParserVite.cpp
index 72ed6287..fd11bd1d 100644
--- a/src/parser/PajeParser/ParserVite.cpp
+++ b/src/parser/PajeParser/ParserVite.cpp
@@ -76,7 +76,7 @@ ParserVite::~ParserVite() {}
 void ParserVite::parse(Trace &trace,
                        bool   finish_trace_after_parse){
 
-    ParserPaje       parserpaje(_file_to_parse,false);
+    ParserPaje       parserpaje(_file_to_parse);
 
     QString                          name;
     stack<Container *>               CTstack;
diff --git a/src/parser/ParserFactory.cpp b/src/parser/ParserFactory.cpp
index bc16fb48..41e0420a 100644
--- a/src/parser/ParserFactory.cpp
+++ b/src/parser/ParserFactory.cpp
@@ -86,9 +86,8 @@
 using namespace std;
 
 bool ParserFactory::create(Parser **parser,
-               const string &filename, bool _use_exact_values_flag)
+			   const string &filename)
 {
-    _use_exact_values_flag=_use_exact_values_flag;
     size_t pos = filename.find_last_of('.');
     string ext = "";
     
@@ -100,7 +99,7 @@ bool ParserFactory::create(Parser **parser,
 #ifdef MT_PARSING
 	    *parser = new mt_ParserPaje(filename);
 #else
-            *parser = new ParserPaje(filename,_use_exact_values_flag);
+            *parser = new ParserPaje(filename);
 #endif
         }
 	else if( ext == ".ept" ) {
@@ -139,7 +138,7 @@ bool ParserFactory::create(Parser **parser,
 #ifdef MT_PARSING
         *parser = new mt_ParserPaje(filename);
 #else
-        *parser = new ParserPaje(filename,_use_exact_values_flag);
+        *parser = new ParserPaje(filename);
 #endif
     }
 
diff --git a/src/parser/ParserFactory.hpp b/src/parser/ParserFactory.hpp
index c2bba4f2..7e3a2534 100644
--- a/src/parser/ParserFactory.hpp
+++ b/src/parser/ParserFactory.hpp
@@ -10,10 +10,6 @@ private:
     ParserFactory();
 
 public:
-    static bool _use_exact_values_flag;
-
-
-
     /*!
      * \fn static bool create(Parser **parser, const std::string &filename);
      * \brief Create the parser corresponding to the filename. If no parser is found, the parser Pajé is set as the default one.
@@ -21,7 +17,7 @@ public:
      * \param filename The name of the file we want to open.
      * \return true if the filename as a Parser associed, false in other cases.
      */
-     static bool create(Parser **parser, const std::string &filename,bool _use_exact_values_flag);
+    static bool create(Parser **parser, const std::string &filename);
 };
 
 #endif /* PARSERFACTORY_HPP */
diff --git a/src/render/Hook_event.cpp b/src/render/Hook_event.cpp
index 20b2f664..cdf0ddb1 100644
--- a/src/render/Hook_event.cpp
+++ b/src/render/Hook_event.cpp
@@ -43,8 +43,7 @@
 /*!
  *\file Hook_event.cpp
  */
-#include <iostream>
-#include <fstream>
+
 #include <stack>
 #include <sstream>
 /* -- */
@@ -67,7 +66,7 @@
 #include "render/Hook_event.hpp"
 /* -- */
 using namespace std;
-#include "parser/PajeParser/PajeFileManager.hpp"
+
 #define message *Message::get_instance() << "(" << __FILE__ << " l." << __LINE__ << "): "
 
 
@@ -200,7 +199,11 @@ Hook_event::~Hook_event(){
  *
  **********************************/
 void Hook_event::mousePressEvent(QMouseEvent * event){
- 
+    /* Do nothing if no trace is loaded */
+    if(_state == DRAWING_STATE_WAITING) {
+        return;
+    }
+
     /* If a right click was triggered, just restore the previous zoom */
     if( Qt::RightButton == event->button() ){
 
@@ -225,11 +228,13 @@ void Hook_event::mousePressEvent(QMouseEvent * event){
         _x_state_translate = _previous_selection.top().x_translate;
         _y_state_translate = _previous_selection.top().y_translate;
 
+
         /* remove the previous value */
         _previous_selection.pop();
 	
 	refresh_scroll_bars(true);
        updateRender();
+	
 
 #ifdef DEBUG_MODE_RENDER_AREA_
              
@@ -247,12 +252,6 @@ void Hook_event::mousePressEvent(QMouseEvent * event){
         int buf;
 
         buf = (int)(100*_x_state_scale);
-        if(buf<200){
-            _core->launch_action(_core->_ZOOM_OUT_PATTERN, NULL);
-        }
-
-
-
         _core->launch_action(_core->_STATE_ZOOM_BOX_VALUE, &buf);
 
         /* Then, return */
@@ -309,7 +308,10 @@ void Hook_event::mouseDoubleClickEvent ( QMouseEvent * event ){
 
 
 void Hook_event::mouseMoveEvent(QMouseEvent * event){
-    if (!_mouse_pressed) return;
+    /* Do nothing if no trace is loaded */
+    if(_state == DRAWING_STATE_WAITING || !_mouse_pressed) {
+        return;
+    }
 
     //if (_mouse_pressed_inside_container)
     //    _new_mouse_x = Info::Screen::width;
@@ -332,6 +334,10 @@ void Hook_event::mouseReleaseEvent(QMouseEvent * event){
         _connected=true;
     }
     
+    /* Do nothing if no trace is loaded */
+    if(_state == DRAWING_STATE_WAITING) {
+        return;
+    }
     
     Element_pos invert_buf_x;
     Element_pos invert_buf_y;
@@ -434,9 +440,8 @@ void Hook_event::mouseReleaseEvent(QMouseEvent * event){
     /*
      * Now, user was drawing a box. Zoom in it!
      */
-    if((_new_mouse_x-_mouse_x<600)){
-    _core->launch_action(_core->_ZOOM_IN_PATTERN, NULL);
-    }
+
+    
         /* Register this position which will be used by a right clic */
         selection_stack_buf.x_scale = _x_state_scale;
         selection_stack_buf.y_scale = _y_state_scale;
@@ -460,6 +465,8 @@ void Hook_event::mouseReleaseEvent(QMouseEvent * event){
       
 }
 
+
+
 void Hook_event::apply_zoom_box(Element_pos x_min, Element_pos x_max, Element_pos y_min, Element_pos y_max){
 
     Element_pos x_middle_selection;
@@ -535,11 +542,12 @@ void Hook_event::apply_zoom_box(Element_pos x_min, Element_pos x_max, Element_po
     _mouse_pressed_inside_container = false;
     _mouse_pressed_inside_ruler     = false;
 
+
     /* Now, check if zoom is not too much */
     update_visible_interval_value();
 
     delta = Info::Render::_x_max_visible - Info::Render::_x_min_visible;
-
+    
     if ( delta <=  zoom_limit ){/* if too much, cancel */
 
         _x_state_scale     *= (x_max - x_min) / Info::Screen::width;
@@ -560,8 +568,8 @@ void Hook_event::apply_zoom_box(Element_pos x_min, Element_pos x_max, Element_po
     #endif
         
      buf = (int)(100*_x_state_scale);
-
-     /* Update render */
+     _core->launch_action(_core->_STATE_ZOOM_BOX_VALUE, &buf);
+    /* Update render */
     updateRender();
     refresh_scroll_bars(true);
 }
@@ -572,7 +580,8 @@ void Hook_event::apply_zoom_on_interval(Element_pos t1, Element_pos t2){
     Element_pos x_max = render_to_screen_x( trace_to_render_x( t2 ) );
     Element_pos y_min = render_to_screen_y(_ruler_height+_ruler_y);
     Element_pos y_max = Info::Screen::height;
-    apply_zoom_box( x_min, x_max, y_min, y_max);
+    
+    apply_zoom_box( x_min, x_max, y_min, y_max); 
 }
 
 void Hook_event::wheelEvent(QWheelEvent * event){
@@ -610,7 +619,7 @@ void Hook_event::keyPressEvent(QKeyEvent * event) {
         ctrl_factor *= _ctrl_scroll_factor;
 	Info::Render::_key_ctrl = true;
     }
-
+    
     switch (event->key()) {
     case Qt::Key_Left:
         /*
diff --git a/src/render/Hook_event.hpp b/src/render/Hook_event.hpp
index 10e80932..5617bcb7 100644
--- a/src/render/Hook_event.hpp
+++ b/src/render/Hook_event.hpp
@@ -50,6 +50,7 @@
 
 class Core;
 class Render_opengl;
+
 /*!
  * \brief Structure used to store selection coordinate information.
  */
@@ -278,7 +279,6 @@ protected:
 public:
 
 
-//    static bool flag;
     /*!
      * \brief The constructor.
      * \param render_instance The instance of a drawing class.
-- 
GitLab