CustusX  22.04
An IGT application
cx::ViewImplService Class Reference

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

#include <cxViewImplService.h>

Inheritance diagram for cx::ViewImplService:
cx::ViewService

Public Slots

virtual void aboutToStop ()
 
- Public Slots inherited from cx::ViewService
virtual void aboutToStop ()=0
 

Public Member Functions

 ViewImplService (ctkPluginContext *context)
 
virtual ~ViewImplService ()
 
virtual ViewPtr get3DView (int group=0, int index=0)
 
virtual int getActiveGroupId () const
 
virtual ViewGroupDataPtr getGroup (int groupIdx) const
 
virtual void setRegistrationMode (REGISTRATION_STATUS mode)
 
virtual void autoShowData (DataPtr data)
 
virtual void enableRender (bool val)
 
virtual bool renderingIsEnabled () const
 
virtual QWidget * createLayoutWidget (QWidget *parent, int index)
 Get the specified layout widget, create if necessary. More...
 
virtual QWidget * getLayoutWidget (int index)
 Get the specified layout widget, NULL if not created. More...
 
virtual QString getActiveLayout (int widgetIndex=0) const
 
virtual void setActiveLayout (const QString &uid, int widgetIndex)
 
virtual ClippersPtr getClippers ()
 
virtual InteractiveCropperPtr getCropper ()
 
virtual CyclicActionLoggerPtr getRenderTimer ()
 
virtual NavigationPtr getNavigation (int group=0)
 
virtual LayoutRepositoryPtr getLayoutRepository ()
 
virtual CameraControlPtr getCameraControl ()
 
virtual QActionGroup * getInteractorStyleActionGroup ()
 
virtual void centerToImageCenterInActiveViewGroup ()
 
virtual void addDefaultLayout (LayoutData layoutData)
 
virtual void enableContextMenuForViews (bool enable=true)
 
virtual bool isNull ()
 
virtual void setCameraStyle (CAMERA_STYLE_TYPE style, int groupIdx)
 
virtual void zoomCamera3D (int viewGroup3DNumber, int zoomFactor)
 
- Public Member Functions inherited from cx::ViewService
RepContainerPtr get3DReps (int group=0, int index=0)
 
unsigned groupCount () const
 
virtual void deactivateLayout ()
 
ViewGroupDataPtr getActiveViewGroup ()
 

Protected Slots

void layoutWidgetDestroyed (QObject *object)
 

Protected Member Functions

void rebuildLayouts ()
 
QList< unsigned > getViewGroupsToAutoShowIn ()
 

Protected Attributes

VisServicesPtr mServices
 
std::vector< QPointer< ViewCollectionWidget > > mLayoutWidgets
 
RenderWindowFactoryPtr mRenderWindowFactory
 
RenderLoopPtr mRenderLoop
 

Additional Inherited Members

- Signals inherited from cx::ViewService
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 ()
 
- Static Public Member Functions inherited from cx::ViewService
static ViewServicePtr getNullObject ()
 

Detailed Description

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

Implementation of ViewService.

cxArchitecture_visualization.png
Overview of ViewManager(=ViewService) 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.

ViewService 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 ViewService. 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
2014-09-19
2016-12-02
Author
Janne Beate Bakeng, SINTEF
Christian Askeland, SINTEF
Ole Vegard Solberg, SINTEF

Definition at line 83 of file cxViewImplService.h.

Constructor & Destructor Documentation

cx::ViewImplService::ViewImplService ( ctkPluginContext *  context)

Definition at line 48 of file cxViewImplService.cpp.

cx::ViewImplService::~ViewImplService ( )
virtual

Definition at line 63 of file cxViewImplService.cpp.

Member Function Documentation

void cx::ViewImplService::aboutToStop ( )
virtualslot

Definition at line 709 of file cxViewImplService.cpp.

void cx::ViewImplService::addDefaultLayout ( LayoutData  layoutData)
virtual

Implements cx::ViewService.

Definition at line 684 of file cxViewImplService.cpp.

void cx::ViewImplService::autoShowData ( DataPtr  data)
virtual

Implements cx::ViewService.

Definition at line 592 of file cxViewImplService.cpp.

void cx::ViewImplService::centerToImageCenterInActiveViewGroup ( )
virtual

Implements cx::ViewService.

Definition at line 719 of file cxViewImplService.cpp.

QWidget * cx::ViewImplService::createLayoutWidget ( QWidget *  parent,
int  index 
)
virtual

Get the specified layout widget, create if necessary.

