source: projectionDesigner/trunk/projdesignerplugins/defaultplugin/DefaultTeapotSceneWidget.h @ 217

Last change on this file since 217 was 4, checked in by Torben Dannhauer, 15 years ago
File size: 2.5 KB
Line 
1#ifndef __DEFAULT_TEAPOT_SCENE_WIDGET_H__
2#define __DEFAULT_TEAPOT_SCENE_WIDGET_H__
3
4
5// Includes Projection Designer headers
6#include <projdesigner/include/interfaces.h>
7
8// Includes ui_... headers
9#include "ui_defaultteapotscenewidget.h"
10
11// Includes local headers
12#include "DefaultTeapotSceneContent.h"
13
14
15/**
16 * This class implements the widget that enables the control of the teapot
17 * scene.
18 *
19 */
20class DefaultTeapotSceneWidget : public SceneWidget,
21                                 private Ui::DefaultTeapotSceneWidget
22{
23    Q_OBJECT
24               
25
26public:
27
28
29    /**
30     * Default constructor.
31     *
32     */
33    DefaultTeapotSceneWidget(SceneInterface *plugin, QWidget* pParent=0, Qt::WFlags flag=0);
34
35
36    /**
37     * Destructor.
38     *
39     */
40    ~DefaultTeapotSceneWidget();
41
42
43    /**
44     * Updates the widget.
45     *
46     * This method can be used it two ways: to force a refresh or to update the
47     * contents of the widget.
48     *
49     * @param content A const pointer on the contents to be used for the widget.
50     *                This contents will be duplicated in the widget. If content
51     *                is NULL, the current contents are used and the refresh is
52     *                forced. If no content is given, NULL is used.
53     *
54     */
55    void updateGUI(const SceneContent* data=NULL);
56
57
58    /**
59     * Clears the fields of the widget.
60     *
61     * This method is typically used when the widget will be disabled (if no
62     * channel is specified in Projection Designer, the widget is visible but
63     * disabled: fields must be empty).
64     *
65     */
66    void clear(void);
67
68
69    /**
70     * Gets the widget contents.
71     *
72     * @return A const reference on the contents of the widget.
73     *
74     */
75    const SceneContent& content(void) const {return m_content;}
76
77
78signals:
79
80
81    /**
82     * [signal] Notify that the contents of the widget have changed.
83     *
84     * This signal is emitted each time that a field is changed.
85     *
86     * @param content A const reference on the new contents (the same as
87     *                returned by the content() method).
88     *
89     */
90    virtual void dataChanged(const SceneContent& content);
91
92
93private slots:
94
95
96    /**
97     * [private slot] Called when the wireframe checkbox state changes.
98     *
99     */
100    void on_wireframeCheckBox_stateChanged(int state);
101
102
103    /**
104     * [private slot] Called when the width changes.
105     *
106     */
107    void on_widthSpinBox_valueChanged(int width);
108
109
110private:
111
112
113    /// The current DefaultPluginData of the widget.
114    DefaultTeapotSceneContent m_content;
115
116};
117
118#endif // __DEFAULT_TEAPOT_SCENE_WIDGET_H__
Note: See TracBrowser for help on using the repository browser.