Workspace 6.21.5
|
Widget for interactive rendering of a Scene object using OpenGL. More...
#include <Rendering/OpenGL/wsglwidget.h>
Inherits QWidget.
Public Types | |
enum | ManipulatorMode { NoManipulator , TranslateManipulator , RotateManipulator , ScaleManipulator } |
Public Slots | |
void | autoFit () |
void | focusCameraOnPosition (const CSIRO::Mesh::Vector3d &pos) |
void | nextCamera () |
void | previousCamera () |
void | renderScene () |
void | selectCurrItemElement (const Mesh::ElementType::Type *elementType, Mesh::ItemHandle::size_type elementIndex) |
void | selectCurrItemNode (Mesh::ItemHandle::size_type nodeIndex) |
void | selectItem (const QString &opIdPath) |
void | selectItem (CSIRO::Rendering::SceneInteractionWidgetItem *item) |
void | setCamera (const QString &name) |
void | setManipulatorMode (ManipulatorMode mode) |
void | setSelectionMode (RenderTargetType mode) |
Signals | |
void | heightChanged (int width) |
void | interactionQueued () |
void | itemSelected (const CSIRO::Rendering::PickedItem &item, const CSIRO::Rendering::PickFilter &filter) |
void | mouseButtonPressed () |
void | mouseButtonReleased () |
void | mouseMove () |
void | renderSceneSuccess () |
void | selectionCleared () |
void | settingsChanged (const CSIRO::Rendering::RenderSettings &settings) |
void | widthChanged (int width) |
Properties | |
bool | antialiasing |
QColor | backgroundColor |
QString | camera |
bool | cameraFrustumsSelectable |
bool | cameraSwitchable |
QString | centerOfOrbit |
bool | depthPeeling |
float | lineWidth |
bool | modelSelection |
unsigned | numDepthLayers |
int | numSamples |
bool | overrideSceneSettings |
float | pointSize |
bool | showCameraFrustums |
bool | showHud |
bool | showSelectionButtons |
bool | showSymbols |
float | ssaoAttenuation |
bool | ssaoEnabled |
int | ssaoNumSamples |
float | ssaoSampleLength |
float | ssaoStrength |
bool | suppressCameraWarnings |
double | symbolLineWidth |
The interactive controls are the specific combinations of mouse buttons and keyboard modifiers. The currently defined interactions are given in the following table:
Key / mouse | Effect |
Shift + LMB | Pan camera in opposite direction to mouse movement. This gives the impression of using the mouse to move the scene in the direction of mouse movement. |
Ctrl + LMB | Rotate view by moving camera about the focal point |
Ctrl + Shift + LMB | Rotate view about an axis perpendicular to the viewing plane. The movement should feel like the mouse has grabbed the scene and causes it to rotate about the viewing axis. |
Mouse wheel up/down | Modify the field of view in/out. This is somewhat like a zoom without actually moving the camera position. |
Shift + wheel up/down | Move the camera location forwards/backwards. This is sometimes referred to as a dolly camera movement. |
Ctrl + wheel up/down | Move the near clipping plane forwards/backwards |
Ctrl + Shift + wheel up/down | Move the far clipping plane forwards/backwards |
enum ManipulatorMode |
WSGLWidget | ( | QWidget * | parent = nullptr | ) |
parent | The widget that this WSGLWidget is parented to. |
|
overridedefault |
|
slot |
Make the whole scene fit inside the viewport and put the orbit center at the center of the scene's bounding box.
const QOpenGLContext * context | ( | ) | const |
void doneCurrent | ( | ) |
|
slot |
Reposition the camera to have it's orbit centre at this position
bool getAntialiasingEnabled | ( | ) | const |
const QColor & getBackgroundColor | ( | ) | const |
const QString & getCamera | ( | ) | const |
bool getCameraFrustumsSelectable | ( | ) | const |
const Mesh::Vector3d & getCenterOfOrbit | ( | ) | const |
bool getDepthPeelingEnabled | ( | ) | const |
float getLineWidth | ( | ) | const |
unsigned getMaxSupportedDepthLayers | ( | ) | const |
int getNumAntialiasingSamples | ( | ) | const |
unsigned getNumDepthLayers | ( | ) | const |
bool getOverrideSceneSettings | ( | ) | const |
float getPointSize | ( | ) | const |
const RenderSettings & getRenderSettings | ( | ) | const |
Scene * getScene | ( | ) |
const Scene * getScene | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool getSelectionEnabled | ( | ) | const |
bool getShowCameraFrustums | ( | ) | const |
bool getShowHud | ( | ) | const |
bool getShowSelectionButtons | ( | ) | const |
bool getShowSymbols | ( | ) |
float getSsaoAttenuation | ( | ) | const |
bool getSsaoEnabled | ( | ) | const |
int getSsaoNumSamples | ( | ) | const |
float getSsaoSampleLength | ( | ) | const |
float getSsaoStrength | ( | ) | const |
bool getSuppressCameraWarnings | ( | ) | const |
double getSymbolLineWidth | ( | ) | const |
QImage grabFrameBuffer | ( | ) |
|
signal |
void installInteractionFilter | ( | QObject * | filterObj | ) |
filterObj | The event filter to install on the main GL canvas inside the widget. |
Installs an event filter on the main QOpenGLWidget contained within this widget. This allows calling code to install custom event handling code to handle special mouse / keypresses that are not included in the default WSGLWidget.
|
signal |
bool isCameraSwitchable | ( | ) | const |
|
signal |
bool lastRenderSucceeded | ( | ) | const |
void makeCurrent | ( | ) |
|
signal |
|
signal |
|
signal |
|
slot |
If the widget permits switching cameras, this function will switch to the next camera in the list of cameras from the last scene rendered.
|
slot |
If the widget permits switching cameras, this function will switch to the preceding camera in the list of cameras from the last scene rendered.
|
slot |
|
signal |
|
slot |
|
slot |
|
signal |
|
slot |
|
slot |
void setAntialiasingEnabled | ( | bool | b | ) |
void setBackgroundColor | ( | const QColor & | color | ) |
color | The background color the widget should use when rendering. |
|
slot |
cameraName | The name of the camera to use for the view into the scene. If the scene does not have the named camera, a default internal camera will be used, which is usually not going to be what you want but at least allows you to see the scene. |
void setCameraFrustumsSelectable | ( | bool | b | ) |
void setCameraSwitchable | ( | bool | b | ) |
b | If true, the user will be allowed to switch to a different camera (eg through the context menu). If false, the context menu won't contain any entries to do this and both nextCamera() and previousCamera() will do nothing. The default is to allow camera switching. |
void setCenterOfOrbit | ( | const Mesh::Vector3d & | center | ) |
center | The new point about which subsequent mouse orbits will rotate. |
void setDepthPeelingEnabled | ( | bool | b | ) |
void setLineWidth | ( | float | width | ) |
|
slot |
void setNumAntialiasingSamples | ( | int | n | ) |
void setNumDepthLayers | ( | unsigned | n | ) |
void setOverrideSceneSettings | ( | bool | b | ) |
b | Whether or not to override the scene's render settings. |
void setPointSize | ( | float | size | ) |
void setRenderSettings | ( | const RenderSettings & | settings | ) |
void setScene | ( | Scene * | scene | ) |
scene | The new scene the widget should render. |
The old scene is not deleted, since the widget does not take ownership of the scene. If scene is a null pointer, then the widget will not render any scene at all (it is not an error to do this).
void setSelectionEnabled | ( | bool | b | ) |
|
slot |
void setShowCameraFrustums | ( | bool | b | ) |
void setShowHud | ( | bool | b | ) |
b | Set to true if the heads-up display should be included in the render or false if it should be kept hidden. |
void setShowSelectionButtons | ( | bool | b | ) |
b | If true, the selection buttons will be shown on the WSGLWidget |
Shows / hides the selection buttons on the WSGL widget. Does not disable model selection.
void setShowSymbols | ( | bool | b | ) |
b | Enable or disable the display of symbols in the renderer. |
void setSsaoAttenuation | ( | float | a | ) |
void setSsaoEnabled | ( | bool | b | ) |
void setSsaoNumSamples | ( | int | n | ) |
void setSsaoSampleLength | ( | float | l | ) |
void setSsaoStrength | ( | float | s | ) |
void setSuppressCameraWarnings | ( | bool | b | ) |
void setSymbolLineWidth | ( | double | width | ) |
|
signal |
void setUndoDetails | ( | QUndoStack & | undoStack, |
DataExecution::Workspace & | rootWorkspace, | ||
const QString & | sceneIdPath | ||
) |
undoStack | The undo stack to give to the widget to allow manipulator events to be reversed using undo / redo. |
rootWorkspace | The workspace that contains the scene we are rendering. We need this because UndoCommands may exist beyond the lifetime of both the Scene and this widget, so we need to make sure we retrieve them both (if they exist) on demand. |
sceneIdPath | The path to the operation that creates the scene, relative to rootWorkspace. |
Sets up the details required for undoing manipulator events in the widget. If this is not invoked prior to renderScene() is called, undo will not be able to be used.
|
override |
|
override |
|
signal |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |