Attention une mise à jour du serveur va être effectuée le vendredi 16 avril entre 12h et 12h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit c6475b04 authored by Thibault Soucarre's avatar Thibault Soucarre

Render_alternate can be compiled and executed but drawing is false.

parent d847a6b7
......@@ -482,7 +482,7 @@ int Core::get_options(int &argc, char **argv)
**********************************/
bool Core::draw_trace(const string & filename, const int format) {
std::cout << "Core::draw_trace" << std::endl;
parser = NULL;
DrawTrace drawing_ogl;
bool killed=false;
......@@ -748,9 +748,9 @@ bool Core::draw_trace(const string & filename, const int format) {
if(!_xml_config_file.empty() && _trace->get_view_root_containers()->empty()){//if we have a partial loading, process it here, but only once
launch_action(_DRAW_OPENGL_PARTIAL,NULL);
}
std::cout << "test" << std::endl;
if (_DRAW_OPENGL == format) {
std::cout << "DRAW_OPENGL == format" << std::endl;
GanttDiagram render(_render_opengl);
drawing_ogl.build(&render, _trace);
_render_opengl->build();
......@@ -847,6 +847,7 @@ void Core::launch_action(int state, void* arg) {
case _STATE_LAUNCH_GRAPHICAL_INTERFACE :
waitGUIInit = new QEventLoop(this);
std::cout << "waitGUIInit créé"<< std::endl;
_main_window = new Interface_graphic (this);/* launch the window interface */
Message::set_interface (_main_window);/* define which interface will receive messages */
......@@ -856,6 +857,7 @@ void Core::launch_action(int state, void* arg) {
SLOT(on_quit_triggered()));
// format.setOverlay(true);
#ifdef WITH_VBO
std::cout << "instanciation render_alternate" << std::endl;
_render_opengl = new Render_alternate (this, _main_window, format);
#else
_render_opengl = new Render_opengl (this, _main_window, format);
......@@ -887,12 +889,11 @@ void Core::launch_action(int state, void* arg) {
// else
// message << QObject::tr("An overlay format was originally asked, but was not created").toStdString () << Message::endw;
// }
_main_window->bind_render_area((QGLWidget*)_render_opengl);
/* Wait that the open gl renderer calls waitGUIInit->quit() to load the file */
waitGUIInit->exec();
std::cout << "gui init" << std::endl;
if ( _STATE_OPEN_FILE == state ){
_main_window->opening_file(_file_opened);/* Must be called after binding the render area to the main window */
if( false == draw_trace(_file_opened, _DRAW_OPENGL) ){
......
......@@ -46,6 +46,7 @@
#ifndef GANTTDIAGRAM_HPP
#define GANTTDIAGRAM_HPP
#include <iostream>
#include "Render.hpp"
class Trace;
......@@ -140,6 +141,7 @@ public:
_container_texts.clear();
drawing_instance->start_draw();
std::cout << "Gantt::start_draw" << std::endl;
}
/*!
......
......@@ -96,7 +96,7 @@ static const int scroll_margin = 100;/* Control the margin of the trace. Must be
void Hook_event::updateRender(){
// _render_instance->updateOverlayGL();
_render_instance->updateGL();
updateGL();
//_render_instance->paintEvent(NULL);
}
......@@ -111,10 +111,10 @@ void Hook_event::updateRender(){
*
**********************************/
Hook_event::Hook_event(Render_opengl* render_instance, Core* core, QWidget *parent, const QGLFormat& format)
Hook_event::Hook_event(Render* render_instance, Core* core, QWidget *parent, const QGLFormat& format)
: QGLWidget(format, parent), _core(core) {
std::cout << "constructeur hook event" << std::endl;
// GLenum glew_code;
......@@ -426,9 +426,9 @@ void Hook_event::mouseReleaseEvent(QMouseEvent * event){
((_new_mouse_y-_mouse_y) < _minimum_distance_for_selection) ){
//hide the vertical line if we press inside a container
_render_instance->set_vertical_line(0);
_render_instance->set_vertical_line(0);
_render_instance->update_vertical_line();
_render_instance->update_vertical_line();
//start the timer to catch a click or double click
_mouse_pressed = false;
......
......@@ -49,7 +49,7 @@
#define HOOK_EVENT_HPP
class Core;
class Render_opengl;
class Render;
/*!
* \brief Structure used to store selection coordinate information.
......@@ -107,7 +107,7 @@ protected:
/*!
* \brief Contains the OpenGL render instance.
*/
Render_opengl* _render_instance;
Render* _render_instance;
/*!
......@@ -283,7 +283,7 @@ public:
* \brief The constructor.
* \param render_instance The instance of a drawing class.
*/
Hook_event(Render_opengl* render_instance, Core* core, QWidget *parent, const QGLFormat& format);
Hook_event(Render* render_instance, Core* core, QWidget *parent, const QGLFormat& format);
/*!
* \brief The destructor
......
......@@ -226,6 +226,24 @@ virtual void start_draw_events() = 0;
*/
virtual void draw_text_value(long int id,double text, double y) = 0;
/*!
* \brief set the vertical line offset
* \param l the line offset.
*/
virtual void set_vertical_line(Element_pos l) = 0;
/*!
* \brief draws the vertical helper line
*/
virtual void draw_vertical_line() = 0;
/*!
* \brief slot connected to the simple click event
*/
virtual void update_vertical_line() = 0;
//virtual void updateGL() = 0;
};
......
......@@ -47,23 +47,30 @@
#include "common/common.hpp"
#include "common/Info.hpp"
#include "common/Message.hpp"
/* -- */
//#include "render/GanttDiagram.hpp"
#include <GL/glew.h>
#include "render/Hook_event.hpp"
#include "render/Render_alternate.hpp"
/* -- */
#include <QFile> // For loading the wait image
#include <QDate>
#include <QTimer>
/* -- */
#include "interface/resource.hpp"
//#include "interface/interface.hpp"
#include "interface/Interface.hpp"
/* -- */
#include "common/common.hpp"
#include "common/Info.hpp"
#include "common/Message.hpp"
/* -- */
#include "render/Ruler.hpp"
#include "render/Render_alternate.hpp"
#include "render/GanttDiagram.hpp"
#include "core/Core.hpp"
/* -- */
#include "vbo.hpp"
#include "core/Core.hpp"
#include "render/vbo.hpp"
#include <iostream>
using namespace std;
......@@ -87,7 +94,7 @@ const int Render_alternate::DRAWING_TIMER_DEFAULT = 10;
**********************************/
Render_alternate::Render_alternate(Core* core, QWidget *parent, const QGLFormat& format)
: Hook_event((Render_opengl*)this, core, parent, format){
: Hook_event(this, core, parent, format){
_arrows.clear();
_circles.clear();
......@@ -119,6 +126,11 @@ void Render_alternate::initializeGL() {
glEnable(GL_DEPTH_TEST);
glClearStencil(0);
std::cout << "init" << std::endl;
if(_core == NULL)
std::cout << "_core = NULL" << std::endl;
_core->waitGUIInit->quit();
std::cout << "init ok" << std::endl;
}
void Render_alternate::resizeGL(int width, int height) {
......@@ -701,6 +713,7 @@ void Render_alternate::draw_container_text(const Element_pos , const Element_pos
void Render_alternate::end_draw_containers(){
_draw_container = false;
glEndList();/* close the list */
cout << "end_draw_containers" << endl;
}
void Render_alternate::start_draw_states(){
......@@ -717,6 +730,7 @@ void Render_alternate::draw_state(const Element_pos , const Element_pos , const
void Render_alternate::end_draw_states(){
_vbos.push_back(_current_vbo);
cout << "end_draw_states" << endl;
}
void Render_alternate::start_draw_arrows(){
......@@ -743,6 +757,7 @@ void Render_alternate::draw_arrow(const Element_pos start_time, const Element_po
void Render_alternate::end_draw_arrows(){
_draw_arrow = false;
cout << "end_draw_arrows" << endl;
}
void Render_alternate::start_draw_events(){
......@@ -767,6 +782,7 @@ void Render_alternate::draw_event(const Element_pos time, const Element_pos heig
void Render_alternate::end_draw_events(){
_draw_event = false;
cout << "end_draw_events" << endl;
}
void Render_alternate::start_draw_counter(){
......@@ -776,6 +792,7 @@ void Render_alternate::draw_counter(const Element_pos , const Element_pos ){
}
void Render_alternate::end_draw_counter(){
cout << "end_draw_counters" << endl;
}
void Render_alternate::start_ruler(){
......@@ -787,6 +804,7 @@ void Render_alternate::end_ruler(){
}
void Render_alternate::end_draw(){
cout << "end_draw" << endl;
}
......@@ -929,3 +947,33 @@ void Render_alternate::draw_stored_circles(){
set_color(1.0, 1.0, 1.0);
}
void Render_alternate::release(){
std::cout << "release" << std::endl;
}
void Render_alternate::draw_text_value(long int id,double text, double y){
}
void Render_alternate::show_minimap(){
}
/*!
* \brief draws the vertical helper line
*/
void Render_alternate::draw_vertical_line(){
}
/*!
* \brief slot connected to the simple click event
*/
void Render_alternate::update_vertical_line(){
}
/*!
* \brief set the vertical line offset
* \param l the line offset.
*/
void Render_alternate::set_vertical_line(Element_pos l){
}
/*
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
/*!
*\file Render_alternate.hpp
*/
......@@ -47,6 +47,25 @@
#ifndef RENDER_OPENGL_HPP
#define RENDER_OPENGL_HPP
#include <stack>
#include <cmath>
#include <sstream>
/* -- */
#include <QObject>
#include <QGLWidget>
#include <QLabel>
#include <QPainter>
/* -- */
#include "common/common.hpp"
#include "common/Info.hpp"
/* -- */
#include "render/Geometry.hpp"
#include "render/Hook_event.hpp"
#include "render/Render.hpp"
#include "render/Minimap.hpp"
#include "render/Ruler.hpp"
#include "render/GanttDiagram.hpp"
class Render_alternate;
class Interface_console;
struct Container_text_;
......@@ -93,12 +112,12 @@ protected:
/*!
* \brief Contains the parent instance.
*/
Core* _core;
//Core* _core;
/*!
* \brief The waiting screen display list.
*/
GLuint _wait_list;
GLuint _wait_list;
/*!
......@@ -111,9 +130,9 @@ protected:
*/
GLuint _list_states;
/*!
* \brief The counter GLu list.
*/
/*!
* \brief The counter GLu list.
*/
GLuint _list_counters;
......@@ -212,7 +231,7 @@ public:
/*!
* \brief Call by the system to initialize the OpenGL render area.
*/
void initializeGL();
void initializeGL();
/*!
* \brief Call by the system when the render area was resized (occurs during a window resizement).
......@@ -229,8 +248,8 @@ public:
//void paintEvent(QPaintEvent *event);
/* void initializeOverlayGL();
void resizeOverlayGL(int width, int height);
void paintOverlayGL();*/
void resizeOverlayGL(int width, int height);
void paintOverlayGL();*/
/***********************************
......@@ -434,64 +453,64 @@ public:
*
**********************************/
// /*!
// * \brief Display on screen containers between container_begin and container_end.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// */
// void display_container(Element_count container_begin, Element_count container_end) =0;
// /*!
// * \brief Display on screen states between timer_begin and time_end,
// * container_begin and container_end and with timer width between depth_begin and depth_end.
// * \param time_begin floating point value : time of the first state.
// * \param time_end floating point value : time of the last state.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// * \param depth_begin floating point value : width of the narrowest state.
// * \param depth_end floating point value : width of the widest state.
// */
// void display_state(Element_pos time_begin, Element_pos time_end,
// Element_count container_begin, Element_count container_end,
// Element_pos depth_begin, Element_pos depth_end) =0;
// /*!
// * \brief Display on screen arrows between timer_begin and time_end,
// * container_begin and container_end and with timer width between depth_begin and depth_end.
// * \param time_begin floating point value : time of the smallest arrow time value.
// * \param time_end floating point value : time of the higher arrow time value.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// * \param depth_begin floating point value : the narrowest difference between
// * the beginning time and the ending time of the arrow.
// * \param depth_end floating point value : width of the widest difference between
// * the beginning time and the ending time of the arrow.
// */
// virtual void display_arrow(Element_pos time_begin, Element_pos time_end,
// Element_count container_begin, Element_count container_end,
// Element_pos depth_begin, Element_pos depth_end) =0;
// /*!
// * \brief Display on screen events between timer_begin and time_end,
// * container_begin and container_end.
// * \param time_begin floating point value : time of the first event.
// * \param time_end floating point value : time of the last event.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// */
// virtual void display_event(Element_pos time_begin, Element_pos time_end,
// Element_count container_begin, Element_count container_end) =0;
// /*!
// * \brief Display on screen counters between timer_begin and time_end,
// * container_begin and container_end.
// * \param time_begin floating point value : time of the smallest counter time value.
// * \param time_end floating point value : time of the higher counter time value.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// */
// virtual void display_counter(Element_pos time_begin, Element_pos time_end,
// Element_count container_begin, Element_count container_end) =0;
// /*!
// * \brief Display on screen containers between container_begin and container_end.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// */
// void display_container(Element_count container_begin, Element_count container_end) =0;
// /*!
// * \brief Display on screen states between timer_begin and time_end,
// * container_begin and container_end and with timer width between depth_begin and depth_end.
// * \param time_begin floating point value : time of the first state.
// * \param time_end floating point value : time of the last state.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// * \param depth_begin floating point value : width of the narrowest state.
// * \param depth_end floating point value : width of the widest state.
// */
// void display_state(Element_pos time_begin, Element_pos time_end,
// Element_count container_begin, Element_count container_end,
// Element_pos depth_begin, Element_pos depth_end) =0;
// /*!
// * \brief Display on screen arrows between timer_begin and time_end,
// * container_begin and container_end and with timer width between depth_begin and depth_end.
// * \param time_begin floating point value : time of the smallest arrow time value.
// * \param time_end floating point value : time of the higher arrow time value.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// * \param depth_begin floating point value : the narrowest difference between
// * the beginning time and the ending time of the arrow.
// * \param depth_end floating point value : width of the widest difference between
// * the beginning time and the ending time of the arrow.
// */
// virtual void display_arrow(Element_pos time_begin, Element_pos time_end,
// Element_count container_begin, Element_count container_end,
// Element_pos depth_begin, Element_pos depth_end) =0;
// /*!
// * \brief Display on screen events between timer_begin and time_end,
// * container_begin and container_end.
// * \param time_begin floating point value : time of the first event.
// * \param time_end floating point value : time of the last event.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// */
// virtual void display_event(Element_pos time_begin, Element_pos time_end,
// Element_count container_begin, Element_count container_end) =0;
// /*!
// * \brief Display on screen counters between timer_begin and time_end,
// * container_begin and container_end.
// * \param time_begin floating point value : time of the smallest counter time value.
// * \param time_end floating point value : time of the higher counter time value.
// * \param container_begin integer value : id of the first container.
// * \param container_end integer value : id of the last container.
// */
// virtual void display_counter(Element_pos time_begin, Element_pos time_end,
// Element_count container_begin, Element_count container_end) =0;
/*!
* \brief Set the color for the further drawings.
......@@ -554,6 +573,26 @@ public:
void draw_stored_circles();
void draw_stored_texts();
void release();
void draw_text_value(long int id,double text, double y);
void show_minimap();
/*!
* \brief draws the vertical helper line
*/
void draw_vertical_line();
/*!
* \brief slot connected to the simple click event
*/
void update_vertical_line();
/*!
* \brief set the vertical line offset
* \param l the line offset.
*/
void set_vertical_line(Element_pos l);
};
......
......@@ -310,3 +310,19 @@ void Render_svg::end_draw(){
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
/*!
* \brief draws the vertical helper line
*/
void Render_svg::draw_vertical_line(){
}
/*!
* \brief slot connected to the simple click event
*/
void Render_svg::update_vertical_line(){
}
void Render_svg::set_vertical_line(Element_pos l){
}
......@@ -289,6 +289,23 @@ public:
* \param y y position of the point.
*/
void draw_text_value(long int id, double text, double y){}
/*!
* \brief draws the vertical helper line
*/
void draw_vertical_line();
/*!
* \brief slot connected to the simple click event
*/
void update_vertical_line();
/*!
* \brief set the vertical line offset