iRoCS Toolbox  1.1.0
Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
NucleusMarkerOrthoViewRenderer Class Reference

#include <NucleusMarkerOrthoViewRenderer.hh>

Inheritance diagram for NucleusMarkerOrthoViewRenderer:
Collaboration diagram for NucleusMarkerOrthoViewRenderer:

Public Slots

void setCacheUpdatesEnabled (bool enable)
 Enables or disables the updates of the rendering cache. More...
 
void setFontSize (int fontSize)
 Set the font size for text rendering of this Marker. More...
 
virtual void updateCache (int direction) const
 Update the rendering cache for the specified orthoview dimension. More...
 
virtual void updateCache () const
 Update the rendering cache for all orthoview planes. More...
 

Public Member Functions

 NucleusMarkerOrthoViewRenderer (NucleusMarker *marker, OrthoViewWidget *view)
 
 NucleusMarkerOrthoViewRenderer (NucleusMarkerOrthoViewRenderer const &renderer)
 
virtual ~NucleusMarkerOrthoViewRenderer ()
 
bool cacheUpdatesEnabled () const
 Check whether cache updates are enabled. More...
 
virtual MarkerRendererclone () const
 
bool isDragging () const
 
Markermarker () const
 
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
 Render this marker into the given SVG-stream. More...
 
virtual void render (QPainter *painter=NULL) const
 Main rendering routine which is called whenever a paintEvent() on the Marker occurs. More...
 
void setDragging (bool drag)
 
void setOrthogonalDimension (int orthogonalDimension)
 Before calling render set the dimension to render using this method. More...
 
virtual void userInteractionEvent (UserInteractionEvent *event)
 
ViewWidgetview () const
 

Static Public Member Functions

static blitz::TinyVector< double, 2 > intersectLineNPlane (const blitz::TinyVector< double, 3 > &p1, const blitz::TinyVector< double, 3 > &p2, int sliceDim, double slicePosition)
 Compute the intersection point of a line segment and an axis-aligned plane. More...
 

Protected Member Functions

std::string _getColorString (bool &draw) const
 Get the RGB color string from the Settings in the PresetWidget. More...
 
bool _setPenColor (QPainter *painter, bool hilighted=false) const
 Set the pen according to the PresetWidget. More...
 

Protected Attributes

blitz::TinyVector< MarkerOrthoViewRendererCache *, 3 > _cache
 
bool _dragging
 
int _orthogonalDimension
 
Markerp_marker
 
ViewWidgetp_view
 

Detailed Description

Definition at line 123 of file NucleusMarkerOrthoViewRenderer.hh.

Constructor & Destructor Documentation

◆ NucleusMarkerOrthoViewRenderer() [1/2]

NucleusMarkerOrthoViewRenderer::NucleusMarkerOrthoViewRenderer ( NucleusMarker marker,
OrthoViewWidget view 
)

◆ NucleusMarkerOrthoViewRenderer() [2/2]

NucleusMarkerOrthoViewRenderer::NucleusMarkerOrthoViewRenderer ( NucleusMarkerOrthoViewRenderer const &  renderer)

◆ ~NucleusMarkerOrthoViewRenderer()

virtual NucleusMarkerOrthoViewRenderer::~NucleusMarkerOrthoViewRenderer ( )
virtual

Member Function Documentation

◆ clone()

virtual MarkerRenderer* NucleusMarkerOrthoViewRenderer::clone ( ) const
virtual

Reimplemented from SHSurfaceMarkerOrthoViewRenderer.

◆ render() [1/2]

virtual void NucleusMarkerOrthoViewRenderer::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
virtual

Render this marker 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 marker 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 will be reported via that ProgressReporter

Reimplemented from SHSurfaceMarkerOrthoViewRenderer.

◆ userInteractionEvent()

virtual void NucleusMarkerOrthoViewRenderer::userInteractionEvent ( UserInteractionEvent event)
virtual

Reimplemented from SHSurfaceMarkerOrthoViewRenderer.

◆ updateCache [1/2]

virtual void NucleusMarkerOrthoViewRenderer::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 Marker 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 markers/channels are involved you should call setUpdatesEnabled(false) to the view before these changes.

◆ render() [2/2]

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

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

