diff --git a/src/interface/render.hpp b/src/interface/render.hpp index 3775f62d397fd022c030e5345967f00b39731abf..ab73cfc92174ccac7a74e68546a4466d7a3a14ed 100644 --- a/src/interface/render.hpp +++ b/src/interface/render.hpp @@ -67,7 +67,7 @@ class Render virtual void start_draw_counter() = 0; - virtual void draw_counter(const Element_pos x, const Element_pos y) = 0; + virtual void draw_counter(const Element_pos x, const Element_pos y) = 0; virtual void end_draw_counter() = 0; diff --git a/src/interface/render_area.hpp b/src/interface/render_area.hpp index e31785b83bb332d411875989eac7742718cd20db..ccb920616c61488f3fd7e63581998360bd7179d6 100644 --- a/src/interface/render_area.hpp +++ b/src/interface/render_area.hpp @@ -324,9 +324,9 @@ class Render_area : public QGLWidget, public Render void start_draw_counter(); - void draw_counter(const Element_pos x, const Element_pos y); + void draw_counter(const Element_pos x, const Element_pos y); - void end_draw_counter(); + void end_draw_counter(); void end_draw(); diff --git a/src/interface/render_svg.cpp b/src/interface/render_svg.cpp index 81edf9026ddc244682480895d427773db49d1f00..d0a0b804fee0613661226e92386e7bbe4d1950d1 100644 --- a/src/interface/render_svg.cpp +++ b/src/interface/render_svg.cpp @@ -40,6 +40,10 @@ void Svg::init(const char *path){ << "\t\t\t{\n" << "\t\t\t\tfill:black;stroke:black;stroke-width:1\n" << "\t\t\t}\n" + << "\t\tpath\n" + << "\t\t\t{\n" + << "\t\t\t\tfill:green;stroke:black;stroke-width:1\n" + << "\t\t\t}\n" << "\t</style>\n" << "\t<desc>Rectangles</desc>\n"; diff --git a/src/interface/render_svg.hpp b/src/interface/render_svg.hpp index fdea2758486159f8c3f181eff752eb748082c7ec..7e0eae0395088cf8cb7dcbdd0e0f2d9298040477 100644 --- a/src/interface/render_svg.hpp +++ b/src/interface/render_svg.hpp @@ -26,6 +26,7 @@ class Svg : public Render{ private: std::ostringstream _buffer; + std::ostringstream _chronogramme; std::ofstream _svg_file; inline void print(); inline void rectangle(const char* name,unsigned long w, unsigned long h,unsigned long x1,unsigned long y1, unsigned int r, unsigned int g, unsigned int b ); @@ -82,7 +83,7 @@ public: void start_draw_counter(); - void draw_counter(const Element_pos x, const Element_pos y); + void draw_counter(const Element_pos x, const Element_pos y); void end_draw_counter(); @@ -103,6 +104,7 @@ public: inline void Svg::start_draw(){ + } inline void Svg::draw_container_text(const Element_pos x, const Element_pos y, const std::string value){ @@ -196,7 +198,7 @@ inline void Svg::draw_state(const Element_pos start , const Element_pos end, con } inline void Svg::draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height){ - //rectangle(1,container_height*LEVEL, time, container_height, 0xff, 0x44, 0xcc); + Svg::rectangle("event",MARGIN,container_height, time, height, 0xff, 0xff, 0xff); } #endif // RENDER_SVG diff --git a/tests/interface/test_svg.cpp b/tests/interface/test_svg.cpp index 41f13557d8e495bf0fcce7a31c4b53d696bc3db3..08cff7a93d06295f3e74b3f26ec15afba6cc6acb 100644 --- a/tests/interface/test_svg.cpp +++ b/tests/interface/test_svg.cpp @@ -22,187 +22,9 @@ int main() - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); - - - - s.draw_state(100, 750, 1,NULL, 0xff,0xcc,33); - s.draw_state(400, 750, 2,NULL, 0xff,0xcc,33); - s.draw_state(70, 300, 3,NULL, 0xff,0xcc,33); - - s.draw_arrow(100,700,LEVEL*1,LEVEL*3); - s.draw_arrow(200,400,LEVEL*2,LEVEL*2); + s.draw_event(200,LEVEL*1,100); + s.draw_event(220,LEVEL*1,100); + s.draw_event(320,LEVEL*1,100); s.end();