ome-qtwidgets 5.2.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:
[legend]
Collaboration diagram for ome::qtwidgets::GLView2D:
[legend]

## 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::files::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::files::dimension_size_type plane)
| Signal current plane changed. More...

## Public Member Functions
| GLView2D (ome::compat::shared_ptr< ome::files::FormatReader > reader, ome::files::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::files::FormatReader > | getReader ()
| Get reader. More...
ome::files::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::files::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::files::dimension_size_type | plane
| Current plane.
ome::files::dimension_size_type | oldplane
| Previous plane.
QPoint | lastPos
| Last mouse position.
gl::Image2D * | image
| Image to render.
gl::Axis2D * | axes
| Axes to render.
gl::Grid2D * | grid
| Grid to render.
ome::compat::shared_ptr< ome::files::FormatReader > | reader
| The image reader.
ome::files::dimension_size_type | series
| The image series.

## Detailed Description

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

## Member Enumeration Documentation

enum ome::qtwidgets::GLView2D::MouseMode

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::files::FormatReader > | reader,
|  | ome::files::dimension_size_type | series,
|  | QWidget * | parent = `0`
| ) |  |

Create a 2D image view.

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

Parameters

  reader | the image reader.
  series | the image series.
  parent | the parent of this object.

## Member Function Documentation

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

Signal maximum value for linear contrast changed.

Parameters

  max | the 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

  min | the 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::files::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::files::FormatReader > ome::qtwidgets::GLView2D::getReader | ( |  | ) |

Get reader.

Returns
  the reader.

References reader.

ome::files::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

Handle mouse button movement events.

Action depends upon the mouse behaviour mode.

Parameters

  event | the event to handle.

References camera, lastPos, MODE_PAN, MODE_ROTATE, MODE_ZOOM, mouseMode, setXTranslation(), setYTranslation(), setZoom(), setZRotation(), ome::qtwidgets::GLView2D::Camera::xTran, ome::qtwidgets::GLView2D::Camera::yTran, ome::qtwidgets::GLView2D::Camera::zoom, and ome::qtwidgets::GLView2D::Camera::zRot.

void ome::qtwidgets::GLView2D::mousePressEvent | ( | QMouseEvent * | event | ) |
| protected

Handle mouse button press events.

Action depends upon the mouse behaviour mode.

Parameters

  event | the event to handle.

References lastPos.

void ome::qtwidgets::GLView2D::planeChanged | ( | ome::files::dimension_size_type | plane | ) |
| signal

Signal current plane changed.

Parameters

  plane | the 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

  max | the 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

  min | the 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

  mode | the behaviour mode to set.

References mouseMode.

void ome::qtwidgets::GLView2D::setPlane | ( | ome::files::dimension_size_type | plane | ) |
| slot

Set plane to render.

Parameters

  plane | the 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

  xtran | x 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

  ytran | y 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

  zoom | the 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

  angle | z 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

Handle timer events.

Used to update scene properties and trigger a render pass.

Parameters

  event | the event to handle.

References camera, cmax, cmin, getPlane(), image, ome::qtwidgets::GLWindow::makeCurrent(), ome::qtwidgets::GLView2D::Camera::projection, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::rotation(), ome::qtwidgets::gl::Image2D::setMax(), ome::qtwidgets::gl::Image2D::setMin(), ome::qtwidgets::gl::Image2D::setPlane(), ome::qtwidgets::GLView2D::Camera::view, ome::qtwidgets::GLView2D::Camera::xTran, ome::qtwidgets::GLView2D::Camera::yTran, and ome::qtwidgets::GLView2D::Camera::zoomfactor().

void ome::qtwidgets::GLView2D::xTranslationChanged | ( | int | xtran | ) |
| signal

Signal x translation changed.

Parameters

  xtran | the 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

  ytran | the 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

  zoom | the 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

  angle | the 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:

- ome/qtwidgets/GLView2D.h
- ome/qtwidgets/GLView2D.cpp