Commit ae9ce0c7 authored by Jan Möbius's avatar Jan Möbius

Matthias:

Postprocessor manager for multiple postprocessors

refs #1736

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17520 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 14d0a11d
......@@ -563,6 +563,9 @@ Core::init() {
connect( coreWidget_->examiner_widgets_[i], SIGNAL( viewChanged() ),
coreWidget_->examiner_widgets_[i], SLOT( updateGL() ) ,Qt::DirectConnection);
// Set post processor
PostProcessorDialog::loadSavedPostProcessors(i);
// ====================================================
// Set renderer
// ====================================================
......
......@@ -631,6 +631,9 @@ public:
/// Show a dialog in which the viewMode can be changed
void slotViewChangeDialog();
/// update the content of the specified examiner
void slotUpdateExaminer(unsigned _id);
public slots :
/// Set the view Mode to the given Mode
......
......@@ -64,6 +64,9 @@ void CoreWidget::slotShowPostProcessorManager() {
postProcessorDialog_ = new PostProcessorDialog();
}
connect(postProcessorDialog_,SIGNAL(updateExaminer(unsigned)),this,SLOT(slotUpdateExaminer(unsigned)));
postProcessorDialog_->show();
}
......
......@@ -515,3 +515,8 @@ void CoreWidget::slotApplyStereoSettings(int /*_tmpParam*/) {
examiner_widgets_[i]->updateGL();
}
}
void CoreWidget::slotUpdateExaminer(unsigned _id)
{
examiner_widgets_[_id]->updateGL();
}
......@@ -41,43 +41,74 @@
\*===========================================================================*/
#include "ui_postProcessorWidget.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <vector>
#include <OpenFlipper/common/RendererInfo.hh>
#include <QDialog>
#include <QPoint>
#include <QStringList>
class QWidget;
class QFrame;
class PostProcessorInfo;
class PostProcessorDialog : public QDialog, public Ui::PostProcessorWidget
{
Q_OBJECT
signals:
/// request an update for an specified viewer
void updateExaminer(unsigned _viewer);
public:
PostProcessorDialog(QWidget *parent = 0);
PostProcessorDialog(QWidget *_parent = 0);
/// return the names of all saved post processors
static QStringList getSavedPostProcessorNames(const unsigned _examiner);
/// append all saved post processors
static void loadSavedPostProcessors(const unsigned _examiner);
private slots:
/// Show the custom context menu
void slotContextMenu(const QPoint& _point);
/// Show the custom context menu for activation
void slotContextMenuActivate(const QPoint& _point);
/// Show the custom context menu for deactivation
void slotContextMenuDeactivate(const QPoint& _point);
/// Activates the post processor (triggered via the context menu)
void slotActivatePostProcessor();
/// Deactivates the current postProcessor
void slotDeactivatePostProcessor();
/// Move the position/ordering of postprocessor in the postprocessor
void slotMovePostProcessor(unsigned _from, unsigned _to);
/// move the selected active postprocessor 1 up
void slotMoveUp();
/// move the selected active postprocessor 1 down
void slotMoveDown();
/// saves active post processor chain
void slotSaveActive();
protected:
void closeEvent(QCloseEvent *event);
void closeEvent(QCloseEvent *_event);
void showEvent ( QShowEvent * );
private:
/// initiaize the window with the post processors of the current examiner
void initWindow();
QFrame* createFrame(const PostProcessorInfo& _pPI);
void update();
/// holds the examiner id for the window
unsigned currentExaminer_;
std::vector<QLabel*> descriptions_;
QVector< QFrame* > frames_;
/// maps activeRow from activeList (same as chainIdx from RendererInfo) to row from list (same as activeId from RendererInfo) for each viewer
std::vector<unsigned> activeRowToRow_;
};
......@@ -13,8 +13,137 @@
<property name="windowTitle">
<string>post processors</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="2">
<widget class="QListWidget" name="activeList">
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::NoDragDrop</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Active Post Processors Order</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="activateButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;activate selected post processor/s and put it on the last position of the post processor chain&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>--&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="deactivateButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;deactivate selected post processor/s&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>&lt;--</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QListWidget" name="list">
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::NoDragDrop</enum>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="viewMode">
<enum>QListView::ListMode</enum>
</property>
<property name="selectionRectVisible">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QFrame" name="frame_3">
<property name="maximumSize">
<size>
......@@ -61,29 +190,80 @@
</layout>
</widget>
</item>
<item>
<widget class="QListWidget" name="list">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
<item row="2" column="3">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>10</number>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="upButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Move selected post processor/s up of the chain&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Up</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="downButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Move selected post processor/s down of the chain&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Down</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>First Active Post Processor</string>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="viewMode">
<enum>QListView::ListMode</enum>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Last Active Post Processor</string>
</property>
<property name="selectionRectVisible">
<bool>false</bool>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<item row="5" column="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
......@@ -99,9 +279,18 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<widget class="QPushButton" name="saveButton">
<property name="toolTip">
<string>save active post processor chain for the next startups</string>
</property>
<property name="statusTip">
<string>save active post processor chain for the next startups</string>
</property>
<property name="whatsThis">
<string>save active post processor chain for the next startups</string>
</property>
<property name="text">
<string>Close</string>
<string>Save Active</string>
</property>
</widget>
</item>
......@@ -120,6 +309,13 @@
</item>
</layout>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
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