NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cx::ViewportListenerBase Class Referenceabstract

Base class for listening to a vtkRenderer. More...

#include <cxViewportListener.h>

Inheritance diagram for cx::ViewportListenerBase:
cx::ViewportListener cx::ViewportPreRenderListener

Public Member Functions

 ViewportListenerBase ()
 
virtual ~ViewportListenerBase ()
 
void startListen (vtkRendererPtr renderer)
 
void stopListen ()
 
bool isListening () const
 
void setCallback (boost::function< void()> func)
 
virtual void callback ()
 
double getVpnZoom ()
 
double getVpnZoom (Vector3D focalPoint)
 ViewportListenerBase::getVpnZoom Calculate the size of a 1mm line at the focal point projected into the normalized viewport space. This method uses a given point as the focal point. More...
 

Protected Types

typedef vtkSmartPointer< class ViewportObserverPrivateViewportObserverPrivatePtr
 

Protected Member Functions

virtual void addObservers ()=0
 
virtual void removeObservers ()=0
 

Protected Attributes

ViewportObserverPrivatePtr mObserver
 
vtkRendererPtr mRenderer
 

Detailed Description

Base class for listening to a vtkRenderer.

Subclass by adding the observer to the mRenderer A callback function is called when a change is detected.

Definition at line 31 of file cxViewportListener.h.

Member Typedef Documentation

◆ ViewportObserverPrivatePtr

Definition at line 50 of file cxViewportListener.h.

Constructor & Destructor Documentation

◆ ViewportListenerBase()

cx::ViewportListenerBase::ViewportListenerBase ( )

Definition at line 36 of file cxViewportListener.cpp.

◆ ~ViewportListenerBase()

cx::ViewportListenerBase::~ViewportListenerBase ( )
virtual

Definition at line 41 of file cxViewportListener.cpp.

Member Function Documentation

◆ addObservers()

virtual void cx::ViewportListenerBase::addObservers ( )
protectedpure virtual

◆ callback()

void cx::ViewportListenerBase::callback ( )
virtual

Reimplemented in cx::ViewportPreRenderListener.

Definition at line 100 of file cxViewportListener.cpp.

◆ getVpnZoom() [1/2]

double cx::ViewportListenerBase::getVpnZoom ( )

Calculate the size of a 1mm line at the focal point projected into the normalized viewport space. This method uses the current default focal point of the camera

Definition at line 110 of file cxViewportListener.cpp.

◆ getVpnZoom() [2/2]

double cx::ViewportListenerBase::getVpnZoom ( Vector3D  focalPoint)

ViewportListenerBase::getVpnZoom Calculate the size of a 1mm line at the focal point projected into the normalized viewport space. This method uses a given point as the focal point.

Parameters
focalPoint
Returns
size of the line

Definition at line 125 of file cxViewportListener.cpp.

◆ isListening()

bool cx::ViewportListenerBase::isListening ( ) const

Definition at line 90 of file cxViewportListener.cpp.

◆ removeObservers()

virtual void cx::ViewportListenerBase::removeObservers ( )
protectedpure virtual

◆ setCallback()

void cx::ViewportListenerBase::setCallback ( boost::function< void()>  func)

Definition at line 95 of file cxViewportListener.cpp.

◆ startListen()

void cx::ViewportListenerBase::startListen ( vtkRendererPtr  renderer)

Definition at line 46 of file cxViewportListener.cpp.

◆ stopListen()

void cx::ViewportListenerBase::stopListen ( )

Definition at line 66 of file cxViewportListener.cpp.

Member Data Documentation

◆ mObserver

ViewportObserverPrivatePtr cx::ViewportListenerBase::mObserver
protected

Definition at line 51 of file cxViewportListener.h.

◆ mRenderer

vtkRendererPtr cx::ViewportListenerBase::mRenderer
protected

Definition at line 52 of file cxViewportListener.h.


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