Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
5182c7c1
Commit
5182c7c1
authored
Apr 11, 2011
by
Sebastian Eichelbaum
Browse files
[CHANGE] - custom GL docks now also get stored and are unified with WQtGLDockWidget.
parent
2ea2c875
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
25 deletions
+23
-25
src/gui/qt4/WMainWindow.cpp
src/gui/qt4/WMainWindow.cpp
+5
-2
src/gui/qt4/WQtCustomDockWidget.cpp
src/gui/qt4/WQtCustomDockWidget.cpp
+3
-11
src/gui/qt4/WQtCustomDockWidget.h
src/gui/qt4/WQtCustomDockWidget.h
+4
-7
src/gui/qt4/WQtGLDockWidget.cpp
src/gui/qt4/WQtGLDockWidget.cpp
+4
-3
src/gui/qt4/WQtGLDockWidget.h
src/gui/qt4/WQtGLDockWidget.h
+5
-1
src/gui/qt4/WQtNavGLWidget.cpp
src/gui/qt4/WQtNavGLWidget.cpp
+2
-1
No files found.
src/gui/qt4/WMainWindow.cpp
View file @
5182c7c1
...
...
@@ -916,7 +916,11 @@ void WMainWindow::customEvent( QEvent* event )
// create new custom dock widget
widget
=
boost
::
shared_ptr
<
WQtCustomDockWidget
>
(
new
WQtCustomDockWidget
(
title
,
this
,
ocdwEvent
->
getProjectionMode
()
)
);
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
widget
.
get
()
);
m_glDock
->
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
widget
.
get
()
);
// restore state and geometry
// TODO(ebaum): this is critical. The dock widgets get closed before saveState. This means the restored docks are closed too.
// m_glDock->restoreDockWidget( widget.get() );
// store it in CustomDockWidget list
m_customDockWidgets
.
insert
(
make_pair
(
title
,
widget
)
);
...
...
@@ -926,7 +930,6 @@ void WMainWindow::customEvent( QEvent* event )
widget
=
m_customDockWidgets
[
title
];
widget
->
increaseUseCount
();
}
//m_customDockWidgetsLock.unlock();
ocdwEvent
->
getFlag
()
->
set
(
widget
);
}
...
...
src/gui/qt4/WQtCustomDockWidget.cpp
View file @
5182c7c1
...
...
@@ -30,22 +30,14 @@
#include "../../graphicsEngine/WGEViewer.h"
WQtCustomDockWidget
::
WQtCustomDockWidget
(
std
::
string
title
,
QWidget
*
parent
,
WGECamera
::
ProjectionMode
projectionMode
)
:
Q
DockWidget
(
QString
::
fromStdString
(
title
),
parent
),
:
WQtGL
DockWidget
(
QString
::
fromStdString
(
title
),
QString
::
fromStdString
(
title
),
parent
,
projectionMode
),
m_useCount
(
1
)
{
setObjectName
(
QString
(
"Custom Dock Window "
)
+
QString
::
fromStdString
(
title
)
);
// setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
setFeatures
(
QDockWidget
::
DockWidgetMovable
|
QDockWidget
::
DockWidgetFloatable
);
setFloating
(
true
);
resize
(
1024
,
768
);
m_glWidget
=
boost
::
shared_ptr
<
WQtGLWidget
>
(
new
WQtGLWidget
(
title
,
this
,
projectionMode
)
);
m_scene
=
new
WGEGroupNode
();
m_scene
->
setDataVariance
(
osg
::
Object
::
DYNAMIC
);
m_glWidget
->
getViewer
()
->
setScene
(
m_scene
);
setWidget
(
m_glWidget
.
get
()
);
getGLWidget
()
->
getViewer
()
->
setScene
(
m_scene
);
}
osg
::
ref_ptr
<
WGEGroupNode
>
WQtCustomDockWidget
::
getScene
()
const
...
...
@@ -55,7 +47,7 @@ osg::ref_ptr< WGEGroupNode > WQtCustomDockWidget::getScene() const
boost
::
shared_ptr
<
WGEViewer
>
WQtCustomDockWidget
::
getViewer
()
const
{
return
m_gl
Widget
->
getViewer
();
return
getGL
Widget
()
->
getViewer
();
}
void
WQtCustomDockWidget
::
increaseUseCount
()
...
...
src/gui/qt4/WQtCustomDockWidget.h
View file @
5182c7c1
...
...
@@ -30,13 +30,15 @@
#include "../../graphicsEngine/WGEGroupNode.h"
#include <QtGui/QDockWidget>
#include "WQtGLWidget.h"
#include "WQtGLDockWidget.h"
#include "../WCustomWidget.h"
/**
* Dock Widget which is created by a module to display custom information.
*/
class
WQtCustomDockWidget
:
public
Q
DockWidget
,
class
WQtCustomDockWidget
:
public
WQtGL
DockWidget
,
public
WCustomWidget
{
public:
...
...
@@ -77,11 +79,6 @@ public:
protected:
private:
/**
* the included GL widget
*/
boost
::
shared_ptr
<
WQtGLWidget
>
m_glWidget
;
/**
* the scene which is displayed by the GL widget
*/
...
...
src/gui/qt4/WQtGLDockWidget.cpp
View file @
5182c7c1
...
...
@@ -27,7 +27,8 @@
#include "WQtGLDockWidget.h"
WQtGLDockWidget
::
WQtGLDockWidget
(
QString
viewTitle
,
QString
dockTitle
,
QWidget
*
parent
,
const
QGLWidget
*
shareWidget
)
WQtGLDockWidget
::
WQtGLDockWidget
(
QString
viewTitle
,
QString
dockTitle
,
QWidget
*
parent
,
WGECamera
::
ProjectionMode
projectionMode
,
const
QGLWidget
*
shareWidget
)
:
QDockWidget
(
dockTitle
,
parent
)
{
setObjectName
(
QString
(
"GL - "
)
+
dockTitle
);
...
...
@@ -41,9 +42,9 @@ WQtGLDockWidget::WQtGLDockWidget( QString viewTitle, QString dockTitle, QWidget*
m_layout
=
new
QVBoxLayout
();
#ifndef _MSC_VER
m_glWidget
=
boost
::
shared_ptr
<
WQtGLWidget
>
(
new
WQtGLWidget
(
viewTitle
.
toStdString
(),
m_panel
,
WGECamera
::
ORTHOGRAPHIC
,
shareWidget
)
);
m_glWidget
=
boost
::
shared_ptr
<
WQtGLWidget
>
(
new
WQtGLWidget
(
viewTitle
.
toStdString
(),
m_panel
,
projectionMode
,
shareWidget
)
);
#else
m_glWidget
=
boost
::
shared_ptr
<
WQtGLWidget
>
(
new
WQtGLWidget
(
viewTitle
.
toStdString
(),
m_panel
,
WGECamera
::
ORTHOGRAPHIC
)
);
m_glWidget
=
boost
::
shared_ptr
<
WQtGLWidget
>
(
new
WQtGLWidget
(
viewTitle
.
toStdString
(),
m_panel
,
projectionMode
)
);
#endif
setMinimumSize
(
240
,
240
);
...
...
src/gui/qt4/WQtGLDockWidget.h
View file @
5182c7c1
...
...
@@ -28,6 +28,8 @@
#include <QtGui/QDockWidget>
#include <QtGui/QVBoxLayout>
#include "../../graphicsEngine/WGECamera.h"
#include "WQtGLWidget.h"
/**
...
...
@@ -44,9 +46,11 @@ public:
* \param viewTitle Title will be used as view title
* \param dockTitle The title of the dock widget.
* \param parent The widget that manages this widget
* \param projectionMode The projection mode used in the GL widget.
* \param shareWidget this widget will share OpenGL display lists and texture objects with shareWidget
*/
WQtGLDockWidget
(
QString
viewTitle
,
QString
dockTitle
,
QWidget
*
parent
,
const
QGLWidget
*
shareWidget
=
0
);
WQtGLDockWidget
(
QString
viewTitle
,
QString
dockTitle
,
QWidget
*
parent
,
WGECamera
::
ProjectionMode
projectionMode
=
WGECamera
::
ORTHOGRAPHIC
,
const
QGLWidget
*
shareWidget
=
0
);
/**
* destructor.
...
...
src/gui/qt4/WQtNavGLWidget.cpp
View file @
5182c7c1
...
...
@@ -30,6 +30,7 @@
#include <QtGui/QKeyEvent>
#include <QtGui/QApplication>
#include "../../graphicsEngine/WGECamera.h"
#include "../../graphicsEngine/WGEViewer.h"
#include "../../graphicsEngine/WGEScene.h"
#include "events/WPropertyChangedEvent.h"
...
...
@@ -38,7 +39,7 @@
#include "WQtNavGLWidget.h"
WQtNavGLWidget
::
WQtNavGLWidget
(
QString
viewTitle
,
QString
dockTitle
,
QWidget
*
parent
,
std
::
string
sliderTitle
,
const
QGLWidget
*
shareWidget
)
:
WQtGLDockWidget
(
viewTitle
,
dockTitle
,
parent
,
shareWidget
)
:
WQtGLDockWidget
(
viewTitle
,
dockTitle
,
parent
,
WGECamera
::
ORTHOGRAPHIC
,
shareWidget
)
{
propertyWidgetMap
.
clear
();
m_sliderTitle
=
QString
(
sliderTitle
.
c_str
()
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment