Commit 2d87083c authored by Olivier Lagrasse's avatar Olivier Lagrasse

ajouts de commentaires pour Doxygen (message + interface)

parent 17ddd2c0
...@@ -45,8 +45,14 @@ protected: ...@@ -45,8 +45,14 @@ protected:
*/ */
Interface_graphic* _main_window; Interface_graphic* _main_window;
/*!
* \brief Contains the render area instance.
*/
Render_area* _render_opengl; Render_area* _render_opengl;
/*!
* \brief Contains the main Qt application instance.
*/
QApplication* app; QApplication* app;
...@@ -185,9 +191,20 @@ protected: ...@@ -185,9 +191,20 @@ protected:
/*! /*!
* \brief This function launch trace drawing. * \brief This function launch trace drawing.
* \param filename Path of the trace file. * \param filename Path of the trace file.
* \param render_area Pointer to the render area.
*
* \return true if no errors occurs.
*/ */
bool draw_trace(const std::string & filename, Render_area* render_area); bool draw_trace(const std::string & filename, Render_area* render_area);
/*!
* \brief This function launch SVG drawing.
* \param filename Path of the trace file.
* \param svg Pointer to the svg instance.
*
* \return true if no errors occurs.
*/
bool draw_trace(const std::string & filename, Svg* svg); bool draw_trace(const std::string & filename, Svg* svg);
......
...@@ -71,7 +71,9 @@ class Interface_graphic : public QWidget, public Interface{ ...@@ -71,7 +71,9 @@ class Interface_graphic : public QWidget, public Interface{
*/ */
QVBoxLayout* _ui_render_area_layout; QVBoxLayout* _ui_render_area_layout;
/*!
* \brief Contains the Interface_console parent instance.
*/
Interface_console* _core; Interface_console* _core;
/*! /*!
...@@ -108,30 +110,6 @@ class Interface_graphic : public QWidget, public Interface{ ...@@ -108,30 +110,6 @@ class Interface_graphic : public QWidget, public Interface{
*/ */
bool _is_rendering_trace; bool _is_rendering_trace;
/***********************************
*
* Parser attribute.
*
**********************************/
/*!
* \brief The parser attribute.
*/
// Parser* _parser;
/***********************************
*
* Data structure attributes.
*
**********************************/
/*!
* \brief The data structure attribute.
*/
//Trace* _trace;
public: public:
...@@ -194,6 +172,7 @@ public: ...@@ -194,6 +172,7 @@ public:
/*! /*!
* \brief Get the name of the current trace file. * \brief Get the name of the current trace file.
* *
* \return The name of the current trace file
*/ */
const std::string get_filename() const; const std::string get_filename() const;
...@@ -213,21 +192,6 @@ public: ...@@ -213,21 +192,6 @@ public:
void opening_file(std::string const &path); void opening_file(std::string const &path);
/***********************************
*
* Trace building function.
*
**********************************/
/*!
* \brief This function will build the trace sent by the data structure ('_trace').
* \arg trace The trace which be displayed.
*/
// bool build(Trace* trace);
protected slots: protected slots:
...@@ -278,10 +242,27 @@ protected slots: ...@@ -278,10 +242,27 @@ protected slots:
*/ */
void on_about_triggered(); void on_about_triggered();
/*!
* \brief Change the scale of state drawing.
* \param new_value The new scale value.
*/
void on_scale_state_valueChanged(int new_value);/* temporary slot */ void on_scale_state_valueChanged(int new_value);/* temporary slot */
/*!
* \brief Change the x position of camera view for state drawing area.
* \param new_value The new position.
*/
void on_translate_state_valueChanged(int new_value);/* temporary slot */ void on_translate_state_valueChanged(int new_value);/* temporary slot */
/*!
* \brief Change the percentage taken by container display in the render area.
* \param new_value The new percentage (between 0 to 100).
*/
void on_scale_container_state_valueChanged(int new_value);/* temporary slot */ void on_scale_container_state_valueChanged(int new_value);/* temporary slot */
/*!
* \brief temporary.
*/
void on_main_window_hide(); void on_main_window_hide();
}; };
......
...@@ -21,9 +21,15 @@ class Render ...@@ -21,9 +21,15 @@ class Render
{ {
public: public:
/*!
* \brief Proceeds with the initialization of draw functions.
*/
virtual void start_draw() = 0; virtual void start_draw() = 0;
/*!
* \brief Proceeds with the initialization of container draw functions.
*/
virtual void start_draw_containers() = 0; virtual void start_draw_containers() = 0;
/*! /*!
...@@ -43,8 +49,14 @@ class Render ...@@ -43,8 +49,14 @@ class Render
*/ */
virtual void draw_container_text(const Element_pos x, const Element_pos y, const std::string value) = 0; virtual void draw_container_text(const Element_pos x, const Element_pos y, const std::string value) = 0;
/*!
* \brief Called when all container draws are finished.
*/
virtual void end_draw_containers() = 0; virtual void end_draw_containers() = 0;
/*!
* \brief Proceeds with the initialization of state draw functions.
*/
virtual void start_draw_states() = 0; virtual void start_draw_states() = 0;
/*! /*!
...@@ -59,18 +71,50 @@ class Render ...@@ -59,18 +71,50 @@ class Render
*/ */
virtual void draw_state(const Element_pos start , const Element_pos end, const Element_pos base, const Element_pos height, const Element_col r, const Element_col g, const Element_col b) = 0; virtual void draw_state(const Element_pos start , const Element_pos end, const Element_pos base, const Element_pos height, const Element_col r, const Element_col g, const Element_col b) = 0;
/*!
* \brief Called when all state draws are finished.
*/
virtual void end_draw_states() = 0; virtual void end_draw_states() = 0;
/*!
* \brief Draw an arrow.
* \param start_time the beginning time of the arrow.
* \param end_time the ending time of the arrow.
* \param start_height vertical position of the begining time of the arrow.
* \param end_height vertical position of the ending time of the arrow.
*/
virtual void draw_arrow(const Element_pos start_time, const Element_pos end_time, const Element_pos start_height, const Element_pos end_height) = 0; virtual void draw_arrow(const Element_pos start_time, const Element_pos end_time, const Element_pos start_height, const Element_pos end_height) = 0;
/*!
* \brief Draw an event.
* \param time time when the event occurs.
* \param height vertical position of the event.
* \param container_height information to draw event. It corresponds to the container height when they are drawn horizontally.
*/
virtual void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height) = 0; virtual void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height) = 0;
/*!
* \brief Proceeds with the initialization of counter draw functions.
*/
virtual void start_draw_counter() = 0; virtual void start_draw_counter() = 0;
virtual void draw_counter(const Element_pos x, const Element_pos y) = 0; /*!
* \brief Draw a point of the counter.
* \param x x position of the point.
* \param y y position of the point.
*
* Each time counter is increased, this function is called with the coordinates of the new point.
*/
virtual void draw_counter(const Element_pos x, const Element_pos y) = 0;
/*!
* \brief Called when all counter draws are finished.
*/
virtual void end_draw_counter() = 0; virtual void end_draw_counter() = 0;
/*!
* \brief Called when all draws are finished.
*/
virtual void end_draw() = 0; virtual void end_draw() = 0;
}; };
......
...@@ -70,8 +70,7 @@ Render_area::Render_area(QWidget *parent) ...@@ -70,8 +70,7 @@ Render_area::Render_area(QWidget *parent)
_state_scale = 1;/* temporary, for states scaling */ _state_scale = 1;/* temporary, for states scaling */
_state_translate = 0;/* temporary, for states translation */ _state_translate = 0;/* temporary, for states translation */
//_container_view_size = 50;/* temporary, for container view */
/* Camera is placed on (0,0,0) and looks to (0,0,-1) */ /* Camera is placed on (0,0,0) and looks to (0,0,-1) */
_z_container = -1.0f; _z_container = -1.0f;
_z_arrow = -2.0f;/* closer to camera than containers or states (MUST be negative)*/ _z_arrow = -2.0f;/* closer to camera than containers or states (MUST be negative)*/
......
...@@ -8,15 +8,13 @@ ...@@ -8,15 +8,13 @@
class Render_area; class Render_area;
typedef double Level;
#include <QtGui> #include <QtGui>
#include <QGLWidget>/* for the OpenGL Widget */ #include <QGLWidget>/* for the OpenGL Widget */
//#include "interface_graphic.hpp"
#include "render.hpp" #include "render.hpp"
//#include "render_svg.hpp"
#include "resource.hpp" #include "resource.hpp"
...@@ -34,7 +32,6 @@ struct Arrow_{ ...@@ -34,7 +32,6 @@ struct Arrow_{
}; };
/*! /*!
* \brief This class redefined the OpenGL widget - QGLWidget - to display the trace. * \brief This class redefined the OpenGL widget - QGLWidget - to display the trace.
*/ */
...@@ -47,33 +44,25 @@ class Render_area : public QGLWidget, public Render ...@@ -47,33 +44,25 @@ class Render_area : public QGLWidget, public Render
protected: protected:
/*!
* \brief Contains container text coordinates.
*/
std::list<Element_pos> _text_pos; std::list<Element_pos> _text_pos;
std::list<std::string> _text_value;
std::vector<Event_> _events;
std::vector<Arrow_> _arrows;
/***********************************
*
* Environment attributes.
*
**********************************/
/*! /*!
* \brief Refers to the parent widget of the render area. * \brief Contains container strings.
*/ */
// Interface_graphic* _parent; std::list<std::string> _text_value;
/*!
* \brief Contains arrow informations.
*/
std::vector<Arrow_> _arrows;
/*********************************** /*!
* * \brief Contains event informations.
* Data structure attributes. */
* std::vector<Event_> _events;
**********************************/
...@@ -135,15 +124,27 @@ class Render_area : public QGLWidget, public Render ...@@ -135,15 +124,27 @@ class Render_area : public QGLWidget, public Render
**********************************/ **********************************/
/*! /*!
* \brief The wait GLu list. * \brief The wait GLu list.
*/ */
GLuint _wait_list; GLuint _wait_list;
/*!
* \brief The container GLu list.
*/
GLuint _list_containers; GLuint _list_containers;
/*!
* \brief The state GLu list.
*/
GLuint _list_states; GLuint _list_states;
/*!
* \brief The counter GLu list.
*/
GLuint _list_counters; GLuint _list_counters;
/*! /*!
* \brief Rotation angle for the wait. * \brief Rotation angle for the wait.
*/ */
float _wait_angle; float _wait_angle;
...@@ -192,12 +193,15 @@ class Render_area : public QGLWidget, public Render ...@@ -192,12 +193,15 @@ class Render_area : public QGLWidget, public Render
*/ */
GLuint _drawing_list; GLuint _drawing_list;
/*!
* \brief The last x position of the point (for counter).
*/
Element_pos _counter_last_x; Element_pos _counter_last_x;
Element_pos _counter_last_y;
/*!
* \brief The last y position of the point (for counter).
*/
Element_pos _counter_last_y;
/*! /*!
* \brief The opengl render area width in pixels. * \brief The opengl render area width in pixels.
...@@ -209,7 +213,6 @@ class Render_area : public QGLWidget, public Render ...@@ -209,7 +213,6 @@ class Render_area : public QGLWidget, public Render
*/ */
Element_pos _screen_height; Element_pos _screen_height;
/*! /*!
* \brief The opengl visibled scene width in the OpenGL units. * \brief The opengl visibled scene width in the OpenGL units.
*/ */
...@@ -220,38 +223,66 @@ class Render_area : public QGLWidget, public Render ...@@ -220,38 +223,66 @@ class Render_area : public QGLWidget, public Render
*/ */
Element_pos _render_height; Element_pos _render_height;
/*!
* \brief The width of container area draw.
*/
Element_pos _container_x_max; Element_pos _container_x_max;
Element_pos _container_y_max;
Element_pos _event_x_max; /*!
Element_pos _event_y_max; * \brief The height of container area draw.
*/
Element_pos _container_y_max;
/*!
* \brief The width of state area draw.
*/
Element_pos _state_x_max; Element_pos _state_x_max;
/*!
* \brief The height of state area draw.
*/
Element_pos _state_y_max; Element_pos _state_y_max;
/*!
* \brief z position for containers.
*/
Element_pos _z_container;
/*!
* z position for states.
*/
Element_pos _z_state;
Element_pos _x_scale_container_state; /*!
* z position for events.
*/
Element_pos _z_event;
/*!
* z position for arrows.
*/
Element_pos _z_arrow;
Element_pos _z_container;/* z position for containers */
Element_pos _z_state;/* z position for states */
Element_pos _z_event;/* z position for events */
Element_pos _z_arrow;/* z position for arrows */
/*********************************** /***********************************
* Trace Drawing functions and attributes. * Trace Drawing functions and attributes.
**********************************/ **********************************/
/*!
* \brief Return the pos container of the list
*/
// Container* get_container(const std::list <Container*> *list_container, const int pos) const;
/*!
* \brief The percentage taken by container display in the render area.
*/
Element_pos _x_scale_container_state;/* temporary */
/*!
* \brief the scale of state drawing.
*/
int _state_scale;/* temporary */ int _state_scale;/* temporary */
/*!
* \brief The x position of camera view for state drawing area.
*/
int _state_translate;/* temporary */ int _state_translate;/* temporary */
// int _container_view_size;/* temporary */
public: public:
...@@ -292,14 +323,33 @@ class Render_area : public QGLWidget, public Render ...@@ -292,14 +323,33 @@ class Render_area : public QGLWidget, public Render
*/ */
bool unbuild(); bool unbuild();
/*!
* \brief Change the scale of state drawing.
* \param scale The new scale value.
*/
void change_scale(int scale);/* temporary -> to change the scale to view states */ void change_scale(int scale);/* temporary -> to change the scale to view states */
/*!
* \brief Change the x position of camera view for state drawing area.
* \param translate The new position.
*/
void change_translate(int translate);/* temporary -> to change the translate to view states */ void change_translate(int translate);/* temporary -> to change the translate to view states */
/*!
* \brief Change the percentage taken by container display in the render area.
* \param view_size The new percentage (between 0 to 100).
*/
void change_scale_container_state(int view_size);/* temporary -> to change the size of container view */ void change_scale_container_state(int view_size);/* temporary -> to change the size of container view */
/*!
* \brief Proceeds with the initialization of the OpenGL draw functions.
*/
void start_draw(); void start_draw();
/*!
* \brief Creates and opens the display list for container draws.
*/
void start_draw_containers(); void start_draw_containers();
/*! /*!
...@@ -316,11 +366,19 @@ class Render_area : public QGLWidget, public Render ...@@ -316,11 +366,19 @@ class Render_area : public QGLWidget, public Render
* \param x the x position of the text. * \param x the x position of the text.
* \param y the y position of the text. * \param y the y position of the text.
* \param value the string value of the text. * \param value the string value of the text.
*
* This function stores text in a list. This list will be display each time the render area need to be updated.
*/ */
void draw_container_text(const Element_pos x, const Element_pos y, const std::string value); void draw_container_text(const Element_pos x, const Element_pos y, const std::string value);
/*!
* \brief Closes the container display list.
*/
void end_draw_containers(); void end_draw_containers();
/*!
* \brief Creates and opens the display list for stater draws.
*/
void start_draw_states(); void start_draw_states();
/*! /*!
...@@ -335,25 +393,67 @@ class Render_area : public QGLWidget, public Render ...@@ -335,25 +393,67 @@ class Render_area : public QGLWidget, public Render
*/ */
void draw_state(const Element_pos start , const Element_pos end, const Element_pos base, const Element_pos height, const Element_col r, const Element_col g, const Element_col b); void draw_state(const Element_pos start , const Element_pos end, const Element_pos base, const Element_pos height, const Element_col r, const Element_col g, const Element_col b);
/*!
* \brief Closes the state display list.
*/
void end_draw_states(); void end_draw_states();
/*!
* \brief Draw an arrow.
* \param start_time the beginning time of the arrow.
* \param end_time the ending time of the arrow.
* \param start_height vertical position of the begining time of the arrow.
* \param end_height vertical position of the ending time of the arrow.
*
* This function stores all the information of the arrow to display it each time the render area need to be updated.