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

ajouts de commentaires pour Doxygen (message + interface)

parent 17ddd2c0
......@@ -45,8 +45,14 @@ protected:
*/
Interface_graphic* _main_window;
/*!
* \brief Contains the render area instance.
*/
Render_area* _render_opengl;
/*!
* \brief Contains the main Qt application instance.
*/
QApplication* app;
......@@ -185,9 +191,20 @@ protected:
/*!
* \brief This function launch trace drawing.
* \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);
/*!
* \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);
......
......@@ -71,7 +71,9 @@ class Interface_graphic : public QWidget, public Interface{
*/
QVBoxLayout* _ui_render_area_layout;
/*!
* \brief Contains the Interface_console parent instance.
*/
Interface_console* _core;
/*!
......@@ -108,30 +110,6 @@ class Interface_graphic : public QWidget, public Interface{
*/
bool _is_rendering_trace;
/***********************************
*
* Parser attribute.
*
**********************************/
/*!
* \brief The parser attribute.
*/
// Parser* _parser;
/***********************************
*
* Data structure attributes.
*
**********************************/
/*!
* \brief The data structure attribute.
*/
//Trace* _trace;
public:
......@@ -194,6 +172,7 @@ public:
/*!
* \brief Get the name of the current trace file.
*
* \return The name of the current trace file
*/
const std::string get_filename() const;
......@@ -213,21 +192,6 @@ public:
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:
......@@ -278,10 +242,27 @@ protected slots:
*/
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 */
/*!
* \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 */
/*!
* \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 */
/*!
* \brief temporary.
*/
void on_main_window_hide();
};
......
......@@ -22,8 +22,14 @@ class Render
public:
/*!
* \brief Proceeds with the initialization of draw functions.
*/
virtual void start_draw() = 0;
/*!
* \brief Proceeds with the initialization of container draw functions.
*/
virtual void start_draw_containers() = 0;
/*!
......@@ -43,8 +49,14 @@ class Render
*/
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;
/*!
* \brief Proceeds with the initialization of state draw functions.
*/
virtual void start_draw_states() = 0;
/*!
......@@ -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;
/*!
* \brief Called when all state draws are finished.
*/
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;
/*!
* \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;
/*!
* \brief Proceeds with the initialization of counter draw functions.
*/
virtual void start_draw_counter() = 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;
/*!
* \brief Called when all draws are finished.
*/
virtual void end_draw() = 0;
};
......
......@@ -70,7 +70,6 @@ Render_area::Render_area(QWidget *parent)
_state_scale = 1;/* temporary, for states scaling */
_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) */
_z_container = -1.0f;
......
......@@ -8,15 +8,13 @@
class Render_area;
typedef double Level;
#include <QtGui>
#include <QGLWidget>/* for the OpenGL Widget */
//#include "interface_graphic.hpp"
#include "render.hpp"
//#include "render_svg.hpp"
#include "resource.hpp"
......@@ -34,7 +32,6 @@ struct Arrow_{
};
/*!
* \brief This class redefined the OpenGL widget - QGLWidget - to display the trace.
*/
......@@ -47,33 +44,25 @@ class Render_area : public QGLWidget, public Render
protected:
/*!
* \brief Contains container text coordinates.
*/
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;
/***********************************
*
* Data structure attributes.
*
**********************************/
std::list<std::string> _text_value;
/*!
* \brief Contains arrow informations.
*/
std::vector<Arrow_> _arrows;
/*!
* \brief Contains event informations.
*/
std::vector<Event_> _events;
......@@ -138,8 +127,20 @@ class Render_area : public QGLWidget, public Render
* \brief The wait GLu list.
*/
GLuint _wait_list;
/*!
* \brief The container GLu list.
*/
GLuint _list_containers;
/*!
* \brief The state GLu list.
*/
GLuint _list_states;
/*!
* \brief The counter GLu list.
*/
GLuint _list_counters;
/*!
......@@ -192,12 +193,15 @@ class Render_area : public QGLWidget, public Render
*/
GLuint _drawing_list;
/*!
* \brief The last x position of the point (for counter).
*/
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.
......@@ -209,7 +213,6 @@ class Render_area : public QGLWidget, public Render
*/
Element_pos _screen_height;
/*!
* \brief The opengl visibled scene width in the OpenGL units.
*/
......@@ -220,38 +223,66 @@ class Render_area : public QGLWidget, public Render
*/
Element_pos _render_height;
/*!
* \brief The width of container area draw.
*/
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;
/*!
* \brief The height of state area draw.
*/
Element_pos _state_y_max;
Element_pos _x_scale_container_state;
/*!
* \brief z position for containers.
*/
Element_pos _z_container;
/*!
* z position for states.
*/
Element_pos _z_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.
**********************************/
/*!
* \brief Return the pos container of the list
* \brief The percentage taken by container display in the render area.
*/
// Container* get_container(const std::list <Container*> *list_container, const int pos) const;
Element_pos _x_scale_container_state;/* temporary */
/*!
* \brief the scale of state drawing.
*/
int _state_scale;/* temporary */
/*!
* \brief The x position of camera view for state drawing area.
*/
int _state_translate;/* temporary */
// int _container_view_size;/* temporary */
public:
......@@ -292,14 +323,33 @@ class Render_area : public QGLWidget, public Render
*/
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 */
/*!
* \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_scale_container_state(int view_size);/* temporary -> to change the size of container view */
/*!
* \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 */
/*!
* \brief Proceeds with the initialization of the OpenGL draw functions.
*/
void start_draw();
/*!
* \brief Creates and opens the display list for container draws.
*/
void start_draw_containers();
/*!
......@@ -316,11 +366,19 @@ class Render_area : public QGLWidget, public Render
* \param x the x position of the text.
* \param y the y position 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);
/*!
* \brief Closes the container display list.
*/
void end_draw_containers();
/*!
* \brief Creates and opens the display list for stater draws.
*/
void start_draw_states();
/*!
......@@ -335,26 +393,68 @@ 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);
/*!
* \brief Closes the state display list.
*/
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.
*/
void draw_arrow(const Element_pos start_time, const Element_pos end_time, const Element_pos start_height, const Element_pos end_height);
/*!
* \brief Draw arrows contained in the Arrow_ vector
* \param arrows An arrow vector.
*/
void draw_stored_arrows(std::vector<Arrow_> &arrows);
/*!
* \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.
*
* This function stores all the information of the event to display it each time the render area need to be updated.
*/
void draw_event(const Element_pos time, const Element_pos height, const Element_pos container_height);
/*!
* \brief Draw events contained in the Event_ vector
* \param events An event vector.
*/
void draw_stored_events(std::vector<Event_> &events);
/*!
* \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.
* \param y y position of the point.
*
* 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.
*/
void end_draw_counter();
/*!
* \brief Do nothing (it is present for compatibility of the Render class).
*/
void end_draw();
};
......@@ -461,6 +561,10 @@ inline void Render_area::draw_state(const Element_pos start, const Element_pos e
#endif
/** DEBUG **/
// if (start==end)
/* std::cout << std::setprecision(15) << std::endl;
std::cerr << "Start "<< start << " end " << end << std::endl;*/
glBegin(GL_QUADS);/* create a quads */
{
......@@ -575,12 +679,6 @@ inline void Render_area::draw_event(const Element_pos time, const Element_pos he
buf.container_height = container_height;
_events.push_back(buf);
if (time>_event_x_max)
_event_x_max = time;
if ((height+container_height)>_event_y_max)
_event_y_max = (height+container_height);
}
......
/*!
*\file resource.hpp
*\file interface/resource.hpp
*\brief This file gives some common header files for the interface classes.
*/
......
/*!
*\file resource.hpp
*\file main_resource.hpp
*\brief This file gives some common header files for the interface classes.
*/
......@@ -21,6 +21,8 @@ typedef double Element_col;
/* Message management */
#include "message/message_ns.hpp"
/* Example:
* message << "Test:" << 45 << " and " << true << endi;
* -> display as an informative message.
......
......@@ -6,6 +6,9 @@
#define ENDERROR_HPP
/*!
* \brief This class is used by message system to determine what kind of message information belongs to. Here, it is for error messages.
*/
struct Enderror{
/*!
......
......@@ -6,6 +6,9 @@
#define ENDINFORMATION_HPP
/*!
* \brief This class is used by message system to determine what kind of message information belongs to. Here, it is for informative messages.
*/
struct Endinformation{
/*!
......
......@@ -6,6 +6,9 @@
#define ENDWARNING_HPP
/*!
* \brief This class is used by message system to determine what kind of message information belongs to. Here, it is for warning messages.
*/
struct Endwarning{
/*!
......
......@@ -14,19 +14,55 @@
namespace message_ns{
/*******************************
Declared inside message_ns.cpp
********************************/
/* declared inside message_ns.cpp */
/*!
* \brief Message variabel will contain messages which must be displayed.
*/
extern std::stringstream message;
/*!
* \brief Putting ende in message variable will triggered message display with the error flag.
*/
extern Enderror ende;
/*!
* \brief Putting endw in message variable will triggered message display with the warning flag.
*/
extern Endwarning endw;
/*!
* \brief Putting endi in message variable will triggered message display with the information flag.
*/
extern Endinformation endi;
/* the operator function declaration */
/*******************************
The operator function declaration
********************************/
/*!
* \brief The macro OP_FUNC_DECL defines operator << for message displaying system.
*
* It will create as operator << functions as different kind of message classes. Operator takes a string stream (it can be strings with numbers and booleans) than trigger the display of this stream according to the second argument which decides what kind of message it is (for example : an error message or a warning message).
*/