Commit 00658482 authored by Mathieu Faverge's avatar Mathieu Faverge

Fix visibility with OpenGl

parent 81284e56
...@@ -559,30 +559,36 @@ void Interface_graphic::on_export_file_triggered(){ ...@@ -559,30 +559,36 @@ void Interface_graphic::on_export_file_triggered(){
void Interface_graphic::on_reload_triggered() { void Interface_graphic::on_reload_triggered() {
if(_is_rendering_trace) { if(_is_rendering_trace) {
Element_pos zoom[2]={Info::Splitter::_x_min,Info::Splitter::_x_max}; Element_pos zoom[2] = { Info::Splitter::_x_min,
if(_ui_settings != NULL){ Info::Splitter::_x_max };
if( _ui_settings != NULL ) {
_ui_settings->refresh(); _ui_settings->refresh();
} }
if(_ui_node_selection!=NULL) // if(_ui_node_selection!=NULL)
_ui_node_selection->on_reset_button_clicked(); // _ui_node_selection->on_reset_button_clicked();
if(_ui_interval_selection!=NULL) // if(_ui_interval_selection!=NULL)
_ui_interval_selection->on_reset_button_clicked(); // _ui_interval_selection->on_reset_button_clicked();
if(_reload_type) if( _reload_type ) {
_core->launch_action(Core::_STATE_RELEASE_RENDER_AREA); _core->launch_action(Core::_STATE_RELEASE_RENDER_AREA);
else }
else {
_core->launch_action(Core::_STATE_CLEAN_RENDER_AREA); _core->launch_action(Core::_STATE_CLEAN_RENDER_AREA);
}
_core->draw_trace(_trace_path, Core::_DRAW_OPENGL); _core->draw_trace(_trace_path, Core::_DRAW_OPENGL);
if(Info::Splitter::_x_max!=0.0) if( Info::Splitter::_x_max != 0.0 ) {
_core->launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom); _core->launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom);
}
_core->launch_action(Core:: _STATE_RENDER_UPDATE); _core->launch_action(Core:: _STATE_RENDER_UPDATE);
//reset the slider to its original value //reset the slider to its original value
scale_container_state->setValue(20); scale_container_state->setValue(20);
//update the interval selection display //update the interval selection display
if(_ui_interval_selection!=NULL) if( _ui_interval_selection != NULL ) {
_ui_interval_selection->update_values(); _ui_interval_selection->update_values();
}
} }
} }
......
...@@ -243,38 +243,36 @@ void Stats_window::set_selected_nodes(string kind_of_state){ ...@@ -243,38 +243,36 @@ void Stats_window::set_selected_nodes(string kind_of_state){
*/ */
void Node_select::on_reset_button_clicked(){ void Node_select::on_reset_button_clicked(){
//resets to initial containers, //resets to initial containers,
_displayed_containers.clear(); _displayed_containers.clear();
QList<QTreeWidgetItem *> items; QList<QTreeWidgetItem *> items;
QTreeWidgetItemIterator it(_nodes_original);//browse only top containers QTreeWidgetItemIterator it(_nodes_original);//browse only top containers
while (*it) { while (*it) {
if((*it)->parent()==NULL){//we only want parent nodes if((*it)->parent()==NULL){//we only want parent nodes
_displayed_containers.push_back(((*it)->data(0,Qt::UserRole)).value<Container*>()); _displayed_containers.push_back(((*it)->data(0,Qt::UserRole)).value<Container*>());
reassign_children_rec(*it, 0); reassign_children_rec(*it, 0);
} }
++it; ++it;
} }
_nodes_displayed->clear(); _nodes_displayed->clear();
//can we load that from _nodes_original instead ? //can we load that from _nodes_original instead ?
set_displayed_container_names(); set_displayed_container_names();
Element_pos zoom[2]={Info::Render::_x_min, Info::Render::_x_max}; Element_pos zoom[2]={Info::Render::_x_min, Info::Render::_x_max};
Info::Render::_x_min_visible = 0.0; Info::Render::_x_min_visible = 0.0;
Info::Render::_x_max_visible = 0.0; Info::Render::_x_max_visible = 0.0;
_trace->set_view_root_containers(_displayed_containers); _trace->set_view_root_containers(_displayed_containers);
//_trace->set_selected_container(_trace->get_root_containers()); //_trace->set_selected_container(_trace->get_root_containers());
_console->get_console()->launch_action(Core:: _STATE_CLEAN_RENDER_AREA); _console->get_console()->launch_action(Core:: _STATE_CLEAN_RENDER_AREA);
#if defined(USE_ITC) && defined(BOOST_SERIALIZE) #if defined(USE_ITC) && defined(BOOST_SERIALIZE)
_trace->updateTrace(new Interval(zoom[0], zoom[1])); _trace->updateTrace(new Interval(zoom[0], zoom[1]));
#endif #endif
_console->get_console()->draw_trace(_console->get_filename(),Core::_DRAW_OPENGL); _console->get_console()->draw_trace(_console->get_filename(),Core::_DRAW_OPENGL);
_console->get_console()->launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom); _console->get_console()->launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom);
_console->get_console()->launch_action(Core:: _STATE_RENDER_UPDATE); _console->get_console()->launch_action(Core:: _STATE_RENDER_UPDATE);
}
}
......
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
/*! /*!
* \brief The default constructor * \brief The default constructor
*/ */
GanttDiagram(Render* instance){ GanttDiagram( Render *instance ) {
_render = instance; _render = instance;
} }
......
...@@ -978,8 +978,14 @@ void Render_alternate::start_draw_states(){ ...@@ -978,8 +978,14 @@ void Render_alternate::start_draw_states(){
_draw_states = true; _draw_states = true;
} }
void Render_alternate::draw_state(const Element_pos x, const Element_pos y, const Element_pos z, const Element_pos w, const Element_pos h, EntityValue* value){ void Render_alternate::draw_state( const Element_pos x,
if(_states.count(value)==0){ //if there is no vbo corresponding to value const Element_pos y,
const Element_pos z,
const Element_pos w,
const Element_pos h,
EntityValue *value )
{
if( _states.count(value) == 0 ) { //if there is no vbo corresponding to value
//we create a new vbo and a new shader corresponding to the current color*/ //we create a new vbo and a new shader corresponding to the current color*/
Shader *s = new Shader(_glsl, _r, _g, _b, true); Shader *s = new Shader(_glsl, _r, _g, _b, true);
s->charger(); s->charger();
...@@ -1472,5 +1478,4 @@ void Render_alternate::reload_events(){ ...@@ -1472,5 +1478,4 @@ void Render_alternate::reload_events(){
} }
it++; it++;
} }
} }
...@@ -860,8 +860,16 @@ void Render_opengl::start_draw_states(){ ...@@ -860,8 +860,16 @@ void Render_opengl::start_draw_states(){
glNewList(_list_states, GL_COMPILE);/* open the list */ glNewList(_list_states, GL_COMPILE);/* open the list */
} }
void Render_opengl::draw_state(const Element_pos x, const Element_pos y, const Element_pos z, const Element_pos w, const Element_pos h, EntityValue* value){ void Render_opengl::draw_state( const Element_pos x,
draw_quad(x, y, z, w, h); const Element_pos y,
const Element_pos z,
const Element_pos w,
const Element_pos h,
EntityValue *value )
{
if ((value == NULL) || (value->get_visible() == true) ) {
draw_quad( x, y, z, w, h );
}
} }
void Render_opengl::end_draw_states(){ void Render_opengl::end_draw_states(){
...@@ -880,22 +888,23 @@ void Render_opengl::draw_arrow(const Element_pos start_time, ...@@ -880,22 +888,23 @@ void Render_opengl::draw_arrow(const Element_pos start_time,
const Element_col red, const Element_col red,
const Element_col green, const Element_col green,
const Element_col blue, const Element_col blue,
EntityValue *v) EntityValue *value)
{ {
Arrow_ buf; Arrow_ buf;
const Element_pos offset_x = -_default_entity_x_translate; const Element_pos offset_x = -_default_entity_x_translate;
const Element_pos offset_y = -_ruler_y - _ruler_height; const Element_pos offset_y = -_ruler_y - _ruler_height;
(void)v;
buf.start_time = start_time + offset_x; if ((value == NULL) || (value->get_visible() == true) ) {
buf.end_time = end_time + offset_x; buf.start_time = start_time + offset_x;
buf.start_height = start_height + offset_y; buf.end_time = end_time + offset_x;
buf.end_height = end_height + offset_y; buf.start_height = start_height + offset_y;
buf.red = red; buf.end_height = end_height + offset_y;
buf.green = green; buf.red = red;
buf.blue = blue; buf.green = green;
buf.blue = blue;
_arrows.push_back(buf); _arrows.push_back(buf);
}
} }
void Render_opengl::end_draw_arrows(){ void Render_opengl::end_draw_arrows(){
...@@ -909,21 +918,22 @@ void Render_opengl::start_draw_events(){ ...@@ -909,21 +918,22 @@ void Render_opengl::start_draw_events(){
void Render_opengl::draw_event(const Element_pos time, void Render_opengl::draw_event(const Element_pos time,
const Element_pos height, const Element_pos height,
const Element_pos container_height, const Element_pos container_height,
EntityValue *v) EntityValue *value)
{ {
Event_ buf; Event_ buf;
const Element_pos offset_x = -_default_entity_x_translate; const Element_pos offset_x = -_default_entity_x_translate;
const Element_pos offset_y = -_ruler_y - _ruler_height; const Element_pos offset_y = -_ruler_y - _ruler_height;
(void)v;
buf.time = time + offset_x; if ((value == NULL) || (value->get_visible() == true) ) {
buf.height = height + offset_y; buf.time = time + offset_x;
buf.container_height = -container_height/2 ; buf.height = height + offset_y;
buf.red = _red; buf.container_height = -container_height/2 ;
buf.green = _green; buf.red = _red;
buf.blue = _blue; buf.green = _green;
buf.blue = _blue;
_circles.push_back(buf); _circles.push_back(buf);
}
} }
......
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