Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoQtFullViewer.h
1 #ifndef SOQT_FULLVIEWER_H
2 #define SOQT_FULLVIEWER_H
3 
4 //
5 
6 /**************************************************************************\
7  * Copyright (c) Kongsberg Oil & Gas Technologies AS
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are
12  * met:
13  *
14  * Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  *
17  * Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  *
21  * Neither the name of the copyright holder nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 \**************************************************************************/
37 
38 #include <Inventor/Qt/viewers/SoQtViewer.h>
39 
40 class SoQtPopupMenu;
41 
42 // *************************************************************************
43 
44 class SOQT_DLL_API SoQtFullViewer : public SoQtViewer {
45  SOQT_OBJECT_ABSTRACT_HEADER(SoQtFullViewer, SoQtViewer);
46 
47 public:
48  enum BuildFlag {
49  BUILD_NONE = 0x00,
50  BUILD_DECORATION = 0x01,
51  BUILD_POPUP = 0x02,
52  BUILD_ALL = (BUILD_DECORATION | BUILD_POPUP)
53  };
54 
55  void setDecoration(const SbBool on);
56  SbBool isDecoration(void) const;
57 
58  void setPopupMenuEnabled(const SbBool on);
59  SbBool isPopupMenuEnabled(void) const;
60 
61  QWidget* getAppPushButtonParent(void) const;
62  void addAppPushButton(QWidget* newButton);
63  void insertAppPushButton(QWidget* newButton, int index);
64  void removeAppPushButton(QWidget* oldButton);
65  int findAppPushButton(QWidget* oldButton) const;
66  int lengthAppPushButton(void) const;
67 
68  QWidget* getRenderAreaWidget(void) const;
69 
70  virtual void setViewing(SbBool on);
71 
72  virtual void setComponentCursor(const SoQtCursor & cursor);
73 
74 protected:
75  SoQtFullViewer(QWidget* parent,
76  const char * name,
77  SbBool embed,
78  BuildFlag flag,
79  Type type,
80  SbBool build);
81  ~SoQtFullViewer();
82 
83  virtual void sizeChanged(const SbVec2s & size);
84 
85  QWidget* buildWidget(QWidget* parent);
86 
87  virtual void buildDecoration(QWidget* parent);
88  virtual QWidget* buildLeftTrim(QWidget* parent);
89  virtual QWidget* buildBottomTrim(QWidget* parent);
90  virtual QWidget* buildRightTrim(QWidget* parent);
91  QWidget* buildAppButtons(QWidget* parent);
92  QWidget* buildViewerButtons(QWidget* parent);
93  virtual void createViewerButtons(QWidget* parent, SbPList * buttonlist);
94 
95  virtual void buildPopupMenu(void);
96  virtual void setPopupMenuString(const char * title);
97  virtual void openPopupMenu(const SbVec2s position);
98 
99  virtual void leftWheelStart(void);
100  virtual void leftWheelMotion(float);
101  virtual void leftWheelFinish(void);
102  float getLeftWheelValue(void) const;
103  void setLeftWheelValue(const float value);
104 
105  virtual void bottomWheelStart(void);
106  virtual void bottomWheelMotion(float);
107  virtual void bottomWheelFinish(void);
108  float getBottomWheelValue(void) const;
109  void setBottomWheelValue(const float value);
110 
111  virtual void rightWheelStart(void);
112  virtual void rightWheelMotion(float);
113  virtual void rightWheelFinish(void);
114  float getRightWheelValue(void) const;
115  void setRightWheelValue(const float value);
116 
117  void setLeftWheelString(const char * const name);
118  QWidget* getLeftWheelLabelWidget(void) const;
119  void setBottomWheelString(const char * const name);
120  QWidget* getBottomWheelLabelWidget(void) const;
121  void setRightWheelString(const char * const name);
122  const char * getRightWheelString() const;
123  QWidget* getRightWheelLabelWidget(void) const;
124 
125  virtual SbBool processSoEvent(const SoEvent * const event);
126 
127 protected:
128  QWidget* leftWheel;
129  QWidget* rightWheel;
130  QWidget* bottomWheel;
131 
132  QWidget* leftDecoration;
133  QWidget* rightDecoration;
135 
136  QWidget* leftWheelLabel;
137  char * leftWheelStr;
139 
140  QWidget* rightWheelLabel;
143 
147 
148  SoQtPopupMenu * prefmenu;
149 
150 private:
151  // Private class for implementation hiding. The idiom we're using is
152  // a variant of what is known as the "Cheshire Cat", and is also
153  // described as the "Bridge" pattern in «Design Patterns» by Gamma
154  // et al (aka The Gang Of Four).
155  class SoQtFullViewerP * pimpl;
156 
157  friend class SoGuiFullViewerP;
158  friend class SoQtFullViewerP;
159 
160 
161 
162 // FIXME: get rid of non-templatized code. 20020108 mortene.
163 
164 #ifdef __COIN_SOXT__ // FIXME: get rid of non-templatized code. 20020108 mortene.
165 protected:
166  Widget buildFunctionsSubmenu(Widget popup);
167  Widget buildDrawStyleSubmenu(Widget popup);
168 
169  char * popupTitle;
170  SbBool popupEnabled;
171  SbPList * viewerButtonWidgets;
172 #endif // __COIN_SOXT__
173 };
174 
175 // *************************************************************************
176 
177 #endif // ! SOQT_FULLVIEWER_H
virtual SbBool processSoEvent(const SoEvent *const event)
Definition: SoQtViewer.cpp:3660
float leftWheelVal
Definition: SoQtFullViewer.h:138
QWidget * leftDecoration
Definition: SoQtFullViewer.h:132
BuildFlag
Definition: SoQtFullViewer.h:48
The SoQtViewer class is the top level base viewer class.
Definition: SoQtViewer.h:90
float bottomWheelVal
Definition: SoQtFullViewer.h:146
float rightWheelVal
Definition: SoQtFullViewer.h:142
QWidget * leftWheelLabel
Definition: SoQtFullViewer.h:136
QWidget * bottomWheelLabel
Definition: SoQtFullViewer.h:144
QWidget * bottomDecoration
Definition: SoQtFullViewer.h:134
QWidget * bottomWheel
Definition: SoQtFullViewer.h:130
QWidget * rightDecoration
Definition: SoQtFullViewer.h:133
virtual void sizeChanged(const SbVec2s &size)
Definition: SoQtViewer.cpp:3651
virtual void setViewing(SbBool enable)
Definition: SoQtViewer.cpp:2147
SoQtPopupMenu * prefmenu
Definition: SoQtFullViewer.h:148
QWidget * rightWheel
Definition: SoQtFullViewer.h:129
char * leftWheelStr
Definition: SoQtFullViewer.h:137
char * rightWheelStr
Definition: SoQtFullViewer.h:141
QWidget * leftWheel
Definition: SoQtFullViewer.h:128
char * bottomWheelStr
Definition: SoQtFullViewer.h:145
The SoQtCursor class is used to set cursors for GUI components.
Definition: SoQtCursor.h:41
virtual void setComponentCursor(const SoQtCursor &cursor)
Definition: SoQtComponent.cpp:971
QWidget * rightWheelLabel
Definition: SoQtFullViewer.h:140
The SoQtFullViewer class adds some user interface components to the viewer canvas.
Definition: SoQtFullViewer.h:44