bioformats  5.1.8
Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ome::qtwidgets::GLView2D Class Reference

2D GL view of an image with axes and gridlines. More...

#include <ome/qtwidgets/GLView2D.h>

+ Inheritance diagram for ome::qtwidgets::GLView2D:
+ Collaboration diagram for ome::qtwidgets::GLView2D:

Classes

struct  Camera
 Camera (modelview projection matrix manipulation) More...
 

Public Types

enum  MouseMode { MODE_ZOOM, MODE_PAN, MODE_ROTATE }
 Mouse behaviour. More...
 

Public Slots

void setZoom (int zoom)
 Set zoom factor. More...
 
void setXTranslation (int xtran)
 Set x translation factor. More...
 
void setYTranslation (int ytran)
 Set y translation factor. More...
 
void setZRotation (int angle)
 Set z rotation factor. More...
 
void setChannelMin (int min)
 Set minimum value for linear contrast (all channels). More...
 
void setChannelMax (int max)
 Set maximum value for linear contrast (all channels). More...
 
void setPlane (ome::bioformats::dimension_size_type plane)
 Set plane to render. More...
 
void setMouseMode (MouseMode mode)
 Set mouse behaviour mode. More...
 
- Public Slots inherited from ome::qtwidgets::GLWindow
void renderLater ()
 Render a frame at the next opportunity. More...
 
void renderNow ()
 Render a frame immediately. More...
 
void logMessage (QOpenGLDebugMessage message)
 Log a GL debug message. More...
 

Signals

void zoomChanged (int zoom)
 Signal zoom level changed. More...
 
void xTranslationChanged (int xtran)
 Signal x translation changed. More...
 
void yTranslationChanged (int ytran)
 Signal y translation changed. More...
 
void zRotationChanged (int angle)
 Signal z rotation changed. More...
 
void channelMinChanged (int min)
 Signal minimum value for linear contrast changed. More...
 
void channelMaxChanged (int max)
 Signal maximum value for linear contrast changed. More...
 
void planeChanged (ome::bioformats::dimension_size_type plane)
 Signal current plane changed. More...
 

Public Member Functions

 GLView2D (ome::compat::shared_ptr< ome::bioformats::FormatReader > reader, ome::bioformats::dimension_size_type series, QWidget *parent=0)
 Create a 2D image view. More...
 
 ~GLView2D ()
 Destructor.
 
QSize minimumSizeHint () const
 Get window minimum size hint. More...
 
QSize sizeHint () const
 Get window size hint. More...
 
ome::compat::shared_ptr< ome::bioformats::FormatReadergetReader ()
 Get reader. More...
 
ome::bioformats::dimension_size_type getSeries ()
 Get series. More...
 
int getZoom () const
 Get zoom factor. More...
 
int getXTranslation () const
 Get x translation factor. More...
 
int getYTranslation () const
 Get y translation factor. More...
 
int getZRotation () const
 Get z rotation factor. More...
 
int getChannelMin () const
 Get minimum value for linear contrast (all channels). More...
 
int getChannelMax () const
 Get maximum value for linear contrast (all channels). More...
 
ome::bioformats::dimension_size_type getPlane () const
 Get plane to render. More...
 
MouseMode getMouseMode () const
 Get mouse behaviour mode. More...
 
- Public Member Functions inherited from ome::qtwidgets::GLWindow
 GLWindow (QWindow *parent=0)
 Create a GL window. More...
 
 ~GLWindow ()
 Destructor.
 
virtual void render (QPainter *painter)
 Render using a QPainter. More...
 
void setAnimating (bool animating)
 Enable or disable animating. More...
 

Protected Member Functions

void initialize ()
 Set up GL context and subsidiary objects.
 
void render ()
 Render the scene with the current view settings.
 
void resize ()
 Resize the view.
 
void mousePressEvent (QMouseEvent *event)
 Handle mouse button press events. More...
 
void mouseMoveEvent (QMouseEvent *event)
 Handle mouse button movement events. More...
 
