Skip to content

Commit

Permalink
Code using Google code style.
Browse files Browse the repository at this point in the history
Animation delay added.
Bug fixes.
  • Loading branch information
sysfal committed Feb 3, 2012
1 parent 1d34bd7 commit b9314e1
Show file tree
Hide file tree
Showing 61 changed files with 3,478 additions and 2,514 deletions.
22 changes: 11 additions & 11 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ PERL_PATH = /usr/bin/perl
# this option also works with HAVE_DOT disabled, but it is recommended to
# install and use dot, since it yields more powerful graphs.

CLASS_DIAGRAMS = YES
CLASS_DIAGRAMS = NO

# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see
Expand Down Expand Up @@ -1578,25 +1578,25 @@ DOT_FONTPATH =
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.

CLASS_GRAPH = YES
CLASS_GRAPH = NO

# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.

COLLABORATION_GRAPH = YES
COLLABORATION_GRAPH = NO

# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for groups, showing the direct groups dependencies

GROUP_GRAPHS = YES
GROUP_GRAPHS = NO

# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.

UML_LOOK = YES
UML_LOOK = NO

# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
Expand All @@ -1608,42 +1608,42 @@ TEMPLATE_RELATIONS = NO
# file showing the direct and indirect include dependencies of the file with
# other documented files.

INCLUDE_GRAPH = YES
INCLUDE_GRAPH = NO

# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.

INCLUDED_BY_GRAPH = YES
INCLUDED_BY_GRAPH = NO

# If the CALL_GRAPH and HAVE_DOT options are set to YES then
# doxygen will generate a call dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable call graphs
# for selected functions only using the \callgraph command.

CALL_GRAPH = YES
CALL_GRAPH = NO

# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
# doxygen will generate a caller dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable caller
# graphs for selected functions only using the \callergraph command.

CALLER_GRAPH = YES
CALLER_GRAPH = NO

# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will generate a graphical hierarchy of all classes instead of a textual one.

GRAPHICAL_HIERARCHY = YES
GRAPHICAL_HIERARCHY = NO

# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.

DIRECTORY_GRAPH = YES
DIRECTORY_GRAPH = NO

# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are svg, png, jpg, or gif.
Expand Down
28 changes: 27 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FLAME Visualiser

*** LINUX ***

To compile you will need Qt4.
The package for Ubuntu is called: libqt4-dev

Expand All @@ -10,4 +12,28 @@ To compile type:

To run:

./flame_visualiser
./flame_visualiser

*** MAC OSX ***

To compile you will need Qt4.
Download from the Qt web site.
Normally qmake creates xcode projects on mac.
To stop this use the -spec flag below.

To compile type:

qmake -spec macx-g++ flame_visualiser.pro
make

To run:

open flame_editor.app

If you have any problems try using Qt Creator.

*** WINDOWS ***

To compile you will need Qt4.
Download from the Qt web site.
Use Qt Creator to open the project flame_visualiser.pro and compile.
21 changes: 13 additions & 8 deletions agent.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#ifndef AGENT_H
#define AGENT_H
/*!
* \file agent.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for agent
*/
#ifndef AGENT_H_
#define AGENT_H_

#include <QStringList>

