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 diff is collapsed.
......@@ -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
* \param l the line offset.
*/
void set_vertical_line(Element_pos l);
};
......
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