OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QWidgetImage.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef QWIDGETIMAGE
15 #define QWIDGETIMAGE
16 
17 #include <osgQt/QGraphicsViewAdapter>
18 #include <osgQt/Version>
19 #include <osg/Image>
20 
21 namespace osgQt
22 {
23 
25 {
26  public:
27 
28  QWidgetImage( QWidget* widget=0 );
29 
30  QWidget* getQWidget() { return _widget; }
32 
33  virtual bool requiresUpdateCall() const { return true; }
34  virtual void update( osg::NodeVisitor* nv ) { render(); }
35 
36  void clearWriteBuffer();
37 
38  void render();
39 
42  virtual void scaleImage(int s,int t,int r, GLenum newDataType);
43 
44  virtual bool sendFocusHint(bool focus);
45 
46  virtual bool sendPointerEvent(int x, int y, int buttonMask);
47 
48  virtual bool sendKeyEvent(int key, bool keyDown);
49 
50  virtual void setFrameLastRendered(const osg::FrameStamp* frameStamp);
51 
52  protected:
53 
54  QPointer<QGraphicsViewAdapter> _adapter;
55  QPointer<QWidget> _widget;
56 };
57 
58 }
59 
60 #endif
QGraphicsViewAdapter * getQGraphicsViewAdapter()
Definition: QWidgetImage.h:31
#define OSGQT_EXPORT
Definition: Export.h:40
QPointer< QWidget > _widget
Definition: QWidgetImage.h:55
virtual void update(osg::NodeVisitor *nv)
Definition: QWidgetImage.h:34
virtual bool requiresUpdateCall() const
Definition: QWidgetImage.h:33
QWidget * getQWidget()
Definition: QWidgetImage.h:30
QPointer< QGraphicsViewAdapter > _adapter
Definition: QWidgetImage.h:54