Commit 00658482 authored by Mathieu Faverge's avatar Mathieu Faverge

Fix visibility with OpenGl

parent 81284e56
......@@ -559,31 +559,37 @@ void Interface_graphic::on_export_file_triggered(){
void Interface_graphic::on_reload_triggered() {
if(_is_rendering_trace) {
Element_pos zoom[2]={Info::Splitter::_x_min,Info::Splitter::_x_max};
if(_ui_settings != NULL){
Element_pos zoom[2] = { Info::Splitter::_x_min,
Info::Splitter::_x_max };
if( _ui_settings != NULL ) {
_ui_settings->refresh();
}
if(_ui_node_selection!=NULL)
_ui_node_selection->on_reset_button_clicked();
if(_ui_interval_selection!=NULL)
_ui_interval_selection->on_reset_button_clicked();
if(_reload_type)
// if(_ui_node_selection!=NULL)
// _ui_node_selection->on_reset_button_clicked();
// if(_ui_interval_selection!=NULL)
// _ui_interval_selection->on_reset_button_clicked();
if( _reload_type ) {
_core->launch_action(Core::_STATE_RELEASE_RENDER_AREA);
else
}
else {
_core->launch_action(Core::_STATE_CLEAN_RENDER_AREA);
}
_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_RENDER_UPDATE);
//reset the slider to its original value
scale_container_state->setValue(20);
//update the interval selection display
if(_ui_interval_selection!=NULL)
if( _ui_interval_selection != NULL ) {
_ui_interval_selection->update_values();
}
}
}
void Interface_graphic::open_recent_file() {
......
......@@ -243,7 +243,7 @@ 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,
_displayed_containers.clear();
QList<QTreeWidgetItem *> items;
......@@ -266,15 +266,13 @@ void Stats_window::set_selected_nodes(string kind_of_state){
_trace->set_view_root_containers(_displayed_containers);
//_trace->set_selected_container(_trace->get_root_containers());
_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]));
#endif
#endif
_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_RENDER_UPDATE);
}
}
......
......@@ -113,7 +113,7 @@ public:
/*!
* \brief The default constructor
*/
GanttDiagram(Render* instance){
GanttDiagram( Render *instance ) {
_render = instance;
}
......
......@@ -978,8 +978,14 @@ void Render_alternate::start_draw_states(){
_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){
if(_states.count(value)==0){ //if there is no vbo corresponding to value
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 )
{
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*/
Shader *s = new Shader(_glsl, _r, _g, _b, true);
s->charger();
......@@ -1472,5 +1478,4 @@ void Render_alternate::reload_events(){
}
it++;
}
}
......@@ -860,8 +860,16 @@ void Render_opengl::start_draw_states(){
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){
draw_quad(x, y, z, w, h);
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 )
{
if ((value == NULL) || (value->get_visible() == true) ) {
draw_quad( x, y, z, w, h );
}
}
void Render_opengl::end_draw_states(){
......@@ -880,13 +888,13 @@ void Render_opengl::draw_arrow(const Element_pos start_time,
const Element_col red,
const Element_col green,
const Element_col blue,
EntityValue *v)
EntityValue *value)
{
Arrow_ buf;
const Element_pos offset_x = -_default_entity_x_translate;
const Element_pos offset_y = -_ruler_y - _ruler_height;
(void)v;
if ((value == NULL) || (value->get_visible() == true) ) {
buf.start_time = start_time + offset_x;
buf.end_time = end_time + offset_x;
buf.start_height = start_height + offset_y;
......@@ -896,6 +904,7 @@ void Render_opengl::draw_arrow(const Element_pos start_time,
buf.blue = blue;
_arrows.push_back(buf);
}
}
void Render_opengl::end_draw_arrows(){
......@@ -909,13 +918,13 @@ void Render_opengl::start_draw_events(){
void Render_opengl::draw_event(const Element_pos time,
const Element_pos height,
const Element_pos container_height,
EntityValue *v)
EntityValue *value)
{
Event_ buf;
const Element_pos offset_x = -_default_entity_x_translate;
const Element_pos offset_y = -_ruler_y - _ruler_height;
(void)v;
if ((value == NULL) || (value->get_visible() == true) ) {
buf.time = time + offset_x;
buf.height = height + offset_y;
buf.container_height = -container_height/2 ;
......@@ -924,6 +933,7 @@ void Render_opengl::draw_event(const Element_pos time,
buf.blue = _blue;
_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