~ubuntu-branches/ubuntu/raring/openwalnut/raring

« back to all changes in this revision

Viewing changes to src/qt4gui/WQtGLDockWidget.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Eichelbaum
  • Date: 2012-12-12 11:26:32 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20121212112632-xhiuwkxuz5h0idkh
Tags: 1.3.1+hg5849-1
* Minor changes compared to 1.3.0 but included several bug fixes.
* See http://www.openwalnut.org/versions/4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//---------------------------------------------------------------------------
 
2
//
 
3
// Project: OpenWalnut ( http://www.openwalnut.org )
 
4
//
 
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
 
6
// For more information see http://www.openwalnut.org/copying
 
7
//
 
8
// This file is part of OpenWalnut.
 
9
//
 
10
// OpenWalnut is free software: you can redistribute it and/or modify
 
11
// it under the terms of the GNU Lesser General Public License as published by
 
12
// the Free Software Foundation, either version 3 of the License, or
 
13
// (at your option) any later version.
 
14
//
 
15
// OpenWalnut is distributed in the hope that it will be useful,
 
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
// GNU Lesser General Public License for more details.
 
19
//
 
20
// You should have received a copy of the GNU Lesser General Public License
 
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
 
22
//
 
23
//---------------------------------------------------------------------------
 
24
 
 
25
#ifndef WQTGLDOCKWIDGET_H
 
26
#define WQTGLDOCKWIDGET_H
 
27
 
 
28
#include <QtGui/QDockWidget>
 
29
#include <QtGui/QVBoxLayout>
 
30
 
 
31
#include "core/graphicsEngine/WGECamera.h"
 
32
 
 
33
#include "WQtGLWidget.h"
 
34
 
 
35
/**
 
36
 * Dock widget containing only a GLWidget.
 
37
 */
 
38
class WQtGLDockWidget : public QDockWidget
 
39
{
 
40
    Q_OBJECT
 
41
 
 
42
public:
 
43
    /**
 
44
     * default constructor
 
45
     *
 
46
     * \param viewTitle Title will be used as view title
 
47
     * \param dockTitle The title of the dock widget.
 
48
     * \param parent The widget that manages this widget
 
49
     * \param projectionMode The projection mode used in the GL widget.
 
50
     * \param shareWidget this widget will share OpenGL display lists and texture objects with shareWidget
 
51
     */
 
52
    WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget* parent, WGECamera::ProjectionMode projectionMode = WGECamera::ORTHOGRAPHIC,
 
53
                                                                            const QWidget* shareWidget = 0 );
 
54
 
 
55
    /**
 
56
     * destructor.
 
57
     */
 
58
    virtual ~WQtGLDockWidget();
 
59
 
 
60
    /**
 
61
     * Gets the contained GL widget instance.
 
62
     *
 
63
     * \return pointer to GL widget
 
64
     */
 
65
    boost::shared_ptr< WQtGLWidget > getGLWidget() const;
 
66
 
 
67
protected:
 
68
    /**
 
69
     * Layout of this widget. Use this to extend the dock width other widgets (i.e. PropWidgets).
 
70
     */
 
71
    QVBoxLayout* m_layout;
 
72
 
 
73
    /**
 
74
     * The panel widget using m_layout.
 
75
     */
 
76
    QWidget* m_panel;
 
77
 
 
78
private slots:
 
79
    /**
 
80
     * If the dock widget changes its visibility.
 
81
     *
 
82
     * \param visible if true, the dock is visible
 
83
     */
 
84
    void handleVisibilityChange( bool visible );
 
85
 
 
86
private:
 
87
    /**
 
88
     * My GL widget.
 
89
     */
 
90
    boost::shared_ptr<WQtGLWidget> m_glWidget;
 
91
};
 
92
 
 
93
#endif  // WQTGLDOCKWIDGET_H