CustusX  15.3.3-beta
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...
 

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 * createInteractorStyleActionGroup ()
 
NavigationPtr getNavigation ()
 
QWidget * getLayoutWidget (QWidget *parent, 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...
 
InteractiveClipperPtr getClipper ()
 
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)
 

Static Public Member Functions

static VisualizationServiceOldPtr create (CoreServicesPtr backend)
 

Protected Slots

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

Protected Member Functions

 ViewManager (CoreServicesPtr backend)
 
void syncOrientationMode (SyncedValuePtr val)
 
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)
 

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
 
InteractiveClipperPtr mInteractiveClipper
 
InteractiveCropperPtr mInteractiveCropper
 
SlicePlanesProxyPtr mSlicePlanesProxy
 
CameraStyleInteractorPtr mCameraStyleInteractor
 
CoreServicesPtr 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 141 of file cxViewManager.cpp.

cx::ViewManager::ViewManager ( CoreServicesPtr  backend)
protected

Definition at line 90 of file cxViewManager.cpp.

Member Function Documentation

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

Definition at line 501 of file cxViewManager.cpp.

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

Definition at line 487 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::addXml ( QDomNode &  parentNode)

Definition at line 314 of file cxViewManager.cpp.

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

Definition at line 621 of file cxViewManager.cpp.

void cx::ViewManager::clear ( )

Definition at line 379 of file cxViewManager.cpp.

VisualizationServiceOldPtr cx::ViewManager::create ( CoreServicesPtr  backend)
static

Definition at line 83 of file cxViewManager.cpp.

QActionGroup * cx::ViewManager::createInteractorStyleActionGroup ( )

Definition at line 583 of file cxViewManager.cpp.

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

Definition at line 524 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 408 of file cxViewManager.cpp.

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

Definition at line 145 of file cxViewManager.cpp.

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

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

Definition at line 608 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 389 of file cxViewManager.cpp.

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

returns the active layout

Definition at line 275 of file cxViewManager.cpp.

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

returns the active view

Definition at line 281 of file cxViewManager.cpp.

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

Definition at line 291 of file cxViewManager.cpp.

CameraControlPtr cx::ViewManager::getCameraControl ( )
inline

Definition at line 172 of file cxViewManager.h.

InteractiveClipperPtr cx::ViewManager::getClipper ( )

Definition at line 265 of file cxViewManager.cpp.

InteractiveCropperPtr cx::ViewManager::getCropper ( )

Definition at line 270 of file cxViewManager.cpp.

LayoutRepositoryPtr cx::ViewManager::getLayoutRepository ( )

Definition at line 553 of file cxViewManager.cpp.

QWidget * cx::ViewManager::getLayoutWidget ( 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 185 of file cxViewManager.cpp.

NavigationPtr cx::ViewManager::getNavigation ( )

Definition at line 180 of file cxViewManager.cpp.

CyclicActionLoggerPtr cx::ViewManager::getRenderTimer ( )

Definition at line 629 of file cxViewManager.cpp.

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

Definition at line 425 of file cxViewManager.cpp.

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

Definition at line 197 of file cxViewManager.h.

void cx::ViewManager::initializeActiveView ( )
protected

Definition at line 169 of file cxViewManager.cpp.

void cx::ViewManager::initializeGlobal2DZoom ( )
protected

Definition at line 161 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 217 of file cxViewManager.cpp.

void cx::ViewManager::loadGlobalSettings ( )
protected

Definition at line 570 of file cxViewManager.cpp.

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

Definition at line 558 of file cxViewManager.cpp.

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

Definition at line 341 of file cxViewManager.cpp.

void cx::ViewManager::rebuildLayouts ( )
protected

Definition at line 454 of file cxViewManager.cpp.

void cx::ViewManager::renderingEnabledChanged ( )
signal

emitted then rendering is enabled/disabled

bool cx::ViewManager::renderingIsEnabled ( ) const

Definition at line 155 of file cxViewManager.cpp.

void cx::ViewManager::saveGlobalSettings ( )
protected

Definition at line 576 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 434 of file cxViewManager.cpp.

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

Definition at line 286 of file cxViewManager.cpp.

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

Definition at line 496 of file cxViewManager.cpp.

void cx::ViewManager::setSlicePlanesProxyInViewsUpTo2DViewgroup ( )
protected

Definition at line 469 of file cxViewManager.cpp.

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

Definition at line 249 of file cxViewManager.cpp.

void cx::ViewManager::syncOrientationMode ( SyncedValuePtr  val)
protected

Definition at line 306 of file cxViewManager.cpp.

void cx::ViewManager::updateCameraStyleActions ( )
protectedslot

Definition at line 588 of file cxViewManager.cpp.

void cx::ViewManager::updateViews ( )
protectedslot

Definition at line 239 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 217 of file cxViewManager.h.

SyncedValuePtr cx::ViewManager::mActiveView
protected

Definition at line 218 of file cxViewManager.h.

CoreServicesPtr cx::ViewManager::mBackend
protected

Definition at line 231 of file cxViewManager.h.

CameraControlPtr cx::ViewManager::mCameraControl
protected

Definition at line 221 of file cxViewManager.h.

CameraStyleInteractorPtr cx::ViewManager::mCameraStyleInteractor
protected

Definition at line 230 of file cxViewManager.h.

SyncedValuePtr cx::ViewManager::mGlobal2DZoomVal
protected

Definition at line 224 of file cxViewManager.h.

bool cx::ViewManager::mGlobalObliqueOrientation
protected

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

Definition at line 223 of file cxViewManager.h.

InteractiveClipperPtr cx::ViewManager::mInteractiveClipper
protected

Definition at line 226 of file cxViewManager.h.

InteractiveCropperPtr cx::ViewManager::mInteractiveCropper
protected

Definition at line 227 of file cxViewManager.h.

LayoutRepositoryPtr cx::ViewManager::mLayoutRepository
protected

Definition at line 215 of file cxViewManager.h.

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

Definition at line 216 of file cxViewManager.h.

RenderLoopPtr cx::ViewManager::mRenderLoop
protected

Definition at line 219 of file cxViewManager.h.

SlicePlanesProxyPtr cx::ViewManager::mSlicePlanesProxy
protected

Definition at line 228 of file cxViewManager.h.

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

Definition at line 220 of file cxViewManager.h.


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