Quarter
1.2.2
Coin3D GUI binding for Qt
|
The QuarterWidget class is the main class in Quarter. It provides a widget for Coin rendering. It provides scene graph management and event handling. More...
#include <Quarter/QuarterWidget.h>
Public Types | |
enum | RenderMode { AS_IS = SoRenderManager::AS_IS , WIREFRAME = SoRenderManager::WIREFRAME , WIREFRAME_OVERLAY = SoRenderManager::WIREFRAME_OVERLAY , POINTS = SoRenderManager::POINTS , HIDDEN_LINE = SoRenderManager::HIDDEN_LINE , BOUNDING_BOX = SoRenderManager::BOUNDING_BOX } |
enum | StereoMode { MONO = SoRenderManager::MONO , ANAGLYPH = SoRenderManager::ANAGLYPH , QUAD_BUFFER = SoRenderManager::QUAD_BUFFER , INTERLEAVED_ROWS = SoRenderManager::INTERLEAVED_ROWS , INTERLEAVED_COLUMNS = SoRenderManager::INTERLEAVED_COLUMNS } |
enum | TransparencyType { SCREEN_DOOR = SoGLRenderAction::SCREEN_DOOR , ADD = SoGLRenderAction::ADD , DELAYED_ADD = SoGLRenderAction::DELAYED_ADD , SORTED_OBJECT_ADD = SoGLRenderAction::SORTED_OBJECT_ADD , BLEND = SoGLRenderAction::BLEND , DELAYED_BLEND = SoGLRenderAction::DELAYED_BLEND , SORTED_OBJECT_BLEND = SoGLRenderAction::SORTED_OBJECT_BLEND , SORTED_OBJECT_SORTED_TRIANGLE_ADD = SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_ADD , SORTED_OBJECT_SORTED_TRIANGLE_BLEND = SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND , NONE = SoGLRenderAction::NONE , SORTED_LAYERS_BLEND = SoGLRenderAction::SORTED_LAYERS_BLEND } |
Public Slots | |
void | redraw (void) |
virtual void | seek (void) |
void | setRenderMode (RenderMode mode) |
void | setStereoMode (StereoMode mode) |
void | setTransparencyType (TransparencyType type) |
virtual void | viewAll (void) |
Signals | |
void | devicePixelRatioChanged (qreal dev_pixel_ratio) |
Public Member Functions | |
QuarterWidget (const QGLFormat &format, QWidget *parent=0, const QGLWidget *shareWidget=0, Qt::WindowFlags f=0) | |
QuarterWidget (QGLContext *context, QWidget *parent=0, const QGLWidget *sharewidget=0, Qt::WindowFlags f=0) | |
QuarterWidget (QWidget *parent=0, const QGLWidget *sharewidget=0, Qt::WindowFlags f=0) | |
virtual | ~QuarterWidget () |
void | addStateMachine (SoScXMLStateMachine *statemachine) |
QColor | backgroundColor (void) const |
bool | clearWindow (void) const |
bool | clearZBuffer (void) const |
bool | contextMenuEnabled (void) const |
qreal | devicePixelRatio (void) const |
uint32_t | getCacheContextId (void) const |
QMenu * | getContextMenu (void) const |
EventFilter * | getEventFilter (void) const |
SoDirectionalLight * | getHeadlight (void) |
virtual SoNode * | getSceneGraph (void) const |
SoEventManager * | getSoEventManager (void) const |
SoRenderManager * | getSoRenderManager (void) const |
bool | headlightEnabled (void) const |
bool | interactionModeEnabled (void) const |
bool | interactionModeOn (void) const |
virtual QSize | minimumSizeHint (void) const |
const QUrl & | navigationModeFile (void) const |
virtual bool | processSoEvent (const SoEvent *event) |
void | removeStateMachine (SoScXMLStateMachine *statemachine) |
RenderMode | renderMode (void) const |
QList< QAction * > | renderModeActions (void) const |
void | resetNavigationModeFile (void) |
void | setBackgroundColor (const QColor &color) |
void | setClearWindow (bool onoff) |
void | setClearZBuffer (bool onoff) |
void | setContextMenuEnabled (bool yes) |
void | setHeadlightEnabled (bool onoff) |
void | setInteractionModeEnabled (bool onoff) |
void | setInteractionModeOn (bool onoff) |
void | setNavigationModeFile (const QUrl &url=QUrl(DEFAULT_NAVIGATIONFILE)) |
virtual void | setSceneGraph (SoNode *root) |
void | setSoEventManager (SoEventManager *manager) |
void | setSoRenderManager (SoRenderManager *manager) |
void | setStateCursor (const SbName &state, const QCursor &cursor) |
void | setupDefaultCursors () |
Sets up the default cursors for the widget. | |
QCursor | stateCursor (const SbName &state) |
StereoMode | stereoMode (void) const |
QList< QAction * > | stereoModeActions (void) const |
TransparencyType | transparencyType (void) const |
QList< QAction * > | transparencyTypeActions (void) const |
Protected Member Functions | |
virtual void | actualRedraw (void) |
virtual void | initializeGL (void) |
virtual void | paintGL (void) |
virtual void | resizeGL (int width, int height) |
virtual bool | updateDevicePixelRatio (void) |
Properties | |
QColor | backgroundColor |
bool | clearWindow |
bool | clearZBuffer |
bool | contextMenuEnabled |
qreal | devicePixelRatio |
bool | headlightEnabled |
bool | interactionModeEnabled |
bool | interactionModeOn |
QUrl | navigationModeFile |
RenderMode | renderMode |
StereoMode | stereoMode |
TransparencyType | transparencyType |
The QuarterWidget class is the main class in Quarter. It provides a widget for Coin rendering. It provides scene graph management and event handling.
If you want to modify the GL format for an existing QuarterWidget, you can set up a new GL context for the widget, e.g.:
Sets how rendering of primitives is done.
See SoRenderManager::RenderMode for a full description of the modes
Sets how stereo rendering is performed.
See SoRenderManager::StereoMode for a full description of the modes
Various settings for how to do rendering of transparent objects in the scene. Some of the settings will provide faster rendering, while others gives you better quality rendering.
See SoGLRenderAction::TransparencyType for a full description of the modes
|
explicit |
constructor
|
explicit |
constructor
|
explicit |
constructor
|
virtual |
destructor
|
protectedvirtual |
Overridden from QGLWidget to render the scene graph.
void QuarterWidget::addStateMachine | ( | SoScXMLStateMachine * | statemachine | ) |
Convenience method that adds a state machine to the current SoEventManager. It also initializes the scene graph root and active camera for the state machine, and finally it sets up the default Quarter cursor handling.
uint32_t QuarterWidget::getCacheContextId | ( | void | ) | const |
Returns the Coin cache context id for this widget.
QMenu * QuarterWidget::getContextMenu | ( | void | ) | const |
Returns the context menu used by the widget.
EventFilter * QuarterWidget::getEventFilter | ( | void | ) | const |
Returns a pointer to the event filter.
SoDirectionalLight * QuarterWidget::getHeadlight | ( | void | ) |
Returns the light used for the headlight.
|
virtual |
Returns pointer to root of scene graph.
SoEventManager * QuarterWidget::getSoEventManager | ( | void | ) | const |
Returns a pointer to the event manager.
SoRenderManager * QuarterWidget::getSoRenderManager | ( | void | ) | const |
Returns a pointer to the render manager.
|
protectedvirtual |
This function will be called whenever the GLContext changes, for instance when the widget is reparented.
Overridden from QGLWidget to enable OpenGL depth buffer and reinitialize the SoRenderManager.
|
virtual |
See QWidget::minimumSizeHint
|
protectedvirtual |
Overridden from QGLWidget to render the scene graph.
|
virtual |
Passes an event to the event manager.
[in] | event | to pass |
Returns | true if the event was successfully processed |
|
slot |
Used for rendering the scene. Usually Coin/Quarter will automatically redraw the scene graph at regular intervals, after the scene is modified.
However, if you want to disable this functionality and gain full control over when the scene is rendered yourself, you can turn off autoredraw in the render manager and render the scene by calling this method.
void QuarterWidget::removeStateMachine | ( | SoScXMLStateMachine * | statemachine | ) |
Convenience method that removes a state machine from the current SoEventManager.
QList< QAction * > QuarterWidget::renderModeActions | ( | void | ) | const |
Returns a list of grouped actions that corresponds to the RenderMode enum. If you want to create a menu in your application that controls the render mode type used in QuarterWidget, add these actions to the menu.
void QuarterWidget::resetNavigationModeFile | ( | void | ) |
Removes any navigationModeFile set.
|
protectedvirtual |
Overridden from QGLWidget to resize the Coin scene graph.
|
virtualslot |
Sets the current camera in seek mode, if supported by the underlying navigation system. Camera typically seeks towards what the mouse is pointing at.
void QuarterWidget::setBackgroundColor | ( | const QColor & | color | ) |
Set background color to a given QColor
Remember that QColors are given in integers between 0 and 255, as opposed to SbColor4f which is in [0, 1]. The default alpha value for a QColor is 255, but you'll probably want to set it to zero before using it as an OpenGL clear color.
void QuarterWidget::setClearWindow | ( | bool | onoff | ) |
Specify if you want the rendering buffer to be cleared before rendering. This is on by default.
void QuarterWidget::setClearZBuffer | ( | bool | onoff | ) |
Specify if you want the z-buffer to be cleared before redraw. This is on by default.
void QuarterWidget::setContextMenuEnabled | ( | bool | yes | ) |
Controls the display of the context menu
[in] | yes | Context menu on? |
void QuarterWidget::setHeadlightEnabled | ( | bool | onoff | ) |
Enable/disable the headlight. This will toggle the SoDirectionalLight::on field (returned from getHeadlight()).
void QuarterWidget::setInteractionModeEnabled | ( | bool | onoff | ) |
Enable/disable interaction mode.
Specifies whether you may use the Alt-key to enter interaction mode.
void QuarterWidget::setInteractionModeOn | ( | bool | onoff | ) |
Turn interaction mode on or off.
void QuarterWidget::setNavigationModeFile | ( | const QUrl & | url = QUrl(DEFAULT_NAVIGATIONFILE) | ) |
Sets a navigation mode file. Supports the schemes "coin" and "file"
[in] | url | URL to the resource |
|
slot |
Sets how rendering of primitives is done.
See SoRenderManager::RenderMode for a full description of the modes
|
virtual |
Sets the Inventor scene graph to be rendered.
void QuarterWidget::setSoEventManager | ( | SoEventManager * | manager | ) |
Set the Coin event manager for the widget.
void QuarterWidget::setSoRenderManager | ( | SoRenderManager * | manager | ) |
Set the render manager for the widget.
void QuarterWidget::setStateCursor | ( | const SbName & | state, |
const QCursor & | cursor ) |
You can set the cursor you want to use for a given navigation state. See the Coin documentation on navigation for information about available states.
|
slot |
Sets how stereo rendering is performed.
See SoRenderManager::StereoMode for a full description of the modes
|
slot |
Sets the transparency type to be used for the scene.
QCursor QuarterWidget::stateCursor | ( | const SbName & | state | ) |
Maps a state to a cursor
[in] | state | Named state in the state machine |
Cursor | corresponding to the given state |
QList< QAction * > QuarterWidget::stereoModeActions | ( | void | ) | const |
Returns a list of grouped actions that corresponds to the StereoMode enum. If you want to create a menu in your application that controls the stereo mode used in QuarterWidget, add these actions to the menu.
QList< QAction * > QuarterWidget::transparencyTypeActions | ( | void | ) | const |
Returns a list of grouped actions that corresponds to the TransparencyType enum. If you want to create a menu in your application that controls the transparency type used in QuarterWidget, add these actions to the menu.
|
virtualslot |
Reposition the current camera to display the entire scene.
|
readwrite |
Set background color to a given QColor
Remember that QColors are given in integers between 0 and 255, as opposed to SbColor4f which is in [0, 1]. The default alpha value for a QColor is 255, but you'll probably want to set it to zero before using it as an OpenGL clear color.
Returns color used for clearing the rendering area before rendering the scene.
|
readwrite |
Specify if you want the rendering buffer to be cleared before rendering. This is on by default.
Returns true if the rendering buffer is cleared before rendering.
|
readwrite |
Specify if you want the z-buffer to be cleared before redraw. This is on by default.
Returns true if the z-buffer is cleared before rendering.
|
readwrite |
Is | context menu enabled? |
Controls the display of the context menu
[in] | yes | Context menu on? |
|
read |
The ratio between logical and physical pixel sizes – obtained from the window that the widget is located within, and updated whenever any change occurs, emitting a devicePixelRatioChanged signal. Only available for version Qt 5.6 and above (will be 1.0 for all previous versions).
|
readwrite |
Enable/disable the headlight. This will toggle the SoDirectionalLight::on field (returned from getHeadlight()).
Returns true if the headlight is on, false if it is off.
|
readwrite |
Enable/disable interaction mode.
Specifies whether you may use the Alt-key to enter interaction mode.
Returns true if interaction mode is enabled, false otherwise.
|
readwrite |
Turn interaction mode on or off.
Returns true if interaction mode is on.
|
readwrite |
An URL to a navigation mode file which is a scxml file which defines the possible states for the Coin navigation system
Supports:
The | current navigation mode file |
|
readwrite |
Sets how rendering of primitives is done.
See SoRenderManager::RenderMode for a full description of the modes
The | current RenderMode |
|
readwrite |
Sets how stereo rendering is performed.
See SoRenderManager::StereoMode for a full description of the modes
The | current StereoMode |
|
readwrite |
Sets the transparency type to be used for the scene.
The | current TransparencyType |