Commit c5e0e40f authored by Thibault Soucarre's avatar Thibault Soucarre

Render_template renommé en Render

parent c3fb2860
......@@ -93,7 +93,7 @@
#include "render/Hook_event.hpp"
#include "render/Ruler.hpp"
#include "render/GanttDiagram.hpp"
#include "render/Render_template.hpp"
#include "render/Render.hpp"
#include "render/Render_svg.hpp"
/* -- */
#include "trace/values/Values.hpp"
......
......@@ -61,7 +61,7 @@
#include "common/Message.hpp"
/* -- */
#include "render/Geometry.hpp"
#include "render/Render_template.hpp"
#include "render/Render.hpp"
#include "render/Render_opengl.hpp"
#include "render/Hook_event.hpp"
/* -- */
......
This diff is collapsed.
......@@ -84,7 +84,7 @@ struct Event_{
/*!
* \brief This class redefined the OpenGL widget - QGLWidget - to display the trace.
*/
class Render_alternate : /*public QGLWidget,*/ public Hook_event, public Render_template
class Render_alternate : /*public QGLWidget,*/ public Hook_event, public Render
{
Q_OBJECT
......
......@@ -62,7 +62,7 @@
/* -- */
#include "render/Geometry.hpp"
#include "render/Hook_event.hpp"
#include "render/Render_template.hpp"
#include "render/Render.hpp"
#include "render/Minimap.hpp"
#include "render/Ruler.hpp"
#include "render/GanttDiagram.hpp"
......@@ -126,7 +126,7 @@ struct Variable_text_{
/*!
* \brief This class redefined the OpenGL widget - QGLWidget - to display the trace.
*/
class Render_opengl : /*public QGLWidget,*/ public Hook_event, public Render_template
class Render_opengl : /*public QGLWidget,*/ public Hook_event, public Render
{
Q_OBJECT
......
......@@ -6,13 +6,13 @@
** 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,
......@@ -23,7 +23,7 @@
** 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.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/*!
......@@ -57,7 +57,7 @@
#include "common/Message.hpp"
/* -- */
#include "render/Geometry.hpp"
#include "render/Render_template.hpp"
#include "render/Render.hpp"
#include "render/Render_svg.hpp"
#include "render/Ruler.hpp"
/* -- */
......@@ -91,7 +91,7 @@ Render_svg::Render_svg(string* output_filename){
Render_svg::~Render_svg(){
if (_output_file.is_open())
_output_file.close();
}
......@@ -112,8 +112,8 @@ void Render_svg::draw_text(const Element_pos x, const Element_pos y, const Eleme
<< " fill=\"white\">"
<< s
<< "</text>\n";
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
......@@ -132,7 +132,7 @@ void Render_svg::draw_quad(Element_pos x, Element_pos y, Element_pos , Element_p
<< " style=\"stroke:white;stroke-width:0.05\""
<< " />\n";
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
void Render_svg::draw_triangle(Element_pos x, Element_pos y,
......@@ -146,7 +146,7 @@ void Render_svg::draw_triangle(Element_pos x, Element_pos y,
<< " fill=\"rgb(" << floor(_red*256) << "," << floor(_green*256) << "," << floor(_blue*256) << ")\""/* TODO: choice better scale than '*256' */
<< "/>\n";
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
void Render_svg::draw_line(Element_pos x1, Element_pos y1, Element_pos x2, Element_pos y2, Element_pos ){
......@@ -159,7 +159,7 @@ void Render_svg::draw_line(Element_pos x1, Element_pos y1, Element_pos x2, Eleme
<< " stroke=\"rgb(" << floor(_red*256) << "," << floor(_green*256) << "," << floor(_blue*256) << ")\""/* TODO: choice better scale than '*256' */
<< "/>\n";
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
void Render_svg::draw_circle(Element_pos x, Element_pos y, Element_pos , Element_pos r){
......@@ -172,7 +172,7 @@ void Render_svg::draw_circle(Element_pos x, Element_pos y, Element_pos , Element
<< " stroke=\"rgb(" << floor((1.0-_red)*256) << "," << floor((1.0-_green)*256) << "," << floor((1.0-_blue)*256) << ")\""/* TODO: choice better scale than '*256' */
<< "/>\n";
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
......@@ -182,12 +182,12 @@ void Render_svg::start_draw(){
<< "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"
<< "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" << Info::Screen::width << "\" height=\"" << Info::Screen::height << "\" >\n"
<< "<rect "
<< " x=\"0\" y=\"0\""
<< " x=\"0\" y=\"0\""
<< " width=\"" << Info::Screen::width << "\" height=\"" << Info::Screen::height << "\""
<< " fill=\"rgb(128, 128, 150)\""
<< " />\n"
<< "<clipPath id=\"stateArea\">"/* Add a clipping area for state, arrow, event and counter */
<< "<path d = \"M "<< render_to_screen_x(_default_entity_x_translate) << " " << render_to_screen_y(9)
<< "<path d = \"M "<< render_to_screen_x(_default_entity_x_translate) << " " << render_to_screen_y(9)
<< "L " << render_to_screen_x(_default_entity_x_translate) << " " << Info::Screen::height
<< "L " << Info::Screen::width << " " << Info::Screen::height
<< "L " << Info::Screen::width << " " << render_to_screen_y(9) << " Z\"/>"
......@@ -200,7 +200,7 @@ void Render_svg::start_draw(){
void Render_svg::start_draw_containers(){
_buffer.str("");
_buffer << "</g>";/* Stop clipping */
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
......@@ -213,7 +213,7 @@ void Render_svg::draw_container_text(const Element_pos , const Element_pos , con
void Render_svg::end_draw_containers(){
_buffer.str("");
_buffer << "<g clip-path=\"url(#stateArea)\">";/* Start again clipping */
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
......@@ -257,27 +257,27 @@ void Render_svg::end_draw_counter(){
void Render_svg::start_ruler(){
_buffer.str("");
_buffer << "</g>";/* Stop clipping */
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
void Render_svg::end_ruler(){
Element_pos graduation_diff;
Element_pos coeff_prefix;
graduation_diff = Ruler::get_graduation_diff(Info::Render::_x_min_visible, Info::Render::_x_max_visible);
coeff_prefix = Ruler::get_coeff_for_common_prefix(Info::Render::_x_min_visible, Info::Render::_x_max_visible);
_buffer.str("");/* flush the buffer */
_buffer << "<text x=\"" << render_to_screen_x(trace_to_render_x(0)) <<"\""
<< " y=\"" << render_to_screen_y(3) << "\""
<< " font-size=\"" << 14 << "\""
<< " fill=\"white\">"
<< "min: " << (double)Info::Render::_x_min_visible
<< "</text>\n";
_buffer << "<text x=\"" << render_to_screen_x(trace_to_render_x(Info::Render::_x_max_visible))- render_to_screen_x(trace_to_render_x(Info::Render::_x_min_visible)) <<"\""
<< " y=\"" << render_to_screen_y(3) << "\""
<< " font-size=\"" << 14 << "\""
......@@ -285,11 +285,11 @@ void Render_svg::end_ruler(){
<< "max: " << (double)Info::Render::_x_max_visible
<< "</text>\n";
for (Element_pos i = Info::Render::_x_min_visible ;
i < Info::Render::_x_max_visible ;
for (Element_pos i = Info::Render::_x_min_visible ;
i < Info::Render::_x_max_visible ;
i+=graduation_diff){
_buffer << "<text x=\"" << render_to_screen_x(trace_to_render_x(i - Info::Render::_x_min_visible)+1) <<"\""
<< " y=\"" << render_to_screen_y(8) << "\""
<< " font-size=\"" << 10 << "\""
......@@ -297,10 +297,10 @@ void Render_svg::end_ruler(){
<< Ruler::get_variable_part(i, coeff_prefix, 2)
<< "</text>\n";
}
_buffer << "<g clip-path=\"url(#stateArea)\">";/* Start again clipping */
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
void Render_svg::end_draw(){
......@@ -308,7 +308,5 @@ void Render_svg::end_draw(){
_buffer << "</g>";/* Stop clipping */
_buffer << "</svg>";/* Close the svg file */
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
_output_file.write(_buffer.str().c_str(), _buffer.str().size());
}
......@@ -6,13 +6,13 @@
** 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,
......@@ -23,7 +23,7 @@
** 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.
**
......@@ -37,7 +37,7 @@
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
** - VUCHENER Clément
**
*/
/*!
......@@ -50,10 +50,10 @@
/*!
* \brief This class redefined the OpenGL widget - QGLWidget - to display the trace.
*/
class Render_svg : /*public QGLWidget,*/ public Render_template, public Geometry
class Render_svg : /*public QGLWidget,*/ public Render, public Geometry
{
protected:
/*!
* \brief buffer containing the main objets to be displayed
*/
......@@ -65,7 +65,7 @@ protected:
std::ofstream _output_file;
float _red, _green, _blue;
public:
......@@ -85,7 +85,7 @@ public:
* \brief The destructor
*/
virtual ~Render_svg();
/*!
* \brief Proceeds with the initialization of the OpenGL draw functions.
......@@ -120,7 +120,7 @@ public:
* \brief Closes the container display list.
*/
void end_draw_containers();
/*!
* \brief Creates and opens the display list for stater draws.
*/
......@@ -196,7 +196,7 @@ public:
* \brief Creates and opens the display list for counter draws.
*/
void start_draw_counter();
/*!
* \brief Draw a point of the counter.
* \param x x position of the point.
......@@ -205,7 +205,7 @@ public:
* Each time counter is increased, this function is called with the coordinates of the new point.
*/
void draw_counter(const Element_pos x, const Element_pos y);
/*!
* \brief Closes the counter display list.
*/
......@@ -215,7 +215,7 @@ public:
* \brief Called before ruler drawing.
*/
void start_ruler();
/*!
* \brief Called after ruler drawing.
*/
......@@ -230,7 +230,7 @@ public:
* \brief Set the color for the further drawings.
* \param r the red value. Within [0 ; 1].
* \param g the green value. Within [0 ; 1].
* \param b the blue value. Within [0 ; 1].
* \param b the blue value. Within [0 ; 1].
*/
void set_color(float r, float g, float b);
......
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