iRoCS Toolbox  1.1.0
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes
ChannelSpecsOrthoViewRenderer Class Referenceabstract

#include <ChannelSpecsOrthoViewRenderer.hh>

Inheritance diagram for ChannelSpecsOrthoViewRenderer:
Collaboration diagram for ChannelSpecsOrthoViewRenderer:

Public Slots

virtual void render (QXmlStreamWriter &svgStream, blitz::TinyVector< double, 3 > const &shapePx, blitz::TinyVector< double, 3 > const &lowerBoundUm, blitz::TinyVector< double, 3 > const &upperBoundUm, std::string const &font, double fontSizePt, iRoCS::ProgressReporter *pr=NULL) const =0
 Render this channel into the given SVG-stream. More...
 
virtual void setCacheUpdatesEnabled (bool enable)
 Enables or disables the updates of the rendering cache. More...
 
virtual void updateCache () const override
 Update the rendering cache. More...
 
virtual void updateCache (int direction) const
 Update the rendering cache for the specified orthoview dimension. More...
 

Signals

void cacheUpdated (ChannelSpecsOrthoViewRenderer const *source, int direction) const
 This signal must be emitted at the end of a cache update to inform the view, that the cache for the orthoview plane has new data. More...
 

Public Member Functions

 ChannelSpecsOrthoViewRenderer (ChannelSpecs *channel, OrthoViewWidget *view)
 
virtual ~ChannelSpecsOrthoViewRenderer ()
 
bool cacheUpdatesEnabled () const
 Check whether cache updates are enabled. More...
 
ChannelSpecschannel () const
 
virtual bool event (QEvent *event)
 Interprets and distributes the given event. More...
 
virtual void render (QPainter *painter=NULL) const =0
 Main rendering routine which is called whenever a paintEvent() on the ViewWidget occurs. More...
 
void setOrthogonalDimension (int orthogonalDimension)
 
ViewWidgetview () const
 

Protected Member Functions

virtual void userInteractionEvent (UserInteractionEvent *e)
 Reimplement this function if your specialized ChannelSpecsRenderer should respond to a passed UserInteractionEvent. More...
 

Protected Attributes

bool _cacheUpdatesEnabled
 
int _orthogonalDimension
 
ChannelSpecsp_channel
 
ViewWidgetp_view
 

Detailed Description

Definition at line 40 of file ChannelSpecsOrthoViewRenderer.hh.

Constructor & Destructor Documentation

◆ ChannelSpecsOrthoViewRenderer()

ChannelSpecsOrthoViewRenderer::ChannelSpecsOrthoViewRenderer ( ChannelSpecs channel,
OrthoViewWidget view 
)

◆ ~ChannelSpecsOrthoViewRenderer()

virtual ChannelSpecsOrthoViewRenderer::~ChannelSpecsOrthoViewRenderer ( )
virtual

Member Function Documentation

◆ setOrthogonalDimension()

void ChannelSpecsOrthoViewRenderer::setOrthogonalDimension ( int  orthogonalDimension)

◆ updateCache [1/2]

virtual void ChannelSpecsOrthoViewRenderer::updateCache ( ) const
overridevirtualslot

Update the rendering cache.

This function is called by the associated ChannelSpecs if its content changes such that an cache update might be neccessary. The default implementation calls the updateCache(int) for every direction . You can disable the cache updates using the setCacheUpdatesEnabled() function. This is important if you programmatically perform many operations on the ChannelSpecs, of which each would need a cache update. After the sequence of operations, you have to call updateCache() explicitely to apply the changes. After cache update update() of the view is called to visualize the changes. So if many channels are involved you should call setUpdatesEnabled(false) to the view before these changes.

Usually this function need not be reimplemented. Reimplement the dimension-aware version updateCache(int) instead.

◆ updateCache [2/2]

virtual void ChannelSpecsOrthoViewRenderer::updateCache ( int  direction) const
virtualslot

Update the rendering cache for the specified orthoview dimension.

This function is called by the updateCache()-Method for every direction. On crosshair position change the view widget explicitely calls this function with the dimensions orthogonal to the cross hair position change. Reimplement this function if you have expensive computations that should not be done at every repaint. The default implementation only calls the update() function of the view. You can disable the cacheUpdates using the setCacheUpdatesEnabled() function. This is important if you programmatically perform many operations on the ChannelSpecs, of which each would need a cache update. After the sequence of operations, you have to call updateCache() explicitely to apply the changes. After cache update update() of the view is called to visualize the changes. So if many channels are involved you should call setUpdatesEnabled(false) to the view before these changes.

◆ render [1/2]

virtual void ChannelSpecsOrthoViewRenderer::render ( QXmlStreamWriter &  svgStream,
blitz::TinyVector< double, 3 > const &  shapePx,
blitz::TinyVector< double, 3 > const &  lowerBoundUm,
blitz::TinyVector< double, 3 > const &  upperBoundUm,
std::string const &  font,
double  fontSizePt,
iRoCS::ProgressReporter pr = NULL 
) const
pure virtualslot

Render this channel into the given SVG-stream.

The default implementation does nothing. Overload this function if you want to be able to render the view of the given channel type as 2D vector graphics.

