source: projectionDesigner/trunk/projdesigner/include/gui/QDesignViewWidget.h @ 27

Last change on this file since 27 was 4, checked in by Torben Dannhauer, 15 years ago
File size: 1.7 KB
RevLine 
[4]1#ifndef _QDESIGNVIEWWIDGET_H_
2#define _QDESIGNVIEWWIDGET_H_
3
4#include "gui/QGLViewerWidget.h"
5
6namespace projection
7{
8class ProjectionModel;
9class Channel;
10
11enum DESIGN_VIEWMODE
12{
13    DESIGN_VIEWMODE_PERSPECTIVE,
14    DESIGN_VIEWMODE_CENTER,
15    DESIGN_VIEWMODE_TOP,
16    DESIGN_VIEWMODE_SIDE,
17    DESIGN_VIEWMODE_FRONT
18};
19
20enum DESIGN_OPMODE
21{
22    DESIGN_OPMODE_PROJECTOR,
23    DESIGN_OPMODE_VIEW
24};
25
26enum DESIGN_TRANSMODE
27{
28    DESIGN_TRANSMODE_LOCAL,
29    DESIGN_TRANSMODE_WORLD
30};
31
32class QDesignViewWidget : public QGLViewerWidget
33{
34    Q_OBJECT
35
36public:
37
38    QDesignViewWidget(QWidget* pParent=0, const QGLWidget* pSharedWidget=0, Qt::WFlags flags=0);
39    virtual ~QDesignViewWidget();
40
41        void setModel(ProjectionModel* pModel);
42
43    void setViewMode(DESIGN_VIEWMODE viewMode);
44    DESIGN_VIEWMODE getViewMode() const;
45
46    void setOpMode(DESIGN_OPMODE opMode);
47    DESIGN_OPMODE getOpMode() const;
48
49    void setTransMode(DESIGN_TRANSMODE transMode);
50    DESIGN_TRANSMODE getTransMode() const;
51
52        void setInfoVisible(bool bVisible);
53        bool isInfoVisible() const;
54
55        void setFont(QFont font);
56        QFont getFont() const;
57
58    virtual void keyReleaseEvent(QKeyEvent* pEvent);
59
60    void processChannelKeyEvent(Channel* pChannel, QKeyEvent* pEvent);
61
62    virtual void initFromDOMElement(const QDomElement& element);
63    virtual QDomElement domElement(QDomDocument& doc) const;
64
65signals:
66
67    void infoVisibilityChanged(bool bVisible);
68
69protected:
70
71    virtual void init();
72    virtual void draw();
73
74protected:
75
76        bool m_bInfoVisible;
77
78    DESIGN_VIEWMODE m_viewMode;
79    DESIGN_OPMODE m_opMode;
80    DESIGN_TRANSMODE m_transMode;
81    QFont m_infoFont;
82
83    ProjectionModel* m_pModel;
84};
85
86}; // projection
87
88#endif // _QDESIGNVIEWWIDGET_H_
Note: See TracBrowser for help on using the repository browser.