void timerEvent (QTimerEvent *event)
 Handle timer events. More...
 
- Protected Member Functions inherited from ome::qtwidgets::GLWindow
bool event (QEvent *event)
 Handle events. More...
 
void exposeEvent (QExposeEvent *event)
 Handle expose events. More...
 
void resizeEvent (QResizeEvent *event)
 Handle resize events. More...
 
QOpenGLContext * context () const
 Get GL context. More...
 
void makeCurrent ()
 Make the GL context for this window the current context.
 

Private Attributes

Camera camera
 Current projection.
 
MouseMode mouseMode
 Current mouse behaviour.
 
QElapsedTimer etimer
 Rendering timer.
 
glm::vec3 cmin
 Minimum level for linear contrast.
 
glm::vec3 cmax
 Maximum level for linear contrast.
 
ome::bioformats::dimension_size_type plane
 Current plane.
 
ome::bioformats::dimension_size_type oldplane
 Previous plane.
 
QPoint lastPos
 Last mouse position.
 
gl::Image2Dimage
 Image to render.
 
gl::Axis2Daxes
 Axes to render.
 
gl::Grid2Dgrid
 Grid to render.
 
ome::compat::shared_ptr< ome::bioformats::FormatReaderreader
 The image reader.
 
ome::bioformats::dimension_size_type series
 The image series.
 

Detailed Description

2D GL view of an image with axes and gridlines.

Member Enumeration Documentation

Mouse behaviour.

Enumerator
MODE_ZOOM 

Zoom in and out.

MODE_PAN 

Pan in x and y.

MODE_ROTATE 

Rotate around point in z.

Constructor & Destructor Documentation

ome::qtwidgets::GLView2D::GLView2D ( ome::compat::shared_ptr< ome::bioformats::FormatReader reader,
ome::bioformats::dimension_size_type  series,
QWidget *  parent = 0 
)

Create a 2D image view.

The size and position will be taken from the specified image.

Parameters
readerthe image reader.
seriesthe image series.
parentthe parent of this object.

Member Function Documentation

void ome::qtwidgets::GLView2D::channelMaxChanged ( int  max)
signal

Signal maximum value for linear contrast changed.

Parameters
maxthe new maximum value.

Referenced by setChannelMax().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::channelMinChanged ( int  min)
signal

Signal minimum value for linear contrast changed.

Parameters
minthe new minimum value.

Referenced by setChannelMin().

+ Here is the caller graph for this function:

int ome::qtwidgets::GLView2D::getChannelMax ( ) const

Get maximum value for linear contrast (all channels).

Returns
the maximum value.

References cmax.

int ome::qtwidgets::GLView2D::getChannelMin ( ) const

Get minimum value for linear contrast (all channels).

Returns
the minimum value.

References cmin.

GLView2D::MouseMode ome::qtwidgets::GLView2D::getMouseMode ( ) const

Get mouse behaviour mode.

Returns
the behaviour mode.

References mouseMode.

ome::bioformats::dimension_size_type ome::qtwidgets::GLView2D::getPlane ( ) const

Get plane to render.

Returns
the plane number to render.

References plane.

Referenced by timerEvent().

+ Here is the caller graph for this function:

ome::compat::shared_ptr< ome::bioformats::FormatReader > ome::qtwidgets::GLView2D::getReader ( )

Get reader.

Returns
the reader.

References reader.

ome::bioformats::dimension_size_type ome::qtwidgets::GLView2D::getSeries ( )

Get series.

Returns
the series.

References series.

int ome::qtwidgets::GLView2D::getXTranslation ( ) const

Get x translation factor.

Returns
the x translation factor.

References camera, and ome::qtwidgets::GLView2D::Camera::xTran.

int ome::qtwidgets::GLView2D::getYTranslation ( ) const

Get y translation factor.

Returns
the y translation factor.

References camera, and ome::qtwidgets::GLView2D::Camera::yTran.

int ome::qtwidgets::GLView2D::getZoom ( ) const

