|
open_iA 2025.6
|
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 | HighlightDrawMode { Enlarged = 1 , CategoricalColor = 2 , Outline = 4 } |
| enum | SelectionMode { Rectangle , Polygon } |
Signals | |
| void | chartClick (double x, double y, Qt::KeyboardModifiers modifiers) |
| Emitted when the mouse button is clicked in the chart. | |
| void | chartPress (double x, double y, Qt::KeyboardModifiers modifiers) |
| Emitted when the mouse is pressed in the chart (and no selection or fixed point selection happened) | |
| void | currentPointModified (size_t index) |
| Emitted when hovered over new point. | |
| void | selectionModified () |
| Emitted when selected points changed. | |
| void | transformModified (double scale, QPointF deltaOffset) |
| Emitted when user transforms (scales, translates) | |
Public Member Functions | |
| iAScatterPlot (iAScatterPlotViewData *spViewData, iAChartParentWidget *parent, int numTicks=5, bool isMaximizedPlot=false) | |
| Constructor, initializes some core members. | |
| ~iAScatterPlot () | |
| void | applyMarginToRanges () |
| Apply margins to ranges so that points are not stretched border-to-border. | |
| void | enter () |
| Mouse entered the plot's rectangle. | |
| size_t | getCurrentPoint () const |
| Get the index of currently hovered point. | |
| const size_t * | getIndices () const |
| Get indices of X and Y parameters. | |
| QPointF | getOffset () const |
| Get current offset applied to the plot points. | |
| QPointF | getPointPosition (size_t index) const |
| Get global position of a point by its index. | |
| double | getPointRadius () const |
| Get point radius (magnified if plot is maximized) | |
| size_t | getPreviousIndex () const |
| Get the index of previously hovered point or iASPLOMData::NoDataIdx. | |
| size_t | getPreviousPoint () const |
| Get the index of point hovered over before previous. | |
| QRect | getRect () const |
| Get rectangle where scatter plot contents are displayed. | |
| double | getScale () const |
| Get current scale applied to the plot points. | |
| bool | hasData () const |
| Check if data is already set to the plot. | |
| void | leave () |
| Mouse is hovering over the plot's rectangle. | |
| std::shared_ptr< iALookupTable > | lookupTable () const |
| double | p2x (double pval) const |
| Parameter scalar value to X coordinate (pixels) | |
| void | paintOnParent (QPainter &painter) |
| Paint plot's contents on a SPLOM-parent. | |
| 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. | |
| void | resetYBounds () |
| void | setCurrentPoint (size_t index) |
| Set the index of currently hovered point. | |
| void | setData (size_t x, size_t y, std::shared_ptr< iASPLOMData > &splomData) |
| Set data to the scatter plot using indices of X and Y parameters and the raw SPLOM data. | |
| void | setHighlightColor (QColor hltCol) |
| void | setHighlightColorTheme (iAColorTheme const *theme) |
| void | setHighlightDrawMode (HighlightDrawModes drawMode) |
| void | setIndices (size_t x, size_t y) |
| Set the indices of the parameters to view. | |
| void | setLookupTable (std::shared_ptr< iALookupTable > &lut, size_t colInd) |
| Set color lookup table and the name of a color-coded parameter. | |
| void | setPointRadius (double radius) |
| Set point radius (magnified if plot is maximized) | |
| void | setPreviewState (bool isPreviewPlot) |
| Set if this plot is currently previewed (displayed in maximized plot view) | |
| void | setRect (QRect val) |
| Set rectangle where scatter plot contents are displayed. | |
| void | setSelectionColor (QColor selCol) |
| void | setTransform (double scale, QPointF newOffset) |
| Set new transform: new scale and new offset. | |
| void | setTransformDelta (double scale, QPointF deltaOffset) |
| Set new transform: new scale and change in the offset (delta) | |
| void | setYBounds (double yMin, double yMax) |
| void | updatePoints () |
| double const * | yBounds () const |
| void | SPLOMWheelEvent (QWheelEvent *event) |
| Qt events are redirected from SPLOM to the active plot using these public event handlers. | |
| void | SPLOMMouseMoveEvent (QMouseEvent *event) |
| void | SPLOMMousePressEvent (QMouseEvent *event) |
| void | SPLOMMouseReleaseEvent (QMouseEvent *event) |
Public Attributes | |
| Settings | settings |
Protected Member Functions | |
| double | applyTransformX (double v) const |
| Apply scaling and offset to X coordinate. | |
| double | applyTransformY (double v) const |
| Apply scaling and offset to Y coordinate. | |
| void | calculateNiceSteps () |
| Calculates nice steps displayed parameter ranges. | |
| void | calculateNiceSteps (double *r, QList< double > *ticks) |
| Calculates nice steps displayed parameter ranges given a range and a desired number of ticks. | |
| QPoint | cropLocalPos (QPoint locPos) const |
| Make sure that local position is inside plot's rectangle. | |
| void | drawBorder (QPainter &painter) |
| Draws plot's border. | |
| void | drawMaximizedLabels (QPainter &painter) |
| Draws additional plot's labels (only maximized plot) | |
| void | drawPoint (QPainter &painter, double ptX, double ptY, int radius, QColor const &color) |
| void | drawPoints (QPainter &painter) |
| Draws plot's points (uses native OpenGL) | |
| void | drawSelectionPolygon (QPainter &painter) |
| Draws selection-lasso polygon. | |
| void | drawTicks (QPainter &painter) |
| Draws plot's ticks. | |
| int | getBinIndex (int x, int y) const |
| Get global grid bin offset (index) using X and Y bin indices. | |
| QPoint | getLocalPos (QPoint pos) const |
| Local (plot) position from global (SPLOM) | |
| size_t | getPointIndexAtPosition (QPointF mpos) const |
| Get index of data point under cursor, iASPLOMData::NoDataIdx if none. | |
| QPointF | getPositionFromPointIndex (size_t idx) const |
| Get position of a data point with a given index. | |
| void | initGrid () |
| Allocate lists for grid subdivision ( for point-picking acceleration) | |
| int | p2binx (double p) const |
| Get grid bin index using parameter value X. | |
| int | p2biny (double p) const |
| Get grid bin index using parameter value Y. | |
| double | p2tx (double pval) const |
| Parameter scalar value to normalized X coordinate [0,1]. | |
| double | p2ty (double pval) const |
| Parameter scalar value to normalized Y coordinate [0,1]. | |
| double | p2y (double pval) const |
| Parameter scalar value to Y coordinate (pixels) | |
| double | revertTransformX (double v) const |
| Revert scaling and offset to get X coordinate. | |
| double | revertTransformY (double v) const |
| Revert scaling and offset to get Y coordinate. | |
| void | updateDrawRect () |
| Re-calculate dimensions of the plot's rectangle. | |
| void | updateGrid () |
| Fill subdivision grid with points ( for point-picking acceleration) | |
| 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) | |
| double | x2p (double x) const |
| X coordinate (pixels) to parameter value. | |
| double | y2p (double y) const |
| Y coordinate (pixels) to parameter value. | |
Protected Attributes | |
| size_t | m_colInd |
| index of color-coded parameter | |
| size_t | m_curInd |
| index of currently selected point (iASPLOMData::NoDataIdx if none) | |
| size_t | m_curVisiblePts |
| number of currently visible points | |
| bool | m_dragging |
| indicates whether a drag operation is currently going on | |
| QRect | m_globRect |
| plot's rectangle | |
| int | m_gridDims [2] |
| dimensions of subdivision grid (point picking acceleration) | |
| bool | m_isMaximizedPlot |
| flag telling if this plot itself is maximized (bigger plot) | |
| bool | m_isPlotActive |
| flag indicating if the plot is active (user hovers mouse over) | |
| bool | m_isPreviewPlot |
| flag telling if a large version of this plot is shown maximized currently | |
| QRectF | m_locRect |
| plot's local drawing rectangle | |
| std::shared_ptr< iALookupTable > | m_lut |
| pointer to SPLOM-parent's lookup table | |
| QRectF | m_maxBtnRect |
| rectangle of maximized button | |
| int | m_numTicks |
| number of ticks | |
| QPointF | m_offset |
| transform offset component | |
| size_t | m_paramIndices [2] |
| indices of plot X, Y parameters | |
| iAChartParentWidget * | m_parentWidget |
| the parent widget | |
| QList< QList< size_t > > | m_pointsGrid |
| grid bins containing point indices | |
| size_t | m_prevInd |
| index of previously selected point (iASPLOMData::NoDataIdx if none) | |
| QPointF | m_prevPos |
| used for computing offset component | |
| size_t | m_prevPtInd |
| index of point selected before (iASPLOMData::NoDataIdx if none, but keeps point index even if no point was selected in between) | |
| double | m_prX [2] |
| double | m_prY [2] |
| range of x and y parameter | |
| double | m_scale |
| transform scale component | |
| QPolygon | m_selPoly |
| polygon of selection lasso | |
| QPoint | m_selStart |
| point where the selection started | |
| std::shared_ptr< iASPLOMData > | m_splomData |
| pointer to SPLOM-parent's data | |
| QList< double > | m_ticksX |
| position of ticks X axis | |
| QList< double > | m_ticksY |
| position of ticks Y axis | |
| iAScatterPlotViewData * | m_viewData |
| selection/highlight/settings handler (if part of a SPLOM, the SPLOM-parent) | |
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 | ( | iAScatterPlotViewData * | spViewData, |
| iAChartParentWidget * | parent, | ||
| int | numTicks = 5, | ||
| bool | isMaximizedPlot = false ) |
Constructor, initializes some core members.
| spViewData | data on the current viewing configuration |
| parent | the parent widget |
| numTicks | the number of ticks in x and y direction |
| isMaximizedPlot | whether this is a maximized plot |
| 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.
|
signal |
Emitted when the mouse button is clicked in the chart.
|
signal |
Emitted when the mouse is pressed in the chart (and no selection or fixed point selection happened)
|
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 |
|
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 |
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, iASPLOMData::NoDataIdx 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 iASPLOMData::NoDataIdx.
| 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.
| std::shared_ptr< iALookupTable > iAScatterPlot::lookupTable | ( | ) | const |
|
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].
| double iAScatterPlot::p2x | ( | double | pval | ) | const |
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.
| void iAScatterPlot::resetYBounds | ( | ) |
|
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, | ||
| std::shared_ptr< iASPLOMData > & | splomData ) |
Set data to the scatter plot using indices of X and Y parameters and the raw SPLOM data.
| void iAScatterPlot::setHighlightColor | ( | QColor | hltCol | ) |
| void iAScatterPlot::setHighlightColorTheme | ( | iAColorTheme const * | theme | ) |
| void iAScatterPlot::setHighlightDrawMode | ( | HighlightDrawModes | drawMode | ) |
| void iAScatterPlot::setIndices | ( | size_t | x, |
| size_t | y ) |
Set the indices of the parameters to view.
| void iAScatterPlot::setLookupTable | ( | std::shared_ptr< 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::setYBounds | ( | double | yMin, |
| double | yMax ) |
| 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.
| double const * iAScatterPlot::yBounds | ( | ) | const |
|
protected |
index of color-coded parameter
|
protected |
index of currently selected point (iASPLOMData::NoDataIdx 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 |
grid bins containing point indices
|
protected |
index of previously selected point (iASPLOMData::NoDataIdx if none)
|
protected |
used for computing offset component
|
protected |
index of point selected before (iASPLOMData::NoDataIdx 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 |
pointer to SPLOM-parent's data
|
protected |
position of ticks X axis
|
protected |
position of ticks Y axis
|
protected |
selection/highlight/settings handler (if part of a SPLOM, the SPLOM-parent)
| Settings iAScatterPlot::settings |