Commit b83efa93 authored by Olivier Lagrasse's avatar Olivier Lagrasse
Browse files

- Debug the 'Merge trunk to unified render. (revision 867 to 896)'

parent ae2b5276
......@@ -81,7 +81,7 @@ SET(VITE_HDRS
trace/Trace.hpp
# Render headers
render/render.hpp
render/Render_area.hpp
render/Hook_event.hpp
render/Render_opengl_dl.hpp
render/Render_opengl.hpp
render/render_svg.hpp
......@@ -90,12 +90,12 @@ SET(VITE_HDRS
render/render_stats_svg.hpp
#render/vbo.hpp
# Interface headers
interface/help.hpp
interface/resource.hpp
interface/parsing_thread.hpp
interface/interface.hpp
interface/interface_console.hpp
interface/interface_graphic.hpp
interface/Interface.hpp
interface/Interface_graphic.hpp
# Core header
core/Core.hpp
# Parser headers
parser/Definition.hpp
parser/Line.hpp
......@@ -152,7 +152,7 @@ SET(VITE_SRCS
trace/Container.cpp
trace/Trace.cpp
# Render code files
render/Render_area.cpp
render/Hook_event.cpp
render/Render_opengl.cpp
render/render_svg.cpp
render/render_stats_opengl.cpp
......@@ -170,10 +170,10 @@ SET(VITE_SRCS
statistics/Statistic.cpp
statistics/Stats_window.cpp
# Interface code files
interface/help.cpp
interface/parsing_thread.cpp
interface/interface_graphic.cpp
interface/interface_console.cpp
interface/Interface_graphic.cpp
# Core code files
core/Core.cpp
# Main
main.cpp
)
......
......@@ -73,24 +73,24 @@
#include "trace/EntityValue.hpp"
#include "trace/EntityTypes.hpp"
#include "trace/Entitys.hpp"
// #include "trace/tree/Interval.hpp"
//#include "trace/tree/Interval.hpp"
#include "trace/Trace.hpp"
#include "trace/DrawTree.hpp"
#include "trace/DrawTrace.hpp"
#include "trace/Container.hpp"
/* -- */
#include "parser/File.hpp"
#include "parser/Parser.hpp"
#include "parser/ParserPaje.hpp"
#ifdef WITH_OTF
# include <otf.h>
# include "parser/ParserOTF.hpp"
#include <otf.h>
#include "parser/ParserOTF.hpp"
#endif //WITH_OTF
#include "parser/ParserVite.hpp"
/* -- */
#include "statistics/Stats_window.hpp"
/* -- */
#include "interface/resource.hpp"
//#include "interface/interface.hpp"
#include "interface/Interface_graphic.hpp"
#include "core/Core.hpp"
#include "interface/parsing_thread.hpp"
......@@ -134,7 +134,7 @@ using namespace std;
**********************************/
Core::Core(int argc, char ** argv){
bool useGUI;/* if window interface can be displayed */
QString current_path;
......@@ -302,7 +302,7 @@ bool Core::draw_trace(const string & filename, const int format){
}
}
parser.reinit_cursor();
// parser.reinit_cursor();
Error::print_numbers();
Error::flush("log.txt");
......
......@@ -58,8 +58,6 @@ class Svg;
#include "../ui_main_window.h"/* the main window graphical interface */
/* Global informations */
#include "common/info.hpp"
#include "Interface.hpp"
/*!
......
......@@ -70,9 +70,9 @@
#include "render/Render_opengl.hpp"
#include "interface/interface.hpp"
#include "interface/interface_graphic.hpp"
#include "interface/interface_console.hpp"
#include "interface/Interface.hpp"
#include "interface/Interface_graphic.hpp"
#include "core/Core.hpp"
/*!
......
#include "../interface/Interface_graphic.hpp"
/*
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
/*!
* \file command_window.cpp
*/
#include <vector>
#include <stack>
#include <QTreeWidgetItem>
#include <QProcess>
/* -- */
#include "interface/Interface_graphic.hpp"
/* -- */
#include "../core/Core.hpp"
/* -- */
#include "trace/values/Values.hpp"
#include "trace/tree/Interval.hpp"
#include "trace/tree/Node.hpp"
#include "trace/tree/BinaryTree.hpp"
#include "trace/EntityValue.hpp"
#include "trace/EntityTypes.hpp"
#include "trace/Entitys.hpp"
// #include "trace/tree/Interval.hpp"
#include "trace/Trace.hpp"
/* -- */
#include "Command_window.hpp"
using namespace std;
Command_window::Command_window( QWidget *parent, Interface_graphic * i) : QMainWindow(parent){
setupUi(this);
......
/*
** This file is part of the ViTE project.
**
** This software is governed by the CeCILL-A license under French law
** and abiding by the rules of distribution of free software. You can
** use, modify and/or redistribute the software under the terms of the
** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following
** URL: "http://www.cecill.info".
**
** As a counterpart to the access to the source code and rights to copy,
** modify and redistribute granted by the license, users are provided
** only with a limited warranty and the software's author, the holder of
** the economic rights, and the successive licensors have only limited
** liability.
**
** In this respect, the user's attention is drawn to the risks associated
** with loading, using, modifying and/or developing or reproducing the
** software by the user in light of its specific status of free software,
** that may mean that it is complicated to manipulate, and that also
** therefore means that it is reserved for developers and experienced
** professionals having in-depth computer knowledge. Users are therefore
** encouraged to load and test the software's suitability as regards
** their requirements in conditions enabling the security of their
** systems and/or data to be ensured and, more generally, to use and
** operate it in the same conditions as regards security.
**
** The fact that you are presently reading this means that you have had
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
** - JAZEIX Johnny
** - LAGRASSE Olivier
** - MARCOUEILLE Jule
** - NOISETTE Pascal
** - REDONDY Arthur
** - VUCHENER Clément
**
*/
/*!
* \file command_window.hpp
*/
......@@ -7,14 +49,18 @@
class Command_window;
#include "../ui_global_cmd.h"
#include "../core/Core.hpp"
#include "../trace/Trace.hpp"
#include "ui_global_cmd.h"
/*!
* \brief Class that is used to execute an exterior command on the trace
*/
class Interface_graphic;
class Container;
class Trace;
class QTreeWidgetItem;
class QProcess;
class Command_window : public QMainWindow, protected Ui::Execution{
Q_OBJECT
......
......@@ -141,7 +141,7 @@ HEADERS += common/common.hpp \
statistics/DrawVDiagram.hpp \
statistics/DrawHDiagram.hpp \
statistics/DrawCounter.hpp \
# plugin header
# Plugin header
plugin/Command_window.hpp
......@@ -199,8 +199,13 @@ SOURCES += common/Message.cpp \
# interface/help.cpp \
interface/parsing_thread.cpp \
interface/interface_graphic.cpp \
# Core file
# Core code file
core/Core.cpp \
# Plugin code file
plugin/Command_window.cpp \
# Main code file
main.cpp
RESOURCES += interface/vite.qrc
......@@ -54,7 +54,7 @@ class Render_stats_opengl;
class Stats_window;
#include <QGLWidget>
//#include <QGLWidget>
#include "ui_stats_viewer.h"
......
......@@ -48,6 +48,15 @@
#ifndef DRAW_TRACE_HPP
#define DRAW_TRACE_HPP
#include <string>
//#include "resource.hpp"
//#include "../render/render_opengl.hpp"
#include "common/Message.hpp"
#include "DrawTree.hpp"
/*
* Theses constants can not be put as static const float because it is a template and there binary representation is not normed by the C++ langage.
*/
......@@ -197,7 +206,7 @@ public:
if(container == NULL ||
container->empty()){
container = new vector<const Container *>();
container = new std::vector<const Container *>();
trace->set_interval_constrained(new Interval(0,trace->get_max_date()));
trace->set_filter(0);
......@@ -214,7 +223,7 @@ public:
//Adding the parent containers if not added yet
else{
bool ended = false;
vector<const Container *> store;
std::vector<const Container *> store;
store.clear();
while (!ended){
ended = true;
......@@ -426,27 +435,36 @@ public:
// Browse variables
variable_map = container->get_variables();
for (std::map<VariableType *, Variable *>::const_iterator i = variable_map->begin();
i != variable_map->end();
i++) {
var = (*i).second;
double min = var->get_min().get_value();
double max = var->get_max().get_value();
variable_values = var->get_values();
draw_variable_value(draw_object, 0.0, 0.0, position);
for (std::list<std::pair<Date, Double> >::const_iterator value = variable_values->begin();
value != variable_values->end();
value++) {
/* Call the object state drawing function */
draw_variable_value(draw_object, (*value).first.get_value(), ((*value).second.get_value()-min)/(max-min), position);
}
draw_variable_value(draw_object, 0.0, 0.0, position);
position++; // One line was used
}/* end for */
}
for (std::map<VariableType *, Variable *>::const_iterator i = variable_map->begin();
i != variable_map->end();
i++) {
var = (*i).second;
double min = var->get_min().get_value();
double max = var->get_max().get_value();
variable_values = var->get_values();
double first_value = 0.;
double second_value = 0.;
draw_variable_value(draw_object, 0.0, 0.0, position);
for (std::list<std::pair<Date, Double> >::const_iterator value = variable_values->begin();
value != variable_values->end();
value++) {
/* Call the object state drawing function.
We pass the first value if correspond to the beginning */
first_value = (*value).first.get_value();
second_value =((*value).second.get_value()-min)/(max-min) ;
if(!(first_value == 0. && second_value == 0.)) {
draw_variable_value(draw_object, first_value, second_value, position);
}
}
draw_variable_value(draw_object, 0.0, 0.0, position);
position++; // One line was used
}/* end for */
}
}//end for
draw_object->end_draw_counter();
}
......@@ -788,7 +806,7 @@ public:
void add( vector<const Container *>* container,std::stack<Container *> *containers){
void add( std::vector<const Container *>* container,std::stack<Container *> *containers){
while (!containers->empty()) {
......
......@@ -47,6 +47,11 @@
#ifndef DRAWTREE_HPP
#define DRAWTREE_HPP
/*#include "tree/BinaryTree.hpp"
#include "Event.hpp"
#include <iostream>
*/
/*!
* \class DrawTree
* \brief Class called to draw a binary tree of type E using a D painting object
......@@ -55,6 +60,7 @@ class Interval;
template <typename E> class Node;
template <typename E> class BinaryTree;
template<class D, class E>
class DrawTree {
private:
......@@ -172,28 +178,67 @@ struct DrawNode<D, Event> {
*/
template<class D>
struct DrawNode<D, StateChange> {
static void draw_node(DrawTree<D, StateChange> *draw, Node<StateChange> *node, bool& b, const Interval * interval) {
// Part to display the first state
static void draw_node(DrawTree<D, StateChange> *draw, Node<StateChange> *node) {
if (!node->get_element()->get_right_state())
return;
std::map<std::string, Value *>::const_iterator field;
const State *state = node->get_element()->get_right_state();
const std::map<std::string, Value *> *extra_fields;
const Color *color;
extra_fields = state->get_value()->get_extra_fields();
// Search the color
if (state->get_value() &&
!state->get_value()->get_extra_fields()->empty() &&
((field = state->get_value()->get_extra_fields()->find(std::string("Color"))) != extra_fields->end())) {
/* Call the object state drawing function with the state color */
color = (const Color *)(*field).second;
draw->draw_state(state->get_start_time().get_value(), state->get_end_time().get_value(),
color->get_red(), color->get_green(), color->get_blue());
}
else {
/* Call the object state drawing function with default color */
draw->draw_state( state->get_start_time().get_value(), state->get_end_time().get_value(), 0.7, 0.7, 0.75);
}
if(!b){
b = true;
// Node<StateChange> n = *node;
// n.get_element()->get_left_state()->set_left_state(interval->_left);
if(/*node &
node->get_element() &*/
node->get_element()->get_left_state()){
std::map<std::string, Value *>::const_iterator field;
const State *state = node->get_element()->get_left_state();
const std::map<std::string, Value *> *extra_fields;
const Color *color;
extra_fields = state->get_value()->get_extra_fields();
// Search the color
if (state->get_value() &&
!state->get_value()->get_extra_fields()->empty() &&
((field = state->get_value()->get_extra_fields()->find(std::string("Color"))) != extra_fields->end())) {
/* Call the object state drawing function with the state color */
color = (const Color *)(*field).second;
draw->draw_state(interval->_left.get_value(), state->get_end_time().get_value(),
color->get_red(), color->get_green(), color->get_blue());
}
else {
/* Call the object state drawing function with default color */
draw->draw_state( state->get_start_time().get_value(), state->get_end_time().get_value(), 0.7, 0.7, 0.75);
}
}
}
if (!node->get_element()->get_right_state())
return;
std::map<std::string, Value *>::const_iterator field;
const State *state = node->get_element()->get_right_state();
const std::map<std::string, Value *> *extra_fields;
const Color *color;
extra_fields = state->get_value()->get_extra_fields();
// Max is made to not display farther than the interval
double max;
if(state->get_end_time().get_value() > interval->_right.get_value())
max = interval->_right.get_value();
else
max = state->get_end_time().get_value();
// Search the color
if (state->get_value() &&
!state->get_value()->get_extra_fields()->empty() &&
((field = state->get_value()->get_extra_fields()->find(std::string("Color"))) != extra_fields->end())) {
/* Call the object state drawing function with the state color */
color = (const Color *)(*field).second;
draw->draw_state(state->get_start_time().get_value(), max,
color->get_red(), color->get_green(), color->get_blue());
}
else {
/* Call the object state drawing function with default color */
draw->draw_state( state->get_start_time().get_value(), max, 0.7, 0.7, 0.75);
}
}
};
......
......@@ -426,3 +426,26 @@ Date Trace::get_max_date(){
return _max_date;
}
void Trace::set_selected_container(std::vector<const Container *> * c) {
_selected_container = c;
}
void Trace::set_interval_constrained(Interval * i) {
_interval_constrained = i;
}
vector<const Container *>* Trace::get_selected_container() {
return _selected_container;
}
Interval *Trace::get_interval_constrained() {
return _interval_constrained;
}
void Trace::set_filter(double f) {
_filter = f;
}
double Trace::get_filter() {
return _filter;
}
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