View Overview
The View
provides a render area to enable visualization of the current model data and
overlay items.
Each view can observe one or more Model
and is linked to a Camera
and a Viewer
. The Camera dictates how the model is viewed, while the Viewer class manages
the interaction with the computer’s windowing system.
Models
A view can accommodate one or more models for visualization. These models can be either an
UnstructGridModel
, a MarkupModel
, or a
GeometryModel
, each offering distinct visual configurations for your data.
See the Model topic for a description of the different model types.
Camera
The camera provides support for camera manipulation in the view. You can use a built-in input handler or create
your own customized input handler by sub classing cee::vis::CameraInputHandler
.
The camera enables both perspective (field of view and clipping planes) and parallel projection. It offers useful
features such as support for rubberband zooming and extracting a ray from windows coordinates to be used
for, for example, picking.
Each view has its own camera object.
Overlay Items
The view can have any number of overlay items. These are items drawn on top of the model in the view, for instance a color legend for scalar results.
Available overlay item
types are:
Overlay items are added to a corner of your choosing using Overlay::addItem()
.
Or, if you want full control over the overlay layout, you can add the overlay item using
LayoutDirection::ABSOLUTE_POSITION
and use OverlayItem::setAbsolutePosition()
.
Clipping
Clipping planes are used to clip parts of the geometry in the scene to be able to look inside. Anything behind (on the opposite side of the plane normal) the given planes is hidden.
CEETRON Envision supports bounded clipping planes. This allows for cutting out parts of
the model in many different ways. Normal clipping planes will clip an object/fragment if
it is on the wrong side of any of the active clipping planes.
By default an object/fragment will be clipped if it is behind (on the opposite side of the plane normal)
at least one of the specified planes. Setting
setMustBeBehindAllPlanesToClip()
to true will require that an object/fragment be behind all the specified planes in order to be clipped.
Background
The view’s background settings
.
The background can either be single colored or a gradient between a top and a bottom color.
Image Rendering
The current view can be exported to an image as a cee::Image
object. The cee::Image is a simple structure
containing raw RGBA image data and can be easily read from any image exporter tool. CEETRON Envision offer the helper
classes cee::ImageIoPng
and cee::ImageIoJpeg
to convert cee::Image
into PNG and JPEG files.
Bounding Box
The bounding box of all currently visible models can be found using boundingBox()
.