Commit d22a03ba authored by schultezub's avatar schultezub
Browse files

+ Doxygen

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@205 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 540783ad
......@@ -15,7 +15,7 @@ namespace TUMVis {
}
MainWindow::~MainWindow() {
_application->s_PipelinesChanged.disconnect(this);
}
void MainWindow::setup() {
......
......@@ -9,22 +9,40 @@
#include <vector>
namespace TUMVis {
/**
* Main Window for the TUMVis application.
* Wraps a nice Qt GUI around the TumVisApplication instance given during creation.
*/
class MainWindow : public QMainWindow, public sigslot::has_slots<> {
Q_OBJECT;
public:
/**
* Creates a new TumVis Main window for \a application.
* \param application TumVisApplication to create a GUI for.
*/
MainWindow(TumVisApplication* application);
/**
* Destructor, make sure to call before destroying the application
*/
~MainWindow();
/**
* Slot to be called by the application when its collection of pipelines has changed.
*/
void onPipelinesChanged();
signals:
/// Qt signal for updating the PipelineWidget.
void updatePipelineWidget(const std::vector<AbstractPipeline*>&);
private:
/**
* Setup Qt GUI stuff
*/
void setup();
TumVisApplication* _application; ///< Pointer to the application hosting the whole stuff
......
......@@ -14,55 +14,107 @@ namespace TUMVis {
// = TreeModel items ==============================================================================
/**
* Abstract base class for TreeView items of the PipelineTreeWidget.
*/
class TreeItem {
public:
/**
* Creates a new TreeItem
* \param parent Parent item, will take ownership of this TreeItem.
*/
TreeItem(TreeItem* parent = 0);
/**
* Destuctor, also deletes all child items.
*/
virtual ~TreeItem();
/**
* Return the of this item at the column \a column.
* To be overwritten by subclasses.
* \param column Column
* \return The data of this item at \a column.
*/
virtual QVariant getData(int column) const = 0;
/**
* Returns the parent TreeItem
* \return _parent
*/
TreeItem* getParent();
/**
* Returns the \a row-th child TreeItem.
* \param row Number of the child to return.
* \return _children[row]
*/
TreeItem* getChild(int row);
/**
* Returns the row of this TreeItem.
* \return _parent._children.indexOf(this)
*/
int getRow();
/**
* Returns the number of children.
* \return _children.size();
*/
int getChildCount();
private:
TreeItem* _parent;
QList<TreeItem*> _children;
TreeItem* _parent; ///< Parent TreeItem.
QList<TreeItem*> _children; ///< Collection of all child items.
};
/**
* Specialization for root TreeItems.
*/
class RootTreeItem : public TreeItem {
public:
RootTreeItem(TreeItem* parent = 0);
virtual ~RootTreeItem();
/// \see TreeItem::getData()
virtual QVariant getData(int column) const;
};
/**
* Specialization for TreeItems hosting an AbstracPipeline.
*/
class PipelineTreeItem : public TreeItem {
public:
PipelineTreeItem(AbstractPipeline* pipeline, TreeItem* parent);
virtual ~PipelineTreeItem();
/// \see TreeItem::getData()
virtual QVariant getData(int column) const;
private:
AbstractPipeline* _pipeline;
AbstractPipeline* _pipeline; ///< Base pipeline
};
/**
* Specialization for TreeItems hosting an AbstractProcessor.
*/
class ProcessorTreeItem : public TreeItem {
public:
ProcessorTreeItem(AbstractProcessor* processor, TreeItem* parent);
virtual ~ProcessorTreeItem();
/// \see TreeItem::getData()
virtual QVariant getData(int column) const;
private:
AbstractProcessor* _processor;
AbstractProcessor* _processor; ///< Base processor
};
// = TreeModel ====================================================================================
/**
* QItemModel for displaying a list of pipelines and their processors in the PipelineTreeWidget.
*/
class PipelineTreeModel : public QAbstractItemModel {
Q_OBJECT
......@@ -87,23 +139,40 @@ namespace TUMVis {
// = Widget =======================================================================================
/**
* Qt widget for showing a list of pipelines and their processors in a QTreeView.
*/
class PipelineTreeWidget : public QTreeView {
Q_OBJECT;
public:
/**
* Creates a new PipelineTreeWidget.
* \param parent Parent widget
*/
PipelineTreeWidget(QWidget* parent = 0);
/**
* Destructor
*/
virtual ~PipelineTreeWidget();
public slots:
/**
* Updates the data in the tree view by the given collection of pipelines \a pipelines.
* \param pipelines
*/
void update(const std::vector<AbstractPipeline*>& pipelines);
private:
/**
* Sets up the widget.
*/
void setupWidget();
PipelineTreeModel* _treeModel;
PipelineTreeModel* _treeModel; ///< Data model for the TreeView.
};
......
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