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