Fraxinus  16.5.0-fx-rc6
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::ViewManager Class Reference

Creates a pool of views and offers an interface to them, also handles layouts on a centralwidget. More...

#include <cxViewManager.h>

Inheritance diagram for cx::ViewManager:

Signals

void fps (int number)
 Emits number of frames per second. More...
 
void activeLayoutChanged ()
 emitted when the active layout changes More...
 
void activeViewChanged ()
 emitted when the active view changes More...
 
void renderingEnabledChanged ()
 emitted then rendering is enabled/disabled More...
 
void pointSampled (Vector3D p_r)
 
void renderFinished ()
 

Public Member Functions

virtual ~ViewManager ()
 
ViewPtr get3DView (int group=0, int index=0)
 
virtual ViewGroupDataPtr getViewGroup (int groupIdx) const
 
unsigned viewGroupCount () const
 
virtual int getActiveViewGroup () const
 
LayoutRepositoryPtr getLayoutRepository ()
 
QActionGroup * getInteractorStyleActionGroup ()
 
NavigationPtr getNavigation (int group=0)
 
QWidget * createLayoutWidget (QWidget *parent, int index)
 
QWidget * getLayoutWidget (int index)
 
void enableRender (bool val)
 
bool renderingIsEnabled () const
 
QString getActiveLayout (int widgetIndex=0) const
 returns the active layout More...
 
void setActiveLayout (const QString &uid, int widgetIndex=0)
 change the layout More...
 
InteractiveCropperPtr getCropper ()
 
CyclicActionLoggerPtr getRenderTimer ()
 
void deactivateCurrentLayout ()
 deactivate the current layout, leaving an empty layout More...
 
void autoShowData (DataPtr data)
 
CameraControlPtr getCameraControl ()
 
void clear ()
 
void addXml (QDomNode &parentNode)
 
void parseXml (QDomNode viewmanagerNode)
 
void centerToImageCenterInViewGroup (unsigned groupNr)
 
void setCameraStyle (CAMERA_STYLE_TYPE style, int groupIdx)
 
void addDefaultLayout (LayoutData layoutData)
 

Static Public Member Functions

static ViewManagerPtr create (VisServicesPtr backend)
 

Protected Slots

void settingsChangedSlot (QString key)
 
void onLayoutRepositoryChanged (QString uid)
 
void updateViews ()
 
void updateCameraStyleActions ()
 
void setActiveView (QString viewUid)
 

Protected Member Functions

 ViewManager (VisServicesPtr backend)
 
std::vector< ViewGroupPtrgetViewGroups ()
 
void activateView (ViewCollectionWidget *widget, LayoutViewData viewData)
 
ViewWrapperPtr createViewWrapper (ViewPtr view, LayoutViewData viewData)
 
int findGroupContaining3DViewGivenGuess (int preferredGroup)
 
QString getActiveView () const
 returns the active view More...
 
void setRenderingInterval (int interval)
 
void setSlicePlanesProxyInViewsUpTo2DViewgroup ()
 
void loadGlobalSettings ()
 
void saveGlobalSettings ()
 
void activateViews (ViewCollectionWidget *widget, LayoutData next)
 
void rebuildLayouts ()
 
void initializeGlobal2DZoom ()
 
void initializeActiveView ()
 
void layoutWidgetDestroyed (QObject *object)
 
void autoShowInViewGroups (DataPtr data)
 
void autoResetCameraToSuperiorView ()
 
void autoCenterToImageCenter ()
 
QList< unsigned > getViewGroupsToAutoShowIn ()
 

Protected Attributes

LayoutRepositoryPtr mLayoutRepository
 
std::vector< QPointer
< ViewCollectionWidget > > 
mLayoutWidgets
 
QStringList mActiveLayout
 the active layout (type) More...
 
SyncedValuePtr mActiveView
 
RenderLoopPtr mRenderLoop
 
std::vector< ViewGroupPtrmViewGroups
 
CameraControlPtr mCameraControl
 
