Commit 166dd2a3 authored by Olivier Lagrasse's avatar Olivier Lagrasse

Correction oublie d'initialisation dans render_area qui provoquait un warning...

Correction oublie d'initialisation dans render_area qui provoquait un warning a chaque dessin de la trace
parent 2ef87135
......@@ -43,6 +43,8 @@ Render_area::Render_area(QWidget *parent)
_counter_last_x=0.0;
_counter_last_y=0.0;
_line_already_begun = false;
/* init main informations about OpenGL scene and QGLWidget size */
......@@ -378,6 +380,28 @@ bool Render_area::build(){
bool Render_area::unbuild(){
/* Free container list */
glDeleteLists(_list_containers, 1);
_list_containers = 0;
if (glIsList(_list_containers)==GL_TRUE)/* if the list exists */
message << "Cannot delete container list" << ende;
/* Free state list */
glDeleteLists(_list_states, 1);
_list_states = 0;
if (glIsList(_list_states)==GL_TRUE)/* if the list exists */
message << "Cannot delete state list" << ende;
/* Free counter list */
glDeleteLists(_list_counters, 1);
_list_counters = 0;
if (glIsList(_list_counters)==GL_TRUE)/* if the list exists */
message << "Cannot delete counter list" << ende;
if (_wait_timer->isActive()==false)/* if timer for the wait animation is not running */
_wait_timer->start(_wait_spf);
......@@ -414,6 +438,7 @@ bool Render_area::unbuild(){
_state_x_max = 0;
_state_y_max = 0;
_line_already_begun = false;
return true;
}
......
......@@ -128,6 +128,11 @@ class Render_area : public QGLWidget, public Render
* The wait list Attributes.
**********************************/
/*!
* \brief Used for draw counter.
*/
bool _line_already_begun;
/*!
* \brief The wait GLu list.
*/
......@@ -762,7 +767,7 @@ inline void Render_area::start_draw_counter(){
_list_counters = glGenLists(1);/* create the list */
if (_list_counters==0){
//message_ns::message << "Error when creating list" << message_ns::ende;
std::cerr << "Error when creating list" << std::endl;
}
glNewList(_list_counters, GL_COMPILE);/* open the list */
......@@ -773,34 +778,33 @@ inline void Render_area::start_draw_counter(){
inline void Render_area::draw_counter(const Element_pos x, const Element_pos y){
static bool line_already_begun = false;
if (x <= 0.0 ){
if (line_already_begun==true){/* it is not the first call */
glEnd();
if (_line_already_begun==true){/* it is not the first call */
glEnd();
}else
line_already_begun = true;
_line_already_begun = true;
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 = 0.0;
}else{
glColor3d(1.0, 1.0, 1.0);glVertex2d(x, y);
_counter_last_x = x;
}
_counter_last_y = y;
}
inline void Render_area::end_draw_counter(){
glEnd();/* suppose that line is not ended */
if ( _line_already_begun == true){/* if a line was previously opened */
glEnd();/* suppose that line is not ended */
}
glEndList();/* close the list */
}
......
......@@ -256,7 +256,7 @@ public:
event = *i;
/* Call the object state drawing function */
draw_event(draw_object, event->get_time().get_value(), position);
draw_event(draw_object, event->get_time().get_value(), position);
}/* end for */
}
......@@ -276,8 +276,8 @@ public:
it++) {
link = *it;
draw_link(draw_object, link->get_start_time().get_value(), link->get_end_time().get_value(),
_container_positions[link->get_source()], _container_positions[link->get_destination()]);
draw_link(draw_object, link->get_start_time().get_value(), link->get_end_time().get_value(),
_container_positions[link->get_source()], _container_positions[link->get_destination()]);
}/* end for */
......@@ -285,6 +285,7 @@ public:
draw_object->end_draw_states();
draw_object->start_draw_counter();
for (list<const Container *>::const_iterator c = _entity_containers.begin();
c != _entity_containers.end();
c++) {
......
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