Get zoom factor.

Returns
the zoom factor.

References camera, and ome::qtwidgets::GLView2D::Camera::zoom.

int ome::qtwidgets::GLView2D::getZRotation ( ) const

Get z rotation factor.

Returns
the z rotation factor.

References camera, and ome::qtwidgets::GLView2D::Camera::zRot.

QSize ome::qtwidgets::GLView2D::minimumSizeHint ( ) const

Get window minimum size hint.

Returns
the size hint.
void ome::qtwidgets::GLView2D::mouseMoveEvent ( QMouseEvent *  event)
protected
void ome::qtwidgets::GLView2D::mousePressEvent ( QMouseEvent *  event)
protected

Handle mouse button press events.

Action depends upon the mouse behaviour mode.

Parameters
eventthe event to handle.

References lastPos.

void ome::qtwidgets::GLView2D::planeChanged ( ome::bioformats::dimension_size_type  plane)
signal

Signal current plane changed.

Parameters
planethe new plane.

Referenced by setPlane().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::setChannelMax ( int  max)
slot

Set maximum value for linear contrast (all channels).

Parameters
maxthe maximum value (scaled normalized).

References channelMaxChanged(), cmax, cmin, ome::qtwidgets::GLWindow::renderLater(), and setChannelMin().

Referenced by setChannelMin().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::setChannelMin ( int  min)
slot

Set minimum value for linear contrast (all channels).

Parameters
minthe minimum value (scaled normalized).

References channelMinChanged(), cmax, cmin, ome::qtwidgets::GLWindow::renderLater(), and setChannelMax().

Referenced by setChannelMax().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::setMouseMode ( MouseMode  mode)
slot

Set mouse behaviour mode.

Parameters
modethe behaviour mode to set.

References mouseMode.

void ome::qtwidgets::GLView2D::setPlane ( ome::bioformats::dimension_size_type  plane)
slot

Set plane to render.

Parameters
planethe plane number to render.

References plane, planeChanged(), and ome::qtwidgets::GLWindow::renderLater().

void ome::qtwidgets::GLView2D::setXTranslation ( int  xtran)
slot

Set x translation factor.

Parameters
xtranx translation factor (pixels).

References camera, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::xTran, and xTranslationChanged().

Referenced by mouseMoveEvent().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::setYTranslation ( int  ytran)
slot

Set y translation factor.

Parameters
ytrany translation factor (pixels).

References camera, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::yTran, and yTranslationChanged().

Referenced by mouseMoveEvent().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::setZoom ( int  zoom)
slot

Set zoom factor.

Parameters
zoomthe zoom factor (pixel drag distance).

References camera, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::zoom, and zoomChanged().

Referenced by mouseMoveEvent().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::setZRotation ( int  angle)
slot

Set z rotation factor.

Parameters
anglez rotation factor (pixel drag distance).

References camera, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::zRot, and zRotationChanged().

Referenced by mouseMoveEvent().

+ Here is the caller graph for this function:

QSize ome::qtwidgets::GLView2D::sizeHint ( ) const

Get window size hint.

Returns
the size hint.
void ome::qtwidgets::GLView2D::timerEvent ( QTimerEvent *  event)
protected
void ome::qtwidgets::GLView2D::xTranslationChanged ( int  xtran)
signal

Signal x translation changed.

Parameters
xtranthe new x translation.

Referenced by setXTranslation().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::yTranslationChanged ( int  ytran)
signal

Signal y translation changed.

Parameters
ytranthe new y translation.

Referenced by setYTranslation().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::zoomChanged ( int  zoom)
signal

Signal zoom level changed.

Parameters
zoomthe new zoom level.

Referenced by setZoom().

+ Here is the caller graph for this function:

void ome::qtwidgets::GLView2D::zRotationChanged ( int  angle)
signal

Signal z rotation changed.

Parameters
anglethe new z rotation.

Referenced by setZRotation().

+ Here is the caller graph for this function:


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