bool mGlobalObliqueOrientation
 controlling whether or not all 2d views should be oblique or orthogonal More...
 
SyncedValuePtr mGlobal2DZoomVal
 
InteractiveCropperPtr mInteractiveCropper
 
SlicePlanesProxyPtr mSlicePlanesProxy
 
CameraStyleInteractorPtr mCameraStyleInteractor
 
VisServicesPtr mBackend
 

Detailed Description

Creates a pool of views and offers an interface to them, also handles layouts on a centralwidget.

cxArchitecture_visualization.png
Overview of ViewManager and Views

The primitive element is the View. Various derivations of ViewWrapper controls each view and fills them with Reps. ViewWrapper2D controls a 2D slice, ViewWrapper3D controls a full 3D scene, ViewWrapperRTSource shows a video stream.

ViewManager handles the visualization of the 3D data. It composes the Views onto the QWidget using a QGridLayout. This is called a Layout in the GUI. Available layouts can be found inside ViewManager. The QWidget is the centralWidget in the MainWindow.

The views are divided into several groups. Each group, represented by a ViewGroup, has some common characteristics, such as which data to display. These data are stored in a ViewGroupData. The View/ViewWrappers connected to a group, uses the ViewGroupData to know what they should visualize. Each ViewWrapper formats the data in their own way (as slices or 3D renderings).

The right-click menu in the Views are created inside the ViewWrappers. The data they manipulate are (mostly) stored within ViewGroupData.

cxArchitecture_view_layout.png
Pipeline from Data to rendering in Views, organization in groups and layout

Layout Example

The Layout uses QGridLayout to organize the views. Each view belong to a group that show the same data in different ways (for example: 3D+ACS). The layout and grouping can be reconfigured in the OR.

  • Group 0 displays A MR volume with an US overlay and segmented vessels.
  • Group 1 displays only the MR volume.
LayoutExample.png
Layout example, schematic view.
metastase_mr_us_small.png
Layout Example, rendered view.
Date
Dec 9, 2008
Jan 19, 2012
Author
Janne Beate Bakeng, SINTEF
Christian Askeland, SINTEF

Definition at line 129 of file cxViewManager.h.

Constructor & Destructor Documentation

cx::ViewManager::~ViewManager ( )
virtual

Definition at line 136 of file cxViewManager.cpp.

cx::ViewManager::ViewManager ( VisServicesPtr  backend)
protected

Definition at line 88 of file cxViewManager.cpp.

Member Function Documentation

void cx::ViewManager::activateView ( ViewCollectionWidget widget,
LayoutViewData  viewData 
)
protected

Definition at line 486 of file cxViewManager.cpp.

void cx::ViewManager::activateViews ( ViewCollectionWidget widget,
LayoutData  next 
)
protected

Definition at line 472 of file cxViewManager.cpp.

void cx::ViewManager::activeLayoutChanged ( )
signal

emitted when the active layout changes

void cx::ViewManager::activeViewChanged ( )
signal

emitted when the active view changes

void cx::ViewManager::addDefaultLayout ( LayoutData  layoutData)

Definition at line 687 of file cxViewManager.cpp.

void cx::ViewManager::addXml ( QDomNode &  parentNode)

Definition at line 305 of file cxViewManager.cpp.

void cx::ViewManager::autoCenterToImageCenter ( )
protected

Definition at line 652 of file cxViewManager.cpp.

void cx::ViewManager::autoResetCameraToSuperiorView ( )
protected

Definition at line 639 of file cxViewManager.cpp.

void cx::ViewManager::autoShowData ( DataPtr  data)

Definition at line 606 of file cxViewManager.cpp.

void cx::ViewManager::autoShowInViewGroups ( DataPtr  data)
protected

Definition at line 616 of file cxViewManager.cpp.

void cx::ViewManager::centerToImageCenterInViewGroup ( unsigned  groupNr)

Definition at line 663 of file cxViewManager.cpp.

void cx::ViewManager::clear ( )

