bioformats
5.1.2
|
2D GL view of an image with axes and gridlines. More...
#include <ome/qtwidgets/GLView2D.h>
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::FormatReader > | getReader () |
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::Image2D * | image |
Image to render. | |
gl::Axis2D * | axes |
Axes to render. | |
gl::Grid2D * | grid |
Grid to render. | |
ome::compat::shared_ptr< ome::bioformats::FormatReader > | reader |
The image reader. | |
ome::bioformats::dimension_size_type | series |
The image series. | |
2D GL view of an image with axes and gridlines.
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.
reader | the image reader. |
series | the image series. |
parent | the parent of this object. |
|
signal |
Signal maximum value for linear contrast changed.
max | the new maximum value. |
Referenced by setChannelMax().
|
signal |
Signal minimum value for linear contrast changed.
min | the new minimum value. |
Referenced by setChannelMin().
int ome::qtwidgets::GLView2D::getChannelMax | ( | ) | const |
int ome::qtwidgets::GLView2D::getChannelMin | ( | ) | const |
GLView2D::MouseMode ome::qtwidgets::GLView2D::getMouseMode | ( | ) | const |
ome::bioformats::dimension_size_type ome::qtwidgets::GLView2D::getPlane | ( | ) | const |
Get plane to render.
References plane.
Referenced by timerEvent().
ome::compat::shared_ptr< ome::bioformats::FormatReader > ome::qtwidgets::GLView2D::getReader | ( | ) |
ome::bioformats::dimension_size_type ome::qtwidgets::GLView2D::getSeries | ( | ) |
int ome::qtwidgets::GLView2D::getXTranslation | ( | ) | const |
Get x translation factor.
References camera, and ome::qtwidgets::GLView2D::Camera::xTran.
int ome::qtwidgets::GLView2D::getYTranslation | ( | ) | const |
Get y translation factor.
References camera, and ome::qtwidgets::GLView2D::Camera::yTran.
int ome::qtwidgets::GLView2D::getZoom | ( | ) | const |
Get zoom factor.
References camera, and ome::qtwidgets::GLView2D::Camera::zoom.
int ome::qtwidgets::GLView2D::getZRotation | ( | ) | const |
Get z rotation factor.
References camera, and ome::qtwidgets::GLView2D::Camera::zRot.
QSize ome::qtwidgets::GLView2D::minimumSizeHint | ( | ) | const |
Get window minimum size hint.
|
protected |
Handle mouse button movement events.
Action depends upon the mouse behaviour mode.
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.
|
protected |
Handle mouse button press events.
Action depends upon the mouse behaviour mode.
event | the event to handle. |
References lastPos.
|
signal |
Signal current plane changed.
plane | the new plane. |
Referenced by setPlane().
|
slot |
Set maximum value for linear contrast (all channels).
max | the maximum value (scaled normalized). |
References channelMaxChanged(), cmax, cmin, ome::qtwidgets::GLWindow::renderLater(), and setChannelMin().
Referenced by setChannelMin().
|
slot |
Set minimum value for linear contrast (all channels).
min | the minimum value (scaled normalized). |
References channelMinChanged(), cmax, cmin, ome::qtwidgets::GLWindow::renderLater(), and setChannelMax().
Referenced by setChannelMax().
|
slot |
|
slot |
Set plane to render.
plane | the plane number to render. |
References plane, planeChanged(), and ome::qtwidgets::GLWindow::renderLater().
|
slot |
Set x translation factor.
xtran | x translation factor (pixels). |
References camera, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::xTran, and xTranslationChanged().
Referenced by mouseMoveEvent().
|
slot |
Set y translation factor.
ytran | y translation factor (pixels). |
References camera, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::yTran, and yTranslationChanged().
Referenced by mouseMoveEvent().
|
slot |
Set zoom factor.
zoom | the zoom factor (pixel drag distance). |
References camera, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::zoom, and zoomChanged().
Referenced by mouseMoveEvent().
|
slot |
Set z rotation factor.
angle | z rotation factor (pixel drag distance). |
References camera, ome::qtwidgets::GLWindow::renderLater(), ome::qtwidgets::GLView2D::Camera::zRot, and zRotationChanged().
Referenced by mouseMoveEvent().
QSize ome::qtwidgets::GLView2D::sizeHint | ( | ) | const |
Get window size hint.
|
protected |
Handle timer events.
Used to update scene properties and trigger a render pass.
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().
|
signal |
Signal x translation changed.
xtran | the new x translation. |
Referenced by setXTranslation().
|
signal |
Signal y translation changed.
ytran | the new y translation. |
Referenced by setYTranslation().
|
signal |
Signal zoom level changed.
zoom | the new zoom level. |
Referenced by setZoom().
|
signal |
Signal z rotation changed.
angle | the new z rotation. |
Referenced by setZRotation().