Implements cx::ViewService.

Definition at line 166 of file cxViewImplService.cpp.

void cx::ViewImplService::enableContextMenuForViews ( bool  enable = true)
virtual

Implements cx::ViewService.

Definition at line 689 of file cxViewImplService.cpp.

void cx::ViewImplService::enableRender ( bool  val)
virtual

Implements cx::ViewService.

Definition at line 119 of file cxViewImplService.cpp.

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

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

Implements cx::ViewService.

Definition at line 346 of file cxViewImplService.cpp.

int cx::ViewImplService::getActiveGroupId ( ) const
virtual

Implements cx::ViewService.

Definition at line 266 of file cxViewImplService.cpp.

QString cx::ViewImplService::getActiveLayout ( int  widgetIndex = 0) const
virtual

Implements cx::ViewService.

Definition at line 250 of file cxViewImplService.cpp.

CameraControlPtr cx::ViewImplService::getCameraControl ( )
virtual

Implements cx::ViewService.

Definition at line 602 of file cxViewImplService.cpp.

ClippersPtr cx::ViewImplService::getClippers ( )
virtual

Implements cx::ViewService.

Definition at line 714 of file cxViewImplService.cpp.

InteractiveCropperPtr cx::ViewImplService::getCropper ( )
virtual

Implements cx::ViewService.

Definition at line 245 of file cxViewImplService.cpp.

ViewGroupDataPtr cx::ViewImplService::getGroup ( int  groupIdx) const
virtual

Implements cx::ViewService.

Definition at line 382 of file cxViewImplService.cpp.

QActionGroup * cx::ViewImplService::getInteractorStyleActionGroup ( )
virtual

Implements cx::ViewService.

Definition at line 556 of file cxViewImplService.cpp.

LayoutRepositoryPtr cx::ViewImplService::getLayoutRepository ( )
virtual

Implements cx::ViewService.

Definition at line 526 of file cxViewImplService.cpp.

QWidget * cx::ViewImplService::getLayoutWidget ( int  index)
virtual

Get the specified layout widget, NULL if not created.

Implements cx::ViewService.

Definition at line 159 of file cxViewImplService.cpp.

NavigationPtr cx::ViewImplService::getNavigation ( int  group = 0)
virtual

Implements cx::ViewService.

Definition at line 153 of file cxViewImplService.cpp.

CyclicActionLoggerPtr cx::ViewImplService::getRenderTimer ( )
virtual

Implements cx::ViewService.

Definition at line 656 of file cxViewImplService.cpp.

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

Definition at line 611 of file cxViewImplService.cpp.

bool cx::ViewImplService::isNull ( )
virtual

Implements cx::ViewService.

Definition at line 704 of file cxViewImplService.cpp.

void cx::ViewImplService::layoutWidgetDestroyed ( QObject *  object)
protectedslot

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 198 of file cxViewImplService.cpp.

void cx::ViewImplService::rebuildLayouts ( )
protected

Definition at line 422 of file cxViewImplService.cpp.

bool cx::ViewImplService::renderingIsEnabled ( ) const
virtual

Implements cx::ViewService.

Definition at line 129 of file cxViewImplService.cpp.

void cx::ViewImplService::setActiveLayout ( const QString &  layout,
int  widgetIndex 
)
virtual

Change layout from current to layout.

Implements cx::ViewService.

Definition at line 399 of file cxViewImplService.cpp.

void cx::ViewImplService::setCameraStyle ( CAMERA_STYLE_TYPE  style,
int  groupIdx 
)
virtual

Implements cx::ViewService.

Definition at line 661 of file cxViewImplService.cpp.

void cx::ViewImplService::setRegistrationMode ( REGISTRATION_STATUS  mode)
virtual

Implements cx::ViewService.

Definition at line 699 of file cxViewImplService.cpp.

void cx::ViewImplService::zoomCamera3D ( int  viewGroup3DNumber,
int  zoomFactor 
)
virtual

Implements cx::ViewService.

Definition at line 675 of file cxViewImplService.cpp.

Member Data Documentation

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

Definition at line 144 of file cxViewImplService.h.

RenderLoopPtr cx::ViewImplService::mRenderLoop
protected

Definition at line 146 of file cxViewImplService.h.

RenderWindowFactoryPtr cx::ViewImplService::mRenderWindowFactory
protected

Definition at line 145 of file cxViewImplService.h.

VisServicesPtr cx::ViewImplService::mServices
protected

Definition at line 143 of file cxViewImplService.h.


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