Definition at line 360 of file cxViewManager.cpp.

ViewManagerPtr cx::ViewManager::create ( VisServicesPtr  backend)
static

Definition at line 81 of file cxViewManager.cpp.

QWidget * cx::ViewManager::createLayoutWidget ( QWidget *  parent,
int  index 
)

Initialize the widget and fill with the default view layout. Return the top widget, it should be added to the calling gui.

Definition at line 187 of file cxViewManager.cpp.

ViewWrapperPtr cx::ViewManager::createViewWrapper ( ViewPtr  view,
LayoutViewData  viewData 
)
protected

Definition at line 509 of file cxViewManager.cpp.

void cx::ViewManager::deactivateCurrentLayout ( )

deactivate the current layout, leaving an empty layout

deactivate the current layout, leaving an empty layout

Definition at line 389 of file cxViewManager.cpp.

void cx::ViewManager::enableRender ( bool  val)

Definition at line 140 of file cxViewManager.cpp.

int cx::ViewManager::findGroupContaining3DViewGivenGuess ( int  preferredGroup)
protected

Look for the index'th 3DView in given group.

Definition at line 594 of file cxViewManager.cpp.

void cx::ViewManager::fps ( int  number)
signal

Emits number of frames per second.

ViewPtr cx::ViewManager::get3DView ( int  group = 0,
int  index = 0 
)

Look for the index'th 3DView in given group.

Definition at line 370 of file cxViewManager.cpp.

QString cx::ViewManager::getActiveLayout ( int  widgetIndex = 0) const

returns the active layout

Definition at line 274 of file cxViewManager.cpp.

QString cx::ViewManager::getActiveView ( ) const
protected

returns the active view

Definition at line 280 of file cxViewManager.cpp.

int cx::ViewManager::getActiveViewGroup ( ) const
virtual

Definition at line 290 of file cxViewManager.cpp.

CameraControlPtr cx::ViewManager::getCameraControl ( )
inline

Definition at line 172 of file cxViewManager.h.

InteractiveCropperPtr cx::ViewManager::getCropper ( )

Definition at line 269 of file cxViewManager.cpp.

QActionGroup * cx::ViewManager::getInteractorStyleActionGroup ( )

Definition at line 569 of file cxViewManager.cpp.

LayoutRepositoryPtr cx::ViewManager::getLayoutRepository ( )

Definition at line 539 of file cxViewManager.cpp.

QWidget * cx::ViewManager::getLayoutWidget ( int  index)

Definition at line 180 of file cxViewManager.cpp.

NavigationPtr cx::ViewManager::getNavigation ( int  group = 0)

Definition at line 174 of file cxViewManager.cpp.

CyclicActionLoggerPtr cx::ViewManager::getRenderTimer ( )

Definition at line 668 of file cxViewManager.cpp.

ViewGroupDataPtr cx::ViewManager::getViewGroup ( int  groupIdx) const
virtual

Definition at line 406 of file cxViewManager.cpp.

std::vector<ViewGroupPtr> cx::ViewManager::getViewGroups ( )
inlineprotected

Definition at line 199 of file cxViewManager.h.

QList< unsigned > cx::ViewManager::getViewGroupsToAutoShowIn ( )
protected

Definition at line 623 of file cxViewManager.cpp.

void cx::ViewManager::initializeActiveView ( )
protected

Definition at line 164 of file cxViewManager.cpp.

void cx::ViewManager::initializeGlobal2DZoom ( )
protected

Definition at line 156 of file cxViewManager.cpp.

void cx::ViewManager::layoutWidgetDestroyed ( QObject *  object)
protected

When GUI deletes the layout widget, we must clear resources here. Our own destructor gets called in a secondary thread (from pluginframework->stop), which shouldnt destroy GL stuff.

Definition at line 221 of file cxViewManager.cpp.

void cx::ViewManager::loadGlobalSettings ( )
protected

Definition at line 556 of file cxViewManager.cpp.

