Commit 4e43592e authored by Olivier Lagrasse's avatar Olivier Lagrasse

dessin de container (mode debug)

parent 8875d4be
......@@ -40,6 +40,8 @@ plugins:
@echo " "
#debugs:
#cd ./src && qmake-qt4 -project && qmake-qt4 -makefile -o Makefile "RESOURCES= vite.qrc" "OBJECTS_DIR=../debug" "CONFIG+=uitools debug console" "QT+=opengl" "DESTDIR = ../debug" src.pro && make all
#mv src/*.o bin/
......@@ -48,8 +50,8 @@ plugins:
#@echo " "
tests: build
cd ./tests && qmake-qt4 -project && qmake-qt4 -makefile -o Makefile "RESOURCES= ../src/vite.qrc" "OBJECTS_DIR=../bin" "CONFIG+=uitools" "QT+=opengl" "DESTDIR = ../bin" tests.pro && make all
tests:all
cd ./tests && qmake-qt4 -project && qmake-qt4 -makefile -o Makefile "OBJECTS_DIR=../bin" "CONFIG+=uitools debug" "QT+=opengl" "DESTDIR = ../bin" tests.pro && make all
@echo " "
@echo "Compilation completed! (test)"
@echo " "
......
......@@ -24,7 +24,7 @@ Interface_graphic::Interface_graphic(QWidget *parent):QWidget(parent){
/* Init pointer attributes */
// _parser = NULL;
//_trace = NULL;
_trace = NULL;
load_windows();
}
......@@ -34,7 +34,7 @@ Interface_graphic::Interface_graphic(char* file_path, QWidget *parent):QWidget(p
/* Init pointer attributes */
// _parser = NULL;
//_trace = NULL;
_trace = NULL;
load_windows();
......@@ -148,8 +148,8 @@ void Interface_graphic::information(const string s) const{
**********************************/
bool Interface_graphic::build(){
return _ui_render_area->build();
bool Interface_graphic::build(Trace* trace){
return _ui_render_area->build(trace);
}
......@@ -178,12 +178,13 @@ void Interface_graphic::on_open_triggered(){
/* Not Yet Implemented -> Send file path to the parser */
/*******************************************************/
if (_ui_render_area->build()==false)
error("Open file : an error occured with wait screen releasing.");
if (build(_trace)==false)
error("Open file : an error occured with wait screen releasing.");
error("Open : not yet implemented");
information(string("File opened: ")+ filename.toStdString());
/*
/*
_trace = new Trace();
_parser = new Parser();
_parser->parse(filename.toStdString(), _trace);
......
......@@ -106,7 +106,7 @@ class Interface_graphic : public QWidget, public Interface{
/*!
* \brief The data structure attribute.
*/
//Trace* _trace;
Trace* _trace;
public:
......@@ -176,9 +176,10 @@ public:
**********************************/
/*!
*\brief This function will build the trace sent by the data structure ('_trace').
* \brief This function will build the trace sent by the data structure ('_trace').
* \arg trace The trace which be displayed.
*/
bool build();
bool build(Trace* trace);
......
This diff is collapsed.
......@@ -17,7 +17,8 @@ typedef double Date;
#include "resource.hpp"
//#include "interface_graphic.hpp"
......@@ -25,7 +26,7 @@ typedef double Date;
/*!
* \brief This class redefined the OpenGL widget - QGLWidget - to display the trace.
*/
class QDESIGNER_WIDGET_EXPORT Render_area : public QGLWidget
class Render_area : public QGLWidget
{
Q_OBJECT
......@@ -48,6 +49,18 @@ class QDESIGNER_WIDGET_EXPORT Render_area : public QGLWidget
/***********************************
*
* Data structure attributes.
*
**********************************/
/*!
* \brief The data structure attribute.
*/
Trace* _trace;
/***********************************
*
......@@ -167,22 +180,22 @@ class QDESIGNER_WIDGET_EXPORT Render_area : public QGLWidget
/*!
* \brief The default height for containers.
*/
static const float DRAWING_CONTAINER_HEIGHT_DEFAULT = 20.0f;
static const float DRAWING_CONTAINER_HEIGHT_DEFAULT = 1.0f;
/*!
* \brief The default width for containers.
*/
static const float DRAWING_CONTAINER_WIDTH_DEFAULT = 50.0f;
static const float DRAWING_CONTAINER_WIDTH_DEFAULT = 2.0f;
/*!
* \brief The default horizontal space between containers.
*/
static const float DRAWING_CONTAINER_H_SPACE_DEFAULT = 2.0f;
static const float DRAWING_CONTAINER_H_SPACE_DEFAULT = 0.2f;
/*!
* \brief The default vertical space between containers.
*/
static const float DRAWING_CONTAINER_V_SPACE_DEFAULT = 5.0f;
static const float DRAWING_CONTAINER_V_SPACE_DEFAULT = 0.2f;
/*!
* \brief Geometrical informations about the trace shape.
......@@ -203,6 +216,19 @@ class QDESIGNER_WIDGET_EXPORT Render_area : public QGLWidget
*/
GLuint draw_trace();
inline Element_count number_of_children(Container* c);
inline Element_count return_last_visited_child(std::stack<Element_count> &s);
/*!
* \brief Return the pos container of the list
*/
Container* get_container(std::list <Container*> list_container, int pos) const;
/*!
* \brief Draw a container according to the parameters
* \param x the x position of the container
......@@ -252,8 +278,9 @@ class QDESIGNER_WIDGET_EXPORT Render_area : public QGLWidget
/*!
* \brief This function draws the trace.
* \arg trace the trace which be displayed.
*/
bool build();
bool build(Trace* trace);
/*!
* \brief This function releases the trace.
......
......@@ -12,4 +12,6 @@
#include "../../main_resource.hpp"
#endif
......@@ -3,7 +3,7 @@ RESOURCES= vite.qrc
SOURCES+=../../main.cpp
OBJECTS_DIR=../bin
DESTDIR=../../bin
CONFIG+=uitools
CONFIG+=uitools debug
QT+=opengl
TEMPLATE = app
DEPENDPATH += .
......
......@@ -7,10 +7,7 @@
#ifndef RESOURCE_TEST_HPP
#define RESOURCE_TEST_HPP
#include <iostream>
#include "../src/interface_console.hpp"
#include "../src/interface_graphic.hpp"
#include "../../main_resource.hpp"
#define ASSERT_SUCCESS 0
......
/*!
*\file test_window_creation.cpp
*\brief This test simply launch a window directly (without use the terminal interface). User have to close it manually.
*/
#include "resource_test.hpp"
/*!
*\brief The main function which launches the test.
*/
int main(int argc, char ** argv){
cout << "Time to display the window (expected result : immediatly)" << endl;
cout << "Position of the window inside the screen (expected result : center on X and Y)" << endl;
cout << "Size of the window (expected result : all the width, and just 600px (around) on the height)" << endl;
cout << "Icon of the window (expected result : the ViTE logo)" << endl;
cout << "Title of the window (expected result : 'ViTE')" << endl;
cout << "The application size in the computer memory (expected result : ********)";
QApplication app(argc, argv);
Interface_graphic window;
window.show();
return app.exec();
}
......@@ -5,6 +5,8 @@
#ifndef MAIN_RESOURCE_HPP
#define MAIN_RESOURCE_HPP
......@@ -12,7 +14,7 @@
#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 */
......@@ -22,6 +24,7 @@
#include <cstdlib> /* for macros EXIT_SUCCESS and EXIT_FAILURE */
#include <cmath>
#include <stack>
#include <list>
/* 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. */
......@@ -55,12 +58,27 @@ class Interface_graphic;
class Render_area;
#include "interface.hpp"
class Trace;
class Container;
#include "interface/tests/test_trace.hpp"
#include "interface/src/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;
......
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