Commit 8889cc51 authored by Olivier Lagrasse's avatar Olivier Lagrasse
Browse files

- Clean some deprecated files.

- Correct bug with counters. (draw them to the end of states)
- Modify Roadmap.php in the web site.
parent 88281c30
/*!
*\file render.hpp
*/
#ifndef RENDER_HPP
#define RENDER_HPP
class Render;
#include "resource.hpp"
/*!
* \brief This class provides an interface for render classes like OpenGL or SVG.
*/
class Render
{
public:
/*!
* \brief Proceeds with the initialization of draw functions.
*/
virtual void start_draw() = 0;
/*!
* \brief Proceeds with the initialization of container draw functions.
*/
virtual void start_draw_containers() = 0;
/*!
* \brief Draw a container according to the parameters
* \param x the x position of the container
* \param y the y position of the container
* \param w the width of the container
* \param h the height of the container
*/
virtual void draw_container(const Element_pos x, const Element_pos y, const Element_pos w, const Element_pos h) = 0;
/*!
* \brief Draw the text of a container.
* \param x the x position of the text.
* \param y the y position of the text.
* \param value the string value of the text.
*/
virtual void draw_container_text(const Element_pos x, const Element_pos y, const std::string value) = 0;
/*!
* \brief Called when all container draws are finished.
*/
virtual void end_draw_containers() = 0;
/*!
* \brief Proceeds with the initialization of state draw functions.
*/
virtual void start_draw_states() = 0;
/*!
* \brief Draw a state of the trace.
* \param start the beginning time of the state.
* \param end the ending time of the state.
* \param base vertical position of the state.
* \param height the state height.
* \param r the red color rate of the state.
* \param g the green color rate of the state.
* \param b the blue color rate of the state.
*/
virtual 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) = 0;
/*!
* \brief Called when all state draws are finished.
*/
virtual void end_draw_states() = 0;
/*!
* \brief Proceeds with the initialization of arrow draw functions.
*/
virtual void start_draw_arrows() = 0;
/*!
* \brief Draw an arrow.
* \param start_time the beginning time of the arrow.
* \param end_time the ending time of the arrow.
* \param start_height vertical position of the begining time of the arrow.
* \param end_height vertical position of the ending time of the arrow.
*/
virtual void draw_arrow(const Element_pos start_time, const Element_pos end_time, const Element_pos start_height, const Element_pos end_height) = 0;
/*!
* \brief Called when all arrow draws are finished.
*/
virtual void end_draw_arrows() = 0;
/*!
* \brief Draw an event.
* \param time time when the event occurs.
* \param height vertical position of the event.
* \param container_height information to draw event. It corresponds to the container height when they are drawn horizontally.
*/
virtual void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height) = 0;
/*!
* \brief Proceeds with the initialization of counter draw functions.
*/
virtual void start_draw_counter() = 0;
/*!
* \brief Draw a point of the counter.
* \param x x position of the point.
* \param y y position of the point.
*
* Each time counter is increased, this function is called with the coordinates of the new point.
*/
virtual void draw_counter(const Element_pos x, const Element_pos y) = 0;
/*!
* \brief Called when all counter draws are finished.
*/
virtual void end_draw_counter() = 0;
/*!
* \brief Called when all draws are finished.
*/
virtual void end_draw() = 0;
/*!
* \brief Set Statistics and Informations about input trace
*/
virtual void set_total_width(Element_pos w) = 0;
/*!
* \brief Set Statistics and Informations about input trace
*/
virtual void set_total_time(Times t) = 0;
/*!
* \brief display the scale
*/
virtual void display_time_scale() = 0;
};
#endif
......@@ -674,7 +674,8 @@ inline void Render_opengl_dl::draw_counter(const Element_pos x, const Element_po
if (x <= 0.0){
if (_line_already_begun){/* it is not the first call */
glEnd();
glColor3d(1.0, 1.0, 1.0);glVertex2d(_state_x_max, _counter_last_y);
glEnd();
}else
_line_already_begun = true;
......@@ -687,7 +688,7 @@ inline void Render_opengl_dl::draw_counter(const Element_pos x, const Element_po
else {
glColor3d(1.0, 1.0, 1.0);glVertex2d(x, _counter_last_y);
glColor3d(1.0, 1.0, 1.0);glVertex2d(x, y);
glColor3d(1.0, 1.0, 1.0);glVertex2d(x, y);
_counter_last_x = x;
}
......@@ -699,9 +700,8 @@ inline void Render_opengl_dl::draw_counter(const Element_pos x, const Element_po
inline void Render_opengl_dl::end_draw_counter(){
if (_line_already_begun) {/* if a line was previously opened */
glEnd();/* suppose that line is not ended */
glEnd();/* suppose that line is not ended */
}
glEndList();/* close the list */
/* Find the most suitable scale depending of the state x min and x max */
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment