OpenCOVER
coVRTui.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef CO_VR_TUI_H
9#define CO_VR_TUI_H
10
24#include "coTabletUI.h"
25#include <util/DLinkList.h>
27
28#include <osg/Matrix>
29#include <osg/Vec3>
30#include <osgUtil/RenderBin>
31#include <osgUtil/RenderStage>
32
33namespace opencover
34{
36{
37public:
39 virtual ~coInputTUI();
40 void updateTUI(); // this is called only if anything has changed
41 void update(); // this is called once per frame
42
43private:
44 virtual void tabletEvent(coTUIElement *tUIItem);
45 virtual void tabletPressEvent(coTUIElement *tUIItem);
46 virtual void tabletReleaseEvent(coTUIElement *tUIItem);
47
48 coTUITab *inputTab;
49 coTUIFrame *personContainer;
50 coTUILabel * personsLabel;
51 coTUIComboBox * personsChoice;
52 coTUILabel *eyeDistanceLabel;
53 coTUIEditFloatField *eyeDistanceEdit;
54
55 coTUIFrame *bodiesContainer;
56 coTUILabel *bodiesLabel;
57 coTUIComboBox *bodiesChoice;
58
59 coTUIEditFloatField *bodyTrans[3];
60 coTUILabel *bodyTransLabel[3];
61 coTUIEditFloatField *bodyRot[3];
62 coTUILabel *bodyRotLabel[3];
63
64 coTUILabel *devicesLabel;
65 coTUIComboBox *devicesChoice;
66
67 coTUIEditFloatField *deviceTrans[3];
68 coTUILabel *deviceTransLabel[3];
69 coTUIEditFloatField *deviceRot[3];
70 coTUILabel *deviceRotLabel[3];
71
72 coTUIFrame *debugContainer;
73 coTUILabel *debugLabel;
74 coTUIToggleButton *debugMouseButton;
75 coTUIToggleButton *debugDriverButton;
76 coTUIToggleButton *debugRawButton;
77 coTUIToggleButton *debugTransformedButton;
78 coTUIToggleButton *debugMatrices, *debugOther;
79 coTUIToggleButton *calibrateTrackingsystem;
80 coTUIToggleButton *calibrateToHand;
81 coTUILabel *calibrationLabel;
82
83 int calibrationStep;
84 osg::Vec3 calibrationPositions[3];
85};
86
87class DontDrawBin : public osgUtil::RenderBin::DrawCallback
88{
89 virtual void drawImplementation(osgUtil::RenderBin *bin, osg::RenderInfo &renderInfo, osgUtil::RenderLeaf *&previous){};
90};
92{
93public:
94 BinListEntry(osgUtil::RenderBin *rb, int num);
95 virtual ~BinListEntry();
96 virtual void tabletEvent(coTUIElement *tUIItem);
97 void updateBin();
98
99private:
101 int binNumber;
102 osgUtil::RenderBin *renderBin();
103};
104
105class BinList : public std::list<BinListEntry *>
106{
107
108public:
110 virtual ~BinList();
111 void refresh();
112 void removeAll();
114};
115class BinRenderStage : public osgUtil::RenderStage
116{
117public:
118 BinRenderStage(osgUtil::RenderStage &rs)
119 : osgUtil::RenderStage(rs){};
120 osgUtil::RenderBin *getPreRenderStage()
121 {
122 if (_preRenderList.size() > 0)
123 return (*_preRenderList.begin()).second.get();
124 else
125 return NULL;
126 };
127 osgUtil::RenderBin *getPostRenderStage()
128 {
129 if (_postRenderList.size() > 0)
130 return (*_postRenderList.begin()).second.get();
131 else
132 return NULL;
133 };
134};
135
136class COVEREXPORT coVRTui : public coTUIListener
137{
138public:
140 virtual ~coVRTui();
141 void update();
142 void config();
143 void updateFPS(double fps);
144 virtual void tabletEvent(coTUIElement *tUIItem);
145 virtual void tabletPressEvent(coTUIElement *tUIItem);
146 virtual void tabletReleaseEvent(coTUIElement *tUIItem);
148
150 {
151 return coverTab;
152 };
154 {
155 return topContainer;
156 };
158 static coVRTui *instance();
159
160 void getTmpFileName(std::string url);
162
164
165private:
166 static coVRTui *tui;
167
168 coTUITab *coverTab;
169 coTUIFrame *topContainer;
170 coTUIFrame *bottomContainer;
171 coTUIFrame *rightContainer;
172 coTUITab *presentationTab = nullptr;
173 coTUILabel *PresentationLabel = nullptr;
174 coTUIButton *PresentationForward = nullptr;
175 coTUIButton *PresentationBack = nullptr;
176 coTUIEditIntField *PresentationStep = nullptr;
177 coTUIToggleButton *Walk;
178 coTUIToggleButton *DebugBins;
179 coTUIToggleButton *FlipStereo;
180 coTUIToggleButton *Drive;
182 coTUIToggleButton *XForm;
183 coTUIToggleButton *Scale;
184 coTUIToggleButton *Collision;
185 coTUIToggleButton *DisableIntersection;
186 coTUIToggleButton *testImage;
187 coTUIToggleButton *Freeze;
188 coTUIToggleButton *Wireframe;
189 coTUIToggleButton *Menu;
194 coTUILabel *fovLabel;
195 coTUIEditFloatField *stereoSep;
196 coTUILabel *stereoSepLabel;
197
198 coTUIEditFloatField *nearEdit;
199 coTUIEditFloatField *farEdit;
200 coTUILabel *nearLabel;
201 coTUILabel *farLabel;
202
203 coTUIButton *Quit;
204 coTUIButton *ViewAll;
205 coTUILabel *speedLabel;
206 coTUILabel *scaleLabel;
207 coTUILabel *viewerLabel;
208 coTUILabel *FPSLabel;
209 coTUILabel *CFPSLabel;
211 coTUIFloatSlider *NavSpeed;
212 coTUIFloatSlider *ScaleSlider;
213 coTUIColorButton *backgroundColor;
214 coTUILabel *backgroundLabel;
215 coTUILabel *LODScaleLabel;
216 coTUIEditFloatField *LODScaleEdit;
217
218 coTUILabel *debugLabel;
219 coTUIEditIntField *debugLevel;
220#ifndef NOFB
221 coTUIFileBrowserButton *FileBrowser;
222 coTUIFileBrowserButton *SaveFileFB;
223#endif
224
225 coTUILabel *driveLabel;
226 coTUINav *driveNav;
227 coTUILabel *panLabel;
228 coTUINav *panNav;
229 osg::Vec3 viewPos;
230 void doTabWalk();
231 void doTabFly();
232 void doTabScale();
233 void doTabXform();
234 void startTabNav();
235 void stopTabNav();
236
237 float getPhiZVerti(float y2, float y1, float x2, float widthX, float widthY);
238
239 float getPhiZHori(float x2, float x1, float y2, float widthY, float widthX);
240
241 float getPhi(float relCoord1, float width1);
242
243 void makeRot(float heading, float pitch, float roll, int headingBool, int pitchBool, int rollBool);
244
245 bool collision;
246 coVRNavigationManager::NavMode navigationMode;
247 float actScaleFactor;
248 float mx, my, x0, y0, relx0, rely0;
249 osg::Matrix mat0;
250 osg::Matrix mat0_Scale;
251 float currentVelocity;
252 float driveSpeed;
253 float ScaleValue;
254 float widthX, widthY, originX, originY;
255 double lastUpdateTime;
256 coInputTUI *inputTUI;
257};
258}
259#endif
Tablet user interface proxy classes.
mouse and tracker 3D navigation
Definition: ARToolKit.h:33
Definition: coIntersection.h:28
Definition: coTabletUI.h:147
Definition: coTabletUI.h:212
Definition: coTabletUI.h:253
Definition: coTabletUI.h:277
Definition: coTabletUI.h:467
Definition: coTabletUI.h:672
Definition: coTabletUI.h:727
Definition: coTabletUI.h:1000
Definition: coTabletUI.h:1069
Definition: coTabletUI.h:1156
Definition: coTabletUI.h:1268
Definition: coTabletUI.h:1591
Definition: coTabletUI.h:1644
Definition: coTabletUI.h:1681
Action listener for events triggered by any coTUIElement.
Definition: coTUIListener.h:61
NavMode
Definition: coVRNavigationManager.h:80
Definition: coVRTui.h:36
Definition: coVRTui.h:88
Definition: coVRTui.h:92
virtual void tabletEvent(coTUIElement *tUIItem)
BinListEntry(osgUtil::RenderBin *rb, int num)
Definition: coVRTui.h:106
Definition: coVRTui.h:116
osgUtil::RenderBin * getPostRenderStage()
Definition: coVRTui.h:127
osgUtil::RenderBin * getPreRenderStage()
Definition: coVRTui.h:120
BinRenderStage(osgUtil::RenderStage &rs)
Definition: coVRTui.h:118
Definition: coVRTui.h:137
virtual void tabletReleaseEvent(coTUIElement *tUIItem)
virtual void tabletPressEvent(coTUIElement *tUIItem)
void updateFPS(double fps)
coTUIFileBrowserButton * getExtFB()
virtual void tabletEvent(coTUIElement *tUIItem)
static coVRTui * instance()
BinList * binList
Definition: coVRTui.h:163
void getTmpFileName(std::string url)
coTUITab * getCOVERTab()
Definition: coVRTui.h:149
coTUITabFolder * mainFolder
Definition: coVRTui.h:147
coTUIFrame * getTopContainer()
Definition: coVRTui.h:153