void cx::ViewManager::onLayoutRepositoryChanged ( QString  uid)
protectedslot

Definition at line 544 of file cxViewManager.cpp.

void cx::ViewManager::parseXml ( QDomNode  viewmanagerNode)

Definition at line 325 of file cxViewManager.cpp.

void cx::ViewManager::pointSampled ( Vector3D  p_r)
signal
void cx::ViewManager::rebuildLayouts ( )
protected

Definition at line 438 of file cxViewManager.cpp.

void cx::ViewManager::renderFinished ( )
signal
void cx::ViewManager::renderingEnabledChanged ( )
signal

emitted then rendering is enabled/disabled

bool cx::ViewManager::renderingIsEnabled ( ) const

Definition at line 150 of file cxViewManager.cpp.

void cx::ViewManager::saveGlobalSettings ( )
protected

Definition at line 562 of file cxViewManager.cpp.

void cx::ViewManager::setActiveLayout ( const QString &  layout,
int  widgetIndex = 0 
)

change the layout

Change layout from current to layout.

Definition at line 415 of file cxViewManager.cpp.

void cx::ViewManager::setActiveView ( QString  viewUid)
protectedslot

Definition at line 285 of file cxViewManager.cpp.

void cx::ViewManager::setCameraStyle ( CAMERA_STYLE_TYPE  style,
int  groupIdx 
)

Definition at line 673 of file cxViewManager.cpp.

void cx::ViewManager::setRenderingInterval ( int  interval)
protected

Definition at line 481 of file cxViewManager.cpp.

void cx::ViewManager::setSlicePlanesProxyInViewsUpTo2DViewgroup ( )
protected

Definition at line 454 of file cxViewManager.cpp.

void cx::ViewManager::settingsChangedSlot ( QString  key)
protectedslot

Definition at line 253 of file cxViewManager.cpp.

void cx::ViewManager::updateCameraStyleActions ( )
protectedslot

Definition at line 574 of file cxViewManager.cpp.

void cx::ViewManager::updateViews ( )
protectedslot

Definition at line 243 of file cxViewManager.cpp.

unsigned cx::ViewManager::viewGroupCount ( ) const
inline

Definition at line 139 of file cxViewManager.h.

Member Data Documentation

QStringList cx::ViewManager::mActiveLayout
protected

the active layout (type)

Definition at line 219 of file cxViewManager.h.

SyncedValuePtr cx::ViewManager::mActiveView
protected

Definition at line 220 of file cxViewManager.h.

VisServicesPtr cx::ViewManager::mBackend
protected

Definition at line 232 of file cxViewManager.h.

CameraControlPtr cx::ViewManager::mCameraControl
protected

Definition at line 223 of file cxViewManager.h.

CameraStyleInteractorPtr cx::ViewManager::mCameraStyleInteractor
protected

Definition at line 231 of file cxViewManager.h.

SyncedValuePtr cx::ViewManager::mGlobal2DZoomVal
protected

Definition at line 226 of file cxViewManager.h.

bool cx::ViewManager::mGlobalObliqueOrientation
protected

controlling whether or not all 2d views should be oblique or orthogonal

Definition at line 225 of file cxViewManager.h.

InteractiveCropperPtr cx::ViewManager::mInteractiveCropper
protected

Definition at line 228 of file cxViewManager.h.

LayoutRepositoryPtr cx::ViewManager::mLayoutRepository
protected

Definition at line 217 of file cxViewManager.h.

std::vector<QPointer<ViewCollectionWidget> > cx::ViewManager::mLayoutWidgets
protected

Definition at line 218 of file cxViewManager.h.

RenderLoopPtr cx::ViewManager::mRenderLoop
protected

Definition at line 221 of file cxViewManager.h.

SlicePlanesProxyPtr cx::ViewManager::mSlicePlanesProxy
protected

Definition at line 229 of file cxViewManager.h.

std::vector<ViewGroupPtr> cx::ViewManager::mViewGroups
protected

Definition at line 222 of file cxViewManager.h.


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