Commit 80433525 authored by Olivier Lagrasse's avatar Olivier Lagrasse

- Correction de la regle. (qui etait fausse ^^)

parent d5d7cbac
......@@ -89,7 +89,6 @@ public:
*/
static bool _no_arrows_and_events;
/*!
* \brief Contains the trace minimum visible time.
*/
......
......@@ -143,7 +143,8 @@ bool Interface_console::draw_trace(const string & filename, const int format){
//delete _progress_dialog;
_main_window->setDisabled (false);
// Wait for the end thread
while(!thread.isFinished());
while(!thread.isFinished()){
}
}else if ( _file_opened != filename){/* just check if execution is normal */
......
......@@ -179,7 +179,8 @@ void Interface_graphic::information(const string s) const{
void Interface_graphic::selection_information(const string s) const{
QString buf = s.c_str();
_ui_info_selection_text->clear();/* Clear the current text (if exists) */
_ui_info_selection_text->insertHtml("<font color='blue'>"+buf+"</font><br /><br />");
_ui_info_selection_text->insertHtml("<font color='blue'>"+buf+"</font>");
_ui_info_selection_text->moveCursor(QTextCursor::Start);/* Insert the new text on the begin */
_ui_info_window->show();/* show info_window */
}
......@@ -280,8 +281,9 @@ void Interface_graphic::change_zoom_box_value(int new_value){
ostringstream int_to_string;
int index;
int max_value = -2147483648L;
if ((int)-2147483648 == new_value)/* prevent overflow value */
if (max_value == new_value)/* prevent overflow value */
new_value = 2147483647;
int_to_string << new_value;
......
......@@ -113,6 +113,7 @@ Render_opengl::Render_opengl(Interface_console* core, QWidget *parent)
_z_ruler_over = -0.5;
_z_container = -1.0;
_z_container_under = -1.2;
_z_ruler = -1.5;
_z_ruler_under = -1.6;
_z_arrow = -2.0;/* closer to camera than containers or states (MUST be negative)*/
......@@ -402,7 +403,7 @@ void Render_opengl::paintGL(){
if (_mouse_pressed){
glTranslated(0.0, 0.0, _z_container);
glTranslated(0.0, 0.0, _z_container_under);
Element_pos old_x, old_y, new_x, new_y;
......@@ -422,6 +423,7 @@ void Render_opengl::paintGL(){
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
/* Square for selection */
glBegin(GL_QUADS);
{
glColor4d(0.9, 1.0, 0.9, _selection_rectangle_alpha);glVertex2d(old_x, old_y);
......@@ -430,7 +432,7 @@ void Render_opengl::paintGL(){
glColor4d(0.9, 0.9, 0.9, _selection_rectangle_alpha);glVertex2d(new_x, old_y);
}
glEnd();
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
......@@ -537,8 +539,8 @@ void Render_opengl::mousePressEvent(QMouseEvent * event){
/* Work out the y value in Data Structure coordinates */
y_result = y_click;///((Element_pos)_container_height + v_space);
y_result = (y_click-_ruler_height + _y_state_translate)*(_container_y_max-_container_y_min)/(_y_state_scale*_render_height);
/*
* Second, check the x position if user click on the container or other
*/
......@@ -1263,10 +1265,11 @@ void Render_opengl::create_ruler(){
ruler_bg_b = 1.0;
}
coeff = (_state_x_max - _state_x_min)/_render_width;/* from [0;100] to [_state_x_min;_state_x_max], used to obtain correct coordinate texts */
entity_width = _render_width*_state_scale;/* the render width from a given scale */
coeff = (_state_x_max - _state_x_min)/(_render_width-_default_entity_x_translate);/* from [0;100] to [_state_x_min;_state_x_max], used to obtain correct coordinate texts */
entity_width = _state_scale*(_render_width-_default_entity_x_translate);/* the render width from a given scale */
graduation_distance = entity_width/ceil(entity_width/_ruler_distance);/* distance between two graduations calculated from a desire distance */
x_min = _default_entity_x_translate-_state_translate;/* received the first integer inside render width */
......@@ -1375,6 +1378,19 @@ void Render_opengl::create_ruler(){
glEnd();
/* Square under containers */
glBegin(GL_QUADS);
{
glColor4d(0.6, 0.6, 0.6, 1.0);glVertex3d(0, 0, _z_container_under);
glColor4d(0.6, 0.6, 0.6, 0.4);glVertex3d(_x_scale_container_state*_render_width, 0, _z_container_under);
glColor4d(0.6, 0.6, 0.6, 0.4);glVertex3d(_x_scale_container_state*_render_width, _render_height, _z_container_under);
glColor4d(0.6, 0.6, 0.6, 1.0);glVertex3d(0, _render_height, _z_container_under);
}
glEnd();
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
......@@ -1407,7 +1423,7 @@ void Render_opengl::create_ruler(){
/* Draw spaced graduation of _ruler_distance */
for (Element_pos i = max(x_min, start_delay) ; i<=min(entity_width+x_min, _render_width) ; i+=graduation_distance){
//for (Element_pos i = Info::Render::_x_min_visible ; i<= Info::Render::_x_max_visible ; i+=graduation_distance){
//for (Element_pos i = 0 ; i<= (int)_render_width ; i+=graduation_distance){
if (i != min(entity_width+x_min, _render_width) ){/* prepare small graduations between the current and the next main graduation */
......@@ -1432,12 +1448,14 @@ void Render_opengl::create_ruler(){
}
glEnd();
buf_number = (i-x_min)*coeff/_state_scale;
//buf_number = i;//*(Info::Render::_x_max_visible-Info::Render::_x_min_visible)/_render_width;
/* Draw the graduation text */
glColor3d(1.0, 1.0, 1.0);
glRasterPos2f(i, _ruler_y+_ruler_height);
buf_number = (i - x_min)*coeff/_state_scale;
/* trunc numbers to a maximum of 3 digits */
buf_number = buf_number*coeff_mul_10 - floor( Info::Render::_x_min_visible*coeff_mul_10 );//floor(buf_number*coeff_mul_10);/* Get the distinct part */
......
......@@ -439,6 +439,11 @@ protected:
*/
Element_pos _z_container;
/*!
* \brief z position for objects under containers.
*/
Element_pos _z_container_under;
/*!
* z position for states.
*/
......
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