Commit c1af4595 authored by Jule Marcoueille's avatar Jule Marcoueille

Mise en place du scroll vertical operationnel.

parent fe1c00b3
......@@ -21,10 +21,12 @@
* \brief unity for count elements such as number of states or events... NOT USED YET
*/
typedef long Element_count ;
/*!
* \brief Unity for variables of position of a element in the display such as height, abscissa...
*/
typedef double Element_pos;
/*!
* \brief unity for colors
*/
......
......@@ -107,6 +107,7 @@ Render_opengl::Render_opengl(QWidget *parent)
_y_state_scale = 1;/* for states scaling */
_y_state_translate = 0;/* for states translation */
_x_scroll_pos = 0;/* horizontal bar placed on 0 */
_y_scroll_pos = 0;/* vertical bar placed on 0 */
/* Camera is placed on (0,0,0) and looks to (0,0,-1) */
......@@ -245,54 +246,54 @@ void Render_opengl::paintGL(){
glCallList(_wait_list);
glPopMatrix();
break;
case DRAWING_STATE_DRAWING:/* A trace is drawn */
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();
{
static float a = 0;
a ++;
glPushMatrix();
{
static float a = 0;
a ++;
glTranslated(0.0, _render_height, 100.0);
glRotated(180.0, 1.0, 0.0, 0.0);
/******************************************************/
/* draw ruler */
create_ruler();
/******************************************************/
/* Translate containers and entities of the ruler height */
glTranslated(0.0, _ruler_height, 0.0);
glTranslated(0.0, _render_height, 100.0);
glRotated(180.0, 1.0, 0.0, 0.0);
/******************************************************/
/* draw ruler */
create_ruler();
/******************************************************/
/* Translate containers and entities of the ruler height */
glTranslated(0.0, _ruler_height, 0.0);
/* Draw containers */
glPushMatrix();
/* glTranslatef(0.0f, 40.0f, -1.0f);
glScalef(10.0f/_container_x_max, 50.0f/_container_y_max, 0.0f);
*/
glTranslatef(0.0f, 0.0f, _z_container);
glTranslatef(0.0f, _y_state_translate, _z_container);
glScalef( (_render_width/_container_x_max)*_x_scale_container_state, (_render_height-_ruler_height)/_container_y_max, 0.0f);
#ifdef DEBUG_MODE_RENDER_OPENGL
cerr << __FILE__ << " l." << __LINE__ << ":" << endl;
cerr << "Default container position (before translation and scaling) : (x_max = " << _container_x_max << ", y_max = " << _container_y_max << ")" << endl << endl;
#endif
if (glIsList(_list_containers)==GL_FALSE)
message << "ERROR LIST not exist for containers." << Message::ende;
......@@ -313,7 +314,8 @@ void Render_opengl::paintGL(){
buf_txt = *it_txt;
glPushMatrix();
glTranslatef(0.0f, _y_state_translate, 0.0f);
/* glTranslatef(0.0f, 40.0f, 0.0f);
glScalef(10.0f/_container_x_max, 50.0f/_container_y_max, 0.0f);
......@@ -350,7 +352,7 @@ void Render_opengl::paintGL(){
/* Draw states */
glPushMatrix();
glTranslated( _default_entity_x_translate - _state_translate , 0.0f, _z_state);
glTranslated( _default_entity_x_translate - _state_translate , _y_state_translate, _z_state);
glScalef(_state_scale*((_render_width-_default_entity_x_translate)/(_state_x_max-_state_x_min)), _y_state_scale*(_render_height-_ruler_height)/_container_y_max, 0.0f);
......@@ -723,14 +725,14 @@ void Render_opengl::replace_translate(Element_pos new_translate){
void Render_opengl::replace_translate_y(Element_pos new_translate){
if (0 == new_translate){/* show the beginning states */
_state_translate = _default_entity_x_translate - (Element_pos)_render_width/2.0;
_y_state_translate = 0;
}else if (-1 == new_translate){/* show the latest states */
_state_translate = (_default_entity_x_translate - (Element_pos)_render_width/2.0 + _state_x_max*_state_scale
*((_render_width-_default_entity_x_translate)/(_state_x_max-_state_x_min)));
/*_y_state_translate = (_default_entity_x_translate - (Element_pos)_render_width/2.0 + _state_x_max*_state_scale
*((_render_width-_default_entity_x_translate)/(_state_x_max-_state_x_min)));*/
}else if (-2 == new_translate){/* show the entire trace */
......@@ -740,9 +742,9 @@ void Render_opengl::replace_translate_y(Element_pos new_translate){
_y_state_scale = 1;
}else{/* Default, just replace the current translate the by new_translate value */
_state_translate = new_translate;
_y_state_translate = -new_translate;
}
updateGL();
}
......
......@@ -412,7 +412,7 @@ class Render_opengl : public QGLWidget, public Render
Element_pos _ruler_height;
/*!
* highness of the ruler.
* Highness of the ruler.
*/
Element_pos _ruler_y;
......@@ -449,6 +449,11 @@ class Render_opengl : public QGLWidget, public Render
* \brief The x position of the horizontal scroll bar.
*/
Element_pos _x_scroll_pos;
/*!
* \brief The y position of the vertical scroll bar.
*/
Element_pos _y_scroll_pos;
public:
......
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