Coin3D is Free Software, published under the BSD 3-clause license. |
https://bitbucket.org/Coin3D/ http://www.kongsberg.com/kogt/ |
The QuarterWidget class is the main class in Quarter. It provides a widget for Coin rendering. It provides scenegraph management and event handling. More...
#include <Quarter/QuarterWidget.h>
Public Types | |
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 } |
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 } |
Public Slots | |
virtual void | viewAll (void) |
virtual void | seek (void) |
void | redraw (void) |
void | setRenderMode (RenderMode mode) |
void | setStereoMode (StereoMode mode) |
void | setTransparencyType (TransparencyType type) |
Signals | |
void | devicePixelRatioChanged (qreal dev_pixel_ratio) |
Public Member Functions | |
QuarterWidget (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 (const QGLFormat &format, QWidget *parent=0, const QGLWidget *shareWidget=0, Qt::WindowFlags f=0) | |
virtual | ~QuarterWidget () |
TransparencyType | transparencyType (void) const |
RenderMode | renderMode (void) const |
StereoMode | stereoMode (void) const |
void | setBackgroundColor (const QColor &color) |
QColor | backgroundColor (void) const |
qreal | devicePixelRatio (void) const |
void | resetNavigationModeFile (void) |
void | setNavigationModeFile (const QUrl &url=QUrl(DEFAULT_NAVIGATIONFILE)) |
const QUrl & | navigationModeFile (void) const |
void | setContextMenuEnabled (bool yes) |
bool | contextMenuEnabled (void) const |
QMenu * | getContextMenu (void) const |
bool | headlightEnabled (void) const |
void | setHeadlightEnabled (bool onoff) |
SoDirectionalLight * | getHeadlight (void) |
bool | clearZBuffer (void) const |
void | setClearZBuffer (bool onoff) |
bool | clearWindow (void) const |
void | setClearWindow (bool onoff) |
bool | interactionModeEnabled (void) const |
void | setInteractionModeEnabled (bool onoff) |
bool | interactionModeOn (void) const |
void | setInteractionModeOn (bool onoff) |
void | setStateCursor (const SbName &state, const QCursor &cursor) |
QCursor | stateCursor (const SbName &state) |
uint32_t | getCacheContextId (void) const |
virtual void | setSceneGraph (SoNode *root) |
virtual SoNode * | getSceneGraph (void) const |
void | setSoEventManager (SoEventManager *manager) |
SoEventManager * | getSoEventManager (void) const |
void | setSoRenderManager (SoRenderManager *manager) |
SoRenderManager * | getSoRenderManager (void) const |
EventFilter * | getEventFilter (void) const |
void | addStateMachine (SoScXMLStateMachine *statemachine) |
void | removeStateMachine (SoScXMLStateMachine *statemachine) |
virtual bool | processSoEvent (const SoEvent *event) |
virtual QSize | minimumSizeHint (void) const |
QList< QAction * > | transparencyTypeActions (void) const |
QList< QAction * > | stereoModeActions (void) const |
QList< QAction * > | renderModeActions (void) const |
Protected Member Functions | |
virtual void | resizeGL (int width, int height) |
virtual void | initializeGL (void) |
virtual void | paintGL (void) |
virtual void | actualRedraw (void) |
virtual bool | updateDevicePixelRatio (void) |
Properties | |
QUrl | navigationModeFile |
QColor | backgroundColor |
bool | contextMenuEnabled |
bool | headlightEnabled |
bool | clearZBuffer |
bool | clearWindow |
bool | interactionModeEnabled |
bool | interactionModeOn |
TransparencyType | transparencyType |
RenderMode | renderMode |
StereoMode | stereoMode |
qreal | devicePixelRatio |
The QuarterWidget class is the main class in Quarter. It provides a widget for Coin rendering. It provides scenegraph 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.:
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
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
|
explicit |
constructor
|
explicit |
constructor
|
explicit |
constructor
|
virtual |
destructor
QuarterWidget::TransparencyType QuarterWidget::transparencyType | ( | void | ) | const |
The | current TransparencyType |
QuarterWidget::RenderMode QuarterWidget::renderMode | ( | void | ) | const |
The | current RenderMode |
QuarterWidget::StereoMode QuarterWidget::stereoMode | ( | void | ) | const |
The | current StereoMode |
void QuarterWidget::setBackgroundColor | ( | const QColor & | color | ) |
Set backgroundcolor 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.
QColor QuarterWidget::backgroundColor | ( | void | ) | const |
Returns color used for clearing the rendering area before rendering the scene.
qreal QuarterWidget::devicePixelRatio | ( | void | ) | const |
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).
void QuarterWidget::resetNavigationModeFile | ( | void | ) |
Removes any navigationModeFile set.
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 |
const QUrl & QuarterWidget::navigationModeFile | ( | void | ) | const |
The | current navigationModeFile |
void QuarterWidget::setContextMenuEnabled | ( | bool | yes | ) |
Controls the display of the contextmenu
[in] | yes | Context menu on? |
bool QuarterWidget::contextMenuEnabled | ( | void | ) | const |
Is | context menu enabled? |
QMenu * QuarterWidget::getContextMenu | ( | void | ) | const |
Returns the context menu used by the widget.
bool QuarterWidget::headlightEnabled | ( | void | ) | const |
Returns true if the headlight is on, false if it is off
void QuarterWidget::setHeadlightEnabled | ( | bool | onoff | ) |
Enable/disable the headlight. This will toggle the SoDirectionalLight::on field (returned from getHeadlight()).
SoDirectionalLight * QuarterWidget::getHeadlight | ( | void | ) |
Returns the light used for the headlight.
bool QuarterWidget::clearZBuffer | ( | void | ) | const |
Returns true if the z buffer is cleared before rendering.
void QuarterWidget::setClearZBuffer | ( | bool | onoff | ) |
Specify if you want the z buffer to be cleared before redraw. This is on by default.
bool QuarterWidget::clearWindow | ( | void | ) | const |
Returns true if the rendering buffer is cleared before rendering.
void QuarterWidget::setClearWindow | ( | bool | onoff | ) |
Specify if you want the rendering buffer to be cleared before rendering. This is on by default.
bool QuarterWidget::interactionModeEnabled | ( | void | ) | const |
Returns true if interaction mode is enabled, false otherwise.
void QuarterWidget::setInteractionModeEnabled | ( | bool | onoff | ) |
Enable/disable interaction mode.
Specifies whether you may use the alt-key to enter interaction mode.
bool QuarterWidget::interactionModeOn | ( | void | ) | const |
Returns true if interaction mode is on.
void QuarterWidget::setInteractionModeOn | ( | bool | onoff | ) |
Turn interaction mode on or off.
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
QCursor QuarterWidget::stateCursor | ( | const SbName & | state | ) |
Maps a state to a cursor
[in] | state | Named state in the statemachine |
Cursor | corresponding to the given state |
uint32_t QuarterWidget::getCacheContextId | ( | void | ) | const |
Returns the Coin cache context id for this widget.
|
virtual |
Sets the Inventor scenegraph to be rendered
|
virtual |
Returns pointer to root of scene graph
void QuarterWidget::setSoEventManager | ( | SoEventManager * | manager | ) |
Set the Coin event manager for the widget.
SoEventManager * QuarterWidget::getSoEventManager | ( | void | ) | const |
Returns a pointer to the event manager
void QuarterWidget::setSoRenderManager | ( | SoRenderManager * | manager | ) |
Set the render manager for the widget.
SoRenderManager * QuarterWidget::getSoRenderManager | ( | void | ) | const |
Returns a pointer to the render manager.
EventFilter * QuarterWidget::getEventFilter | ( | void | ) | const |
Returns a pointer to the event filter
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.
void QuarterWidget::removeStateMachine | ( | SoScXMLStateMachine * | statemachine | ) |
Convenience method that removes a state machine to the current SoEventManager.
|
virtual |
Passes an event to the eventmanager.
[in] | event | to pass |
Returns | true if the event was successfully processed |
|
virtual |
See QWidget::minimumSizeHint
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.
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::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.
|
virtualslot |
Reposition the current camera to display the entire scene
|
virtualslot |
Sets the current camera in seekmode, if supported by the underlying navigation system. Camera typically seeks towards what the mouse is pointing at.
|
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.
|
slot |
Sets how rendering of primitives is done.
See SoRenderManager::RenderMode for a full description of the modes
|
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.
|
protectedvirtual |
Overridden from QGLWidget to resize the Coin scenegraph
|
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.
|
protectedvirtual |
Overridden from QGLWidget to render the scenegraph
|
protectedvirtual |
Overridden from QGLWidget to render the scenegraph
|
readwrite |
An url to a navigation mode file which is a scxml file which defines the possible states for the Coin navigation system
Supports:
|
readwrite |
Set backgroundcolor 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.
|
readwrite |
Controls the display of the contextmenu
[in] | yes | Context menu on? |
|
readwrite |
Enable/disable the headlight. This will toggle the SoDirectionalLight::on field (returned from getHeadlight()).
|
readwrite |
Specify if you want the z buffer to be cleared before redraw. This is on by default.
|
readwrite |
Specify if you want the rendering buffer to be cleared before rendering. This is on by default.
|
readwrite |
Enable/disable interaction mode.
Specifies whether you may use the alt-key to enter interaction mode.
|
readwrite |
Turn interaction mode on or off.
|
readwrite |
Sets the transparency type to be used for the scene.
|
readwrite |
Sets how rendering of primitives is done.
See SoRenderManager::RenderMode for a full description of the modes
|
readwrite |
Sets how stereo rendering is performed.
See SoRenderManager::StereoMode for a full description of the modes