Commit 428fb663 authored by Johnny Jazeix's avatar Johnny Jazeix

Doxyfile modified for taking in account all the headers files.

Adding comments in a lot of files for Doxygen.
End of the histogram statistic (else if you need some adjustement).

parent 6b098eef
......@@ -31,7 +31,7 @@ PROJECT_NAME = ViTE
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.0
PROJECT_NUMBER = 0.3
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......@@ -513,7 +513,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = src/interface/ src/message/ src/parser/ src/render/ src/trace/ src/trace/values/ src/main.cpp src/main_resource.hpp tests/interface tests/message tests/parser tests/trace src/Tools.cpp src/Tools.hpp
INPUT = src/interface/ src/message/ src/parser/ src/render/ src/trace/ src/trace/values/ src/trace/tree/ src/main.cpp src/main_resource.hpp src/statistics/ src/Tools.cpp src/Tools.hpp
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
......
......@@ -84,8 +84,8 @@ clean:
cleanall: clean
make -C \$(DOC)/user_manual cleanall
make -C \$(DOC)/technical_manual cleanall
@(cd bin/ && rm -rf vite)
@(cd ../documentation/ && \$(RM) html/ latex/)
@(cd bin/ && \$(RM) vite)
@(cd ../documentation/ && rm -rf html/ latex/)
distclean: cleanall
\$(RM) Makefile
......
......@@ -28,7 +28,7 @@ class Interface_console;
#include "resource.hpp"
#include "../Tools.hpp"
#include "../general/Tools.hpp"
#include "parsing_thread.hpp"
......
......@@ -171,6 +171,13 @@ public:
static void set(const std::string kind_of_error, const int priority);
/*!
* \fn set(const std::string kind_of_error, const unsigned int line_number, const int priority) static void
* \brief raise an error or a warning
* \param kind_of_error : content of error
* \param line_number : the line in the trace file where the error occurs.
* \param priority : _ERROR or _WARNING
*/
static void set(const std::string kind_of_error, const unsigned int line_number, const int priority);
/*!
* \fn set_and_print(const std::string kind_of_error, const int priority) static void
......
......@@ -33,6 +33,10 @@ public:
};
#endif
/*!
* \class Message
* \brief Contains routine for easily send messages of informations, warnings or errors to the user
*/
class Message: public std::stringstream {
private:
......
......@@ -3,7 +3,7 @@
*/
#ifndef RENDER_AREA_HPP
#ifndef RENDER_AREA_HPP
#define RENDER_AREA_HPP
......@@ -14,7 +14,7 @@ class Interface_console;
class Render_opengl;
/* Global informations */
#include "info/info.hpp"
#include "../info/info.hpp"
#include "resource.hpp"
......@@ -100,17 +100,17 @@ struct Selection_{
class Render_area : public QGLWidget/*, public Render*/
{
Q_OBJECT
protected:
/*!
* \brief Contains container text coordinates.
*/
std::list<Element_pos> _text_pos;
/*!
* \brief Contains container strings.
*/
......@@ -130,18 +130,18 @@ protected:
* \brief Contains the previous selection coordinates.
*/
std::stack<Selection_> _previous_selection;
/*!
* \brief Contains the OpenGL render instance.
*/
Render_opengl* _render_instance;
/*!
* \brief Contains the parent instance.
*/
Interface_console* _core;
/***********************************
*
......@@ -153,12 +153,12 @@ protected:
* \brief State when there is no file opened.
*/
static const int DRAWING_STATE_WAITING;
/*!
* \brief State when the application is drawing traces.
*/
static const int DRAWING_STATE_DRAWING;
/*!
* \brief Contains the kind of state for the render area (drawing, waiting, etc.).
......@@ -171,22 +171,22 @@ protected:
bool _mouse_pressed;
/*!
* \brief Used to store the mouse last x position.
* \brief Used to store the mouse last x position.
*/
int _mouse_x;
/*!
* \brief Used to store the mouse last y position.
* \brief Used to store the mouse last y position.
*/
int _mouse_y;
/*!
* \brief Used to store the mouse current x position.
* \brief Used to store the mouse current x position.
*/
int _new_mouse_x;
/*!
* \brief Used to store the mouse current y position.
* \brief Used to store the mouse current y position.
*/
int _new_mouse_y;
......@@ -204,7 +204,7 @@ protected:
* \brief Define the minimum width and height to draw the selection rectangle (avoid bas manipulations).
*/
Element_pos _minimum_distance_for_selection;
/*!
* \brief Define the scrolling factor when CTRL key is pressed.
*/
......@@ -214,18 +214,18 @@ protected:
* \brief Define the scrolling factor when CTRL key is pressed.
*/
static const int _ctrl_zoom_factor;
/***********************************
*
* The wait screen drawing.
*
**********************************/
/***********************************
* The wait list Attributes.
**********************************/
/*!
* \brief Rotation angle for the wait.
......@@ -241,14 +241,14 @@ protected:
* \brief Time in ms between two frames for the waiting screen.
*/
static const int DRAWING_TIMER_DEFAULT;
/*!
* \brief Wait animation seconds per frame.
*/
int _wait_spf;
/*!
* \brief Timer to animate the wait.
* \brief Timer to animate the wait.
*/
QTimer* _wait_timer;
......@@ -261,21 +261,21 @@ protected:
*
**********************************/
/***********************************
* The drawing list Attributes.
**********************************/
/*!
* \brief The waiting screen display list.
*/
*/
GLuint _wait_list;
/*!
* \brief The ruler display list.
*/
*/
GLuint _list_ruler;
/*!
......@@ -352,7 +352,7 @@ protected:
* \brief The y base of state area draw.
*/
Element_pos _state_y_min;
/*!
* \brief z position for the ruler.
*/
......@@ -369,12 +369,12 @@ protected:
Element_pos _z_ruler_under;
/*!
* \brief z position for containers.
* \brief z position for containers.
*/
Element_pos _z_container;
/*!
* \brief z position for objects under containers.
* \brief z position for objects under containers.
*/
Element_pos _z_container_under;
......@@ -417,7 +417,7 @@ protected:
* Highness of the ruler.
*/
Element_pos _ruler_y;
/*!
* Width of the ruler.
*/
......@@ -457,20 +457,20 @@ protected:
* \brief The y position of the vertical scroll bar.
*/
Element_pos _y_scroll_pos;
/***********************************
*
* Default QWidget functions.
*
**********************************/
/*!
* \brief This functions receives all mouse press events.
* \param event The event triggered by mouse.
*/
void mousePressEvent(QMouseEvent * event);
void mousePressEvent(QMouseEvent * event);
/*!
* \brief If user press, this functions receives all mouse move events until user release mouse.
......@@ -482,14 +482,14 @@ protected:
* \brief This functions receives all mouse release events.
* \param event The event triggered by mouse.
*/
void mouseReleaseEvent(QMouseEvent * event);
void mouseReleaseEvent(QMouseEvent * event);
/*!
* \brief This functions receives all mouse wheel events.
* \param event The event triggered by the mouse wheel.
*/
void wheelEvent(QWheelEvent * event);
/*!
* \brief This functions receives all keyboard events.
* \param event The event triggered by the keyboard event.
......@@ -502,7 +502,7 @@ protected:
*/
void keyReleaseEvent(QKeyEvent * event);
/***********************************
......@@ -510,7 +510,7 @@ protected:
* Render OpenGL drawing functions.
*
**********************************/
/*!
* \brief Display a wait on the screen if there is no file opened.
* \return Asset value of the wait.
......@@ -564,7 +564,7 @@ public:
* Scaling and scrolling functions.
*
**********************************/
/*!
* \brief Change the scale of state drawing.
......@@ -613,24 +613,24 @@ public:
* \param id The pre registered translation id.
*/
void registered_translate(int id);
/*!
* \brief Refresh scroll bar positions when shortcuts execute movements
* \param LENGTH_CHANGED If true the total length of the scroll bar will be updated.
*/
void refresh_scroll_bars(bool LENGTH_CHANGED = false);
/*!
* \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 This function updates the visible interval value (for export).
*/
void update_visible_interval_value();
/*!
* \brief Scale the current view to the zoom box shape.
* \param x_min the x minimum position.
......
This diff is collapsed.
......@@ -14,6 +14,8 @@ using namespace std;
Render_stats_opengl::Render_stats_opengl(QWidget *parent) : QGLWidget(parent){
_translated_y = 0;
_translated_x = 0;
_render_height = height();
_render_width = width();
}
Render_stats_opengl::~Render_stats_opengl(){
......@@ -88,13 +90,22 @@ void Render_stats_opengl::paintGL(){
}
void Render_stats_opengl::translate_y(int value) {
_translated_y = (double)value/100.0*_render_height;
//cout << "h :" << _render_height << endl;
if(value == 0) {
_translated_y = 0;
}
else {
_translated_y = (double)(value+1)/100.0*_render_height;
}
updateGL();
}
void Render_stats_opengl::translate_x(int value) {
_translated_x = (double)value/100.0*_render_width;
if(value == 0) {
_translated_x = 0;
}
else {
_translated_x = (double)(value+1)/100.0*_render_width;
}
//cout << "w :" << _render_width << endl;
updateGL();
}
......
......@@ -75,6 +75,7 @@ public:
void start_draw();
/*!
* \fn draw_text(const Element_pos x, const Element_pos y, const std::string value)
* \brief Draw the text of a container.
* \param x the x position of the text.
* \param y the y position of the text.
......@@ -83,21 +84,31 @@ public:
void draw_text(const Element_pos x, const Element_pos y, const std::string value);
/*!
* \fn draw_horizontal_line(const Element_pos x, const Element_pos y, const Element_pos size_x)
* \brief Draw a line.
* \param x the x position of the text.
* \param y the y position of the text.
* \param value the string value of the text.
* \param x the x position of the origin.
* \param y the y position of the origin.
* \param size_x the length of the line.
*/
void draw_horizontal_line(const Element_pos x, const Element_pos y, const Element_pos size_x);
/*!
* \fn draw_vertical_line(const Element_pos x, const Element_pos y, const Element_pos size_y)
* \brief Draw a line.
* \param x the x position of the text.
* \param y the y position of the text.
* \param value the string value of the text.
* \param x the x position of the origin.
* \param y the y position of the origin.
* \param size_y the length of the line.
*/
void draw_vertical_line(const Element_pos x, const Element_pos y, const Element_pos size_x);
void draw_vertical_line(const Element_pos x, const Element_pos y, const Element_pos size_y);
/*!
* \fn draw_axis(const Element_pos x, const Element_pos y, const Element_pos size_x, const Element_pos size_y)
* \brief Draw axis.
* \param x the x position of the origin.
* \param y the y position of the origin.
* \param size_x the length for the horizontal axis.
* \param size_y the length for the vertical axis.
*/
void draw_axis(const Element_pos x, const Element_pos y, const Element_pos size_x, const Element_pos size_y);
/*!
* \brief Draw a rectangle.
......@@ -111,7 +122,17 @@ public:
*/
void end_draw();
/*!
* \fn translate_y(int value)
* \brief Translate the window on the vertical axis.
* \param value the new value of the scroll bar.
*/
void translate_y(int value);
/*!
* \fn translate_x(int value)
* \brief Translate the window on the horizontal axis.
* \param value the new value of the scroll bar.
*/
void translate_x(int value);
/*!
......
......@@ -28,7 +28,6 @@ macx {
# Input
HEADERS += message/Message.hpp \
message/Errors.hpp \
Tools.hpp \
main_resource.hpp \
# Info header
info/info.hpp \
......@@ -87,6 +86,8 @@ HEADERS += message/Message.hpp \
trace/tree/BinaryTree.hpp \
trace/tree/Node.hpp \
trace/tree/Interval.hpp \
# General headers
general/Tools.hpp \
# Statistics headers
statistics/Stats_window.hpp \
statistics/Statistic.hpp \
......@@ -95,7 +96,6 @@ HEADERS += message/Message.hpp \
FORMS += interface/info_window.ui interface/main_window.ui interface/option_export_window.ui interface/stats_viewer.ui
SOURCES += message/Message.cpp \
message/Errors.cpp \
Tools.cpp \
main.cpp \
# Info code file
info/info.cpp \
......@@ -141,6 +141,8 @@ SOURCES += message/Message.cpp \
trace/values/Name.cpp \
trace/values/String.cpp \
trace/tree/Interval.cpp \
# General code files
general/Tools.cpp \
# Statistics code files
statistics/Stats_window.cpp \
statistics/Statistic.cpp
......
/*!
*\file DrawStats.hpp
*\file DrawDiagram.hpp
*/
#ifndef DRAW_DIAGRAM_HPP
......@@ -16,7 +16,7 @@
#include "DrawStats.hpp"
/*!
* \class Drawdiagramm
* \class DrawDiagram
* \brief Browse the stats and call back T drawing methods
*/
template<class T>
......@@ -40,10 +40,10 @@ public:
/*!
* \fn build(T* draw_object, Trace* trace)
* \fn build(T* draw_object, std::vector<Container *> containers_to_print)
* \brief The trace building function.
* \param draw_object the kind of object which will be drawn (OpenGL, SVG...).
* \param trace the trace data.
* \param containers_to_print the container's data
*/
virtual void build(T* draw_object, std::vector<Container *> containers_to_print) {
......@@ -55,7 +55,6 @@ public:
const int number_of_containers = this->_containers_to_print.size();
draw_object->start_draw();
draw_object->set_total_height((number_of_containers-1)*this->_size_for_one_container);
draw_object->set_total_width(draw_object->width());
for(int i = 0 ; i < number_of_containers ; i ++) {
draw_container_name(draw_object, i);
......@@ -64,6 +63,7 @@ public:
draw_legend(draw_object, i);
}
set_width(draw_object);
end_draw(draw_object);
}
......@@ -122,6 +122,11 @@ public:
pos_x += _WIDTH_HISTOGRAM_DEFAULT;
}
// We check for the width
if(pos_x > this->_max_width){
this->_max_width = pos_x;
}
delete stat_temp;
}
......@@ -158,6 +163,11 @@ public:
break;
}
}
// We check for the width
if(pos_x > this->_max_width){
this->_max_width = pos_x;
}
}
......@@ -169,7 +179,7 @@ public:
virtual double get_max_percentage(std::map<const EntityValue*, stats*> &temp_states) const {
double value;
double max_length = 0.;
for (map<const EntityValue *, stats *>::iterator it = temp_states.begin();
for (map<const EntityValue *, stats *>::const_iterator it = temp_states.begin();
it != temp_states.end();
it ++) {
if((*it).second->_total_length >= max_length) {
......@@ -182,6 +192,10 @@ public:
return value;
}
virtual void set_width(T* draw_object) {
draw_object->set_total_width(this->_max_width);
}
void set_geometrical_informations() {
this->_pos_x_container_name = _POS_X_CONTAINER_NAME;
this->_pos_y_container_name = this->_size_for_one_container - 30;
......
/*!
*\file DrawStats.hpp
*\file DrawHDiagram.hpp
*/
#ifndef DRAW_HDIAGRAM_HPP
......@@ -15,6 +15,10 @@
#include "Statistic.hpp"
#include "DrawStats.hpp"
/*!
* \class DrawHDiagram
* \brief Browse the stats and call back T drawing methods
*/
template<class T>
class DrawHDiagram : public DrawStats<T> {
protected:
......@@ -54,10 +58,10 @@ public:
/*!
* \fn build(T* draw_object, Trace* trace)
* \fn build(T* draw_object, std::vector<Container *> containers_to_print)
* \brief The trace building function.
* \param draw_object the kind of object which will be drawn (OpenGL, SVG...).
* \param trace the trace data.
* \param containers_to_print the container's data.
*/
void build(T* draw_object, std::vector<Container *> containers_to_print) {
int nbcont;
......
......@@ -32,7 +32,7 @@
* \brief The default y position for the container name.
* The origin is set at the north west.
*/
#define _POS_Y_CONTAINER_NAME _HEIGHT_FOR_ONE_CONTAINER_DEFAULT-30.0f
#define _POS_Y_CONTAINER_NAME _HEIGHT_FOR_ONE_CONTAINER_DEFAULT-10.0f
/*!
* \def _WIDTH_HISTOGRAM_DEFAULT
......@@ -114,13 +114,15 @@ public:
/*!
* \fn build(T* draw_object, Trace* trace)
* \fn build(T* draw_object, std::vector<Container *> containers_to_print)
* \brief The trace building function.
* \param draw_object the kind of object which will be drawn (OpenGL, SVG...).
* \param trace the trace data.
* \param containers_to_print the container's data.
*/
virtual void build(T* draw_object, std::vector<Container *> containers_to_print) = 0;
void set_max_width(T* draw_object);
inline void end_draw(T* draw_object) {
_previous_start_time = _start_time;
_previous_end_time = _end_time;
......@@ -159,7 +161,7 @@ public:
virtual void set_geometrical_informations() {
_pos_x_container_name = _POS_X_CONTAINER_NAME;
_pos_y_container_name = _size_for_one_container - 30;
_pos_y_container_name = _POS_Y_CONTAINER_NAME;
_percentage_height_default = (_size_for_one_container - _START_HISTOGRAM_Y_DEFAULT - 20) / 100.;
......
......@@ -2,16 +2,21 @@
#define STATISTIC_HPP
/*!
* \file Statistic.hpp
*/
class Statistic;
#include "../trace/EntityValue.hpp"
#include "../trace/Container.hpp"
/*!
* \file Statistic.hpp
* \struct stats
* \brief Structure used to keep informations used for statistics.
* It keeps the states for an EntityValue.
*/
struct stats{
double _total_length;
int _cardinal;
......@@ -19,6 +24,11 @@ struct stats{
stats(double length, int cardinal = 1) : _total_length(length), _cardinal(cardinal){}
};
/*!
* \class Statistic
* \brief Class used to keep informations used for statistics
* It keeps the states for a Container.
*/
class Statistic{
private :
map<const EntityValue*, stats*> _states;
......@@ -42,13 +52,13 @@ public :
~Statistic();
/*!
* \fn add_state(EntityValue * val, double length)
* \fn add_state(EntityValue const * val, double length)
* \brief Add a new entry to the state map
*/
void add_state(EntityValue const * val, double length);
/*!
* \fn add_link(Container * target)
* \fn add_link(const Container * target)
* \brief Add a new entry to the link map
*/
void add_link(const Container * target);
......@@ -60,7 +70,7 @@ public :
void set_nb_event(int number);
/*!
* \fn get_nb_event();
* \fn get_nb_event() const;
* \brief get the number of event
*/
int get_nb_event() const;
......
......@@ -100,20 +100,22 @@ public:
void add_child(Container *child);
/*!
* \fn set_state(Date time, StateType *type, EntityValue *value)
* \fn set_state(Date time, StateType *type, EntityValue *value, map<std::string, Value *> &opt)
* \brief Set the current state of the container
* \param time Date of the event
* \param type Type of the state
* \param value Value of the state
* \param opt Optional options of the state
*/
void set_state(Date time, StateType *type, EntityValue *value, map<std::string, Value *> &opt);
/*!
* \fn push_state(Date time, StateType *type, EntityValue *value)
* \fn push_state(Date time, StateType *type, EntityValue *value, map<std::string, Value *> &opt)
* \brief Set the current state of the container and save the previous state
* \param time Date of the event
* \param type Type of the state
* \param value Value of the state
* \param opt Optional options of the state
*/
void push_state(Date time, StateType *type, EntityValue *value, map<std::string, Value *> &opt);
......@@ -125,31 +127,34 @@ public:
void pop_state(Date time);
/*!
* \fn new_event(Date time, EventType *type, EntityValue *value)
* \fn new_event(Date time, EventType *type, EntityValue *value, map<std::string, Value *> &opt)
* \brief Add a new event
* \param time Date of the event
* \param type Type of the event
* \param value Value of the event
* \param opt Optional options of the state
*/
void new_event(Date time, EventType *type, EntityValue *value, map<std::string, Value *> &opt);
/*!
* \fn start_link(Date time, LinkType *type, Container *source, EntityValue *value, String key)
* \fn start_link(Date time, LinkType *type, Container *source, EntityValue *value, String key, map<std::string, Value *> &opt)
* \brief Start a new link identified by key
* \param time Date of the start of the link