![]() |
open_iA
2020.04
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
|
Represents a single scatter plot in the scatter plot matrix (SPLOM). More...
#include <iAScatterPlot.h>
Classes | |
| struct | Settings |
| All settings of the plot in one struct. More... | |
Public Types | |
| enum | SelectionMode { Rectangle, Polygon } |
Signals | |
| void | currentPointModified (size_t index) |
| Emitted when hovered over new point. More... | |
| void | selectionModified () |
| Emitted when selected points changed. More... | |
| void | transformModified (double scale, QPointF deltaOffset) |
| Emitted when user transforms (scales, translates) More... | |
Public Member Functions | |
| void | applyMarginToRanges () |
| Apply margins to ranges so that points are not stretched border-to-border. More... | |
| void | enter () |
| Mouse entered the plot's rectangle. More... | |
| size_t | getCurrentPoint () const |
| Get the index of currently hovered point. More... | |
| const size_t * | getIndices () const |
| Get indices of X and Y parameters. More... | |
| QPointF | getOffset () const |
| Get current offset applied to the plot points. More... | |
| QPointF | getPointPosition (size_t index) const |
| Get global position of a point by its index. More... | |
| double | getPointRadius () const |
| Get point radius (magnified if plot is maximized) More... | |
| size_t | getPreviousIndex () const |
| Get the index of previously hovered point or NoPointIndex. More... | |
| size_t | getPreviousPoint () const |
| Get the index of point hovered over before previous. More... | |
| QRect | getRect () const |
| Get rectangle where scatter plot contents are displayed. More... | |
| double | getScale () const |
| Get current scale applied to the plot points. More... | |
| bool | hasData () const |
| Check if data is already set to the plot. More... | |
| iAScatterPlot (iAScatterPlotSelectionHandler *splom, iAQGLWidget *parent, int numTicks=5, bool isMaximizedPlot=false) | |
| Constructor: requires a parent SPLOM widget. More... | |
| void | leave () |
| Mouse is hovering over the plot's rectangle. More... | |
| void | paintOnParent (QPainter &painter) |
| Paint plot's contents on a SPLOM-parent. More... | |
| void | printTicksInfo (QList< double > *posX, QList< double > *posY, QList< QString > *textX, QList< QString > *textY) const |
| Output positions and labels of plot ticks for X and Y axes. More... | |
| void | setCurrentPoint (size_t index) |
| Set the index of currently hovered point. More... | |
| void | setData (size_t x, size_t y, QSharedPointer< iASPLOMData > &splomData) |
| Set data to the scatter plot using indices of X and Y parameters and the raw SPLOM data. More... | |
| void | setLookupTable (QSharedPointer< iALookupTable > &lut, size_t colInd) |
| Set color lookup table and the name of a color-coded parameter. More... | |
| void | setPointRadius (double radius) |
| Set point radius (magnified if plot is maximized) More... | |
| void | setPreviewState (bool isPreviewPlot) |
| Set if this plot is currently previewed (displayed in maximized plot view) More... | |
| void | setRect (QRect val) |
| Set rectangle where scatter plot contents are displayed. More... | |
| void | setTransform (double scale, QPointF newOffset) |
| Set new transform: new scale and new offset. More... | |
| void | setTransformDelta (double scale, QPointF deltaOffset) |
| Set new transform: new scale and change in the offset (delta) More... | |
| void | updatePoints () |
| ~iAScatterPlot () | |
| void | SPLOMWheelEvent (QWheelEvent *event) |
| Qt events are redirected from SPLOM to the active plot using these public event handlers. More... | |
| void | SPLOMMouseMoveEvent (QMouseEvent *event) |
| void | SPLOMMousePressEvent (QMouseEvent *event) |
| void | SPLOMMouseReleaseEvent (QMouseEvent *event) |
| void | setSelectionColor (QColor selCol) |
Public Attributes | |
| Settings | settings |
Static Public Attributes | |
| static size_t | NoPointIndex = std::numeric_limits<size_t>::max() |
Protected Member Functions | |
| double | applyTransformX (double v) const |
| Apply scaling and offset to X coordinate. More... | |
| double | applyTransformY (double v) const |
| Apply scaling and offset to Y coordinate. More... | |
| void | calculateNiceSteps () |
| Calculates nice steps displayed parameter ranges. More... | |
| void | calculateNiceSteps (double *r, QList< double > *ticks) |
| Calculates nice steps displayed parameter ranges given a range and a desired number of ticks. More... | |
| void | createVBO () |
| Creates and fills VBO with plot's 2D-points. More... | |
| QPoint | cropLocalPos (QPoint locPos) const |
| Make sure that local position is inside plot's rectangle. More... | |
| void | drawBorder (QPainter &painter) |
| Draws plot's border. More... | |
| void | drawMaximizedLabels (QPainter &painter) |
| Draws additional plot's labels (only maximized plot) More... | |
| void | drawPoints (QPainter &painter) |
| Draws plot's points (uses native OpenGL) More... | |
| void | drawSelectionPolygon (QPainter &painter) |
| Draws selection-lasso polygon. More... | |
| void | drawTicks (QPainter &painter) |
| Draws plot's ticks. More... | |
| void | fillVBO () |
| Fill existing VBO with plot's 2D-points. More... | |
| int | getBinIndex (int x, int y) const |
| Get global grid bin offset (index) using X and Y bin indices. More... | |
| QPoint | getLocalPos (QPoint pos) const |
| Local (plot) position from global (SPLOM) More... | |
| size_t | getPointIndexAtPosition (QPointF mpos) const |
| Get index of data point under cursor, NoPointIndex if none. More... | |
| QPointF | getPositionFromPointIndex (size_t idx) const |
| Get position of a data point with a given index. More... | |
| void | initGrid () |
| Allocate lists for grid subdivision ( for point-picking acceleration) More... | |
| int | p2binx (double p) const |
| Get grid bin index using parameter value X. More... | |
| int | p2biny (double p) const |
| Get grid bin index using parameter value Y. More... | |
| double | p2tx (double pval) const |
| Parameter scalar value to normalized X coordinate [0,1]. More... | |
| double | p2ty (double pval) const |
| Parameter scalar value to normalized Y coordinate [0,1]. More... | |
| double | p2x (double pval) const |
| Parameter scalar value to X coordinate (pixels) More... | |
| double | p2y (double pval) const |
| Parameter scalar value to Y coordinate (pixels) More... | |
| double | revertTransformX (double v) const |
| Revert scaling and offset to get X coordinate. More... | |
| double | revertTransformY (double v) const |
| Revert scaling and offset to get Y coordinate. More... | |
| void | updateDrawRect () |
| Re-calculate dimensions of the plot's rectangle. More... | |
| void | updateGrid () |
| Fill subdivision grid with points ( for point-picking acceleration) More... | |
| void | updateSelectedPoints (bool append, bool remove) |
| Update selected points; parameters specify whether to append or to remove from previous selection (or create new if both false). if both append and remove are true, then XOR logic is applied (of newly selected, those already selected will be de-selected, new ones will be added) More... | |
| double | x2p (double x) const |
| X coordinate (pixels) to parameter value. More... | |
| double | y2p (double y) const |
| Y coordinate (pixels) to parameter value. More... | |
Protected Attributes | |
| size_t | m_colInd |
| index of color-coded parameter More... | |
| size_t | m_curInd |
| index of currently selected point (NoPointIndex if none) More... | |
| size_t | m_curVisiblePts |
| number of currently visible points More... | |
| bool | m_dragging |
| indicates whether a drag operation is currently going on More... | |
| QRect | m_globRect |
| plot's rectangle More... | |
| int | m_gridDims [2] |
| dimensions of subdivision grid (point picking acceleration) More... | |
| bool | m_isMaximizedPlot |
| flag telling if this plot itself is maximized (bigger plot) More... | |
| bool | m_isPlotActive |
| flag indicating if the plot is active (user hovers mouse over) More... | |
| bool | m_isPreviewPlot |
| flag telling if a large version of this plot is shown maximized currently More... | |
| QRectF | m_locRect |
| plot's local drawing rectangle More... | |
| QSharedPointer< iALookupTable > | m_lut |
| pointer to SPLOM-parent's lookup table More... | |
| QRectF | m_maxBtnRect |
| rectangle of maximized button More... | |
| int | m_numTicks |
| number of ticks More... | |
| QPointF | m_offset |
| transform offset component More... | |
| size_t | m_paramIndices [2] |
| indices of plot X, Y parameters More... | |
| iAQGLWidget * | m_parentWidget |
| the parent widget More... | |
| iAQGLBuffer * | m_pointsBuffer |
| OpenGL buffer used for points VBO. More... | |
| QList< QList< size_t > > | m_pointsGrid |
| grid bins containing point indices More... | |
| bool | m_pointsOutdated |
| indicates whether we need to fill the points buffer More... | |
| size_t | m_prevInd |
| index of previously selected point (NoPointIndex if none) More... | |
| QPointF | m_prevPos |
| used for computing offset component More... | |
| size_t | m_prevPtInd |
| index of point selected before (NoPointIndex if none, but keeps point index even if no point was selected in between) More... | |
| double | m_prX [2] |
| double | m_prY [2] |
| range of x and y parameter More... | |
| double | m_scale |
| transform scale component More... | |
| QPolygon | m_selPoly |
| polygon of selection lasso More... | |
| QPoint | m_selStart |
| point where the selection started More... | |
| iAScatterPlotSelectionHandler * | m_splom |
| selection/highlight/settings handler (if part of a SPLOM, the SPLOM-parent) More... | |
| QSharedPointer< iASPLOMData > | m_splomData |
| pointer to SPLOM-parent's data More... | |
| QList< double > | m_ticksX |
| position of ticks X axis More... | |
| QList< double > | m_ticksY |
| position of ticks Y axis More... | |
Represents a single scatter plot in the scatter plot matrix (SPLOM).
The class is managed from the parent SPLOM. Draws its contents in a given rectangle on a parent SPLOM widget. Appearance can be customized via the public settings member.
| iAScatterPlot::iAScatterPlot | ( | iAScatterPlotSelectionHandler * | splom, |
| iAQGLWidget * | parent, | ||
| int | numTicks = 5, |
||
| bool | isMaximizedPlot = false |
||
| ) |
Constructor: requires a parent SPLOM widget.
| iAScatterPlot::~iAScatterPlot | ( | ) |
| void iAScatterPlot::applyMarginToRanges | ( | ) |
Apply margins to ranges so that points are not stretched border-to-border.
|
protected |
Apply scaling and offset to X coordinate.
|
protected |
Apply scaling and offset to Y coordinate.
|
protected |
Calculates nice steps displayed parameter ranges.
|
protected |
Calculates nice steps displayed parameter ranges given a range and a desired number of ticks.
|
protected |
Creates and fills VBO with plot's 2D-points.
|
protected |
Make sure that local position is inside plot's rectangle.
|
signal |
Emitted when hovered over new point.
|
protected |
Draws plot's border.
|
protected |
Draws additional plot's labels (only maximized plot)
|
protected |
Draws plot's points (uses native OpenGL)
|
protected |
Draws selection-lasso polygon.
|
protected |
Draws plot's ticks.
| void iAScatterPlot::enter | ( | ) |
Mouse entered the plot's rectangle.
|
protected |
Fill existing VBO with plot's 2D-points.
|
protected |
Get global grid bin offset (index) using X and Y bin indices.
| size_t iAScatterPlot::getCurrentPoint | ( | ) | const |
Get the index of currently hovered point.
|
inline |
Get indices of X and Y parameters.
|
protected |
Local (plot) position from global (SPLOM)
|
inline |
Get current offset applied to the plot points.
|
protected |
Get index of data point under cursor, NoPointIndex if none.
| QPointF iAScatterPlot::getPointPosition | ( | size_t | index | ) | const |
Get global position of a point by its index.
| double iAScatterPlot::getPointRadius | ( | ) | const |
Get point radius (magnified if plot is maximized)
|
protected |
Get position of a data point with a given index.
| size_t iAScatterPlot::getPreviousIndex | ( | ) | const |
Get the index of previously hovered point or NoPointIndex.
| size_t iAScatterPlot::getPreviousPoint | ( | ) | const |
Get the index of point hovered over before previous.
|
inline |
Get rectangle where scatter plot contents are displayed.
|
inline |
Get current scale applied to the plot points.
| bool iAScatterPlot::hasData | ( | ) | const |
Check if data is already set to the plot.
|
protected |
Allocate lists for grid subdivision ( for point-picking acceleration)
| void iAScatterPlot::leave | ( | ) |
Mouse is hovering over the plot's rectangle.
|
protected |
Get grid bin index using parameter value X.
|
protected |
Get grid bin index using parameter value Y.
|
protected |
Parameter scalar value to normalized X coordinate [0,1].
|
protected |
Parameter scalar value to normalized Y coordinate [0,1].
|
protected |
Parameter scalar value to X coordinate (pixels)
|
protected |
Parameter scalar value to Y coordinate (pixels)
| void iAScatterPlot::paintOnParent | ( | QPainter & | painter | ) |
Paint plot's contents on a SPLOM-parent.
| void iAScatterPlot::printTicksInfo | ( | QList< double > * | posX, |
| QList< double > * | posY, | ||
| QList< QString > * | textX, | ||
| QList< QString > * | textY | ||
| ) | const |
Output positions and labels of plot ticks for X and Y axes.
|
protected |
Revert scaling and offset to get X coordinate.
|
protected |
Revert scaling and offset to get Y coordinate.
|
signal |
Emitted when selected points changed.
| void iAScatterPlot::setCurrentPoint | ( | size_t | index | ) |
Set the index of currently hovered point.
| void iAScatterPlot::setData | ( | size_t | x, |
| size_t | y, | ||
| QSharedPointer< iASPLOMData > & | splomData | ||
| ) |
Set data to the scatter plot using indices of X and Y parameters and the raw SPLOM data.
| void iAScatterPlot::setLookupTable | ( | QSharedPointer< iALookupTable > & | lut, |
| size_t | colInd | ||
| ) |
Set color lookup table and the name of a color-coded parameter.
| void iAScatterPlot::setPointRadius | ( | double | radius | ) |
Set point radius (magnified if plot is maximized)
| void iAScatterPlot::setPreviewState | ( | bool | isPreviewPlot | ) |
Set if this plot is currently previewed (displayed in maximized plot view)
| void iAScatterPlot::setRect | ( | QRect | val | ) |
Set rectangle where scatter plot contents are displayed.
| void iAScatterPlot::setSelectionColor | ( | QColor | selCol | ) |
| void iAScatterPlot::setTransform | ( | double | scale, |
| QPointF | newOffset | ||
| ) |
Set new transform: new scale and new offset.
| void iAScatterPlot::setTransformDelta | ( | double | scale, |
| QPointF | deltaOffset | ||
| ) |
Set new transform: new scale and change in the offset (delta)
| void iAScatterPlot::SPLOMMouseMoveEvent | ( | QMouseEvent * | event | ) |
| void iAScatterPlot::SPLOMMousePressEvent | ( | QMouseEvent * | event | ) |
| void iAScatterPlot::SPLOMMouseReleaseEvent | ( | QMouseEvent * | event | ) |
| void iAScatterPlot::SPLOMWheelEvent | ( | QWheelEvent * | event | ) |
Qt events are redirected from SPLOM to the active plot using these public event handlers.
|
signal |
Emitted when user transforms (scales, translates)
|
protected |
Re-calculate dimensions of the plot's rectangle.
|
protected |
Fill subdivision grid with points ( for point-picking acceleration)
| void iAScatterPlot::updatePoints | ( | ) |
|
protected |
Update selected points; parameters specify whether to append or to remove from previous selection (or create new if both false). if both append and remove are true, then XOR logic is applied (of newly selected, those already selected will be de-selected, new ones will be added)
|
protected |
X coordinate (pixels) to parameter value.
|
protected |
Y coordinate (pixels) to parameter value.
|
protected |
index of color-coded parameter
|
protected |
index of currently selected point (NoPointIndex if none)
|
protected |
number of currently visible points
|
protected |
indicates whether a drag operation is currently going on
|
protected |
plot's rectangle
|
protected |
dimensions of subdivision grid (point picking acceleration)
|
protected |
flag telling if this plot itself is maximized (bigger plot)
|
protected |
flag indicating if the plot is active (user hovers mouse over)
|
protected |
flag telling if a large version of this plot is shown maximized currently
|
protected |
plot's local drawing rectangle
|
protected |
pointer to SPLOM-parent's lookup table
|
protected |
rectangle of maximized button
|
protected |
number of ticks
|
protected |
transform offset component
|
protected |
indices of plot X, Y parameters
|
protected |
the parent widget
|
protected |
OpenGL buffer used for points VBO.
|
protected |
grid bins containing point indices
|
protected |
indicates whether we need to fill the points buffer
|
protected |
index of previously selected point (NoPointIndex if none)
|
protected |
used for computing offset component
|
protected |
index of point selected before (NoPointIndex if none, but keeps point index even if no point was selected in between)
|
protected |
|
protected |
range of x and y parameter
|
protected |
transform scale component
|
protected |
polygon of selection lasso
|
protected |
point where the selection started
|
protected |
selection/highlight/settings handler (if part of a SPLOM, the SPLOM-parent)
|
protected |
pointer to SPLOM-parent's data
|
protected |
position of ticks X axis
|
protected |
position of ticks Y axis
|
static |
| Settings iAScatterPlot::settings |
1.8.18