Commit cba8c94c authored by Olivier Lagrasse's avatar Olivier Lagrasse

amelioration algorithme de dessin de la trace

parent 9d151304
......@@ -7,6 +7,9 @@
#ifndef INTERFACE_HPP
#define INTERFACE_HPP
class Interface;
#include "resource.hpp"
......@@ -23,20 +26,20 @@ class Interface{
* \arg string : the string to be displayed.
* \brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialog box for the Interface_graphic. Then, it killed the application.
*/
virtual void error(const string) const =0;
virtual void error(const std::string) const =0;
;
/*!
\arg string : the string to be displayed.
\brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialog box for the Interface_graphic. Then the program go on, but with an indeterminated behaviour.
*/
virtual void warning(const string) const =0;
virtual void warning(const std::string) const =0;
/*!
\arg string : the string to be displayed.
\brief The function takes a string then displayed it either on the terminal if there is an Interface_console instance, or on a dialog box for the Interface_graphic. Then the program go on normally.
*/
virtual void information(const string) const =0;
virtual void information(const std::string) const =0;
};
......
......@@ -6,7 +6,7 @@
#include "interface_console.hpp"
using namespace std;
/***********************************
......
......@@ -6,8 +6,10 @@
#define INTERFACE_CONSOLE_HPP
#include "interface.hpp"
#include "interface_graphic.hpp"
class Interface_console;
#include "resource.hpp"
......@@ -133,21 +135,21 @@ protected:
\arg string : the string to be displayed.
\brief The function takes a string then displayed it into the terminal, then killed the application.
*/
void error(const string) const;
void error(const std::string) const;
/*!
\arg string : the string to be displayed.
\brief The function takes a string then displayed it into the terminal, then the program go on with an indeterminated behaviour.
*/
void warning(const string) const;
void warning(const std::string) const;
/*!
\arg string : the string to be displayed.
\brief The function takes a strings then displayed it into the terminal, then the program go on.
*/
void information(const string) const;
void information(const std::string) const;
};
......
......@@ -6,6 +6,7 @@
#include "interface_graphic.hpp"
using namespace std;
/***********************************
......@@ -37,7 +38,7 @@ Interface_graphic::Interface_graphic(char* file_path, QWidget *parent):QWidget(p
load_windows();
information(string("File opened: ")+ string(file_path));
information(string("File opened: ") + string(file_path));
}
......
......@@ -8,9 +8,8 @@
class Interface_graphic;
#include "interface.hpp"
#include "render_area.hpp"
#include "resource.hpp"
/*!
......@@ -109,11 +108,6 @@ class Interface_graphic : public QWidget, public Interface{
*/
//Trace* _trace;
/*!
* \brief The container lists.
*/
// list<Container *> _list_container;
public:
......@@ -156,21 +150,21 @@ public:
* \arg string : the string to be displayed.
*\brief The function takes strings and/or numbers then displayed an info box containing it, then the application will be killed.
*/
void error(const string) const;
void error(const std::string) const;
/*!
*\arg string : the string to be displayed.
*\brief The function takes strings and/or numbers then displayed an info box containing it, then the program go on with an indeterminated behaviour.
*/
void warning(const string) const;
void warning(const std::string) const;
/*!
*\arg string : the string to be displayed.
*\brief The function takes strings and/or numbers then displayed an info box containing it, then the program go on.
*/
void information(const string) const;
void information(const std::string) const;
......
......@@ -2,9 +2,12 @@
*\file render_area.cpp
*/
#include "render_area.hpp"
using namespace std;
/***********************************
*
......@@ -22,7 +25,7 @@ Render_area::Render_area(QWidget *parent)
_parent = (Interface_graphic*)parent;
if (_parent==NULL){
cerr << "The render area parent must be passed by arguments.";
std::cerr << "The render area parent must be passed by arguments.";
exit(EXIT_FAILURE);
}
......@@ -128,7 +131,7 @@ void Render_area::paintGL()
GLenum glerror;
glerror = glGetError();
if( glerror != GL_NO_ERROR)
_parent->warning(string("Render area : the following OpengGL error occured: ") + string((char *)gluErrorString(glerror)));
_parent->warning(std::string("Render area : the following OpengGL error occured: ") + std::string((char *)gluErrorString(glerror)));
}
......@@ -308,7 +311,7 @@ GLuint Render_area::draw_wait()
GLuint Render_area::draw_trace()
GLuint Render_area::draw_trace()//Trace trace)
{
GLuint object;
......@@ -329,21 +332,33 @@ GLuint Render_area::draw_trace()
* if a container has more than one child, it will be draw
* vertically, else horizontally.
*/
/*
long container_size;
long pos_x = 0;
long pos_y = 0;
/* size_type container_size;
list<Container *> * container_list;
container_list = _trace->get_root_containers();
container_size = container_list.size();
while ( ){
for (size_type i=0;i<container_size;i++){
container_list = get_children();
if (container_list->get_type()
EntityList* _trace_state;
list<Container *> * _trace_container;
list<Container *>::iterator it;
trace_container = _trace->get_root_containers();
*/
/* If the current container has at least one child */
/* while ( trace_container->get_children().empty()!= false) {
for ( it=trace_container->begin() ; it != trace_container->end(); it++ ){
trace_container->get_children();
}
}*/
for (trace_state = trace_container->get_states() ; trace_state->has_next()==true ; trace_state->next()) {
Entity* nn = trace_state->get_current_entity();
}
}
*/
draw_container(1, "AZZ");
draw_container(2, "B");
......@@ -360,7 +375,7 @@ GLuint Render_area::draw_trace()
void Render_area::draw_container(const Level level, const string &name) const{
void Render_area::draw_container(const Level level, const std::string &name) const{
glBegin(GL_QUADS);/* create a quads */
......
......@@ -15,9 +15,8 @@ typedef double Date;
#include "resource.hpp"
#include "interface_graphic.hpp"
//#include "interface_graphic.hpp"
#include <QtDesigner/QDesignerExportWidget>/* For the render area plugin */
......@@ -205,7 +204,7 @@ class QDESIGNER_WIDGET_EXPORT Render_area : public QGLWidget
* \param level the vertical position of the container.
* \param name the name of the container.
*/
void draw_container(const Level level, const string &name) const;
void draw_container(const Level level, const std::string &name) const;
/*!
* \brief Draw a state of the trace.
......
......@@ -8,44 +8,8 @@
#ifndef RESOURCE_HPP
#define RESOURCE_HPP
#include <QApplication>
#include <QtGui>/* for all of the Qt's Widgets */
#include <QtUiTools>/* for the run-time loading .ui file */
#include <QGLWidget>/* for the OpenGL Widget */
#include <iostream>/* to use the C standard library input output functions */
#include <sstream>/* to use the C standard library streams for displayed messages composed by string and numbers */
#include <string>
#include <cstdlib> /* for macros EXIT_SUCCESS and EXIT_FAILURE */
#include <cmath>
using namespace std;
/* These paths corresponding to the path in the resource file ('vite.qrc' in the 'bin' folder) */
#define UI_MAIN_WINDOW_NAME ":/window/main_window.ui"/* The main window ui file. */
#define UI_INFO_WINDOW_NAME ":/window/info_window.ui"/* The info window ui file. */
/* Now, two checkers are defined (the first for integer return value, the other
for pointer return value). Their body can be empty to enhance program speed.
To pass multi arguments for m, use "<<" between each arguments.
*/
#define CKF(f, m) if((f)==-1) { \
cerr << "File " << __FILE__ <<" - line : " << __LINE__ <<endl; \
cerr << m <<endl; \
exit(EXIT_FAILURE); \
}
#define CKFP(f, m) if((f)==NULL) { \
cerr << "File " << __FILE__ <<" - line : " << __LINE__ <<endl; \
cerr << m <<endl; \
exit(EXIT_FAILURE); \
}
#include "../../main_resource.hpp"
#endif
......@@ -8,7 +8,7 @@
* \brief The main launcher.
*/
#include "interface_console.hpp"
#include "main_resource.hpp"
/*!
*\brief The main function of ViTE.
......
/*!
*\file resource.hpp
*\brief This file gives some common header files for the interface classes.
*/
#ifndef MAIN_RESOURCE_HPP
#define MAIN_RESOURCE_HPP
#include <QApplication>
#include <QtGui>/* for all of the Qt's Widgets */
#include <QtUiTools>/* for the run-time loading .ui file */
#include <QGLWidget>/* for the OpenGL Widget */
#include <QtDesigner/QDesignerExportWidget>/* For the render area plugin */
#include <iostream>/* to use the C standard library input output functions */
#include <sstream>/* to use the C standard library streams for displayed messages composed by string and numbers */
#include <string>
#include <cstdlib> /* for macros EXIT_SUCCESS and EXIT_FAILURE */
#include <cmath>
/* These paths corresponding to the path in the resource file ('vite.qrc' in the 'bin' folder) */
#define UI_MAIN_WINDOW_NAME ":/window/main_window.ui"/* The main window ui file. */
#define UI_INFO_WINDOW_NAME ":/window/info_window.ui"/* The info window ui file. */
/* Now, two checkers are defined (the first for integer return value, the other
for pointer return value). Their body can be empty to enhance program speed.
To pass multi arguments for m, use "<<" between each arguments.
*/
#define CKF(f, m) if((f)==-1) { \
cerr << "File " << __FILE__ <<" - line : " << __LINE__ <<endl; \
cerr << m <<endl; \
exit(EXIT_FAILURE); \
}
#define CKFP(f, m) if((f)==NULL) { \
cerr << "File " << __FILE__ <<" - line : " << __LINE__ <<endl; \
cerr << m <<endl; \
exit(EXIT_FAILURE); \
}
/* Interface classes and headers */
class Interface;
class Interface_console;
class Interface_graphic;
class Render_area;
#include "interface.hpp"
#include "interface/src/interface_console.hpp"
#include "interface/src/interface_graphic.hpp"
#include "interface/src/render_area.hpp"
/* Trace (data structure) classes and headers */
/*class Trace;
class Container;
#include "trace/src/Trace.hpp"
#include "trace/src/Container.hpp"
*/
#endif
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