Parameters
svgStreamThe output stream to append this channel visualization to
shapePxThe shape of the rectangular ROI to render in voxel coordinates. It is only given for convenience, since one could compute this information from the model's element size and the given bounds
lowerBoundUmThe lower bounds of the rectangular ROI to render
upperBoundUmThe upper bounds of the rectangular POI to render
fontThe font to use for textual annotations
fontSizePtThe font size in pt
prIf given progress is reported via that ProgressReporter

Implemented in VisualizationChannelSpecsOrthoViewRenderer, AnnotationChannelSpecsOrthoViewRenderer, DataChannelSpecsOrthoViewRenderer, RGBChannelSpecsOrthoViewRenderer, IRoCSSCTChannelSpecsOrthoViewRenderer, SplineCurveChannelSpecsOrthoViewRenderer, and IRoCSChannelSpecsOrthoViewRenderer.

◆ cacheUpdated

void ChannelSpecsOrthoViewRenderer::cacheUpdated ( ChannelSpecsOrthoViewRenderer const *  source,
int  direction 
) const
signal

This signal must be emitted at the end of a cache update to inform the view, that the cache for the orthoview plane has new data.

Parameters
sourceA pointer to this ChannelSpecsRenderer
directionThe OrthoViewPlane index (its normal direction)

◆ channel()

ChannelSpecs* ChannelSpecsRenderer::channel ( ) const
inherited

◆ view()

ViewWidget* ChannelSpecsRenderer::view ( ) const
inherited

◆ cacheUpdatesEnabled()

bool ChannelSpecsRenderer::cacheUpdatesEnabled ( ) const
inherited

Check whether cache updates are enabled.

Returns
true if the cache is updated by changes in channel or view false otherwise
See also
setCacheUpdatesEnabled(bool)

◆ render() [2/2]

virtual void ChannelSpecsRenderer::render ( QPainter *  painter = NULL) const
pure virtualinherited

Main rendering routine which is called whenever a paintEvent() on the ViewWidget occurs.

Within this function the actual rendering of the associated channel into the associated view is performed. This may imply to use the passed QPainter but may be also done by other means as e.g. by directly imposing OpenGL commands. This function must be re-implemented and should be as fast as possible since it is called at every widget repaint

Parameters
painterThe active QPainter or NULL if no painter is currently active or the view update is not QPainter-based, like e.g. for OpenGL rendering

Implemented in VisualizationChannelSpecsOpenGlRenderingViewRenderer, VisualizationChannelSpecsOrthoViewRenderer, AnnotationChannelSpecsOrthoViewRenderer, DataChannelSpecsOrthoViewRenderer, IRoCSChannelSpecsOpenGlRenderingViewRenderer, IRoCSSCTChannelSpecsOpenGlRenderingViewRenderer, RGBChannelSpecsOrthoViewRenderer, SplineCurveChannelSpecsOpenGlRenderingViewRenderer, AnnotationChannelSpecsOpenGlRenderingViewRenderer, DataChannelSpecsOpenGlRenderingViewRenderer, RGBChannelSpecsOpenGlRenderingViewRenderer, IRoCSSCTChannelSpecsOrthoViewRenderer, SplineCurveChannelSpecsOrthoViewRenderer, and IRoCSChannelSpecsOrthoViewRenderer.

◆ event()

virtual bool ChannelSpecsRenderer::event ( QEvent *  event)
virtualinherited

Interprets and distributes the given event.

This function checks, whether the event is a UserInteractionEvent and if so passes the event to the specialized function userInteractionEvent(UserInteractionEvent*). If you want to enable mouse interaction with the view associated with this renderer you should reimplement the specialized function, for everything beyond mouse interaction reimplement this function.

Parameters
eventThe event sent to this ChannelSpecsRenderer
Returns
true if the event was accepted, false otherwise

◆ setCacheUpdatesEnabled

virtual void ChannelSpecsRenderer::setCacheUpdatesEnabled ( bool  enable)
virtualslotinherited

Enables or disables the updates of the rendering cache.

This usually means that changes in the ChannelSpecs or the view position don't lead to an update of the view. This is useful, if you have to programmatically perform many small operations on the channel of which not each should trigger a repaint.

Parameters
enabletrue to enable, false to disable cache updates

◆ userInteractionEvent()

virtual void ChannelSpecsRenderer::userInteractionEvent ( UserInteractionEvent e)
protectedvirtualinherited

Reimplement this function if your specialized ChannelSpecsRenderer should respond to a passed UserInteractionEvent.

Parameters
eThe UserInteractionEvent containing the position, type and other parameters of the event

Reimplemented in VisualizationChannelSpecsOrthoViewRenderer, and AnnotationChannelSpecsOrthoViewRenderer.

Field Documentation

◆ _orthogonalDimension

int ChannelSpecsOrthoViewRenderer::_orthogonalDimension
protected

Definition at line 140 of file ChannelSpecsOrthoViewRenderer.hh.

◆ p_channel

ChannelSpecs* ChannelSpecsRenderer::p_channel
protectedinherited

Definition at line 150 of file ChannelSpecsRenderer.hh.

◆ p_view

ViewWidget* ChannelSpecsRenderer::p_view
protectedinherited

Definition at line 151 of file ChannelSpecsRenderer.hh.

◆ _cacheUpdatesEnabled

bool ChannelSpecsRenderer::_cacheUpdatesEnabled
protectedinherited

Definition at line 153 of file ChannelSpecsRenderer.hh.


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