postProcessorWidget.hh 5.69 KB
Newer Older
1
2
3
/*===========================================================================*\
*                                                                            *
*                              OpenFlipper                                   *
Martin Schultz's avatar
Martin Schultz committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 *           Copyright (c) 2001-2015, RWTH-Aachen University                 *
 *           Department of Computer Graphics and Multimedia                  *
 *                          All rights reserved.                             *
 *                            www.openflipper.org                            *
 *                                                                           *
 *---------------------------------------------------------------------------*
 * This file is part of OpenFlipper.                                         *
 *---------------------------------------------------------------------------*
 *                                                                           *
 * Redistribution and use in source and binary forms, with or without        *
 * modification, are permitted provided that the following conditions        *
 * are met:                                                                  *
 *                                                                           *
 * 1. Redistributions of source code must retain the above copyright notice, *
 *    this list of conditions and the following disclaimer.                  *
 *                                                                           *
 * 2. Redistributions in binary form must reproduce the above copyright      *
 *    notice, this list of conditions and the following disclaimer in the    *
 *    documentation and/or other materials provided with the distribution.   *
 *                                                                           *
 * 3. Neither the name of the copyright holder nor the names of its          *
 *    contributors may be used to endorse or promote products derived from   *
 *    this software without specific prior written permission.               *
 *                                                                           *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS       *
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A           *
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  *
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,       *
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR        *
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    *
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING      *
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS        *
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              *
39
40
41
42
43
44
45
46
47
48
49
50
*                                                                            *
\*===========================================================================*/

/*===========================================================================*\
*                                                                            *
*   $Revision: 15910 $                                                       *
*   $LastChangedBy: moeller $                                                *
*   $Date: 2012-12-05 12:53:39 +0100 (Mi, 05 Dez 2012) $                     *
*                                                                            *
\*===========================================================================*/

#include "ui_postProcessorWidget.hh"
Matthias Möller's avatar
Matthias Möller committed
51

Jan Möbius's avatar
Jan Möbius committed
52
#include <vector>
53

Jan Möbius's avatar
Jan Möbius committed
54
55
56
57
58
59
#include <QDialog>
#include <QPoint>
#include <QStringList>
class QWidget;
class QFrame;
class PostProcessorInfo;
60
61
62
63
64

class PostProcessorDialog : public QDialog, public Ui::PostProcessorWidget
{
  Q_OBJECT

Jan Möbius's avatar
Jan Möbius committed
65
66
67
68
  signals:
    /// request an update for an specified viewer
    void updateExaminer(unsigned _viewer);

69
  public:
Jan Möbius's avatar
Jan Möbius committed
70
    explicit PostProcessorDialog(QWidget *_parent = 0);
71

Jan Möbius's avatar
Jan Möbius committed
72
73
    /// return the names of all saved post processors
    static QStringList getSavedPostProcessorNames(const unsigned _examiner);
74

Jan Möbius's avatar
Jan Möbius committed
75
76
    /// append all saved post processors
    static void loadSavedPostProcessors(const unsigned _examiner);
77

78
79
80
81
  public slots:
    /// refreshes the content of the dialog with current examiner
    void refresh();

82
  private slots:
Jan Möbius's avatar
Jan Möbius committed
83
84
85
86
87
    /// Show the custom context menu for activation
    void slotContextMenuActivate(const QPoint& _point);

    /// Show the custom context menu for deactivation
    void slotContextMenuDeactivate(const QPoint& _point);
88
89
90
91

    /// Activates the post processor (triggered via the context menu)
    void slotActivatePostProcessor();

Jan Möbius's avatar
Jan Möbius committed
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
    /// 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();

107
  protected:
Jan Möbius's avatar
Jan Möbius committed
108
    void closeEvent(QCloseEvent *_event);
109
110
111
112

    void showEvent ( QShowEvent * );

  private:
Jan Möbius's avatar
Jan Möbius committed
113
114
115
116
    /// initiaize the window with the post processors of the current examiner
    void initWindow();

    QFrame* createFrame(const PostProcessorInfo& _pPI);
117

Jan Möbius's avatar
Jan Möbius committed
118
119
    /// holds the examiner id for the window
    unsigned currentExaminer_;
120

Jan Möbius's avatar
Jan Möbius committed
121
122
    /// 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_;
123
124
125

};