Within this function the actual rendering of the associated Marker into the associated view is performed. The orthoview plane the painter is associated to has to be set prior to the call to the render() method using setOrthogonalDimension().

Within this method the passed QPainter may be used but painting may be also done by other means as e.g. by directly imposing OpenGL commands. The default implementation renders the current marker cache for the selected orthoview plane.

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

Implements MarkerRenderer.

Reimplemented in CylinderMarkerOrthoViewRenderer.

◆ intersectLineNPlane()

static blitz::TinyVector<double,2> SHSurfaceMarkerOrthoViewRenderer::intersectLineNPlane ( const blitz::TinyVector< double, 3 > &  p1,
const blitz::TinyVector< double, 3 > &  p2,
int  sliceDim,
double  slicePosition 
)
staticinherited

Compute the intersection point of a line segment and an axis-aligned plane.

Parameters
p1The first end point of the line segment
p2The second end point of the line segment
sliceDimThe dimension orthogonal to the plane
slicePositionThe position along the slice dimension
Returns
The in-plane coordinates of the intersection point or special values (inf,inf) if there is no intersection, or (0, inf) if the line is on the plane.

◆ updateCache [2/2]

virtual void MarkerOrthoViewRenderer::updateCache ( ) const
virtualslotinherited

Update the rendering cache for all orthoview planes.

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.

◆ setOrthogonalDimension()

void MarkerOrthoViewRenderer::setOrthogonalDimension ( int  orthogonalDimension)
inherited

Before calling render set the dimension to render using this method.

Parameters
orthogonalDimensionThe orthogonal dimension to the orthoview plane to render

◆ setFontSize

void MarkerOrthoViewRenderer::setFontSize ( int  fontSize)
inlineslotinherited

Set the font size for text rendering of this Marker.

Parameters
fontSizeThe font size in px

Definition at line 226 of file MarkerOrthoViewRenderer.hh.

◆ _setPenColor()

bool MarkerOrthoViewRenderer::_setPenColor ( QPainter *  painter,
bool  hilighted = false 
) const
protectedinherited

Set the pen according to the PresetWidget.

Parameters
painterThe painter to set the pen for
hilightedIf the marker is selected set this bool to true
Returns
true if the marker is visible, false if not

◆ _getColorString()

std::string MarkerOrthoViewRenderer::_getColorString ( bool &  draw) const
protectedinherited

Get the RGB color string from the Settings in the PresetWidget.

It is of the form "\#RRGGBB".

Parameters
drawThis bool is false if the marker has an alpha value of zero and is therefore not visible
Returns
The marker color as RGB color string

◆ marker()

Marker* MarkerRenderer::marker ( ) const
inherited

◆ view()

ViewWidget* MarkerRenderer::view ( ) const
inherited

◆ isDragging()

bool MarkerRenderer::isDragging ( ) const
inherited

◆ setDragging()

void MarkerRenderer::setDragging ( bool  drag)
inherited

◆ cacheUpdatesEnabled()

bool MarkerRenderer::cacheUpdatesEnabled ( ) const
inherited

Check whether cache updates are enabled.

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

◆ setCacheUpdatesEnabled

void MarkerRenderer::setCacheUpdatesEnabled ( bool  enable)
slotinherited

Enables or disables the updates of the rendering cache.

This usually means that changes in the Marker 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 marker of which not each should trigger a repaint.

Parameters
enabletrue to enable, false to disable cache updates

Field Documentation

◆ _orthogonalDimension

int MarkerOrthoViewRenderer::_orthogonalDimension
protectedinherited

Definition at line 300 of file MarkerOrthoViewRenderer.hh.

◆ _cache

blitz::TinyVector<MarkerOrthoViewRendererCache*,3> MarkerOrthoViewRenderer::_cache
mutableprotectedinherited

Definition at line 302 of file MarkerOrthoViewRenderer.hh.

◆ p_marker

Marker* MarkerRenderer::p_marker
protectedinherited

Definition at line 131 of file MarkerRenderer.hh.

◆ p_view

ViewWidget* MarkerRenderer::p_view
protectedinherited

Definition at line 132 of file MarkerRenderer.hh.

◆ _dragging

bool MarkerRenderer::_dragging
protectedinherited

Definition at line 134 of file MarkerRenderer.hh.


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