Commit bff7b047 authored by Olivier Lagrasse's avatar Olivier Lagrasse

- Correction pour la selection d'information.

- Ajout menu pour masquer les fleches et les events (manque les icones dans la barre...)
parent 501c677b
......@@ -19,4 +19,5 @@ Element_pos Info::Render::_info_x = 0.0;
Element_pos Info::Render::_info_y = 0.0;
Element_pos Info::Render::_info_accurate = 0.0;
bool Info::Render::_no_arrows_and_events = false;
bool Info::Render::_no_arrows = false;
bool Info::Render::_no_events = false;
......@@ -85,9 +85,14 @@ public:
static bool _key_ctrl;
/*!
* \brief Prevent arrows and events to be displayed (used with Display List since it should highly decreased performance).
* \brief Prevent arrows to be displayed (used with Display List since it should highly decreased performance).
*/
static bool _no_arrows_and_events;
static bool _no_arrows;
/*!
* \brief Prevent events to be displayed (used with Display List since it should highly decreased performance).
*/
static bool _no_events;
/*!
* \brief Contains the trace minimum visible time.
......
......@@ -585,7 +585,10 @@ void Interface_console::launch_action(int state, void* arg){
if(_trace != NULL){
buf.display_information(_trace, Info::Render::_info_x, Info::Render::_info_y, Info::Render::_info_accurate);
}
break;
case _STATE_RENDER_UPDATE:
_render_opengl->update();
break;
default:/* like _STATE_UNKNOWN */
......
......@@ -158,6 +158,12 @@ public:
*/
static const int _STATE_RENDER_DISPLAY_INFORMATION = 21;
/*!
*\brief Update the render area.
*/
static const int _STATE_RENDER_UPDATE = 22;
/*!
* \brief Launch an action according to the argument state value.
* \param state An integer corresponding to a kind of action which must be executed.
......
......@@ -508,10 +508,17 @@ void Interface_graphic::on_no_warning_triggered(){
_no_warning = !_no_warning;
}
void Interface_graphic::on_no_arrows_and_events_triggered(){
Info::Render::_no_arrows_and_events = !Info::Render::_no_arrows_and_events;
void Interface_graphic::on_no_arrows_triggered(){
Info::Render::_no_arrows = !Info::Render::_no_arrows;
_core->launch_action(Interface_console::_STATE_RENDER_UPDATE);
}
void Interface_graphic::on_no_events_triggered(){
Info::Render::_no_events = !Info::Render::_no_events;
_core->launch_action(Interface_console::_STATE_RENDER_UPDATE);
}
void Interface_graphic::on_zoom_in_triggered(){
Element_pos t = 1;
......
......@@ -409,10 +409,14 @@ protected slots:
void on_no_warning_triggered();
/*!
*\brief A slot called when 'no_arrows_and_events' in the menu is clicked.
*\brief A slot called when 'no_arrows' in the menu is clicked.
*/
void on_no_arrows_and_events_triggered();
void on_no_arrows_triggered();
/*!
*\brief A slot called when 'no_events' in the menu is clicked.
*/
void on_no_events_triggered();
/*!
*\brief A slot called when 'zoom_in' in the menu is clicked.
......
......@@ -208,7 +208,8 @@
<addaction name="fullscreen"/>
<addaction name="separator"/>
<addaction name="no_warning"/>
<addaction name="no_arrows_and_events"/>
<addaction name="no_arrows"/>
<addaction name="no_events"/>
</widget>
<widget class="QMenu" name="menuFile">
<property name="title">
......@@ -253,6 +254,8 @@
<addaction name="fullscreen"/>
<addaction name="separator"/>
<addaction name="help"/>
<addaction name="no_arrows"/>
<addaction name="no_events"/>
</widget>
<action name="open">
<property name="icon">
......@@ -439,12 +442,20 @@
<string>zoom_control</string>
</property>
</action>
<action name="no_arrows_and_events">
<action name="no_arrows">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>No arrows and events</string>
<string>No arrows</string>
</property>
</action>
<action name="no_events">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>No events</string>
</property>
</action>
</widget>
......
......@@ -19,12 +19,12 @@ void ParserPaje::parse(string filename, Trace &trace){
static const string PERCENT = "%";
string event_identity_string;
unsigned int event_identity;
while(!line.is_eof()) {
// For the rabbit, else it does not turn :(
QApplication::processEvents();
line.newline();
if(line.starts_with(PERCENT)) {
parserdefinition->store_definition(line);
......
......@@ -373,11 +373,13 @@ void Render_opengl::paintGL(){
if (false == Info::Render::_no_arrows_and_events){/* display arrows and events */
if (false == Info::Render::_no_arrows)/* display arrows */
draw_stored_arrows(_arrows);/* draw arrows without display lists */
if (false == Info::Render::_no_events)/* display events */
draw_stored_events(_events);/* draw events without display lists */
}
......@@ -539,14 +541,16 @@ void Render_opengl::mousePressEvent(QMouseEvent * event){
/* Work out the y value in Data Structure coordinates */
y_result = (y_click-_ruler_height + _y_state_translate)*(_container_y_max-_container_y_min)/(_y_state_scale*_render_height);
y_result = y_click-(_ruler_y+_ruler_height) + _y_state_translate;
y_result *= (_container_y_max-_container_y_min)/((_render_height-_ruler_height)*_y_state_scale);
/*
* Second, check the x position if user click on the container or other
*/
if (x_click <= (_x_scale_container_state*_render_width) ){/* user had clicked on the container */
// cerr << "Click container" << endl;
if (x_click <= (_x_scale_container_state*_render_width) ){/* user had clicked on the container */
}
else{
/*
......@@ -562,12 +566,11 @@ void Render_opengl::mousePressEvent(QMouseEvent * event){
/*
* To convert from [0;_render_width*_state_scale] to [_state_x_min;_state_x_max]
*/
x_result *= (_state_x_max - _state_x_min)/(_render_width*_state_scale);
x_result *= (_state_x_max - _state_x_min)/((_render_width-_default_entity_x_translate)*_state_scale);
// message << "Click entity" << x_result << Message::endsi;
Info::Render::_info_x = x_result;
Info::Render::_info_y = y_result;
Info::Render::_info_accurate = _state_x_max/_render_width;
Info::Render::_info_accurate = (_state_x_max - _state_x_min)/((_render_width-_default_entity_x_translate)*_state_scale);//_state_x_max/_render_width;
_core->launch_action(Interface_console::_STATE_RENDER_DISPLAY_INFORMATION);
......
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