open_iA 2025.6
Loading...
Searching...
No Matches
iARendererViewSync Class Reference

Class synchronizing the viewing parameters between multiple renderers. More...

#include <iARendererViewSync.h>

Public Member Functions

 iARendererViewSync (bool sharedCamera=true)
 Creates a new renderer view synchronization service.
 
 ~iARendererViewSync ()
 destructor, disconnects from all renderers
 
void addToBundle (vtkRenderer *renderer)
 Adds given renderer to the bundle of renderers with synced views.
 
void removeAll ()
 Remove all renderers from the bundle synchronized by this class.
 
bool removeFromBundle (vtkRenderer *renderer, bool resetCamera=true)
 Remove given renderer from bundle.
 
bool sharedCamera () const
 whether this renderer view sync instance uses a shared camera or not
 

Detailed Description

Class synchronizing the viewing parameters between multiple renderers.

Two "modes":

  • Shared camera (default, i.e. sharedCamera = true in constructor), each added renderer gets assigned the same camera (the one from the renderer added first). Pro: Less overhead on updates (only triggering an update on other renderer windows) Con: The views share the visible area; so if the renderers have different pixel dimensions, viewed objects might be distorted (i.e., the aspect ratio is only correct in one window if they have different width/height ratios)
  • Synchronized camera settings: An observer is registered to each added renderer's camera, and whenever in one of them, the camera is modified, its main camera parameters (camera position, focal point, view up direction, clipping planes, and parallel scale if source camera has parallel projection turned on) are copied to all other renderers. Pro: Avoids sharing "too much", i.e. avoids distortions and renderers can have separate visible areas Con: Slightly more (coding) effort to synchronize relevant viewing parameters (and potentially error prone - relevant parameters for specific viewing modes might be missed)

Constructor & Destructor Documentation

◆ iARendererViewSync()

iARendererViewSync::iARendererViewSync ( bool sharedCamera = true)

Creates a new renderer view synchronization service.

Parameters
sharedCamerawhether to use shared camera (true) or just synchronize required view parameters (false). see class description for details.

◆ ~iARendererViewSync()

iARendererViewSync::~iARendererViewSync ( )

destructor, disconnects from all renderers

Member Function Documentation

◆ addToBundle()

void iARendererViewSync::addToBundle ( vtkRenderer * renderer)

Adds given renderer to the bundle of renderers with synced views.

Any change in that renderer's viewing parameters will be synced to all other renderers in the bundle.

Parameters
rendererthe renderer to add to the bundle

◆ removeAll()

void iARendererViewSync::removeAll ( )

Remove all renderers from the bundle synchronized by this class.

◆ removeFromBundle()

bool iARendererViewSync::removeFromBundle ( vtkRenderer * renderer,
bool resetCamera = true )

Remove given renderer from bundle.

Stops synchronizing this renderers' viewing parameters with the other renderers in the bundle.

Parameters
rendererthe renderer to remove from the bundle
resetCamerawhether the camera of the removed renderer should be reset to a new one with a copy of the settings of the common renderer; set to false for example if the renderer is not used after removing from bundle, or if you set your own camera. Note that when resetCamera=false, and you reuse the renderer afterwards, but don't set your own camera to the renderer, camera updates will still be shared to other renderers added to the bundle, but updates will not propagate anymore!

◆ sharedCamera()

bool iARendererViewSync::sharedCamera ( ) const

whether this renderer view sync instance uses a shared camera or not


The documentation for this class was generated from the following files: