Emdee
|
#include <stereoviewport.h>
Public Types | |
enum | RenderMode { UnknownRender, DirectRender, BufferedRender } |
enum | StereoType { Hardware, RedCyanAnaglyph, LeftRight, RightLeft, TopBottom, BottomTop, StretchedLeftRight, StretchedRightLeft, StretchedTopBottom, StretchedBottomTop } |
Public Slots | |
void | update3d () |
void | setStereoType (StereoType arg) |
Signals | |
void | viewportChanged () |
void | showSceneGraphChanged () |
void | antialiasingChanged () |
void | stereoTypeChanged (StereoType arg) |
Public Member Functions | |
StereoViewport (QQuickItem *parent=0) | |
~StereoViewport () | |
QColor | fillColor () const |
void | setFillColor (const QColor &) |
bool | picking () const |
void | setPicking (bool value) |
bool | showPicking () const |
void | setShowPicking (bool value) |
bool | showSceneGraph () const |
void | setShowSceneGraph (bool show) |
bool | navigation () const |
void | setNavigation (bool value) |
bool | fovzoom () const |
void | setFovzoom (bool value) |
bool | blending () const |
void | setBlending (bool value) |
bool | antialiasing () const |
void | setAntialiasing (bool value) |
QGLCamera * | camera () const |
void | setCamera (QGLCamera *value) |
QGLLightParameters * | light () const |
void | setLight (QGLLightParameters *value) |
QGLLightModel * | lightModel () const |
void | setLightModel (QGLLightModel *value) |
int | registerPickableObject (QObject *obj) |
virtual void | registerEarlyDrawObject (QObject *obj, int order) |
void | paint (QPainter *painter) |
RenderMode | renderMode () const |
void | setRenderMode (RenderMode mode) |
StereoType | stereoType () const |
Protected Member Functions | |
void | mousePressEvent (QMouseEvent *event) |
void | mouseReleaseEvent (QMouseEvent *event) |
void | mouseDoubleClickEvent (QMouseEvent *event) |
void | mouseMoveEvent (QMouseEvent *event) |
void | hoverEnterEvent (QHoverEvent *event) |
void | hoverMoveEvent (QHoverEvent *event) |
void | hoverLeaveEvent (QHoverEvent *event) |
void | wheelEvent (QWheelEvent *event) |
void | keyPressEvent (QKeyEvent *event) |
virtual QSGNode * | updatePaintNode (QSGNode *, UpdatePaintNodeData *) |
void | itemChange (QQuickItem::ItemChange change, const ItemChangeData &value) |
void | geometryChanged (const QRectF &newGeometry, const QRectF &oldGeometry) |
Properties | |
QColor | fillColor |
RenderMode | renderMode |
bool | picking |
bool | showPicking |
bool | showSceneGraph |
bool | navigation |
bool | fovzoom |
bool | blending |
QGLCamera | camera |
QGLLightParameters | light |
QGLLightModel | lightModel |
bool | antialiasing |
StereoType | stereoType |
StereoViewport::StereoViewport | ( | QQuickItem * | parent = 0 ) |
StereoViewport::~StereoViewport | ( | ) |
bool StereoViewport::antialiasing | ( | ) | const |
|
signal |
bool StereoViewport::blending | ( | ) | const |
QGLCamera* StereoViewport::camera | ( | ) | const |
QColor StereoViewport::fillColor | ( | ) | const |
bool StereoViewport::fovzoom | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
QGLLightParameters* StereoViewport::light | ( | ) | const |
QGLLightModel* StereoViewport::lightModel | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
bool StereoViewport::navigation | ( | ) | const |
void StereoViewport::paint | ( | QPainter * | painter) |
bool StereoViewport::picking | ( | ) | const |
|
virtual |
int StereoViewport::registerPickableObject | ( | QObject * | obj) |
RenderMode StereoViewport::renderMode | ( | ) | const |
void StereoViewport::setAntialiasing | ( | bool | value) |
void StereoViewport::setBlending | ( | bool | value) |
void StereoViewport::setCamera | ( | QGLCamera * | value) |
void StereoViewport::setFillColor | ( | const QColor & | color) |
void StereoViewport::setFovzoom | ( | bool | value) |
void StereoViewport::setLight | ( | QGLLightParameters * | value) |
void StereoViewport::setLightModel | ( | QGLLightModel * | value) |
void StereoViewport::setNavigation | ( | bool | value) |
void StereoViewport::setPicking | ( | bool | value) |
void StereoViewport::setRenderMode | ( | StereoViewport::RenderMode | mode) |
void StereoViewport::setShowPicking | ( | bool | value) |
void StereoViewport::setShowSceneGraph | ( | bool | show) |
|
slot |
bool StereoViewport::showPicking | ( | ) | const |
bool StereoViewport::showSceneGraph | ( | ) | const |
|
signal |
StereoType StereoViewport::stereoType | ( | ) | const |
|
signal |
|
slot |
|
protectedvirtual |
|
signal |
|
protected |
|
readwrite |
bool StereoViewport::antialiasing
The antialiasing property is used to enable or disable antialiasing on the viewport. This property only has an effect if renderMode() == BufferedRender. For renderMode() == DirectRender antialiasing can be enabled by setting the QSurfaceFormat.
By default, antialiasing is set to false.
|
readwrite |
The blending property is used to enable or disable GL_BLEND on the viewport, for alpha blending of drawn objects.
By default, blending is set to false.
|
readwrite |
Camera StereoViewport::camera
This property sets the camera parameters which will be used for the appropriate viewing transforms in OpenGL. The default is a perspective camera with its eye located at (0, 0, 10) looking at the center (0, 0, 0), with the y axis as up.
|
readwrite |
bool StereoViewport::fillColor()
The color to use for the background of the viewport, if any. When no color is set then the underlying QML background will show through (the viewport will be trans- parent).
If a color is set here, then the viewport will be filled with that color before any content is rendered into it.
The default value for this property is no color (an invalid color) resulting in a transparent viewport.
|
readwrite |
This property is used to set or unset zooming based on field-of-view (fov). Normally zooming is achieved by moving the camera physically closer to the target object. This options achieves zooming by narrowing or broadening the fov.
By default, fov zooming is set to false.
|
readwrite |
Light StereoViewport::light
This property defines the main scene light to use for 3D items that are drawn in this viewport.
|
readwrite |
LightModel StereoViewport::lightModel The user is able to set a lighting model for the 3d environment through the use of the lightModel property. By default the light model is undefined.
|
readwrite |
bool StereoViewport::navigation
This property is used to set or unset camera navigation in for the viewport. Camera navigation allows the user to move the camera position around using the mouse.
By default, camera navigation is set to true.
|
readwrite |
User interaction in QML/3d is handled through the concept of object picking. Each item has a unique picking id which is queried for a given screen click position when the mouse is clicked.
If this property is set to true, picking will be supported for this viewport, while if the property is false, no picking will be applied.
The default value for this property is false.
|
readwrite |
enumeration StereoViewport::renderMode
This property defines the mode of rendering of this viewport as to whether it is direct to the GL context, or via a buffer (in this case a framebuffer object).
If the scene occupies most of the display, but the Viewport is not the top level item, this property can be set to DirectRender in order to improve performance.
At construction the render mode is set to UnknownRender, but during initialization it is updated to an appropriate default. It is an error to set the renderMode() to UnknownRender, and in debug mode an assert will be thrown in this case. In release mode behavior is undefined.
By default if the viewport is a child object of another SGItem, then the renderMode() is set to use a buffer. This is suitable for most simple 3D items which are small in size relative to the overall QML content displayed. The buffer is prepared by drawing the 3D items into it and then in a second step the buffer is composited into the QML 2D scene.
Otherwise if the viewport is a top-level item, the renderMode() is set by default to use direct rendering, in this case using a "GL Under" approach to capture the GL context prior to other QML content being rendered. The 3D items are then rendered directly into the context with any 2D QML content being rendered over the top. This is suitable where the 3D components of the scene occupies most or all of the screen.
|
readwrite |
bool StereoViewport::showPicking The underlying mechanism for picking is based on painting an off-screen buffer with a flat coloured image containing all of the objects with a unique color value.
Setting this property to true will display this flat-colour picking representation in the viewport, which can be useful for debugging problems with object selection.
The default value for this property is false.
|
readwrite |
bool StereoViewport::showSceneGraph
This property controls whether or not the 3D scenegraph structure is dumped to the console when the viewport is first rendered. Studying the output can be very useful for optimising the scene, and for detecting issues with rendering, such as misplaced textures, materials, geometry and so on.
By default the value is set to false.
|
readwrite |