qCC version 2.13.alpha (Qt) - 31 May 2022
Main CloudCompare application (GUI & command line)
|
Histogram widget. More...
#include <ccHistogramWindow.h>
Signals | |
void | sfMinDispValChanged (double) |
void | sfMaxDispValChanged (double) |
void | sfMinSatValChanged (double) |
void | sfMaxSatValChanged (double) |
Public Member Functions | |
ccHistogramWindow (QWidget *parent=0) | |
Default constructor. | |
virtual | ~ccHistogramWindow () |
Destructor. | |
void | setTitle (const QString &str) |
Sets title. | |
void | setAxisLabels (const QString &xLabel, const QString &yLabel) |
Sets axis labels. | |
void | fromSF (ccScalarField *sf, unsigned initialNumberOfClasses=0, bool numberOfClassesCanBeChanged=true, bool showNaNValuesInGrey=true) |
Computes histogram from a scalar field. More... | |
void | fromBinArray (const std::vector< unsigned > &histoValues, double minVal, double maxVal) |
Creates histogram from a bin array (each bin = number of elements per class) More... | |
void | setCurveValues (const std::vector< double > &curveValues) |
Sets overlay curve values. More... | |
void | setColorScheme (HISTOGRAM_COLOR_SCHEME scheme) |
Sets how the gradient bars should be colored. | |
void | setSolidColor (QColor color) |
Sets solid color. More... | |
void | setColorScale (ccColorScale::Shared scale) |
Sets gradient color scale. More... | |
void | clear () |
Clears the display. | |
void | refresh () |
Updates the display. | |
void | refreshBars () |
Updates the histogram bars only. More... | |
const std::vector< unsigned > & | histoValues () const |
Returns the current histogram bins. | |
double | minVal () const |
Returns the current histogram min value. | |
double | maxVal () const |
Returns the current histogram max value. | |
void | setSFInteractionMode (SFInteractionModes modes) |
Enables SF interaction mode. | |
void | setAxisDisplayOption (AxisDisplayOptions axisOptions) |
void | setRefreshAfterResize (bool refreshAfterResize) |
void | setMinDispValue (double) |
void | setMaxDispValue (double) |
void | setMinSatValue (double) |
void | setMaxSatValue (double) |
Protected Types | |
enum | SELECTABLE_ITEMS { NONE , LEFT_AREA , RIGHT_AREA , BOTH_AREAS , LEFT_ARROW , RIGHT_ARROW , BOTH_ARROWS } |
Selectable items in "SF interaction" mode. | |
Protected Member Functions | |
void | setNumberOfClasses (size_t n) |
Changes the current number of classes. More... | |
void | mousePressEvent (QMouseEvent *event) |
void | mouseMoveEvent (QMouseEvent *event) |
void | wheelEvent (QWheelEvent *event) |
void | resizeEvent (QResizeEvent *event) |
unsigned | getMaxHistoVal () |
Returns current maximum bin size. | |
void | clearInternal () |
Clears internal structures. | |
bool | computeBinArrayFromSF (size_t binCount) |
Dynamically computes histogram bins from scalar field. | |
void | updateOverlayCurveWidth (int w, int h) |
Updates overlay curve width depending on the widget display size. | |
Protected Attributes | |
QString | m_titleStr |
QCPTextElement * | m_titlePlot |
HISTOGRAM_COLOR_SCHEME | m_colorScheme |
Color scheme. | |
QColor | m_solidColor |
Solid color. | |
ccColorScale::Shared | m_colorScale |
Gradient color scale. | |
ccScalarField * | m_associatedSF |
Associated scalar field. | |
bool | m_numberOfClassesCanBeChanged |
bool | m_refreshAfterResize |
QCPColoredBars * | m_histogram |
std::vector< unsigned > | m_histoValues |
double | m_minVal |
double | m_maxVal |
unsigned | m_maxHistoVal |
QCPGraph * | m_overlayCurve |
Overlay curve. | |
std::vector< double > | m_curveValues |
QCPBarsWithText * | m_vertBar |
bool | m_drawVerticalIndicator |
double | m_verticalIndicatorPositionPercent |
QFont | m_renderingFont |
Rendering font. | |
AxisDisplayOptions | m_axisDisplayOptions |
SFInteractionModes | m_sfInteractionModes |
Which SF interaction modes are enabled. | |
SELECTABLE_ITEMS | m_selectedItem |
Currently selected item. | |
QCPHiddenArea * | m_areaLeft |
Left greyed area. | |
double | m_areaLeftlastValue |
QCPHiddenArea * | m_areaRight |
Right greyed area. | |
double | m_areaRightlastValue |
QCPArrow * | m_arrowLeft |
Left arrow. | |
double | m_arrowLeftlastValue |
QCPArrow * | m_arrowRight |
Right arrow. | |
double | m_arrowRightlastValue |
QPoint | m_lastMouseClick |
Last mouse click. | |
Histogram widget.
void ccHistogramWindow::fromBinArray | ( | const std::vector< unsigned > & | histoValues, |
double | minVal, | ||
double | maxVal | ||
) |
Creates histogram from a bin array (each bin = number of elements per class)
Number of classes can't be modified.
histoValues | array of bins |
minVal | minimum value |
maxVal | maximum value |
void ccHistogramWindow::fromSF | ( | ccScalarField * | sf, |
unsigned | initialNumberOfClasses = 0 , |
||
bool | numberOfClassesCanBeChanged = true , |
||
bool | showNaNValuesInGrey = true |
||
) |
Computes histogram from a scalar field.
Number of classes can be freely modified afterwards (if enabled).
sf | associated scalar field |
initialNumberOfClasses | initial number of classes |
numberOfClassesCanBeChanged | whether to allow the user to modify the number of classes |
showNaNValuesInGrey | show NaN values (in gray) |
void ccHistogramWindow::refreshBars | ( | ) |
Updates the histogram bars only.
Only works if a SF is associated and color scheme is USE_SF_SCALE.
|
inline |
Sets gradient color scale.
Only used if color scheme is set to USE_CUSTOM_COLOR_SCALE.
void ccHistogramWindow::setCurveValues | ( | const std::vector< double > & | curveValues | ) |
Sets overlay curve values.
The curve will only appear over an histogram
curveValues | curve points 'Y' coordinates only (regularly sampled between the min and max histogram values) |
|
protected |
Changes the current number of classes.
Warning: n should be a multiple of 4.
|
inline |
Sets solid color.
Only used if color scheme is set to USE_SOLID_COLOR.
|
protected |
Only possible with an associated scalar field.