Commit 34712093 authored by Olivier Lagrasse's avatar Olivier Lagrasse

liage de l'export en svg (ATTENTION svn st! L'exportation fait une boucle...

liage de l'export en svg (ATTENTION svn st! L'exportation fait une boucle infinie et cree un fichier potentiellement infini.
parent d70b6dae
......@@ -151,6 +151,7 @@ void Interface_graphic::opening_file(string const &path){
information(string("File opened: ")+ path);
_trace_path = path;
_core->draw_trace(path, _ui_render_area);
......@@ -241,6 +242,11 @@ void Interface_graphic::on_export_triggered(){
*/
information(string("Exporting trace to ")+filename.toStdString());
{
Svg svg;
svg.init(filename.toStdString().c_str());
_core->draw_trace(_trace_path, &svg);
}
}
else
......@@ -297,6 +303,8 @@ void Interface_graphic::on_fullscreen_triggered(){
void Interface_graphic::on_show_info_triggered(){
_ui_info_window->show();
}
......
......@@ -74,6 +74,11 @@ class Interface_graphic : public QWidget, public Interface{
Interface_console* _core;
/*!
* \brief Contains the trace displayed path.
*/
std::string _trace_path;
/***********************************
*
* Informative window widget attributes.
......
......@@ -65,6 +65,12 @@ class Render
virtual void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height) = 0;
virtual void start_draw_counter() = 0;
virtual void draw_counter(const Element_pos x, const Element_pos y) = 0;
virtual void end_draw_counter() = 0;
virtual void end_draw() = 0;
};
......
......@@ -89,6 +89,9 @@ void Render_area::initializeGL(){
glClearStencil(0);
_wait_list = draw_wait();
message << "Counter drawing not yet implemented" << endw;
}
void Render_area::resizeGL(int width, int height){
......
......@@ -16,6 +16,7 @@ typedef double Level;
//#include "interface_graphic.hpp"
#include "render.hpp"
//#include "render_svg.hpp"
#include "resource.hpp"
......@@ -124,6 +125,7 @@ class Render_area : public QGLWidget, public Render
GLuint _wait_list;
GLuint _list_containers;
GLuint _list_states;
GLuint _list_counters;
/*!
* \brief Rotation angle for the wait.
......@@ -283,6 +285,12 @@ class Render_area : public QGLWidget, public Render
void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height);
void start_draw_counter();
void draw_counter(const Element_pos x, const Element_pos y);
void end_draw_counter();
void end_draw();
};
......@@ -495,6 +503,37 @@ inline void Render_area::draw_event(const Element_pos time, const Element_pos he
}
/********************
* Counter
*******************/
inline void Render_area::start_draw_counter(){
_list_counters = glGenLists(1);/* create the list */
if (_list_counters==0){
// _parent->warning("Error when creating list");
}
glNewList(_list_counters, GL_COMPILE);/* open the list */
glColor3d(0.7, 0.7, 0.7);
glBegin(GL_LINES);
}
inline void Render_area::draw_counter(const Element_pos x, const Element_pos y){
glVertex2d(x, y);
}
inline void Render_area::end_draw_counter(){
glEnd();
glEndList();/* close the list */
}
inline void Render_area::end_draw(){
......
......@@ -80,7 +80,12 @@ public:
void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height);
void start_draw_counter();
void draw_counter(const Element_pos x, const Element_pos y);
void end_draw_counter();
void end_draw();
};
......@@ -116,6 +121,19 @@ inline void Svg::end_draw_states(){
}
/********************
* Counter
*******************/
inline void Svg::start_draw_counter(){
}
inline void Svg::draw_counter(const Element_pos x, const Element_pos y){
}
inline void Svg::end_draw_counter(){
}
inline void Svg::end_draw(){
}
......
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