diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ed255538b33ee52a088a857abe2bd4a2063512d1..451bc2e51d1a9fe92b0631405ad3a2d713b9f1e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -129,7 +129,7 @@ SET(VITE_HDRS plugin/Command_window.hpp plugin/Plugin_window.hpp plugin/Plugin.hpp -) + ) SET(VITE_UIS interface/info_window.ui @@ -141,7 +141,7 @@ SET(VITE_UIS interface/list_of_counter_to_export.ui interface/node_select.ui interface/interval_select.ui -) + ) SET(VITE_SRCS # Messages & Errors @@ -381,25 +381,25 @@ IF(USE_QT5) QT5_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS}) QT5_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS}) ADD_DEFINITIONS(-DQT_NO_DEBUG) -############################################# -# QT4 -############################################# + ############################################# + # QT4 + ############################################# ELSE(USE_QT5) -QT4_AUTOMOC(${VITE_SRCS}) -FOREACH(_hdrs_file ${VITE_HDRS}) - GET_FILENAME_COMPONENT(_abs_file ${_hdrs_file} ABSOLUTE) - FILE(READ ${_abs_file} _contents) - STRING(REGEX MATCHALL "Q_OBJECT" _match "${_contents}") - IF(_match) - SET(VITE_MOC_HDRS ${VITE_MOC_HDRS} ${_hdrs_file}) - ENDIF(_match) -ENDFOREACH(_hdrs_file ${VITE_HDRS}) - -QT4_WRAP_UI(VITE_UIS_H ${VITE_UIS}) -QT4_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS}) -QT4_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS}) - -ADD_DEFINITIONS(-DQT_NO_DEBUG) + QT4_AUTOMOC(${VITE_SRCS}) + FOREACH(_hdrs_file ${VITE_HDRS}) + GET_FILENAME_COMPONENT(_abs_file ${_hdrs_file} ABSOLUTE) + FILE(READ ${_abs_file} _contents) + STRING(REGEX MATCHALL "Q_OBJECT" _match "${_contents}") + IF(_match) + SET(VITE_MOC_HDRS ${VITE_MOC_HDRS} ${_hdrs_file}) + ENDIF(_match) + ENDFOREACH(_hdrs_file ${VITE_HDRS}) + + QT4_WRAP_UI(VITE_UIS_H ${VITE_UIS}) + QT4_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS}) + QT4_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS}) + + ADD_DEFINITIONS(-DQT_NO_DEBUG) ENDIF(USE_QT5) ############################################# @@ -408,7 +408,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QTCOLORPICKERDIR} -) + ) #ADD_LIBRARY(vite2 SHARED ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS}) IF( VITE_ENABLE_OTF ) @@ -422,14 +422,14 @@ if( APPLE ) set_source_files_properties(${OSX_ICON_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) ADD_EXECUTABLE(vite MACOSX_BUNDLE ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS} ${OSX_ICON_FILES}) SET_TARGET_PROPERTIES(vite PROPERTIES - MACOSX_BUNDLE_INFO_STRING "ViTE" - MACOSX_BUNDLE_ICON_FILE "mac_logo.icns" - MACOSX_BUNDLE_LONG_VERSION_STRING "Visual Trace Explorer - version ${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}" - MACOSX_BUNDLE_BUNDLE_NAME "Vite-MacOSX" - MACOSX_BUNDLE_SHORT_VERSION_STRING "ViTE-${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}" - MACOSX_BUNDLE_BUNDLE_VERSION "1.0" - MACOSX_BUNDLE_COPYRIGHT "INRIA 2006-2012" - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/vite-info.plist.in) + MACOSX_BUNDLE_INFO_STRING "ViTE" + MACOSX_BUNDLE_ICON_FILE "mac_logo.icns" + MACOSX_BUNDLE_LONG_VERSION_STRING "Visual Trace Explorer - version ${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}" + MACOSX_BUNDLE_BUNDLE_NAME "Vite-MacOSX" + MACOSX_BUNDLE_SHORT_VERSION_STRING "ViTE-${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}" + MACOSX_BUNDLE_BUNDLE_VERSION "1.0" + MACOSX_BUNDLE_COPYRIGHT "INRIA 2006-2012" + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/vite-info.plist.in) else( APPLE ) ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS}) endif( APPLE ) @@ -449,8 +449,8 @@ TARGET_LINK_LIBRARIES(vite IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") TARGET_LINK_LIBRARIES(vite - rt - ) + rt + ) ADD_DEFINITIONS("-DBOOST_GZIP") ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") diff --git a/src/core/Core.cpp b/src/core/Core.cpp index 1cff289c17cc0ff9144dae0d998dafd787d9db05..5ccff44fc354c0b185a72aaa4a9cf659e05af770 100644 --- a/src/core/Core.cpp +++ b/src/core/Core.cpp @@ -1,45 +1,45 @@ /* -** This file is part of the ViTE project. -** -** This software is governed by the CeCILL-A license under French law -** and abiding by the rules of distribution of free software. You can -** 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, -** that may mean that it is complicated to manipulate, and that also -** therefore means that it is reserved for developers and experienced -** professionals having in-depth computer knowledge. Users are therefore -** encouraged to load and test the software's suitability as regards -** 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. -** -** -** ViTE developers are (for version 0.* to 1.0): -** -** - COULOMB Kevin -** - FAVERGE Mathieu -** - JAZEIX Johnny -** - LAGRASSE Olivier -** - MARCOUEILLE Jule -** - NOISETTE Pascal -** - REDONDY Arthur -** - VUCHENER Clément -** -*/ + ** This file is part of the ViTE project. + ** + ** This software is governed by the CeCILL-A license under French law + ** and abiding by the rules of distribution of free software. You can + ** 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, + ** that may mean that it is complicated to manipulate, and that also + ** therefore means that it is reserved for developers and experienced + ** professionals having in-depth computer knowledge. Users are therefore + ** encouraged to load and test the software's suitability as regards + ** 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. + ** + ** + ** ViTE developers are (for version 0.* to 1.0): + ** + ** - COULOMB Kevin + ** - FAVERGE Mathieu + ** - JAZEIX Johnny + ** - LAGRASSE Olivier + ** - MARCOUEILLE Jule + ** - NOISETTE Pascal + ** - REDONDY Arthur + ** - VUCHENER Clément + ** + */ /*! *\file Core.cpp *\brief This is the console interface C source code. @@ -153,8 +153,8 @@ using namespace std; Core::Core(int &argc, char ** argv) { - /* - * graphic_app is used if a graphical interface is used + /* + * graphic_app is used if a graphical interface is used * console_app is used if we only care about the console interface */ graphic_app = NULL; @@ -165,7 +165,7 @@ Core::Core(int &argc, char ** argv) QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale()); #endif /* - * Store application name and current directory + * Store application name and current directory */ _run_env[0] = new QString(QDir::currentPath().toStdString().c_str()); _run_env[1] = new QString(argv[0]); @@ -186,8 +186,8 @@ Core::Core(int &argc, char ** argv) Message::set_interface(this); /* Set the options according to the parameters given - * Warning: Work on a copy of argv to keep parameter - * that could be usefull to boost or Qt, as psn + * Warning: Work on a copy of argv to keep parameter + * that could be usefull to boost or Qt, as psn * on Mac for example */ _state = get_options(argc, argv); @@ -196,7 +196,7 @@ Core::Core(int &argc, char ** argv) #endif /* Create the Qt application */ - if ( (_state != _STATE_SPLITTING ) && + if ( (_state != _STATE_SPLITTING ) && (_state != _STATE_EXPORT_FILE) ) { graphic_app = new QApplication(argc, argv); } @@ -240,15 +240,15 @@ Core::~Core(){ #if defined(HAVE_GETOPT_LONG) static struct option long_options[] = - { - {"interval", required_argument, 0, 't'}, - {"export", required_argument, 0, 'e'}, - {"load_containers_config", required_argument, 0, 'c'}, - {"input", required_argument, 0, 'i'}, - {"split", required_argument, 0, 's'}, - {"help", no_argument, 0, 'h'}, - {0, 0, 0, 0} - }; +{ + {"interval", required_argument, 0, 't'}, + {"export", required_argument, 0, 'e'}, + {"load_containers_config", required_argument, 0, 'c'}, + {"input", required_argument, 0, 'i'}, + {"split", required_argument, 0, 's'}, + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} +}; #endif int Core::get_options(int &argc, char **argv) @@ -258,7 +258,7 @@ int Core::get_options(int &argc, char **argv) int c; int largc; char **largv; - + /* Ignore any -psn_%d_%d argument, which is Mac OS specific */ largc = 0; largv = (char**)calloc(argc+1, sizeof(char**)); @@ -274,82 +274,82 @@ int Core::get_options(int &argc, char **argv) } do - { + { #if defined(HAVE_GETOPT_LONG) - c = getopt_long_only(largc, largv, "", - long_options, &opt); + c = getopt_long_only(largc, largv, "", + long_options, &opt); #else - c = getopt(largc, largv, GETOPT_STRING); - (void) opt; + c = getopt(largc, largv, GETOPT_STRING); + (void) opt; #endif // defined(HAVE_GETOPT_LONG) - switch(c) { - case 't' : - double t1, t2; - // Only the end - if( optarg[0] == ':' ) { - if ( sscanf( optarg, ":%lf", &t2) == 1 ) { - _time_end = t2; - } else { - cerr << QObject::tr("Interval is not in the correct format [%d:%d]").toStdString() << endl; - state=_STATE_DISPLAY_HELP; - goto cleanup; - } + switch(c) { + case 't' : + double t1, t2; + // Only the end + if( optarg[0] == ':' ) { + if ( sscanf( optarg, ":%lf", &t2) == 1 ) { + _time_end = t2; } else { - int ret = sscanf( optarg, "%lf:%lf", &t1, &t2); - switch( ret ) { - case 2: - _time_end = t2; - case 1 : - _time_start = t1; - break; - case 0: - cerr << QObject::tr("Interval is not in the correct format [%d:%d]").toStdString() << endl; - state=_STATE_DISPLAY_HELP; - goto cleanup; - } + cerr << QObject::tr("Interval is not in the correct format [%d:%d]").toStdString() << endl; + state=_STATE_DISPLAY_HELP; + goto cleanup; } - //cerr << "Interval: from " << _time_start << " to " << _time_end << endl; - break; + } else { + int ret = sscanf( optarg, "%lf:%lf", &t1, &t2); + switch( ret ) { + case 2: + _time_end = t2; + case 1 : + _time_start = t1; + break; + case 0: + cerr << QObject::tr("Interval is not in the correct format [%d:%d]").toStdString() << endl; + state=_STATE_DISPLAY_HELP; + goto cleanup; + } + } + //cerr << "Interval: from " << _time_start << " to " << _time_end << endl; + break; - case 'e' : - _path_to_export = optarg; - state = _STATE_EXPORT_FILE; - //cerr << "Export in file: " << _path_to_export << endl; - break; + case 'e' : + _path_to_export = optarg; + state = _STATE_EXPORT_FILE; + //cerr << "Export in file: " << _path_to_export << endl; + break; - case 'i' : - _file_opened = optarg; - if (state == 0) state = _STATE_OPEN_FILE; - //cerr << "Open file: " << _file_opened << endl; - break; + case 'i' : + _file_opened = optarg; + if (state == 0) state = _STATE_OPEN_FILE; + //cerr << "Open file: " << _file_opened << endl; + break; - case 's' : - // We want to split the file and save its parts - _file_opened = optarg; - Info::Splitter::split=true; - if (state == 0) state = _STATE_SPLITTING ; - break; + case 's' : + // We want to split the file and save its parts + _file_opened = optarg; + Info::Splitter::split=true; + if (state == 0) state = _STATE_SPLITTING ; + break; - case 'h' : - state=_STATE_DISPLAY_HELP; - goto cleanup; + case 'h' : + state=_STATE_DISPLAY_HELP; + goto cleanup; - case 'c' : - _xml_config_file = optarg; - //cerr << "Export in file: " << _path_to_export << endl; - break; + case 'c' : + _xml_config_file = optarg; + //cerr << "Export in file: " << _path_to_export << endl; + break; - default: - continue; - } - } while(-1 != c); + default: + continue; + } + } while(-1 != c); if(optind < argc) - { - _file_opened = largv[optind]; - if (state == 0) state = _STATE_OPEN_FILE; - } + { + _file_opened = largv[optind]; + if (state == 0) state = _STATE_OPEN_FILE; + } // This is here where we put new options !! (for filters for example) @@ -466,7 +466,7 @@ int Core::get_options(int &argc, char **argv) // state = _STATE_OPEN_FILE; // } - cleanup: + cleanup: free(largv); return state; } @@ -930,66 +930,66 @@ void Core::launch_action(int state, void* arg) { break; case _STATE_RELEASE_RENDER_AREA: - { - /*if(parser!=NULL ){ - parser->set_canceled(); - //locks the mutex and automatically unlocks it when going out of scope - QMutexLocker locker(_mutex); - emit build_finished(false); - emit close_windows(); - while(parser!=NULL) - _closed->wait(_mutex,100); - }*/ - - if (_render_opengl->unbuild()==false) - message << "Close file : an error occured with trace releasing." << Message::ende; - _file_opened.clear(); - - - if (false == _is_trace_loaded) { - *Message::get_instance() << "Try to release a render area whereas no file was loaded" << Message::ende; - } else { - _is_trace_loaded = false; - } - - if (NULL == _trace) { - *Message::get_instance() << "Try to release a render area whereas no trace is loaded" << Message::ende; - } else { - delete _trace; - _trace = NULL; - } - _render_opengl->updateGL(); + { + /*if(parser!=NULL ){ + parser->set_canceled(); + //locks the mutex and automatically unlocks it when going out of scope + QMutexLocker locker(_mutex); + emit build_finished(false); + emit close_windows(); + while(parser!=NULL) + _closed->wait(_mutex,100); + }*/ + + if (_render_opengl->unbuild()==false) + message << "Close file : an error occured with trace releasing." << Message::ende; + _file_opened.clear(); + + + if (false == _is_trace_loaded) { + *Message::get_instance() << "Try to release a render area whereas no file was loaded" << Message::ende; + } else { + _is_trace_loaded = false; + } - /* Release all data */ - Info::release_all(); + if (NULL == _trace) { + *Message::get_instance() << "Try to release a render area whereas no trace is loaded" << Message::ende; + } else { + delete _trace; + _trace = NULL; } - break; + _render_opengl->updateGL(); + + /* Release all data */ + Info::release_all(); + } + break; case _STATE_EXPORT_FILE: case _STATE_EXPORT_FILE_IN_INTERVAL: - { - if (_file_opened.empty()) { - *Message::get_instance() << "Please to previously open a trace." << Message::endw; - return; - } - - cout << "export of " << _file_opened << " to " << _path_to_export << " between "; - if(_time_start == 0){ - cout << "the beginning of the trace to "; - } - else{ - cout << _time_start << " seconds to "; - } - if(_time_end != 0){ - cout << _time_end << " seconds." << endl; - } - else{ - cout << "the end of the trace." << endl; - } + { + if (_file_opened.empty()) { + *Message::get_instance() << "Please to previously open a trace." << Message::endw; + return; + } - draw_trace(_file_opened, _DRAW_SVG); + cout << "export of " << _file_opened << " to " << _path_to_export << " between "; + if(_time_start == 0){ + cout << "the beginning of the trace to "; + } + else{ + cout << _time_start << " seconds to "; + } + if(_time_end != 0){ + cout << _time_end << " seconds." << endl; + } + else{ + cout << "the end of the trace." << endl; } - break; + + draw_trace(_file_opened, _DRAW_SVG); + } + break; case _STATE_RENDER_AREA_CHANGE_TRANSLATE: _render_opengl->change_translate( *((int*)arg) ); @@ -1048,151 +1048,151 @@ void Core::launch_action(int state, void* arg) { break; case _STATE_CLEAN_RENDER_AREA: - { - Info::Render::_x_min_visible = 0.0; - Info::Render::_x_max_visible = 0.0; - if (_render_opengl->unbuild() == false) - message << "Close file : an error occured while cleaning the render." << Message::ende; - _render_opengl->release(); - _render_opengl->updateGL(); - } - break; + { + Info::Render::_x_min_visible = 0.0; + Info::Render::_x_max_visible = 0.0; + if (_render_opengl->unbuild() == false) + message << "Close file : an error occured while cleaning the render." << Message::ende; + _render_opengl->release(); + _render_opengl->updateGL(); + } + break; case _STATE_RENDER_SHOW_MINIMAP: _render_opengl->show_minimap(); break; case _STATE_SWITCH_CONTAINERS: - { - Element_pos yr = ((Element_pos*)arg)[0]; - Element_pos yr2 = ((Element_pos*)arg)[1]; - const Container* container=NULL; - const Container* container2=NULL; - const Container::Vector *root_containers = _trace->get_view_root_containers(); - if(root_containers->empty())root_containers= _trace->get_root_containers(); - if (!root_containers->empty()){ - for (Container::VectorIt i = root_containers->begin(); - i != root_containers->end(); - i++) - if ((container = buf.search_container_by_position(*i, yr))) - break; - - for (Container::VectorIt i = root_containers->begin(); - i != root_containers->end(); - i++) - if ((container2 = buf.search_container_by_position(*i, yr2))) - break; + { + Element_pos yr = ((Element_pos*)arg)[0]; + Element_pos yr2 = ((Element_pos*)arg)[1]; + const Container* container=NULL; + const Container* container2=NULL; + const Container::Vector *root_containers = _trace->get_view_root_containers(); + if(root_containers->empty())root_containers= _trace->get_root_containers(); + if (!root_containers->empty()){ + for (Container::VectorIt i = root_containers->begin(); + i != root_containers->end(); + i++) + if ((container = buf.search_container_by_position(*i, yr))) + break; + + for (Container::VectorIt i = root_containers->begin(); + i != root_containers->end(); + i++) + if ((container2 = buf.search_container_by_position(*i, yr2))) + break; - } + } - // If the clic is out - if (!container) - return; - if (!container2) - return; + // If the clic is out + if (!container) + return; + if (!container2) + return; - //we found the two children containers, we have to know the depth - Element_pos xr = ((Element_pos*)arg)[2] * (_trace->get_depth()+1); - if(xr<0)return; + //we found the two children containers, we have to know the depth + Element_pos xr = ((Element_pos*)arg)[2] * (_trace->get_depth()+1); + if(xr<0)return; - Element_pos xr2 = ((Element_pos*)arg)[3] * (_trace->get_depth()+1); - if(xr2<0)return; - for(int i=0; i < (const_cast<Container*>(container)->get_depth() - xr); i++){ - container= container->get_parent(); - } + Element_pos xr2 = ((Element_pos*)arg)[3] * (_trace->get_depth()+1); + if(xr2<0)return; + for(int i=0; i < (const_cast<Container*>(container)->get_depth() - xr); i++){ + container= container->get_parent(); + } - for(int i=0; i < (const_cast<Container*>(container2)->get_depth() - xr2); i++){ - container2=container2->get_parent(); - } + for(int i=0; i < (const_cast<Container*>(container2)->get_depth() - xr2); i++){ + container2=container2->get_parent(); + } - //we cannot switch when containers' parents are not the same - if( container->get_parent() != container2->get_parent() ) - return; + //we cannot switch when containers' parents are not the same + if( container->get_parent() != container2->get_parent() ) + return; - if( container == container2 ) - return; + if( container == container2 ) + return; - Container* parent= const_cast<Container*>(container->get_parent()); + Container* parent= const_cast<Container*>(container->get_parent()); - //printf("we ask to switch %s and %s \n", container->get_name().to_string().c_str(), container2->get_name().to_string().c_str()); + //printf("we ask to switch %s and %s \n", container->get_name().to_string().c_str(), container2->get_name().to_string().c_str()); - const std::list<Container*>* children=NULL; + const std::list<Container*>* children=NULL; - if(parent==NULL){//we switch top level containers - children = _trace->get_view_root_containers(); - if(children->empty()) children = _trace->get_root_containers(); - }else{ - children = new std::list<Container*>(*parent->get_view_children()); - if(children->empty()) children = parent->get_children(); - } + if(parent==NULL){//we switch top level containers + children = _trace->get_view_root_containers(); + if(children->empty()) children = _trace->get_root_containers(); + }else{ + children = new std::list<Container*>(*parent->get_view_children()); + if(children->empty()) children = parent->get_children(); + } - std::list<Container*>::const_iterator it= children->begin(); - const std::list<Container*>::const_iterator it_end= children->end(); - if(parent!=NULL){ - parent->clear_view_children(); - for(; it!=it_end; it++){ - if((*it)==container) parent->add_view_child(const_cast<Container*>(container2)); - else if((*it)==container2) parent->add_view_child(const_cast<Container*>(container)); - else parent->add_view_child(*it); - } - }else{//for root containers we have to build a new list and fill it - std::list<Container*>* new_list= new std::list<Container*> (); - for(; it!=it_end; it++){ - if((*it)==container){ - new_list->push_back(const_cast<Container*>(container2)); - } - else if((*it)==container2) new_list->push_back(const_cast<Container*>(container)); - else new_list->push_back(*it); + std::list<Container*>::const_iterator it= children->begin(); + const std::list<Container*>::const_iterator it_end= children->end(); + if(parent!=NULL){ + parent->clear_view_children(); + for(; it!=it_end; it++){ + if((*it)==container) parent->add_view_child(const_cast<Container*>(container2)); + else if((*it)==container2) parent->add_view_child(const_cast<Container*>(container)); + else parent->add_view_child(*it); + } + }else{//for root containers we have to build a new list and fill it + std::list<Container*>* new_list= new std::list<Container*> (); + for(; it!=it_end; it++){ + if((*it)==container){ + new_list->push_back(const_cast<Container*>(container2)); } - _trace->set_view_root_containers(*new_list); + else if((*it)==container2) new_list->push_back(const_cast<Container*>(container)); + else new_list->push_back(*it); } + _trace->set_view_root_containers(*new_list); + } - Element_pos zoom[2]={Info::Render::_x_min, Info::Render::_x_max}; - Info::Render::_x_min_visible = 0.0; - Info::Render::_x_max_visible = 0.0; + Element_pos zoom[2]={Info::Render::_x_min, Info::Render::_x_max}; + Info::Render::_x_min_visible = 0.0; + Info::Render::_x_max_visible = 0.0; - launch_action(Core:: _STATE_CLEAN_RENDER_AREA); + launch_action(Core:: _STATE_CLEAN_RENDER_AREA); #if defined(USE_ITC) && defined(BOOST_SERIALIZE) - _trace->updateTrace(new Interval(zoom[0], zoom[1])); + _trace->updateTrace(new Interval(zoom[0], zoom[1])); #endif - draw_trace(get_filename(),Core::_DRAW_OPENGL); - launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom); - launch_action(Core:: _STATE_RENDER_UPDATE); + draw_trace(get_filename(),Core::_DRAW_OPENGL); + launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom); + launch_action(Core:: _STATE_RENDER_UPDATE); - break; - } + break; + } case _DRAW_OPENGL_PARTIAL: - { - //_main_window->get_node_select()->set_trace(_trace); - bool xml_success = _trace->load_config_from_xml(QString(_xml_config_file.c_str())); - if(!xml_success){ - //std::list<Container *> displayed_containers; - //_main_window->get_node_select()->build_displayed_nodes(displayed_containers); - //_trace->set_view_root_containers(displayed_containers); - //}else{ - message << "Error while parsing" << _xml_config_file << Message::ende; - } - break; - } - case _STATE_ZOOM_IN_AN_INTERVAL: - { - _render_opengl->apply_zoom_on_interval(((Element_pos*)arg)[0], ((Element_pos*)arg)[1]); + { + //_main_window->get_node_select()->set_trace(_trace); + bool xml_success = _trace->load_config_from_xml(QString(_xml_config_file.c_str())); + if(!xml_success){ + //std::list<Container *> displayed_containers; + //_main_window->get_node_select()->build_displayed_nodes(displayed_containers); + //_trace->set_view_root_containers(displayed_containers); + //}else{ + message << "Error while parsing" << _xml_config_file << Message::ende; } break; + } + case _STATE_ZOOM_IN_AN_INTERVAL: + { + _render_opengl->apply_zoom_on_interval(((Element_pos*)arg)[0], ((Element_pos*)arg)[1]); + } + break; case _STATE_UPDATE_VARVALUES: - { - if( NULL != _trace ) { - std::map<long int, double> var_map = _trace->update_text_variable_values(((Element_pos*)arg)[0]); - buf.draw_text_variable_values(_render_opengl,&var_map,((Element_pos*)arg)[0]); - } + { + if( NULL != _trace ) { + std::map<long int, double> var_map = _trace->update_text_variable_values(((Element_pos*)arg)[0]); + buf.draw_text_variable_values(_render_opengl,&var_map,((Element_pos*)arg)[0]); } - break; + } + break; case _LOAD_DATA: - { + { //case where data has to be loaded from serialized files, after a zoom in the preview //by default, we do that in another window _time_start=Info::Splitter::_x_min; diff --git a/src/interface/Interface.hpp b/src/interface/Interface.hpp index 184bc9fae340a8a983a60728a0566611ed3ad659..6fb85e590a64fb62ad016bfffcdc8d9255051526 100644 --- a/src/interface/Interface.hpp +++ b/src/interface/Interface.hpp @@ -1,45 +1,45 @@ /* -** This file is part of the ViTE project. -** -** This software is governed by the CeCILL-A license under French law -** and abiding by the rules of distribution of free software. You can -** 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, -** that may mean that it is complicated to manipulate, and that also -** therefore means that it is reserved for developers and experienced -** professionals having in-depth computer knowledge. Users are therefore -** encouraged to load and test the software's suitability as regards -** 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. -** -** -** ViTE developers are (for version 0.* to 1.0): -** -** - COULOMB Kevin -** - FAVERGE Mathieu -** - JAZEIX Johnny -** - LAGRASSE Olivier -** - MARCOUEILLE Jule -** - NOISETTE Pascal -** - REDONDY Arthur -** - VUCHENER Clément -** -*/ + ** This file is part of the ViTE project. + ** + ** This software is governed by the CeCILL-A license under French law + ** and abiding by the rules of distribution of free software. You can + ** 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, + ** that may mean that it is complicated to manipulate, and that also + ** therefore means that it is reserved for developers and experienced + ** professionals having in-depth computer knowledge. Users are therefore + ** encouraged to load and test the software's suitability as regards + ** 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. + ** + ** + ** ViTE developers are (for version 0.* to 1.0): + ** + ** - COULOMB Kevin + ** - FAVERGE Mathieu + ** - JAZEIX Johnny + ** - LAGRASSE Olivier + ** - MARCOUEILLE Jule + ** - NOISETTE Pascal + ** - REDONDY Arthur + ** - VUCHENER Clément + ** + */ /*! *\file Interface.hpp */ @@ -56,10 +56,10 @@ class Interface; *\brief This is an interface, used by the terminal and graphical interfaces. * *Interface defines functions implemented in their inherited classes. It gives functions which can be used by others parts of ViTE (for example the Parser and the Data Structure). Thus, it hides which kind of interface is used: a console interface (where messages are displayed in the terminal) or a graphical interface (where messages are displayed in a dialog box). -*/ + */ class Interface{ - public: +public: /*! * \arg string : the string to be displayed. @@ -69,27 +69,27 @@ class Interface{ /*! - \arg string : the string to be displayed. - \brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialog box for the Interface_graphic. Then the program go on, but with an indeterminated behaviour. - */ + \arg string : the string to be displayed. + \brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialog box for the Interface_graphic. Then the program go on, but with an indeterminated behaviour. + */ virtual void warning(const std::string &) const =0; /*! - \arg string : the string to be displayed. - \brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialog box for the Interface_graphic. Then the program go on normally. - */ + \arg string : the string to be displayed. + \brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialog box for the Interface_graphic. Then the program go on normally. + */ virtual void information(const std::string &) const =0; - /*! + /*! *\arg string : the string to be displayed. *\brief The function takes strings and/or numbers then displayed it in the entity informative text area in the info window (use in graphic interface). - */ + */ virtual void selection_information(const std::string &) const =0; /*! - \brief Return the name of the file opened. - */ + \brief Return the name of the file opened. + */ virtual const std::string get_filename() const = 0; }; diff --git a/src/interface/Interface_graphic.hpp b/src/interface/Interface_graphic.hpp index 77c2677668b2f886c443666dd301d45baf60e37c..5075c775c8ea78ffd451996a18ff91340a74e464 100644 --- a/src/interface/Interface_graphic.hpp +++ b/src/interface/Interface_graphic.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 ** */ /*! @@ -82,7 +82,7 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public protected: - + /*********************************** * * Window function. @@ -128,12 +128,12 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public * \brief This variable contains the OpenGL render area. */ QGLWidget* _ui_render_area; - + /*! * \brief Layout which will contain the render area. */ QVBoxLayout* _ui_render_area_layout; - + /*! * \brief This variable contains the instance of the horizontal scroll bar. */ @@ -158,7 +158,7 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public * \brief Contains the zoom box instance. */ QComboBox* _ui_zoom_box; - + /*! * \brief Use to store the filename when the trace is exported. */ @@ -168,17 +168,17 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public * \brief Contains the last zoom value. (Prevent recursive calls) */ QString _zoom_box_check_value; - + /*! * \brief Contains the trace displayed path. */ std::string _trace_path; - + /*! * \brief Contains the conversion factor between x virtual and real scroll unit. */ double _x_factor_virtual_to_real; - + /*! * \brief Contains the conversion factor between y virtual and real scroll unit. */ @@ -188,12 +188,12 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public * \brief Contains the real x scroll bar length. */ static const int _REAL_X_SCROLL_LENGTH = 10000; - + /*! * \brief Contains the real x scroll bar length. */ static const int _REAL_Y_SCROLL_LENGTH = 10000; - + /*********************************** * * Informative window widget attributes. @@ -208,7 +208,7 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public /*! * \brief This variable contains the floatting export box window of the application. */ - QWidget* _ui_time_selection_export; + QWidget* _ui_time_selection_export; /*! * \brief Dialog box to give some help for user. @@ -219,7 +219,7 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public * \brief Dialog box to allow user to set its ViTE environment. (change color, text size, etc.) */ Settings_window* _ui_settings; - + /*! * \brief Dialog box to allow user to select nodes to display */ @@ -260,7 +260,7 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public * Export windows. * **********************************/ - + /*! * \brief ComboBox which allow the choice between svg export and counter export. */ @@ -275,13 +275,13 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public QWidget* _ui_counter_choice_to_export; QComboBox *_counter_list_names; std::map <std::string, Variable *> _all_variables; - + /*********************************** * * Help window. * **********************************/ - + /*! * \brief Button uses to close the help window. */ @@ -303,12 +303,12 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public * \brief Prevent warnings to be displayed (used with malformed traces to prevent Qt spending too much time). */ bool _no_warning; - + /*! * \brief if true, reload button reloads it from the trace (new parsing), if false, just update the render */ bool _reload_type; - + /*! * \brief Prevent recursive callings when changing manualy scroll bars. */ @@ -369,7 +369,7 @@ public: * \param string The string to be displayed. */ void information(const std::string &string) const; - + /*********************************** @@ -395,7 +395,7 @@ public: * \param filename The file name of the file parsed. */ void init_parsing(const std::string &filename); - + /*! * \brief Update the bar with the new time and the percentage loaded. * \param filename The file name of the file parsed. @@ -418,33 +418,33 @@ public: * Tool functions. * **********************************/ - + /*! * \brief Create a Parser and a DataStructure to display a trace file. * \param path The path of the file. */ void opening_file(const std::string &path); - + /*! * \brief Bind a render area to the main window. * \param render_area A pointer to a QGLWidget. */ void bind_render_area(QGLWidget* render_area); - + /*! * \brief Ajust scroll bar length. * \param new_x_virtual_length The new virtual x length of the scroll bar. * \param new_y_virtual_length The new virtual y length of the scroll bar. */ void set_scroll_bars_length(Element_pos new_x_virtual_length, Element_pos new_y_virtual_length); - + /*! * \brief Ajust scroll bar values when there is a translation. * \param x_bar_new_value The new x_scroll bar value. * \param y_bar_new_value The new y_scroll bar value. */ void linking_scroll_bars(Element_pos x_bar_new_value, Element_pos y_bar_new_value); - + /*! * \brief Convert scroll units from real scroll bar unit to render area scroll unit. * \param scroll_position The real value to convert. @@ -452,7 +452,7 @@ public: * \return The converted value. */ Element_pos real_to_virtual_scroll_unit(int scroll_position, const char &axe); - + /*! * \brief Convert scroll units from virtual render area scroll unit to real scroll bar unit. * \param scroll_position The virtual value to convert. @@ -460,7 +460,7 @@ public: * \return The converted value. */ int virtual_to_real_scroll_unit(Element_pos scroll_position, const char &axe); - + /*! * \brief Change the current value of the zoom box. * \param new_value The new zoom value. @@ -488,18 +488,18 @@ public: */ Core *get_console(); - /*! + /*! * \fn get_node_select() * \brief To get the node selection console */ - Node_select* get_node_select(); + Node_select* get_node_select(); - /*! + /*! * \fn get_interval_select() * \brief To get the node selection console */ - Interval_select* get_interval_select(); + Interval_select* get_interval_select(); /*! * \fn update_recent_files_menu() @@ -579,8 +579,8 @@ protected slots: *\brief A slot called when 'Shaded states' in the menu is clicked. */ void on_shaded_states_triggered(); - - /*! + + /*! *\brief A slot called when 'Vertical line' in the menu is clicked. */ void on_vertical_line_triggered(); @@ -589,7 +589,7 @@ protected slots: *\brief A slot called when 'Show toolbar' in the menu is clicked. */ void on_toolbar_menu_triggered(); - + /*! *\brief A slot called when 'Show minimap' in the menu is clicked. */ @@ -602,7 +602,7 @@ protected slots: /*! *\brief A slot called when 'help' in the menu is clicked. - */ + */ void on_help_triggered(); /*! @@ -619,13 +619,13 @@ protected slots: *\brief A slot called when 'Settings' in the menu is clicked. */ void on_show_settings_triggered(); - + /*! *\brief A slot called when 'Node selection' in the menu is clicked. */ void on_node_selection_triggered(); - /*! + /*! *\brief A slot called when 'Node selection' in the menu is clicked. */ void on_interval_selection_triggered(); @@ -639,7 +639,7 @@ protected slots: *\brief A slot called when 'no_warning' in the menu is clicked. */ void on_no_warning_triggered(); - + /*! *\brief A slot called when 'reload_from_file' in the menu is clicked. */ @@ -649,7 +649,7 @@ protected slots: *\brief A slot called when 'no_arrows' in the menu is clicked. */ void on_no_arrows_triggered(); - + /*! *\brief A slot called when 'no_events' in the menu is clicked. */ @@ -669,12 +669,12 @@ protected slots: *\brief A slot called when 'goto_start' in the menu is clicked. */ void on_goto_start_triggered(); - + /*! *\brief A slot called when 'goto_end' in the menu is clicked. */ void on_goto_end_triggered(); - + /*! *\brief A slot called when 'show_all_trace' in the menu is clicked. */ diff --git a/src/interface/settings.ui b/src/interface/settings.ui index 30911c5df5bba886bdd39768c477b3b60176d387..b63e13794081aac3cf1ede8b4760352a12933de8 100755 --- a/src/interface/settings.ui +++ b/src/interface/settings.ui @@ -1,663 +1,663 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>settings</class> - <widget class="QWidget" name="settings"> - <property name="windowModality"> - <enum>Qt::NonModal</enum> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>467</width> - <height>665</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>Preferences</string> - </property> - <property name="windowIcon"> - <iconset resource="vite.qrc"> - <normaloff>:/icon/icon/vite.png</normaloff>:/icon/icon/vite.png</iconset> - </property> - <layout class="QVBoxLayout" name="verticalLayout_9"> - <item> - <widget class="QTabWidget" name="tabWidget"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>100</verstretch> + <class>settings</class> + <widget class="QWidget" name="settings"> + <property name="windowModality"> + <enum>Qt::NonModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>467</width> + <height>665</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> </sizepolicy> - </property> - <property name="currentIndex"> - <number>5</number> - </property> - <widget class="QWidget" name="tab_2"> - <attribute name="title"> - <string>General</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="title"> - <string>Filters</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <property name="topMargin"> - <number>9</number> - </property> - <item> - <widget class="QCheckBox" name="use_palette_cb"> - <property name="text"> - <string>Use palettes</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_2"> - <property name="text"> - <string>No links</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_3"> - <property name="text"> - <string>No events</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_8"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_3"> - <attribute name="title"> - <string>States</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <widget class="QComboBox" name="palette_list"/> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="add_palette_btn"> - <property name="text"> - <string>Add</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="copy_palette_btn"> - <property name="text"> - <string>Copy</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="rm_palette_btn"> - <property name="text"> - <string>Remove</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QTableWidget" name="states_table"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>100</horstretch> - <verstretch>100</verstretch> - </sizepolicy> - </property> - <column> - <property name="text"> - <string>State name</string> - </property> - </column> - <column> - <property name="text"> - <string>Color</string> + </property> + <property name="windowTitle"> + <string>Preferences</string> + </property> + <property name="windowIcon"> + <iconset resource="vite.qrc"> + <normaloff>:/icon/icon/vite.png</normaloff>:/icon/icon/vite.png</iconset> + </property> + <layout class="QVBoxLayout" name="verticalLayout_9"> + <item> + <widget class="QTabWidget" name="tabWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>100</verstretch> + </sizepolicy> </property> - </column> - <column> - <property name="text"> - <string>Visible</string> + <property name="currentIndex"> + <number>5</number> </property> - </column> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_16"> - <item> - <widget class="QLabel" name="label_9"> - <property name="text"> - <string>State:</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="reload_states_btn"> - <property name="toolTip"> - <string>Reload all the states types from the displayed trace</string> - </property> - <property name="text"> - <string>Reload All</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="add_state_btn"> - <property name="text"> - <string>Add</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="rm_state_btn"> - <property name="text"> - <string>Remove</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_4"> - <attribute name="title"> - <string>Event Types</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_14"> - <item> - <widget class="QComboBox" name="event_types_palette_list"/> - </item> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="reload_event_types_palette_btn"> - <property name="text"> - <string>Reload</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="copy_event_types_palette_btn"> - <property name="text"> - <string>Copy</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="rm_event_types_palette_btn"> - <property name="text"> - <string>Remove</string> - </property> + <widget class="QWidget" name="tab_2"> + <attribute name="title"> + <string>General</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="title"> + <string>Filters</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="topMargin"> + <number>9</number> + </property> + <item> + <widget class="QCheckBox" name="use_palette_cb"> + <property name="text"> + <string>Use palettes</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_2"> + <property name="text"> + <string>No links</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_3"> + <property name="text"> + <string>No events</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_8"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <item> - <widget class="QTableWidget" name="event_types_table"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>100</verstretch> - </sizepolicy> - </property> - <column> - <property name="text"> - <string>Event Type</string> - </property> - </column> - <column> - <property name="text"> - <string>Color</string> - </property> - </column> - <column> - <property name="text"> - <string>Visible</string> - </property> - </column> + <widget class="QWidget" name="tab_3"> + <attribute name="title"> + <string>States</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <widget class="QComboBox" name="palette_list"/> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="add_palette_btn"> + <property name="text"> + <string>Add</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="copy_palette_btn"> + <property name="text"> + <string>Copy</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="rm_palette_btn"> + <property name="text"> + <string>Remove</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QTableWidget" name="states_table"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>100</horstretch> + <verstretch>100</verstretch> + </sizepolicy> + </property> + <column> + <property name="text"> + <string>State name</string> + </property> + </column> + <column> + <property name="text"> + <string>Color</string> + </property> + </column> + <column> + <property name="text"> + <string>Visible</string> + </property> + </column> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_16"> + <item> + <widget class="QLabel" name="label_9"> + <property name="text"> + <string>State:</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="reload_states_btn"> + <property name="toolTip"> + <string>Reload all the states types from the displayed trace</string> + </property> + <property name="text"> + <string>Reload All</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="add_state_btn"> + <property name="text"> + <string>Add</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="rm_state_btn"> + <property name="text"> + <string>Remove</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_5"> - <attribute name="title"> - <string>Link Types</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_10"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_12"> - <item> - <widget class="QComboBox" name="link_types_palette_list"/> - </item> - <item> - <spacer name="horizontalSpacer_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="reload_link_types_palette_btn"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Reload</string> - </property> + <widget class="QWidget" name="tab_4"> + <attribute name="title"> + <string>Event Types</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <item> + <widget class="QComboBox" name="event_types_palette_list"/> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="reload_event_types_palette_btn"> + <property name="text"> + <string>Reload</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="copy_event_types_palette_btn"> + <property name="text"> + <string>Copy</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="rm_event_types_palette_btn"> + <property name="text"> + <string>Remove</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <item> + <widget class="QTableWidget" name="event_types_table"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>100</verstretch> + </sizepolicy> + </property> + <column> + <property name="text"> + <string>Event Type</string> + </property> + </column> + <column> + <property name="text"> + <string>Color</string> + </property> + </column> + <column> + <property name="text"> + <string>Visible</string> + </property> + </column> + </widget> + </item> + </layout> + </item> + </layout> </widget> - </item> - <item> - <widget class="QPushButton" name="copy_link_types_palette_btn"> - <property name="text"> - <string>Copy</string> - </property> + <widget class="QWidget" name="tab_5"> + <attribute name="title"> + <string>Link Types</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_10"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <item> + <widget class="QComboBox" name="link_types_palette_list"/> + </item> + <item> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="reload_link_types_palette_btn"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Reload</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="copy_link_types_palette_btn"> + <property name="text"> + <string>Copy</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="rm_link_types_palette_btn"> + <property name="text"> + <string>Remove</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_15"> + <item> + <widget class="QTableWidget" name="link_types_table"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cornerButtonEnabled"> + <bool>true</bool> + </property> + <column> + <property name="text"> + <string>Link Type</string> + </property> + </column> + <column> + <property name="text"> + <string>Color</string> + </property> + </column> + <column> + <property name="text"> + <string>Visible</string> + </property> + </column> + </widget> + </item> + </layout> + </item> + </layout> </widget> - </item> - <item> - <widget class="QPushButton" name="rm_link_types_palette_btn"> - <property name="text"> - <string>Remove</string> - </property> + <widget class="QWidget" name="tab"> + <attribute name="title"> + <string>Plugin</string> + </attribute> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <item> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>Directory list:</string> + </property> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <widget class="QListWidget" name="dir_list"/> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="rm_dir_btn"> + <property name="text"> + <string>-</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="add_dir_btn"> + <property name="text"> + <string>+</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_15"> - <item> - <widget class="QTableWidget" name="link_types_table"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="cornerButtonEnabled"> - <bool>true</bool> - </property> - <column> - <property name="text"> - <string>Link Type</string> - </property> - </column> - <column> - <property name="text"> - <string>Color</string> - </property> - </column> - <column> - <property name="text"> - <string>Visible</string> - </property> - </column> + <widget class="QWidget" name="map_tab"> + <attribute name="title"> + <string>Minimap</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_11"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QCheckBox" name="minimap_hide_cb"> + <property name="text"> + <string>hidden on start</string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Position</string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>x</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="minimap_x_sb"> + <property name="maximum"> + <number>1000</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>y</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="minimap_y_sb"> + <property name="maximum"> + <number>1000</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Dimension</string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>width</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="minimap_w_sb"> + <property name="maximum"> + <number>1000</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>height</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="minimap_h_sb"> + <property name="maximum"> + <number>1000</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <item> + <widget class="QLabel" name="label_7"> + <property name="text"> + <string>square border size</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_5"/> + </item> + <item> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab"> - <attribute name="title"> - <string>Plugin</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <widget class="QLabel" name="label_8"> - <property name="text"> - <string>Directory list:</string> - </property> </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <widget class="QListWidget" name="dir_list"/> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> </spacer> - </item> - <item> - <widget class="QPushButton" name="rm_dir_btn"> - <property name="text"> - <string>-</string> - </property> + </item> + <item> + <widget class="QPushButton" name="cancel"> + <property name="text"> + <string>Cancel</string> + </property> </widget> - </item> - <item> - <widget class="QPushButton" name="add_dir_btn"> - <property name="text"> - <string>+</string> - </property> + </item> + <item> + <widget class="QPushButton" name="apply"> + <property name="text"> + <string>Apply</string> + </property> </widget> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="map_tab"> - <attribute name="title"> - <string>Minimap</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_11"> - <item> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QCheckBox" name="minimap_hide_cb"> - <property name="text"> - <string>hidden on start</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Position</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string>x</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="minimap_x_sb"> - <property name="maximum"> - <number>1000</number> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>y</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="minimap_y_sb"> - <property name="maximum"> - <number>1000</number> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Dimension</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>width</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="minimap_w_sb"> - <property name="maximum"> - <number>1000</number> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>height</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="minimap_h_sb"> - <property name="maximum"> - <number>1000</number> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <spacer name="horizontalSpacer_8"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <item> - <widget class="QLabel" name="label_7"> - <property name="text"> - <string>square border size</string> - </property> + </item> + <item> + <widget class="QPushButton" name="ok"> + <property name="text"> + <string>OK</string> + </property> </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_5"/> - </item> - <item> - <spacer name="horizontalSpacer_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> + </item> </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_11"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="cancel"> - <property name="text"> - <string>Cancel</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="apply"> - <property name="text"> - <string>Apply</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="ok"> - <property name="text"> - <string>OK</string> - </property> - </widget> - </item> + </item> </layout> - </item> - </layout> - </widget> - <resources> - <include location="vite.qrc"/> - </resources> - <connections/> + </widget> + <resources> + <include location="vite.qrc"/> + </resources> + <connections/> </ui> diff --git a/src/render/Render_opengl.cpp b/src/render/Render_opengl.cpp index 684712782973f783f277ec32d0a812e09f241bd0..71347d10d91923ade5c3247f1316e52aa283de71 100644 --- a/src/render/Render_opengl.cpp +++ b/src/render/Render_opengl.cpp @@ -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 ** */ /*! @@ -82,21 +82,21 @@ using namespace std; template <int N> void Render_opengl::cos_table_builder(double table[]){ - cos_table_builder<N-1>(table); - table[N-1]=cos(angle+delta_angle*(N-1))*radius; + cos_table_builder<N-1>(table); + table[N-1]=cos(angle+delta_angle*(N-1))*radius; } template <> void Render_opengl::cos_table_builder<0>(double table[]){ - table[0]=cos(angle*radius); + table[0]=cos(angle*radius); } template <int N> void Render_opengl::sin_table_builder(double table[]){ - sin_table_builder<N-1>(table); - table[N-1]=sin(angle+delta_angle*(N-1))*(radius); + sin_table_builder<N-1>(table); + table[N-1]=sin(angle+delta_angle*(N-1))*(radius); } template <> void Render_opengl::sin_table_builder<0>(double table[]){ - table[0]=sin(angle)*(radius); + table[0]=sin(angle)*(radius); } static double cos_table[NB_STEPS]; @@ -120,7 +120,7 @@ Render_opengl::Render_opengl(Core* core, QWidget *parent, const QGLFormat& forma : Hook_event(this, core, parent, format){ - + _arrows.clear(); _circles.clear(); _texts.clear(); @@ -138,11 +138,11 @@ Render_opengl::Render_opengl(Core* core, QWidget *parent, const QGLFormat& forma connect(_wait_timer, SIGNAL(timeout()), _render_instance, SLOT(updateGL())); _wait_timer->start(_wait_spf); #endif // SPINNING_LOGO - vertical_line=0; + vertical_line=0; vertical_line=0; setAutoFillBackground(false); - - + + cos_table_builder<NB_STEPS>(cos_table); sin_table_builder<NB_STEPS>(sin_table); @@ -159,7 +159,7 @@ void Render_opengl::release(){ delete _wait_timer; _wait_timer=NULL; } - + // release_minimap(); } @@ -186,24 +186,24 @@ void Render_opengl::initializeGL() { void Render_opengl::resizeGL(int width, int height) { glViewport(0, 0, width, height); - + /* update informations about widget size */ Info::Screen::width = width; Info::Screen::height = height; - + glMatrixMode(GL_PROJECTION); glLoadIdentity(); - + if(DRAWING_STATE_WAITING == _state){// A wait is drawn glOrtho(-50, 50, -50, 50, 0, 1000); - }else if (DRAWING_STATE_DRAWING == _state){// A trace is drawn + }else if (DRAWING_STATE_DRAWING == _state){// A trace is drawn glOrtho(0, Info::Render::width, 0, Info::Render::height, 0, -1000); }else{ message << tr("Undefined value for the drawing state attribute - Render area").toStdString() << Message::ende; } - + glMatrixMode(GL_MODELVIEW); } @@ -219,37 +219,37 @@ void Render_opengl::paintGL(){ glLoadIdentity(); - + if(DRAWING_STATE_WAITING == _state){/* A wait is drawn */ - + /* turn around y axis */ _wait_angle+=0.1f; if (_wait_angle>=360) _wait_angle=0.0f; - + glPushMatrix(); - + glScalef(15, 15, 0); - + #ifdef SPINNING_LOGO glRotatef(-_wait_angle,0, 1, 0); #endif // SPINNING_LOGO - + glCallList(_wait_list); glPopMatrix(); - - + + }else if (DRAWING_STATE_DRAWING == _state){/* A trace is drawn */ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); - { + { glTranslated(0.0, Info::Render::height, 100.0); - glRotated(180.0, 1.0, 0.0, 0.0); - + glRotated(180.0, 1.0, 0.0, 0.0); + glPushMatrix(); - { + { glTranslatef(0.0f, _ruler_y + _ruler_height -_y_state_translate, _z_container); glScalef(_x_scale_container_state/0.20, _y_state_scale, 1.0); @@ -281,7 +281,7 @@ void Render_opengl::paintGL(){ _minimap.width()/_x_state_scale, _minimap.height()/_y_state_scale ); - //initialize the minimap if it hasn't been done yet + //initialize the minimap if it hasn't been done yet if(!_minimap.is_initialized()){ QImage buf = grabFrameBuffer(true); _minimap.init(buf); @@ -289,39 +289,39 @@ void Render_opengl::paintGL(){ if(false == Info::Render::_no_arrows){ draw_stored_arrows(); } - - - + + + if (false == Info::Render::_no_events)/* display events */ draw_stored_circles(); - + /* Untranslate ruler */ glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); call_ruler(); glDisable(GL_BLEND); - + if (Info::Render::_vertical_line){ - draw_vertical_line(); - } - + draw_vertical_line(); + } + } glPopMatrix(); - + glPushMatrix(); { glTranslated(0.0, 0.0, 100.0);/* not accurate */ - + if (_mouse_pressed && (Info::Render::_key_ctrl == false) && !_mouse_pressed_inside_container){ - - + + glTranslated(0.0, 0.0, _z_container_under); - + Element_pos old_x, old_y, new_x, new_y; - - + + old_x = screen_to_render_x(_mouse_x); old_y = Info::Render::height - screen_to_render_y(_mouse_y); @@ -330,15 +330,15 @@ void Render_opengl::paintGL(){ new_y = Info::Render::height - screen_to_render_y(_new_mouse_y); #ifdef DEBUG_MODE_RENDER_OPENGL - - cerr << __FILE__ << " l." << __LINE__ << ":" << endl; - cerr << "Selection rectangle position: (" << old_x << ", " << old_y << ") - (" << new_x << ", " << new_y << ")" << endl; + + cerr << __FILE__ << " l." << __LINE__ << ":" << endl; + cerr << "Selection rectangle position: (" << old_x << ", " << old_y << ") - (" << new_x << ", " << new_y << ")" << endl; #endif - + glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + /* Square for selection */ glBegin(GL_QUADS); { @@ -348,9 +348,9 @@ void Render_opengl::paintGL(){ glColor4f(0.9f, 0.9f, 0.9f, _selection_rectangle_alpha);glVertex2d(new_x, old_y); } glEnd(); - + glDisable(GL_BLEND); - + }/* end if (true==_mouse_pressed) */ } glPopMatrix(); @@ -360,7 +360,7 @@ void Render_opengl::paintGL(){ }else{ message << tr("Undefined value for the drawing state attribute - Render area").toStdString() << Message::ende; } - + glFlush(); @@ -381,22 +381,22 @@ void Render_opengl::paintGL(){ qglColor(Qt::white); const QFontMetrics metric(arial_font); - + //we calculate the height of the interline we want : max height of the font + 1 pixel to avoid overlapping (metric.height() returns a bigger value, a bit too much) int height = metric.tightBoundingRect("fg").height()+1; - + /* Draw container text */ const unsigned int texts_size = _texts.size(); std::map<Element_pos,Element_pos> previous_by_column; - + //int skipped,displayed=0; for (unsigned int i=0 ; i<texts_size ; i++){ - + if (trace_to_render_y(_texts[i].y) + 0.5 < 9) continue;/* Do not display text if it is on the ruler area */ - + //check if ye are not too close to another container to properly display the text std::map<Element_pos,Element_pos>::const_iterator it = previous_by_column.find(_texts[i].x); const std::map<Element_pos,Element_pos>::const_iterator it_end = previous_by_column.end(); @@ -413,7 +413,7 @@ void Render_opengl::paintGL(){ //displayed++; }//else{skipped++;} } - + // printf("skipped %d displayed %d\n", skipped, displayed); @@ -423,64 +423,64 @@ void Render_opengl::paintGL(){ Element_pos coeff_prefix; graduation_diff = Ruler::get_graduation_diff(Info::Render::_x_min_visible, Info::Render::_x_max_visible); coeff_prefix = Ruler::get_coeff_for_common_prefix(Info::Render::_x_min_visible, Info::Render::_x_max_visible); - + arial_font.setPointSize(14); - + buf_txt.str("");/* flush the buffer */ buf_txt << "min: " << (double)Info::Render::_x_min_visible; - + renderText (render_to_screen_x(trace_to_render_x(Info::Render::_x_min_visible)), render_to_screen_y(3), buf_txt.str().c_str(), arial_font); - + buf_txt.str("");/* flush the buffer */ buf_txt << "max: " << (double)Info::Render::_x_max_visible; - + renderText (render_to_screen_x(trace_to_render_x(Info::Render::_x_max_visible))-130, render_to_screen_y(3), buf_txt.str().c_str(), arial_font); - + buf_txt.str(""); buf_txt << Ruler::get_common_part_string(Info::Render::_x_min_visible, coeff_prefix) << "--"; - + renderText (render_to_screen_x( trace_to_render_x( - (Info::Render::_x_min_visible + - Info::Render::_x_max_visible) / 2)), + (Info::Render::_x_min_visible + + Info::Render::_x_max_visible) / 2)), render_to_screen_y(3), buf_txt.str().c_str(), arial_font); - + arial_font.setPointSize(10); - - for (Element_pos i = Info::Render::_x_min_visible ; - i < Info::Render::_x_max_visible ; + + for (Element_pos i = Info::Render::_x_min_visible ; + i < Info::Render::_x_max_visible ; i+=graduation_diff){ - + buf_txt.str("");/* flush the buffer */ buf_txt << Ruler::get_variable_part(i, coeff_prefix, 2); - + renderText (render_to_screen_x(trace_to_render_x(i)+1), render_to_screen_y(8), buf_txt.str().c_str(), arial_font); - } - + } + // update_minimap(); - - //initialize the minimap if it hasn't been done yet + + //initialize the minimap if it hasn't been done yet if(!_minimap.is_initialized()){ QImage buf = grabFrameBuffer(true); _minimap.init(buf); } - + } @@ -500,7 +500,7 @@ void Render_opengl::paintGL(){ bool Render_opengl::build(){ - + _state = DRAWING_STATE_DRAWING;/* change the drawing state */ /* disable some OpenGL features to enhance the rendering */ @@ -518,7 +518,7 @@ bool Render_opengl::build(){ } #endif // SPINNING_LOGO - + if (NULL == _render_instance) return true; @@ -532,14 +532,14 @@ bool Render_opengl::build(){ // QImage buf = grabFrameBuffer(true); // _minimap.init(buf); // updateGL(); - + return true;//_render_instance->display_build(); } bool Render_opengl::unbuild(){ - + /********************** * * Init OpenGL features @@ -549,10 +549,10 @@ bool Render_opengl::unbuild(){ /* enable some OpenGL features*/ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - + glEnable(GL_TEXTURE_2D); - glEnable(GL_BLEND);/* enable blending for the alpha color */ + glEnable(GL_BLEND);/* enable blending for the alpha color */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor3f(1.0, 1.0, 1.0);/* init color to white */ @@ -567,7 +567,7 @@ bool Render_opengl::unbuild(){ _state = DRAWING_STATE_WAITING;/* change the drawing state */ _wait_angle=0.0f;/* begin with 0 rad angle */ - + /* clear lists to store container texts */ _text_pos.clear(); @@ -576,7 +576,7 @@ bool Render_opengl::unbuild(){ _arrows.clear(); _circles.clear(); _texts.clear(); - + /* empty the selection stack */ // while(false == _previous_selection.empty()) // _previous_selection.pop(); @@ -588,7 +588,7 @@ bool Render_opengl::unbuild(){ #ifdef SPINNING_LOGO if (_wait_timer == NULL){ _wait_angle = 0.0f; - + _wait_timer = new QTimer(this); connect(_wait_timer, SIGNAL(timeout()), _render_instance, SLOT(updateGL())); _wait_timer->start(_wait_spf); @@ -620,17 +620,17 @@ bool Render_opengl::unbuild(){ GLuint Render_opengl::draw_wait() { GLuint object; GLuint texture; - + object = glGenLists(1);/* create the list */ if (object == 0) message << tr("Error when creating list").toStdString() << Message::endw; - glGenTextures(1, &texture);/* create the texture and link it with the list previously created */ - + glGenTextures(1, &texture);/* create the texture and link it with the list previously created */ + QFile texture_file(QString(":/img/img/logo") + QDate::currentDate().toString("MMdd") + QString(".png")); - + if (true == texture_file.exists())/* The texture exists */ texture = bindTexture(QPixmap(texture_file.fileName()), GL_TEXTURE_2D); else/* use the default picture */ @@ -639,7 +639,7 @@ GLuint Render_opengl::draw_wait() { glNewList(object, GL_COMPILE);/* open the list */ { glBindTexture(GL_TEXTURE_2D, texture);/* load texture for drawing */ - + glBegin(GL_QUADS);/* draw a square */ { glTexCoord2d(0,0); glVertex2f(-1, -1); @@ -648,21 +648,21 @@ GLuint Render_opengl::draw_wait() { glTexCoord2d(0,1); glVertex2f(-1, 1); } glEnd(); - - - } + + + } glEndList();/* close the list */ - + /* apply some parameters on the texture */ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - + glEnable(GL_TEXTURE_2D); - glEnable(GL_BLEND);/* enable blending for the alpha color */ + glEnable(GL_BLEND);/* enable blending for the alpha color */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - + /* Now, timer is set */ if (_wait_timer == NULL){ _wait_angle = 0.0f; @@ -683,12 +683,12 @@ void Render_opengl::call_ruler(){ const Element_pos offset_y = _ruler_y + _ruler_height+3.5; update_visible_interval_value(); - + graduation_diff = Ruler::get_graduation_diff(Info::Render::_x_min_visible, Info::Render::_x_max_visible); // coeff_prefix = Ruler::get_coeff_for_common_prefix(Info::Render::_x_min_visible, Info::Render::_x_max_visible); - + set_color(1.0, 1.0, 1.0); - + for (Element_pos i = Info::Render::_x_min_visible ; i < Info::Render::_x_max_visible ; i+=graduation_diff){ @@ -705,11 +705,11 @@ void Render_opengl::call_ruler(){ if (i>=Info::Render::_x_max_visible) break; - + draw_line( trace_to_render_x(i) + offset_x, offset_y-1 , trace_to_render_x(i) + offset_x, 4+offset_y, _z_ruler); } - + glBegin(GL_QUADS); { glColor4f(0.0f, 0.0f, 1.0f, 0.8f); @@ -719,7 +719,7 @@ void Render_opengl::call_ruler(){ glVertex3d(trace_to_render_x(Info::Render::_x_max_visible) , 3, _z_ruler_under ); } glEnd(); - + glBegin(GL_QUADS); { glColor4f(0.0, 0.0, 0.0, 1.0); @@ -729,9 +729,9 @@ void Render_opengl::call_ruler(){ glVertex3d(trace_to_render_x(Info::Render::_x_max_visible) , 0, _z_ruler_over ); } glEnd(); - + return; -} +} @@ -762,7 +762,7 @@ void Render_opengl::draw_text(const Element_pos x, const Element_pos y, const El if (_draw_state) message << "Fatal error! Cannot put text in state lists!" << Message::ende; Container_text_ buf; - + buf.x = x; buf.y = render_to_trace_y(y);/* Cancel previous transformation. */ buf.value = s; @@ -782,30 +782,30 @@ void Render_opengl::draw_quad(Element_pos x, Element_pos y, Element_pos /*z*/, E if (!_draw_container) offset_x = -_default_entity_x_translate; - + glBegin(GL_QUADS); { glColor3f(_red, _green, _blue); - + glVertex2d(x + offset_x , y + offset_y); glVertex2d(x + offset_x , y + h + offset_y); - if (Info::Render::_shaded_states){/* State color is shaded */ - glColor3f(_red*0.6, _green*0.6, _blue*0.6); - - glVertex2d(x + w + offset_x, y + h + offset_y); - glVertex2d(x + w + offset_x, y + offset_y); - }else{/* State color must be uniform */ - glColor3f(_red, _green, _blue); - - /* Multiply by 0.98 to allow distinction between two States with the same color. Temporary solution - before using a border. - */ - glVertex2d(x + w*0.98 + offset_x, y + h + offset_y); - glVertex2d(x + w*0.98 + offset_x, y + offset_y); - } + if (Info::Render::_shaded_states){/* State color is shaded */ + glColor3f(_red*0.6, _green*0.6, _blue*0.6); + + glVertex2d(x + w + offset_x, y + h + offset_y); + glVertex2d(x + w + offset_x, y + offset_y); + }else{/* State color must be uniform */ + glColor3f(_red, _green, _blue); + + /* Multiply by 0.98 to allow distinction between two States with the same color. Temporary solution + before using a border. + */ + glVertex2d(x + w*0.98 + offset_x, y + h + offset_y); + glVertex2d(x + w*0.98 + offset_x, y + offset_y); + } } glEnd(); } @@ -822,8 +822,8 @@ void Render_opengl::draw_line(Element_pos x1, Element_pos y1, Element_pos x2, El if (_draw_ruler || _draw_arrow || _draw_event) return;/* do not draw line for ruler or for arrow or for event */ if (_draw_state) message << "Fatal error! Cannot put line in state lists!" << Message::ende; - - + + glBegin(GL_LINES); { glColor3f(_red, _green, _blue); @@ -844,9 +844,9 @@ void Render_opengl::start_draw(){ _draw_ruler = false; _draw_arrow = false; _draw_event = false; - + init_geometry();/* Initialize geometry */ - + } void Render_opengl::start_draw_containers(){ @@ -855,12 +855,12 @@ void Render_opengl::start_draw_containers(){ *Message::get_instance() << tr("Error when creating containers list.").toStdString() << Message::endw; } - _draw_container = true; + _draw_container = true; glNewList(_list_containers, GL_COMPILE);/* open the list */ } void Render_opengl::draw_container(const Element_pos , const Element_pos , const Element_pos , const Element_pos ){ - + } void Render_opengl::draw_container_text(const Element_pos , const Element_pos , const std::string ){ @@ -877,7 +877,7 @@ void Render_opengl::start_draw_states(){ *Message::get_instance() << tr("Error when creating states list.").toStdString() << Message::endw; } - _draw_state = true; + _draw_state = true; glNewList(_list_states, GL_COMPILE);/* open the list */ } @@ -908,7 +908,7 @@ void Render_opengl::draw_arrow(const Element_pos start_time, const Element_pos e buf.blue = blue; _arrows.push_back(buf); - //printf("sizeof eventlist : %d %d %d %d\n",_circles.size(), _circles.size()*sizeof(Event_),_arrows.size(),_arrows.size()*sizeof(Arrow_)); + //printf("sizeof eventlist : %d %d %d %d\n",_circles.size(), _circles.size()*sizeof(Event_),_arrows.size(),_arrows.size()*sizeof(Arrow_)); } void Render_opengl::end_draw_arrows(){ @@ -932,7 +932,7 @@ void Render_opengl::draw_event(const Element_pos time, const Element_pos height, buf.blue = _blue; _circles.push_back(buf); - //printf("sizeof eventlist : %d %d\n", _circles.size()*sizeof(Event_),_arrows.size()*sizeof(Arrow_)); + //printf("sizeof eventlist : %d %d\n", _circles.size()*sizeof(Event_),_arrows.size()*sizeof(Arrow_)); } @@ -946,7 +946,7 @@ void Render_opengl::start_draw_counter(){ if (_list_counters == 0) { *Message::get_instance() << tr("Error when creating counters list").toStdString() << Message::ende; } - + glNewList(_list_counters, GL_COMPILE);/* open the list */ } @@ -985,14 +985,14 @@ void Render_opengl::draw_stored_arrows(){ const unsigned int arrow_size = _arrows.size(); for (unsigned int i=0 ; i<arrow_size ; i++){ - + start_time = _arrows[i].start_time;// + _x_state_scale*_x_state_translate; end_time = _arrows[i].end_time;// + _x_state_scale*_x_state_translate; start_height = _arrows[i].start_height; end_height = _arrows[i].end_height; glColor3f(_arrows[i].red, _arrows[i].green, _arrows[i].blue); - + scaled_start_time = start_time * _x_state_scale; scaled_end_time = end_time * _x_state_scale; scaled_start_height = start_height * _y_state_scale; @@ -1000,12 +1000,12 @@ void Render_opengl::draw_stored_arrows(){ glPushMatrix(); { - - glTranslated(_default_entity_x_translate + _x_state_scale*end_time - _x_state_translate, + + glTranslated(_default_entity_x_translate + _x_state_scale*end_time - _x_state_translate, _ruler_y + _ruler_height + _y_state_scale*end_height - _y_state_translate, _z_arrow);/* - - glTranslated( _x_state_scale*end_time, + + glTranslated( _x_state_scale*end_time, _y_state_scale*end_height , 0);*/ @@ -1015,7 +1015,7 @@ void Render_opengl::draw_stored_arrows(){ } else glRotated(90, 0, 0, 1);/* vertical alignment */ - + glBegin(GL_TRIANGLES); { // glColor3d(_red, _green, _blue); @@ -1024,28 +1024,28 @@ void Render_opengl::draw_stored_arrows(){ glVertex2d(-1.2, 0.4); } glEnd(); - + } glPopMatrix(); } for (unsigned int i=0 ; i<arrow_size ; i++){ - + start_time = _arrows[i].start_time;// + _x_state_scale*_x_state_translate; end_time = _arrows[i].end_time;// + _x_state_scale*_x_state_translate; start_height = _arrows[i].start_height; end_height = _arrows[i].end_height; glColor3f(_arrows[i].red, _arrows[i].green, _arrows[i].blue); - + glPushMatrix(); { - + glTranslated(_default_entity_x_translate - _x_state_translate, _ruler_y + _ruler_height - _y_state_translate, _z_arrow); glScaled(_x_state_scale, _y_state_scale, 1.0); - + glBegin(GL_LINES); { glVertex2d(start_time, start_height); @@ -1069,55 +1069,55 @@ void Render_opengl::draw_stored_circles(){ cos_table2[j]= cos_table[j]/_x_state_scale; sin_table2[j]= (sin_table[j]*Info::Screen::width)/(_y_state_scale*Info::Screen::height); } - + const unsigned int size = _circles.size(); for (unsigned int i=0 ; i<size ; i++){ - + glPushMatrix(); { - glColor3f(1.0 - _circles[i].red, 1.0 - _circles[i].green, 1.0 - _circles[i].blue); - + glColor3f(1.0 - _circles[i].red, 1.0 - _circles[i].green, 1.0 - _circles[i].blue); + glTranslated(_default_entity_x_translate - _x_state_translate, _ruler_y + _ruler_height - _y_state_translate, _z_arrow); - glScalef(_x_state_scale, _y_state_scale, 1.0); - + glScalef(_x_state_scale, _y_state_scale, 1.0); + + + + // Draw the outer circle - - // Draw the outer circle - glBegin(GL_POLYGON); { for(int j = 0 ; j < NB_STEPS ; j ++){ glVertex2d(_circles[i].time + cos_table2[j], - _circles[i].height + sin_table2[j]); + _circles[i].height + sin_table2[j]); } } glEnd(); } glPopMatrix(); - } + } for (unsigned int i=0 ; i<size ; i++){ - + glPushMatrix(); { - - - glColor3f(_circles[i].red, _circles[i].green, _circles[i].blue); + + + glColor3f(_circles[i].red, _circles[i].green, _circles[i].blue); glTranslated(_default_entity_x_translate - _x_state_translate, _ruler_y + _ruler_height - _y_state_translate, _z_arrow); - glScalef(_x_state_scale, _y_state_scale, 1.0); - - // Draw the sub-circle + glScalef(_x_state_scale, _y_state_scale, 1.0); + + // Draw the sub-circle glBegin(GL_POLYGON); { for(int j = 0 ; j < NB_STEPS ; j ++){ glVertex3d(_circles[i].time + cos_table2[j]/1.2 , - _circles[i].height + sin_table2[j]/1.2 , + _circles[i].height + sin_table2[j]/1.2 , 0.1); } } @@ -1125,21 +1125,21 @@ void Render_opengl::draw_stored_circles(){ } glPopMatrix(); } - + //draw the line in another loop for better performance for (unsigned int i=0 ; i<size ; i++){ - + glPushMatrix(); { - glColor3f(_circles[i].red, _circles[i].green, _circles[i].blue); + glColor3f(_circles[i].red, _circles[i].green, _circles[i].blue); glTranslated(_default_entity_x_translate - _x_state_translate, _ruler_y + _ruler_height - _y_state_translate, _z_arrow); - glScalef(_x_state_scale, _y_state_scale, 1.0); - + glScalef(_x_state_scale, _y_state_scale, 1.0); + glLineWidth( 3.0 ); - //Draw the line + //Draw the line glBegin(GL_LINES); { glVertex2d(_circles[i].time, _circles[i].height-_circles[i].container_height); @@ -1150,13 +1150,13 @@ void Render_opengl::draw_stored_circles(){ } glPopMatrix(); } - + glLineWidth( 1.0 ); } void Render_opengl::update_vertical_line(){ - + if (_mouse_pressed_inside_container) set_vertical_line(0); else @@ -1165,7 +1165,7 @@ void Render_opengl::update_vertical_line(){ } Element_pos Render_opengl::get_vertical_line(){ - return vertical_line; + return vertical_line; } void Render_opengl::set_vertical_line(Element_pos new_coord){ @@ -1173,23 +1173,23 @@ void Render_opengl::set_vertical_line(Element_pos new_coord){ else vertical_line=new_coord; } - - + + void Render_opengl::draw_vertical_line(){ - + if(vertical_line==0)return; glPushMatrix(); - { - glLineWidth( 1.0 ); - /* Draw the line */ - glBegin(GL_LINES); - { - glColor3d(1.0,0.0,0.0); - glVertex2d( trace_to_render_x(vertical_line),0); - glVertex2d( trace_to_render_x(vertical_line),Info::Render::height); - } - glEnd(); - } + { + glLineWidth( 1.0 ); + /* Draw the line */ + glBegin(GL_LINES); + { + glColor3d(1.0,0.0,0.0); + glVertex2d( trace_to_render_x(vertical_line),0); + glVertex2d( trace_to_render_x(vertical_line),Info::Render::height); + } + glEnd(); + } glPopMatrix(); QFont arial_font = QFont("Arial", 10); const QFontMetrics metric(arial_font); @@ -1200,11 +1200,11 @@ void Render_opengl::draw_vertical_line(){ t, arial_font); - + //draw texts for variables std::map<long int, Variable_text_>::const_iterator it=_variable_texts.begin(); const std::map<long int, Variable_text_>::const_iterator it_end=_variable_texts.end(); - + for(;it!=it_end;it++){ renderText ( render_to_screen_x(trace_to_render_x(vertical_line))+3, render_to_screen_y( trace_to_render_y((*it).second.y) + 0.5), @@ -1213,7 +1213,7 @@ void Render_opengl::draw_vertical_line(){ } } - + // void Render_opengl::create_minimap(const int width, const int height){ // _minimap_widget = new QLabel; @@ -1227,11 +1227,11 @@ void Render_opengl::draw_vertical_line(){ // paintGL(); // *_minimap_image = grabFrameBuffer(true); - -// // _default_entity_x_translate = 20; /* TODO: use constant value define in config file */ + +// // _default_entity_x_translate = 20; /* TODO: use constant value define in config file */ // /*_ruler_height = 8.5; // _ruler_y = 0.0;*/ - + // // *_minimap_image = _minimap_image->scaled(QSize(width, height), Qt::IgnoreAspectRatio); // _minimap_widget->resize(width, height); // _minimap_widget->hide();/* Do not display it */ @@ -1269,7 +1269,7 @@ void Render_opengl::draw_vertical_line(){ // _minimap_image->width()/_x_state_scale,//render_to_screen_x(trace_to_render_x(Info::Render::_x_max_visible - Info::Render::_x_min_visible)), // _minimap_image->height()/_y_state_scale); // painter.end(); - + // _minimap_widget->setPixmap(buf); // _minimap_widget->setScaledContents(true); @@ -1295,7 +1295,7 @@ void Render_opengl::show_minimap(){ // void Render_opengl::release_minimap(){ - + // if (_minimap_image){ // delete _minimap_image; // _minimap_image = NULL;