OpenCMISS-Zinc C++ API Documentation
|
The Zinc sceneviewer is responsible for rendering the graphical Scene. More...
#include <sceneviewer.hpp>
Public Types | |
enum | BufferingMode { BUFFERING_MODE_INVALID = CMZN_SCENEVIEWER_BUFFERING_MODE_INVALID, BUFFERING_MODE_DEFAULT = CMZN_SCENEVIEWER_BUFFERING_MODE_DEFAULT, BUFFERING_MODE_SINGLE = CMZN_SCENEVIEWER_BUFFERING_MODE_SINGLE, BUFFERING_MODE_DOUBLE = CMZN_SCENEVIEWER_BUFFERING_MODE_DOUBLE, BUFFERING_MODE_RENDER_OFFSCREEN_AND_COPY = CMZN_SCENEVIEWER_BUFFERING_MODE_RENDER_OFFSCREEN_AND_COPY, BUFFERING_MODE_RENDER_OFFSCREEN_AND_BLEND = CMZN_SCENEVIEWER_BUFFERING_MODE_RENDER_OFFSCREEN_AND_BLEND } |
enum | InteractMode { INTERACT_MODE_INVALID = CMZN_SCENEVIEWER_INTERACT_MODE_INVALID, INTERACT_MODE_STANDARD = CMZN_SCENEVIEWER_INTERACT_MODE_STANDARD, INTERACT_MODE_2D = CMZN_SCENEVIEWER_INTERACT_MODE_2D } |
enum | ProjectionMode { PROJECTION_MODE_INVALID = CMZN_SCENEVIEWER_PROJECTION_MODE_INVALID, PROJECTION_MODE_PARALLEL = CMZN_SCENEVIEWER_PROJECTION_MODE_PARALLEL, PROJECTION_MODE_PERSPECTIVE = CMZN_SCENEVIEWER_PROJECTION_MODE_PERSPECTIVE } |
enum | StereoMode { STEREO_MODE_INVALID = CMZN_SCENEVIEWER_STEREO_MODE_INVALID, STEREO_MODE_DEFAULT = CMZN_SCENEVIEWER_STEREO_MODE_DEFAULT, STEREO_MODE_MONO = CMZN_SCENEVIEWER_STEREO_MODE_MONO, STEREO_MODE_STEREO = CMZN_SCENEVIEWER_STEREO_MODE_STEREO } |
enum | TransparencyMode { TRANSPARENCY_MODE_INVALID = CMZN_SCENEVIEWER_TRANSPARENCY_MODE_INVALID, TRANSPARENCY_MODE_FAST = CMZN_SCENEVIEWER_TRANSPARENCY_MODE_FAST, TRANSPARENCY_MODE_SLOW = CMZN_SCENEVIEWER_TRANSPARENCY_MODE_SLOW, TRANSPARENCY_MODE_ORDER_INDEPENDENT = CMZN_SCENEVIEWER_TRANSPARENCY_MODE_ORDER_INDEPENDENT } |
enum | ViewportMode { VIEWPORT_MODE_INVALID = CMZN_SCENEVIEWER_VIEWPORT_MODE_INVALID, VIEWPORT_MODE_ABSOLUTE = CMZN_SCENEVIEWER_VIEWPORT_MODE_ABSOLUTE, VIEWPORT_MODE_RELATIVE = CMZN_SCENEVIEWER_VIEWPORT_MODE_RELATIVE, VIEWPORT_MODE_DISTORTING_RELATIVE = CMZN_SCENEVIEWER_VIEWPORT_MODE_DISTORTING_RELATIVE } |
Public Member Functions | |
Sceneviewer (cmzn_sceneviewer_id in_sceneviewer_id) | |
Sceneviewer (const Sceneviewer &sceneviewermodule) | |
Sceneviewer & | operator= (const Sceneviewer &sceneviewer) |
bool | isValid () const |
cmzn_sceneviewer_id | getId () const |
int | beginChange () |
int | endChange () |
int | renderScene () |
int | setScene (const Scene &scene) |
Scene | getScene () |
int | setScenefilter (const Scenefilter &scenefilter) |
Scenefilter | getScenefilter () |
int | setViewportSize (int width, int height) |
Sceneviewerinput | createSceneviewerinput () |
int | processSceneviewerinput (const Sceneviewerinput &input) |
int | getAntialiasSampling () |
int | setAntialiasSampling (int numberOfSamples) |
int | getEyePosition (double *eyeValuesOut3) |
int | setEyePosition (double const *eyeValuesIn3) |
InteractMode | getInteractMode () |
int | setInteractMode (InteractMode interactMode) |
int | getLookatPosition (double *lookatValuesOut3) |
int | setLookatPosition (double const *lookatValuesIn3) |
bool | getPerturbLinesFlag () |
int | setPerturbLinesFlag (bool value) |
ProjectionMode | getProjectionMode () |
int | setProjectionMode (ProjectionMode projectionMode) |
double | getTranslationRate () |
int | setTranslationRate (double translationRate) |
double | getTumbleRate () |
int | setTumbleRate (double tumbleRate) |
double | getZoomRate () |
int | setZoomRate (double zoomRate) |
int | getUpVector (double *upVectorValuesOut3) |
int | setUpVector (double const *upVectorValuesIn3) |
int | getLookatParameters (double *eyeValuesOut3, double *lookatValuesOut3, double *upVectorValuesOut3) |
int | setLookatParametersNonSkew (double const *eyeValuesIn3, double const *lookatValuesIn3, double const *upVectorValuesIn3) |
int | getViewingVolume (double *left, double *right, double *bottom, double *top, double *near_plane, double *far_plane) |
int | setViewingVolume (double left, double right, double bottom, double top, double near_plane, double far_plane) |
int | setBackgroundColourComponentRGB (double red, double green, double blue) |
int | setBackgroundColourRGB (const double *valuesIn3) |
int | getBackgroundColourRGB (double *valuesOut3) |
int | viewAll () |
TransparencyMode | getTransparencyMode () |
int | setTransparencyMode (TransparencyMode transparencyMode) |
int | getTransparencyLayers () |
int | setTransparencyLayers (int layers) |
double | getViewAngle () |
int | setViewAngle (double viewAngle) |
ViewportMode | getViewportMode () |
int | setViewportMode (ViewportMode viewportMode) |
double | getFarClippingPlane () |
double | getNearClippingPlane () |
int | setFarClippingPlane (double farClippingPlane) |
int | setNearClippingPlane (double nearClippingPlane) |
Sceneviewernotifier | createSceneviewernotifier () |
Protected Attributes | |
cmzn_sceneviewer_id | id |
The Zinc sceneviewer is responsible for rendering the graphical Scene.
The Zinc sceneviewer is responsible for rendering the graphical Scene using OpenGL. It has methods to set its top scene and scene filter, and to get and set attributes controlling the view orientation, field of view, clipping planes and more. The client is responsible for creating the OpenGL-capable canvas with a sceneviewer, informing the sceneviewer of its size including on resize events, making the OpenGL context current and invoking the render scene method of the sceneviewer.
Describes the buffering mode of the scene viewer. The special modes RENDER_OFFSCREEN_AND_COPY and RENDER_OFFSCREEN_AND_BLEND are used when an OpenGL context cannot be activated directly on the supplied window, such as when the graphics are to be composited by an external program. These are currently only implemeneted for winapi. The graphics will be drawn offscreen and only rendered on screen when requested. The COPY version will overwrite any existing pixels when drawing and the BLEND version will use the alpha channel of the rendered scene to blend itself with the existing pixels.
Controls the way the mouse and keyboard are used to interact with the scene viewer.
Specifies the sort of projection matrix used to render the 3D scene.
Specifies whether a STEREO capable scene viewer is required. This will have to work in cooperation with your window manager and hardware.
Controls the way partially transparent objects are rendered in scene viewer.
Specifies the behaviour of the NDC coordinates with respect to the size of the viewport.
|
inline |
Call this function before making multiple changes on the sceneviewer, this will stop sceneviewer from notifying clients of every change. After multiple changes have been made, call the sceneviewer end change method to restart notifications and notify clients of changes that have happened. Can be nested.
|
inline |
Create a scene viewer input object for manually setting mouse or other input event data.
|
inline |
Create a notifier for getting callbacks for changes to the scene viewer..
|
inline |
Call sceneviewer begin change method before making multiple changes on the sceneviewer, to stop sceneviewer from notifying clients of every change. After multiple changes have been made, call this method to restart notifications and notify clients of changes that have happened.
scene | The handle to the sceneviewer. |
|
inline |
Gets the number of jitter samples used to antialias the scene viewer.
|
inline |
Returns the background_colour of the scene viewer. The component order in the array is [red, green, blue]
valuesOut3 | The rgb components of the colour with values between [0, 1.0] |
|
inline |
Get the eye position of the scene viewer.
eyeValuesOut3 | Array of size 3 to hold the values of the eye position. |
|
inline |
Gets the distance from the eye_point to the far clipping plane in the scene viewer.
|
inline |
Return the C handle of the Sceneviewer object.
|
inline |
Gets the mouse and keyboard interaction mode of the scene viewer.
|
inline |
Gets the 3 main viewing parameters of the scene viewer: eye point, lookat point and up vector in a single call.
eyeValuesOut3 | Array of size 3 to receive the coordinates of the point you are looking from. |
lookatValuesOut3 | Array of size 3 to receive the coordinates of the point you are looking at, often also called the interest point. |
upVectorValuesOut3 | Array of size 3 to receive the vector giving the up orientation in the scene viewer. |
|
inline |
Get the lookat position of the scene viewer.
lookatValuesOut3 | Array of size 3 to hold the values of the lookat position. |
|
inline |
Gets the distance from the eye_point to the near clipping plane in the scene viewer.
|
inline |
Query whether lines are perturbed to appear in front of surfaces at the same depth to avoid visual stitching artefacts.
|
inline |
Gets the projection mode - parallel/perspective - of the scene viewer.
|
inline |
Get the top scene for the scene viewer.
|
inline |
Get the filter currently used in scene viewer.
|
inline |
Gets the rate at which translation occurs in relation to mouse movement using standard sceneviewerinput transformation processing.
|
inline |
Get the number of layers used in the TRANSPARENCY_MODE_ORDER_INDEPENDENT transparency mode.
|
inline |
Get the transparency_mode of the scene viewer. In fast transparency mode, the scene is drawn as it is, with depth buffer writing even for semi-transparent objects. In slow transparency mode, opaque objects are rendered first, then semi-transparent objects are rendered without writing the depth buffer. Hence, you can even see through the first semi-transparent surface drawn.
|
inline |
Gets the rate at which tumble occurs in relation to mouse movement using standard sceneviewerinput transformation processing.
|
inline |
Get the up vector of the scene viewer.
upVectorValuesOut3 | Array of size 3 to hold the values of the up vector. |
|
inline |
Gets the diagonal view angle, in radians, of the scene viewer. View angle is measured across the largest square which fits inside the viewing window.
|
inline |
Gets the viewing volume of the scene viewer.
|
inline |
Gets the viewport mode (absolute/relative/distorting relative) for the scene viewer.
|
inline |
Gets the rate at which zoom occurs in relation to mouse movement using standard sceneviewerinput transformation processing.
|
inline |
Check if this is a valid Sceneviewer object.
|
inline |
Manually calls the scene viewer's list of input callbacks with the supplied input data.
input | Description of the input event. |
|
inline |
Forces a redraw of the given scene viewer to take place immediately
|
inline |
Sets the number of jitter samples used to antialias the scene viewer.
numberOfSamples | The number of jitter samples used to antialias the graphics. Only 2, 4 or 8 samples are supported. Zero disables antialiasing. |
|
inline |
Sets the background_colour of the scene viewer by individual component. Each component should be in the range [0, 1.0].
red | The red component value between [0, 1.0] |
green | The green component value between [0, 1.0] |
blue | The blue component value between [0, 1.0] |
|
inline |
Sets the background_colour of the scene viewer. Each component should be in the range [0, 1.0]. The component order is [red, green, blue]
valuesIn3 | The rgb components of the colour |
|
inline |
Set the eye position of the scene viewer.
eyeValuesIn3 | Array of three values containing the new eye position. |
|
inline |
Sets the distance from the eye_point to the far clipping plane in the scene viewer.
farClippingPlane | distance from the eye_point to the far clipping plane |
|
inline |
Sets the mouse and keyboard interaction mode of the scene viewer.
|
inline |
Sets the 3 main viewing parameters of the scene viewer: eye point, lookat point and up vector in a single call. This function ensures the up vector is orthogonal to the view direction so the projection is not skew.
eyeValuesIn3 | The 3 coordinates of the point you are looking from. It is an error if this is at the same as the lookat point. |
lookatValuesIn3 | The 3 coordinates of the point you are looking at, often also called the interest point. |
upVectorValuesIn3 | A vector which gives the up orientation in the scene viewer. It is an error if this vector is colinear with the view direction line from the eye to the lookat point. This vector is automatically converted to a unit vector orthogonal to the view direction. |
|
inline |
Set the lookat position of the scene viewer.
lookatValuesIn3 | Array of three values containing the new lookat position. |
|
inline |
Sets the distance from the eye_point to the near clipping plane in the scene viewer.
nearClippingPlane | distance from the eye_point to the near clipping plane |
|
inline |
Set whether lines are perturbed to appear in front of surfaces at the same depth to avoid visual stitching artefacts. Uses GL_EXT_polygon_offset. Note that quality of surface-only graphics can be impacted with this mode.
value | New value of perturb lines flag. |
|
inline |
Sets the projection mode - parallel/perspective - of the scene viewer.
projectionMode | The new projection mode. |
|
inline |
Set the top scene for the scene viewer. Only graphics for this scene and its descendents, filtered by the scene filter, are displayed.
scene | The top scene to display. |
|
inline |
Set the filter to be used in scene viewer. All graphics will be shown if no filter is set.
scenefilter | Scene filter to set for scene viewer, or NULL to show all graphics in scene. |
|
inline |
Sets the rate at which translation occurs in relation to mouse movement using standard sceneviewerinput transformation processing.
translationRate | The translation rate; |
|
inline |
Set the number of layers used in the TRANSPARENCY_MODE_ORDER_INDEPENDENT transparency_mode.
layers | number of layers to be set for this scene viewer. |
|
inline |
Set the transparency_mode of the scene viewer.
transparencyMode | Transparency mode to be set for sceneviewer |
|
inline |
Sets the rate at which tumble occurs in relation to mouse movement using standard sceneviewerinput transformation processing.
tumbleRate | The tumble rate; |
|
inline |
Set the up vector of the scene viewer. Internally this is always converted into a unit vector.
upVectorValuesIn3 | Array of three values containing the new up vector. |
|
inline |
Sets the diagonal view angle, in radians, of the scene viewer. View angle is measured across the largest square which fits inside the viewing window.
viewAngle | The view angle in radians, > 0. |
|
inline |
Sets the viewing volume of the scene viewer. Unless the viewing volume is the same shape as the window, taking into account the aspect, the scene viewer will enlarge it to maintain the desired aspect ratio. Hence, the values specified represent the minimum viewing volume. The left, right, bottom and top values are at the lookat point, not on the near plane as OpenGL assumes. This gives a similar sized viewing_volume for both parallel and perspective projections. The viewing volume can be made unsymmetric to create special effects such as rendering a higher resolution image in parts.
|
inline |
Sets the viewport mode(absolute/relative/distorting relative) for the scene viewer.
|
inline |
Sets the width and height of the scene viewer's drawing area.
|
inline |
Sets the rate at which zoom occurs in relation to mouse movement using standard sceneviewerinput transformation processing.
zoomRate | The zoom rate; |
|
inline |
Finds the x, y and z ranges from the scene and sets the view parameters so that everything can be seen, and with window's std_view_angle. Also adjusts near and far clipping planes; if specific values are required, should follow with commands for setting these.