diff --git a/src/core/Core.cpp b/src/core/Core.cpp index 5ccff44fc354c0b185a72aaa4a9cf659e05af770..356913b954517b6e6e44cfbb4d6b38692c6f2940 100644 --- a/src/core/Core.cpp +++ b/src/core/Core.cpp @@ -487,13 +487,6 @@ bool Core::draw_trace(const string & filename, const int format) { DrawTrace drawing_ogl; bool killed=false; -#ifdef WITH_VBO - Renderrender(_render_opengl) ; -#else - Render render(_render_opengl) ; -#endif - _render=(void*)&render; - QTime time_elapsed; ostringstream buf_txt; int time_buf = 0; @@ -526,9 +519,9 @@ bool Core::draw_trace(const string & filename, const int format) { _trace = new Trace(); // Init of the thread - _finished= new QWaitCondition(); - _closed= new QWaitCondition(); - _mutex= new QMutex(); + _finished = new QWaitCondition(); + _closed = new QWaitCondition(); + _mutex = new QMutex(); QThread thread; @@ -755,10 +748,10 @@ bool Core::draw_trace(const string & filename, const int format) { if(!_xml_config_file.empty() && _trace->get_view_root_containers()->empty()){//if we have a partial loading, process it here, but only once launch_action(_DRAW_OPENGL_PARTIAL,NULL); } - if (_DRAW_OPENGL == format) { + if (_DRAW_OPENGL == format) { - drawing_ogl.build(&render, _trace); + drawing_ogl.build(&_render_opengl, _trace); _render_opengl->build(); // _render_opengl->updateGL(); _render_opengl->refresh_scroll_bars(); diff --git a/src/render/Render.hpp b/src/render/Render.hpp index 8782518bd42ce41254ea222939e191b2be99bc5b..333123e53f955d304d6e5850a91f5e539c6fa488 100644 --- a/src/render/Render.hpp +++ b/src/render/Render.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 Render.hpp */ @@ -79,7 +79,7 @@ struct Container_text_{ template class Render: public Geometry { - private: +private: /*! * This attribute store the instance of a drawing class. (OpenGL or SVG for example) @@ -137,7 +137,7 @@ public: /* clear vectors */ _containers.clear(); _container_texts.clear(); - + drawing_instance->start_draw(); } @@ -155,7 +155,7 @@ public: * \param h the height of the container */ inline void draw_container(const Element_pos x, const Element_pos y, const Element_pos w, const Element_pos h){ - + Container_ buf; buf.x = x; @@ -164,29 +164,26 @@ public: buf.h = h; _containers.push_back(buf); - + if ((x+w)>Info::Container::x_max) Info::Container::x_max = x+w; - + if ((y+h)>Info::Container::y_max) Info::Container::y_max = y+h; - + if (Info::Container::x_min > x) Info::Container::x_min = x; - + if (Info::Container::y_min > y) Info::Container::y_min = y; - - #ifdef DEBUG_MODE_RENDER_AREA - std::cerr << __FILE__ << " l." << __LINE__ << ":" << std::endl; std::cerr < "Container drawing:" << std::endl; std::cerr << "x: " << x << " y: " << y << " w: " << w << " h: " << h << " xmax-xmin: " << Info::Container::x_max << " - " << Info::Container::x_min << " ymax-ymin: " << Info::Container::y_max << " - " << Info::Container::y_min << std::endl; - + #endif - + } /*! @@ -198,7 +195,7 @@ public: * This function stores text in a list. This list will be display each time the render area need to be updated. */ inline void draw_container_text(const Element_pos x, const Element_pos y, const std::string value){ - + Container_text_ buf; buf.x = x; buf.y = y; @@ -221,19 +218,19 @@ public: drawing_instance->set_color(0, 0, j); drawing_instance->draw_quad(_containers[i].x * (Info::Render::width/Info::Container::x_max)*_x_scale_container_state, trace_to_render_y(_containers[i].y),// * _y_state_scale*(_render_height-_ruler_height)/Info::Container::y_max) - _y_state_translate + _ruler_y + _ruler_height, - _z_container, + _z_container, _containers[i].w * (Info::Render::width/Info::Container::x_max)*_x_scale_container_state, _containers[i].h * _y_state_scale*(Info::Render::height-_ruler_height)/Info::Container::y_max); } // std::cout << __FILE__ << " ~ " << __LINE__ << " " << Info::Container::y_max << " " << Info::Container::y_min << std::endl; - + for (unsigned int i=0 ; i<_container_texts.size() ; i++){ _container_texts[i].x *= (Info::Render::width/Info::Container::x_max)*_x_scale_container_state; _container_texts[i].y = trace_to_render_y(_container_texts[i].y);// + _render_height-_ruler_height)*coeff_trace_render_y(); drawing_instance->draw_text(_container_texts[i].x, _container_texts[i].y, _z_container+1, _container_texts[i].value); } - + drawing_instance->end_draw_containers(); } @@ -261,14 +258,14 @@ public: */ inline void draw_state(const Element_pos start, const Element_pos end, const Element_pos base, const Element_pos height, const Element_col r, const Element_col g, const Element_col b) { - + drawing_instance->set_color(r, g, b); - + drawing_instance->draw_quad(trace_to_render_x(start - Info::Render::_x_min_visible), trace_to_render_y(base), - _z_state, - (end-start)*coeff_trace_render_x(), + _z_state, + (end-start)*coeff_trace_render_x(), height*coeff_trace_render_y()); } @@ -296,28 +293,28 @@ public: * This function stores all the information of the arrow to display it each time the render area need to be updated. */ inline void draw_arrow(Element_pos start_time, Element_pos end_time, Element_pos start_height, Element_pos end_height, const Element_col r, const Element_col g, const Element_col b){ - + /* For SVG */ const Element_pos triangle_size = 2.0; const Element_pos coeff = 180.0f/M_PI; Element_pos angle; - + drawing_instance->set_color(r, g, b); start_time = trace_to_render_x(start_time - Info::Render::_x_min_visible); end_time = trace_to_render_x(end_time - Info::Render::_x_min_visible); start_height = trace_to_render_y(start_height); end_height = trace_to_render_y(end_height); - + if (start_time != end_time) angle = atan2((end_height - start_height), (end_time - start_time))*coeff;/* arc tangent */ else angle = 90; - + drawing_instance->draw_triangle(end_time, end_height, triangle_size, angle); - - drawing_instance->draw_line(start_time, start_height, - end_time, end_height, _z_arrow); + + drawing_instance->draw_line(start_time, start_height, + end_time, end_height, _z_arrow); /* For OpenGL */ drawing_instance->draw_arrow(start_time, end_time, start_height, end_height, r, g, b); @@ -331,7 +328,7 @@ public: inline void end_draw_arrows(){ drawing_instance->end_draw_arrows(); } - + inline void start_draw_events(){ drawing_instance->start_draw_events(); } @@ -346,17 +343,17 @@ public: */ inline void draw_event(Element_pos time, Element_pos height, Element_pos container_height, const Element_col r, const Element_col g, const Element_col b){ - /* For SVG */ + /* For SVG */ Element_pos radius;/* the circle radius */ drawing_instance->set_color(r, g, b); - + time = trace_to_render_x(time - Info::Render::_x_min_visible); height = trace_to_render_y(height); container_height = container_height*coeff_trace_render_y(); - radius = .5f; - + radius = .5f; + drawing_instance->draw_circle(time, height, _z_event, radius); drawing_instance->draw_line(time, height, time, height+container_height, _z_event); @@ -364,7 +361,7 @@ public: /* For OpenGL */ drawing_instance->draw_event(time, height, container_height); } - + inline void end_draw_events(){ drawing_instance->end_draw_events(); } @@ -401,37 +398,37 @@ public: inline void draw_counter(const Element_pos x, const Element_pos y){ if (_start_new_line){/* Start a new line */ - + _counter_last_x = x; _counter_last_y = y; _start_new_line = false; - + }else{/* line is already started */ - + if (x <= 0.0){/* convention: the line is over */ - + // drawing_instance->draw_line( _counter_last_x, _counter_last_y, // _state_x_max, _counter_last_y, _z_counter); - + drawing_instance->draw_line( trace_to_render_x(_counter_last_x - Info::Render::_x_min_visible), trace_to_render_y(_counter_last_y), trace_to_render_x(Info::Entity::x_max), trace_to_render_y(_counter_last_y), _z_counter); - - + + _start_new_line = true; }else{/* add new points to the line */ - - /* Each time, the method draw the line from the previous point to - the current point (x, y). This last is stored for the next line drawing. */ + + /* Each time, the method draw the line from the previous point to + the current point (x, y). This last is stored for the next line drawing. */ // drawing_instance->draw_line( _counter_last_x, _counter_last_y, // x, _counter_last_y, _z_counter); // drawing_instance->draw_line( x, _counter_last_y, // x, y, _z_counter); - + drawing_instance->draw_line( trace_to_render_x(_counter_last_x - Info::Render::_x_min_visible), trace_to_render_y(_counter_last_y), trace_to_render_x(x - Info::Render::_x_min_visible), trace_to_render_y(_counter_last_y), _z_counter); drawing_instance->draw_line( trace_to_render_x(x - Info::Render::_x_min_visible), trace_to_render_y(_counter_last_y), trace_to_render_x(x - Info::Render::_x_min_visible), trace_to_render_y(y), _z_counter); - + _counter_last_x = x; _counter_last_y = y; } @@ -453,7 +450,7 @@ public: } drawing_instance->end_draw_counter(); } - + /*! * \brief Do nothing (it is present for compatibility of the Render class). */ @@ -463,10 +460,10 @@ public: //Element_pos coeff_prefix; const Element_pos offset_x = 0; const Element_pos offset_y = 0; - - + + 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); + // coeff_prefix = Ruler::get_coeff_for_common_prefix(Info::Render::_x_min_visible, Info::Render::_x_max_visible); /* Now, draw ruler */ @@ -474,7 +471,7 @@ public: drawing_instance->start_ruler(); { /* Since SVG has no depth, first draw the quads then the graduation */ - + /* Draw quads */ drawing_instance->set_color(0.0, 0.0, 1.0); @@ -486,23 +483,23 @@ public: drawing_instance->set_color(0.0, 0.0, 0.0); - drawing_instance->draw_quad(trace_to_render_x(0), - 0, - _z_ruler_over, - trace_to_render_x(Info::Render::_x_max_visible) - trace_to_render_x(Info::Render::_x_min_visible), + drawing_instance->draw_quad(trace_to_render_x(0), + 0, + _z_ruler_over, + trace_to_render_x(Info::Render::_x_max_visible) - trace_to_render_x(Info::Render::_x_min_visible), 3); /* Draw graduations */ drawing_instance->set_color(1, 1, 1); - + for (Element_pos i = Info::Render::_x_min_visible ; i < Info::Render::_x_max_visible ; i+=graduation_diff){ const Element_pos grad_div_by_5 = graduation_diff/5; for (Element_pos j = (i+grad_div_by_5) ; j<(i+graduation_diff) ; j+= grad_div_by_5){ drawing_instance->draw_line( trace_to_render_x(j - Info::Render::_x_min_visible) + offset_x, offset_y+3, trace_to_render_x(j - Info::Render::_x_min_visible) + offset_x, 5+offset_y, _z_ruler); } - + drawing_instance->draw_line( trace_to_render_x(i - Info::Render::_x_min_visible) + offset_x, offset_y+3, trace_to_render_x(i - Info::Render::_x_min_visible) + offset_x, 7+offset_y, _z_ruler); } @@ -518,6 +515,4 @@ public: } }; - - #endif diff --git a/src/render/Render_opengl.hpp b/src/render/Render_opengl.hpp index 279af5ba91328eeda1a6fe93e08503489d6256a6..acce74575ee252dba616be1e831b264b549d612b 100644 --- a/src/render/Render_opengl.hpp +++ b/src/render/Render_opengl.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 Render_opengl.hpp */ @@ -70,18 +70,18 @@ struct Container_text_; /*template -class CSingleton -{ - public: - static T& Instance() - { - static T me; - return me; - } -}; + class CSingleton + { + public: + static T& Instance() + { + static T me; + return me; + } + }; -*/ + */ /*! * \brief Structure used to store arrow information. @@ -131,7 +131,7 @@ class Render_opengl : /*public QGLWidget,*/ public Hook_event, public Render_te Q_OBJECT - private: +private: bool _draw_container; bool _draw_state; @@ -144,7 +144,7 @@ protected: /*! * \brief The waiting screen display list. */ - GLuint _wait_list; + GLuint _wait_list; /*! * \brief The minimap. @@ -161,15 +161,15 @@ protected: */ GLuint _list_states; - /*! - * \brief The counter GLu list. - */ + /*! + * \brief The counter GLu list. + */ GLuint _list_counters; - /*! - * \brief The arrows GLu list. - */ + /*! + * \brief The arrows GLu list. + */ GLuint _list_arrows; @@ -212,10 +212,10 @@ protected: */ int _wait_spf; - /*! - * \brief Offset of the vertical helper line - */ - Element_pos vertical_line; + /*! + * \brief Offset of the vertical helper line + */ + Element_pos vertical_line; /*! @@ -283,8 +283,8 @@ public: */ void display_time_scale(){} -// void set_vertical_line(int l){} - // void draw_vertical_line(); + // void set_vertical_line(int l){} + // void draw_vertical_line(); /*********************************** * * Default QGLWidget functions. @@ -294,7 +294,7 @@ public: /*! * \brief Call by the system to initialize the OpenGL render area. */ - void initializeGL(); + void initializeGL(); /*! * \brief Call by the system when the render area was resized (occurs during a window resizement). @@ -311,8 +311,8 @@ public: //void paintEvent(QPaintEvent *event); /* void initializeOverlayGL(); - void resizeOverlayGL(int width, int height); - void paintOverlayGL();*/ + void resizeOverlayGL(int width, int height); + void paintOverlayGL();*/ /*********************************** @@ -523,64 +523,64 @@ public: * **********************************/ - // /*! -// * \brief Display on screen containers between container_begin and container_end. -// * \param container_begin integer value : id of the first container. -// * \param container_end integer value : id of the last container. -// */ -// void display_container(Element_count container_begin, Element_count container_end) =0; - -// /*! -// * \brief Display on screen states between timer_begin and time_end, -// * container_begin and container_end and with timer width between depth_begin and depth_end. -// * \param time_begin floating point value : time of the first state. -// * \param time_end floating point value : time of the last state. -// * \param container_begin integer value : id of the first container. -// * \param container_end integer value : id of the last container. -// * \param depth_begin floating point value : width of the narrowest state. -// * \param depth_end floating point value : width of the widest state. -// */ -// void display_state(Element_pos time_begin, Element_pos time_end, -// Element_count container_begin, Element_count container_end, -// Element_pos depth_begin, Element_pos depth_end) =0; - -// /*! -// * \brief Display on screen arrows between timer_begin and time_end, -// * container_begin and container_end and with timer width between depth_begin and depth_end. -// * \param time_begin floating point value : time of the smallest arrow time value. -// * \param time_end floating point value : time of the higher arrow time value. -// * \param container_begin integer value : id of the first container. -// * \param container_end integer value : id of the last container. -// * \param depth_begin floating point value : the narrowest difference between -// * the beginning time and the ending time of the arrow. -// * \param depth_end floating point value : width of the widest difference between -// * the beginning time and the ending time of the arrow. -// */ -// virtual void display_arrow(Element_pos time_begin, Element_pos time_end, -// Element_count container_begin, Element_count container_end, -// Element_pos depth_begin, Element_pos depth_end) =0; - -// /*! -// * \brief Display on screen events between timer_begin and time_end, -// * container_begin and container_end. -// * \param time_begin floating point value : time of the first event. -// * \param time_end floating point value : time of the last event. -// * \param container_begin integer value : id of the first container. -// * \param container_end integer value : id of the last container. -// */ -// virtual void display_event(Element_pos time_begin, Element_pos time_end, -// Element_count container_begin, Element_count container_end) =0; - -// /*! -// * \brief Display on screen counters between timer_begin and time_end, -// * container_begin and container_end. -// * \param time_begin floating point value : time of the smallest counter time value. -// * \param time_end floating point value : time of the higher counter time value. -// * \param container_begin integer value : id of the first container. -// * \param container_end integer value : id of the last container. -// */ -// virtual void display_counter(Element_pos time_begin, Element_pos time_end, -// Element_count container_begin, Element_count container_end) =0; + // /*! + // * \brief Display on screen containers between container_begin and container_end. + // * \param container_begin integer value : id of the first container. + // * \param container_end integer value : id of the last container. + // */ + // void display_container(Element_count container_begin, Element_count container_end) =0; + + // /*! + // * \brief Display on screen states between timer_begin and time_end, + // * container_begin and container_end and with timer width between depth_begin and depth_end. + // * \param time_begin floating point value : time of the first state. + // * \param time_end floating point value : time of the last state. + // * \param container_begin integer value : id of the first container. + // * \param container_end integer value : id of the last container. + // * \param depth_begin floating point value : width of the narrowest state. + // * \param depth_end floating point value : width of the widest state. + // */ + // void display_state(Element_pos time_begin, Element_pos time_end, + // Element_count container_begin, Element_count container_end, + // Element_pos depth_begin, Element_pos depth_end) =0; + + // /*! + // * \brief Display on screen arrows between timer_begin and time_end, + // * container_begin and container_end and with timer width between depth_begin and depth_end. + // * \param time_begin floating point value : time of the smallest arrow time value. + // * \param time_end floating point value : time of the higher arrow time value. + // * \param container_begin integer value : id of the first container. + // * \param container_end integer value : id of the last container. + // * \param depth_begin floating point value : the narrowest difference between + // * the beginning time and the ending time of the arrow. + // * \param depth_end floating point value : width of the widest difference between + // * the beginning time and the ending time of the arrow. + // */ + // virtual void display_arrow(Element_pos time_begin, Element_pos time_end, + // Element_count container_begin, Element_count container_end, + // Element_pos depth_begin, Element_pos depth_end) =0; + + // /*! + // * \brief Display on screen events between timer_begin and time_end, + // * container_begin and container_end. + // * \param time_begin floating point value : time of the first event. + // * \param time_end floating point value : time of the last event. + // * \param container_begin integer value : id of the first container. + // * \param container_end integer value : id of the last container. + // */ + // virtual void display_event(Element_pos time_begin, Element_pos time_end, + // Element_count container_begin, Element_count container_end) =0; + + // /*! + // * \brief Display on screen counters between timer_begin and time_end, + // * container_begin and container_end. + // * \param time_begin floating point value : time of the smallest counter time value. + // * \param time_end floating point value : time of the higher counter time value. + // * \param container_begin integer value : id of the first container. + // * \param container_end integer value : id of the last container. + // */ + // virtual void display_counter(Element_pos time_begin, Element_pos time_end, + // Element_count container_begin, Element_count container_end) =0; /*! * \brief Set the color for the further drawings. @@ -659,13 +659,13 @@ public: /*! * \brief returns the offset of the vertical helper line */ - Element_pos get_vertical_line(); + Element_pos get_vertical_line(); /*! * \brief set the vertical line offset * \param l the line offset. */ - void set_vertical_line(Element_pos l); + void set_vertical_line(Element_pos l); /*! * \brief draws the vertical helper line @@ -673,10 +673,10 @@ public: void draw_vertical_line(); - public slots: +public slots: /*! * \brief slot connected to the simple click event - */ + */ void update_vertical_line(); }; diff --git a/src/render/Render_opengl_dl.hpp b/src/render/Render_opengl_dl.hpp index e33c534547dbee644c79613528df87d2e477a355..11302ad3592ded6d0d8898c79ac3639dceaeb3f5 100644 --- a/src/render/Render_opengl_dl.hpp +++ b/src/render/Render_opengl_dl.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 ** */ /*! @@ -211,7 +211,7 @@ public: * This function stores all the information of the event to display it each time the render area need to be updated. */ void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height); - + /*! * \brief Draw events contained in the Event_ vector * \param events An event vector. @@ -730,7 +730,7 @@ inline void Render_opengl_dl::draw_counter(const Element_pos x, const Element_po glBegin(GL_LINE_STRIP);/* set of connected verteces */ glColor3d(1.0, 1.0, 1.0);glVertex2d(0.0, y);/* draw the init point */ - + _counter_last_x = x; _counter_last_y = y; _start_new_line = false; @@ -822,7 +822,7 @@ inline void Render_opengl_dl::display_container(Element_count , Element_count ){ buf_txt = *it_txt; glPushMatrix(); - { + { glTranslatef(0.0f, -_y_state_translate, 0.0f); glScalef((_render_width/_container_x_max)*_x_scale_container_state, _y_state_scale*(_render_height-_ruler_height)/_container_y_max, 0.0f); diff --git a/src/render/Render_template.hpp b/src/render/Render_template.hpp index b4b6a0b3f7f31d2a9a0b155f69db8e6b2bb9089a..27c1e631e9ef2ba90c90cce323462b5ef64a5245 100644 --- a/src/render/Render_template.hpp +++ b/src/render/Render_template.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 ** */ /*! @@ -52,10 +52,10 @@ * \brief This class provides an interface for render classes like OpenGL or SVG. */ class Render_template -{ +{ public: - + /*! * \brief Proceeds with the initialization of draw functions. */ @@ -70,7 +70,7 @@ public: * \brief Called when all container draws are finished. */ virtual void end_draw_containers() = 0; - + /*! * \brief Proceeds with the initialization of state draw functions. */ @@ -95,7 +95,7 @@ public: * \brief Proceeds with the initialization of counter draw functions. */ virtual void start_draw_counter() = 0; - + /*! * \brief Called when all counter draws are finished. */ @@ -105,12 +105,12 @@ public: * \brief Called before ruler drawing. */ virtual void start_ruler() = 0; - + /*! * \brief Called after ruler drawing. */ virtual void end_ruler() = 0; - + /*! * \brief Called when all draws are finished. */ @@ -120,7 +120,7 @@ public: * \brief Set the color for the further drawings. * \param r the red value. Within [0 ; 1]. * \param g the green value. Within [0 ; 1]. - * \param b the blue value. Within [0 ; 1]. + * \param b the blue value. Within [0 ; 1]. */ virtual void set_color(float r, float g, float b) = 0; diff --git a/src/trace/DrawTrace.hpp b/src/trace/DrawTrace.hpp index c2978c08913a1874ada5e3e6b92c02573d853c38..ee2bf127a54d99c2d5074ba25a5452650f05a3ed 100644 --- a/src/trace/DrawTrace.hpp +++ b/src/trace/DrawTrace.hpp @@ -263,8 +263,9 @@ public: * **********************************/ /* - * \fn browse_container_tree(T* draw_object, Trace* trace, Container::Vector container) - * \brief Function that browses the containers of the trace argument that are in the set container and make them painted with a T object + * \fn browse_container_tree + * \brief Function that browses the containers of the trace argument that + * are in the set container and make them painted with a T object */ template inline void browse_container_tree(T* draw_object, Trace* trace, std::vector *container){ @@ -272,32 +273,39 @@ public: int position = 0; const Container::Vector *root_containers = trace->get_view_root_containers(); - if(root_containers->empty())root_containers= trace->get_root_containers(); + if (root_containers->empty()) + root_containers = trace->get_root_containers(); + if (root_containers->empty()) { *Message::get_instance() << QObject::tr("There is no container. The trace can not be drawn.").toStdString() << Message::endw; } - else + else { for (Container::VectorIt i = root_containers->begin(); - i != root_containers->end(); - i++) - // Use the fact a container is selected implies all his ancestors are + i != root_containers->end(); + i++) + // Use the fact that if a container is selected, then it implies that all his ancestors are if(is_in_set(*i,container)) position += browse_container(draw_object, *i, position, 0,container); + } }/* end browse_container_tree */ /* - * \fn browse_container(T* draw_object, const Container *container, int position, int depth, Container::Vector set_container) - * \brief Recursive function that browse a container to draw it if it is in the set of container with a T painting object in position, knowing the current depth in the tree + * \fn browse_container + * \brief Recursive function that browse a container to draw it if it is in + * the set of container with a T painting object in position, knowing the + * current depth in the tree */ - template - int browse_container(T* draw_object, const Container *container, int position, int depth, std::vector *set_container) { + int browse_container(T* draw_object, const Container *container, int position, int depth, + std::vector *set_container) { int size = 0; - // Draw children - const Container::Vector *children = container->get_view_children();//we want to display only children meant to be displayed - if(children->empty())children = container->get_children(); + // Draw children: + // we want to display only children meant to be displayed + const Container::Vector *children = container->get_view_children(); + if( children->empty() ) + children = container->get_children(); for (Container::VectorIt i = children->begin(); i != children->end(); @@ -308,15 +316,17 @@ public: // Use one line for states and events #ifdef USE_ITC - if ((container->get_states()!=NULL && !container->get_states()->empty() )|| (container->get_events()!=NULL && !container->get_events()->empty())) { + if ( (container->get_states() != NULL && !container->get_states()->empty()) || + (container->get_events() != NULL && !container->get_events()->empty()) ) #else - if ((!container->get_states()->empty() )|| (!container->get_events()->empty())) { + if ( !container->get_states()->empty() || + !container->get_events()->empty() ) #endif - size++; + { + size++; _entity_containers.push_back(container); } - // Store the position to draw links _container_positions[container] = position; // First line after children _container_sizes[container] = size; // First line after children @@ -350,12 +360,13 @@ public: */ template inline void draw_container(T* draw_object, int position, int size, int depth, const std::string &text) { - Element_pos x = depth*(_container_width+_container_h_space) + _container_h_space/2; - Element_pos y = position*(_container_height+_container_v_space) + _container_v_space/2; - Element_pos height = size*(_container_height+_container_v_space) - _container_v_space; + Element_pos x = depth *(_container_width +_container_h_space) + _container_h_space/2; + Element_pos y = position*(_container_height+_container_v_space) + _container_v_space/2; + Element_pos height = size *(_container_height+_container_v_space) - _container_v_space; draw_object->draw_container(x, y, _container_width, height); draw_object->draw_container_text(x, y+height/2, text); } + /*! * \brief Browse the states list and draw them */