class Agent
{
public:
Agent()
{
class Agent {
public:
Agent() {
agentType = "";
x = 0.0;
y = 0.0;
Expand All @@ -34,4 +39,4 @@ class Agent
bool isPicked;
};

#endif // AGENT_H
#endif // AGENT_H_
30 changes: 17 additions & 13 deletions agentdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#include "agentdialog.h"
#include "ui_agentdialog.h"
/*!
* \file agentdialog.cpp
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Implementation of agent dialog
*/
#include "./agentdialog.h"
#include "./ui_agentdialog.h"

AgentDialog::AgentDialog(Agent * a, QWidget *parent) :
QDialog(parent),
ui(new Ui::AgentDialog)
{
AgentDialog::AgentDialog(Agent * a, QWidget *parent)
: QDialog(parent), ui(new Ui::AgentDialog) {
ui->setupUi(this);
agent = a;

Expand All @@ -19,11 +24,11 @@ AgentDialog::AgentDialog(Agent * a, QWidget *parent) :
ui->tableWidget_Variables->verticalHeader()->hide();
QHeaderView *headerView = ui->tableWidget_Variables->horizontalHeader();
headerView->setResizeMode(QHeaderView::Stretch);
//headerView->setResizeMode(1, QHeaderView::Interactive);
//ui->tableWidget_Variables->setSelectionBehavior(QAbstractItemView::SelectRows);
// headerView->setResizeMode(1, QHeaderView::Interactive);
// ui->tableWidget_Variables->setSelectionBehavior(
// QAbstractItemView::SelectRows);

for(int i = 0; i < a->tags.size(); i++)
{
for (int i = 0; i < a->tags.size(); i++) {
int row = i;
int column = 0;
QTableWidgetItem *newItem = new QTableWidgetItem(a->tags[i]);
Expand All @@ -35,12 +40,11 @@ AgentDialog::AgentDialog(Agent * a, QWidget *parent) :
ui->tableWidget_Variables->setItem(row, column, newItem);
}

//resize(ui->tableWidget_Variables->size());
// resize(ui->tableWidget_Variables->size());

connect(ui->pushButton_Okay, SIGNAL(clicked()), this, SLOT(close()));
}

AgentDialog::~AgentDialog()
{
AgentDialog::~AgentDialog() {
delete ui;
}
22 changes: 14 additions & 8 deletions agentdialog.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
#ifndef AGENTDIALOG_H
#define AGENTDIALOG_H
/*!
* \file agentdialog.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for agent dialog
*/
#ifndef AGENTDIALOG_H_
#define AGENTDIALOG_H_

#include <QDialog>
#include "agent.h"
#include "./agent.h"

namespace Ui {
class AgentDialog;
}

class AgentDialog : public QDialog
{
class AgentDialog : public QDialog {
Q_OBJECT

public:
public:
explicit AgentDialog(Agent * a, QWidget *parent = 0);
~AgentDialog();

private:
private:
Ui::AgentDialog *ui;
Agent * agent;
};

#endif // AGENTDIALOG_H
#endif // AGENTDIALOG_H_
24 changes: 17 additions & 7 deletions agenttype.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
#ifndef AGENTTYPE_H
#define AGENTTYPE_H
/*!
* \file agenttype.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for agent type
*/
#ifndef AGENTTYPE_H_
#define AGENTTYPE_H_

#include <QString>
#include <QList>

class AgentType
{
public:
class AgentType {
public:
AgentType() { agent = true; }
AgentType(QString n) { name = n; agent = true; isEnvironment = false; }
explicit AgentType(QString n) {
name = n;
agent = true;
isEnvironment = false;
}

QString name;
QList<QString> variables;
bool agent;
bool isEnvironment;
};

#endif // AGENTTYPE_H
#endif // AGENTTYPE_H_
39 changes: 20 additions & 19 deletions agenttypedelegate.cpp
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
#include "agenttypedelegate.h"
/*!
* \file agenttypedelegate.cpp
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Implementation of agent type delegate
*/
#include <QComboBox>
#include <QDebug>
#include "./agenttypedelegate.h"

AgentTypeDelegate::AgentTypeDelegate(QList<AgentType> * ats, QObject * parent)
: QItemDelegate(parent)
{
: QItemDelegate(parent) {
agentTypes = ats;
}

QWidget *AgentTypeDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &/*option*/,
const QModelIndex &/*index*/) const
{
const QModelIndex &/*index*/) const {
QComboBox *editor = new QComboBox(parent);
for(int i = 0; i < agentTypes->count(); i++)
{
for (int i = 0; i < agentTypes->count(); i++) {
editor->insertItem(i, agentTypes->at(i).name);
//qDebug() << "AgentTypeDelegate::createEditor " << agentTypes->at(i).name;
// qDebug() << "AgentTypeDelegate::createEditor "
// << agentTypes->at(i).name;
}
//editor->insertItem(agentTypes->count(), "add...");
// editor->insertItem(agentTypes->count(), "add...");
return editor;
}

void AgentTypeDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const
{
const QModelIndex &index) const {
QString value = index.data().toString();

QComboBox *comboBox = static_cast<QComboBox*>(editor);
for(int i = 0; i < comboBox->count(); i++)
{
if(comboBox->itemText(i) == value)
for (int i = 0; i < comboBox->count(); i++) {
if (comboBox->itemText(i) == value)
comboBox->setCurrentIndex(i);
}
}

void AgentTypeDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const
{
void AgentTypeDelegate::setModelData(QWidget *editor,
QAbstractItemModel *model, const QModelIndex &index) const {
QComboBox *comboBox = static_cast<QComboBox*>(editor);
QString value = comboBox->currentText();

model->setData(index, value, Qt::EditRole);
}

void AgentTypeDelegate::updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &/*index*/) const
{
const QStyleOptionViewItem &option, const QModelIndex &/*index*/) const {
editor->setGeometry(option.rect);
}
Loading

0 comments on commit b9314e1

Please sign in to comment.