Commit b4b3b104 authored by Jan Möbius's avatar Jan Möbius

Dennis: Provide-pointer-to-main-QGLWidget-to-allow-to-use-i

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6651 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 229a8b4c
......@@ -39,6 +39,7 @@
//=============================================================================
#include <OpenFlipper/common/Types.hh>
#include <QGLWidget>
#include "PluginFunctions.hh"
#include "PluginFunctionsCore.hh"
......@@ -99,6 +100,12 @@ static ViewObjectMarker* defaultMarker_ = 0;
*/
static ViewObjectMarker* currentMarker_ = 0;
/** \brief DONT USE DIRECTLY!!
*
* This pointer is used internally
*/
static QGLWidget* shareGLWidget_ = 0;
void setDataRoot( BaseObject* _root ) {
objectRoot_ = _root;
}
......@@ -361,6 +368,16 @@ void actionMode ( Viewer::ActionMode _mode) {
viewerProperties().actionMode(_mode);
}
void shareGLWidget (QGLWidget *_widget)
{
shareGLWidget_ = _widget;
}
QGLWidget *shareGLWidget ()
{
return shareGLWidget_;
}
void getCurrentViewImage(QImage& _image) {
viewer( activeExaminer() )->snapshot( _image, true );
}
......
......@@ -56,6 +56,7 @@
//== FORWARDDECLARATIONS ======================================================
class ViewObjectMarker;
class QGLWidget;
/** The Namespace PluginFunctions contains functions for all plugins. These functions should be used to get the
* objects to work on or to set modes in the examiner widget. */
......@@ -275,6 +276,14 @@ void actionMode ( Viewer::ActionMode _mode);
DLLEXPORT
Viewer::ActionMode actionMode();
/// Sets the main QGLWidget for gl data sharing.
DLLEXPORT
void shareGLWidget (QGLWidget* _widget);
/// Returns the main QGLWidget for gl data sharing.
DLLEXPORT
QGLWidget* shareGLWidget ();
/** Lock scene rotation via mouse
*
* @param _mode allow or disallow rotation
......
......@@ -153,7 +153,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
delete test;
glWidget_ = new QGLWidget(format,0);
PluginFunctions::shareGLWidget (glWidget_);
glView_ = new QtGLGraphicsView(stackedWidget_);
glScene_ = new QtGLGraphicsScene (&examiner_widgets_, baseLayout_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment