![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Histogram widget. More...
#include <ecvHistogramWindow.h>


Public Types | |
| enum | HISTOGRAM_COLOR_SCHEME { USE_SOLID_COLOR , USE_CUSTOM_COLOR_SCALE , USE_SF_SCALE } |
| enum class | AxisDisplayOption { None = 0x0 , XAxis = 0x01 , YAxis = 0x02 , All = XAxis | YAxis } |
| enum class | SFInteractionMode { None = 0x0 , DisplayRange = 0x01 , SaturationRange = 0x02 , All = DisplayRange | SaturationRange } |
Public Types inherited from QCustomPlot | |
| enum | LayerInsertMode { limBelow , limAbove , limBelow , limAbove } |
| enum | RefreshPriority { rpImmediateRefresh , rpQueuedRefresh , rpRefreshHint , rpQueuedReplot , rpImmediate , rpQueued , rpHint } |
| enum | LayerInsertMode { limBelow , limAbove , limBelow , limAbove } |
| enum | RefreshPriority { rpImmediateRefresh , rpQueuedRefresh , rpRefreshHint , rpQueuedReplot , rpImmediate , rpQueued , rpHint } |
Public Member Functions | |
| ccHistogramWindow (QWidget *parent=0) | |
| Default constructor. More... | |
| virtual | ~ccHistogramWindow () |
| Destructor. More... | |
| void | setTitle (const QString &str) |
| Sets title. More... | |
| void | setAxisLabels (const QString &xLabel, const QString &yLabel) |
| Sets axis labels. More... | |
| 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) |
| 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. More... | |
| void | setSolidColor (QColor color) |
| Sets solid color. More... | |
| void | setColorScale (ccColorScale::Shared scale) |
| Sets gradient color scale. More... | |
| void | clear () |
| Clears the display. More... | |
| void | refresh () |
| Updates the display. More... | |
| void | refreshBars () |
| Updates the histogram bars only. More... | |
| const std::vector< unsigned > & | histoValues () const |
| Returns the current histogram bins. More... | |
| double | minVal () const |
| Returns the current histogram min value. More... | |
| double | maxVal () const |
| Returns the current histogram max value. More... | |
| void | setSFInteractionMode (SFInteractionModes modes) |
| Enables SF interaction mode. More... | |
| void | setAxisDisplayOption (AxisDisplayOptions axisOptions) |
| void | setRefreshAfterResize (bool refreshAfterResize) |
| void | setMinDispValue (double) |
| void | setMaxDispValue (double) |
| void | setMinSatValue (double) |
| void | setMaxSatValue (double) |
Public Member Functions inherited from QCustomPlot | |
| QCustomPlot (QWidget *parent=0) | |
| virtual | ~QCustomPlot () |
| QRect | viewport () const |
| double | bufferDevicePixelRatio () const |
| QPixmap | background () const |
| bool | backgroundScaled () const |
| Qt::AspectRatioMode | backgroundScaledMode () const |
| QCPLayoutGrid * | plotLayout () const |
| QCP::AntialiasedElements | antialiasedElements () const |
| QCP::AntialiasedElements | notAntialiasedElements () const |
| bool | autoAddPlottableToLegend () const |
| const QCP::Interactions | interactions () const |
| int | selectionTolerance () const |
| bool | noAntialiasingOnDrag () const |
| QCP::PlottingHints | plottingHints () const |
| Qt::KeyboardModifier | multiSelectModifier () const |
| QCP::SelectionRectMode | selectionRectMode () const |
| QCPSelectionRect * | selectionRect () const |
| bool | openGl () const |
| void | setViewport (const QRect &rect) |
| void | setBufferDevicePixelRatio (double ratio) |
| void | setBackground (const QPixmap &pm) |
| void | setBackground (const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding) |
| void | setBackground (const QBrush &brush) |
| void | setBackgroundScaled (bool scaled) |
| void | setBackgroundScaledMode (Qt::AspectRatioMode mode) |
| void | setAntialiasedElements (const QCP::AntialiasedElements &antialiasedElements) |
| void | setAntialiasedElement (QCP::AntialiasedElement antialiasedElement, bool enabled=true) |
| void | setNotAntialiasedElements (const QCP::AntialiasedElements ¬AntialiasedElements) |
| void | setNotAntialiasedElement (QCP::AntialiasedElement notAntialiasedElement, bool enabled=true) |
| void | setAutoAddPlottableToLegend (bool on) |
| void | setInteractions (const QCP::Interactions &interactions) |
| void | setInteraction (const QCP::Interaction &interaction, bool enabled=true) |
| void | setSelectionTolerance (int pixels) |
| void | setNoAntialiasingOnDrag (bool enabled) |
| void | setPlottingHints (const QCP::PlottingHints &hints) |
| void | setPlottingHint (QCP::PlottingHint hint, bool enabled=true) |
| void | setMultiSelectModifier (Qt::KeyboardModifier modifier) |
| void | setSelectionRectMode (QCP::SelectionRectMode mode) |
| void | setSelectionRect (QCPSelectionRect *selectionRect) |
| void | setOpenGl (bool enabled, int multisampling=16) |
| QCPAbstractPlottable * | plottable (int index) |
| QCPAbstractPlottable * | plottable () |
| bool | removePlottable (QCPAbstractPlottable *plottable) |
| bool | removePlottable (int index) |
| int | clearPlottables () |
| int | plottableCount () const |
| QList< QCPAbstractPlottable * > | selectedPlottables () const |
| QCPAbstractPlottable * | plottableAt (const QPointF &pos, bool onlySelectable=false) const |
| bool | hasPlottable (QCPAbstractPlottable *plottable) const |
| QCPGraph * | graph (int index) const |
| QCPGraph * | graph () const |
| QCPGraph * | addGraph (QCPAxis *keyAxis=0, QCPAxis *valueAxis=0) |
| bool | removeGraph (QCPGraph *graph) |
| bool | removeGraph (int index) |
| int | clearGraphs () |
| int | graphCount () const |
| QList< QCPGraph * > | selectedGraphs () const |
| QCPAbstractItem * | item (int index) const |
| QCPAbstractItem * | item () const |
| bool | removeItem (QCPAbstractItem *item) |
| bool | removeItem (int index) |
| int | clearItems () |
| int | itemCount () const |
| QList< QCPAbstractItem * > | selectedItems () const |
| QCPAbstractItem * | itemAt (const QPointF &pos, bool onlySelectable=false) const |
| bool | hasItem (QCPAbstractItem *item) const |
| QCPLayer * | layer (const QString &name) const |
| QCPLayer * | layer (int index) const |
| QCPLayer * | currentLayer () const |
| bool | setCurrentLayer (const QString &name) |
| bool | setCurrentLayer (QCPLayer *layer) |
| int | layerCount () const |
| bool | addLayer (const QString &name, QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove) |
| bool | removeLayer (QCPLayer *layer) |
| bool | moveLayer (QCPLayer *layer, QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove) |
| int | axisRectCount () const |
| QCPAxisRect * | axisRect (int index=0) const |
| QList< QCPAxisRect * > | axisRects () const |
| QCPLayoutElement * | layoutElementAt (const QPointF &pos) const |
| QCPAxisRect * | axisRectAt (const QPointF &pos) const |
| Q_SLOT void | rescaleAxes (bool onlyVisiblePlottables=false) |
| QList< QCPAxis * > | selectedAxes () const |
| QList< QCPLegend * > | selectedLegends () const |
| Q_SLOT void | deselectAll () |
| bool | savePdf (const QString &fileName, int width=0, int height=0, QCP::ExportPen exportPen=QCP::epAllowCosmetic, const QString &pdfCreator=QString(), const QString &pdfTitle=QString()) |
| bool | savePng (const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch) |
| bool | saveJpg (const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch) |
| bool | saveBmp (const QString &fileName, int width=0, int height=0, double scale=1.0, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch) |
| bool | saveRastered (const QString &fileName, int width, int height, double scale, const char *format, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch) |
| QPixmap | toPixmap (int width=0, int height=0, double scale=1.0) |
| void | toPainter (QCPPainter *painter, int width=0, int height=0) |
| Q_SLOT void | replot (QCustomPlot::RefreshPriority refreshPriority=QCustomPlot::rpRefreshHint) |
| QCustomPlot (QWidget *parent=0) | |
| virtual | ~QCustomPlot () |
| QRect | viewport () const |
| QPixmap | background () const |
| bool | backgroundScaled () const |
| Qt::AspectRatioMode | backgroundScaledMode () const |
| QCPLayoutGrid * | plotLayout () const |
| QCP::AntialiasedElements | antialiasedElements () const |
| QCP::AntialiasedElements | notAntialiasedElements () const |
| bool | autoAddPlottableToLegend () const |
| const QCP::Interactions | interactions () const |
| int | selectionTolerance () const |
| bool | noAntialiasingOnDrag () const |
| QCP::PlottingHints | plottingHints () const |
| Qt::KeyboardModifier | multiSelectModifier () const |
| void | setViewport (const QRect &rect) |
| void | setBackground (const QPixmap &pm) |
| void | setBackground (const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding) |
| void | setBackground (const QBrush &brush) |
| void | setBackgroundScaled (bool scaled) |
| void | setBackgroundScaledMode (Qt::AspectRatioMode mode) |
| void | setAntialiasedElements (const QCP::AntialiasedElements &antialiasedElements) |
| void | setAntialiasedElement (QCP::AntialiasedElement antialiasedElement, bool enabled=true) |
| void | setNotAntialiasedElements (const QCP::AntialiasedElements ¬AntialiasedElements) |
| void | setNotAntialiasedElement (QCP::AntialiasedElement notAntialiasedElement, bool enabled=true) |
| void | setAutoAddPlottableToLegend (bool on) |
| void | setInteractions (const QCP::Interactions &interactions) |
| void | setInteraction (const QCP::Interaction &interaction, bool enabled=true) |
| void | setSelectionTolerance (int pixels) |
| void | setNoAntialiasingOnDrag (bool enabled) |
| void | setPlottingHints (const QCP::PlottingHints &hints) |
| void | setPlottingHint (QCP::PlottingHint hint, bool enabled=true) |
| void | setMultiSelectModifier (Qt::KeyboardModifier modifier) |
| QCPAbstractPlottable * | plottable (int index) |
| QCPAbstractPlottable * | plottable () |
| bool | addPlottable (QCPAbstractPlottable *plottable) |
| bool | removePlottable (QCPAbstractPlottable *plottable) |
| bool | removePlottable (int index) |
| int | clearPlottables () |
| int | plottableCount () const |
| QList< QCPAbstractPlottable * > | selectedPlottables () const |
| QCPAbstractPlottable * | plottableAt (const QPointF &pos, bool onlySelectable=false) const |
| bool | hasPlottable (QCPAbstractPlottable *plottable) const |
| QCPGraph * | graph (int index) const |
| QCPGraph * | graph () const |
| QCPGraph * | addGraph (QCPAxis *keyAxis=0, QCPAxis *valueAxis=0) |
| bool | removeGraph (QCPGraph *graph) |
| bool | removeGraph (int index) |
| int | clearGraphs () |
| int | graphCount () const |
| QList< QCPGraph * > | selectedGraphs () const |
| QCPAbstractItem * | item (int index) const |
| QCPAbstractItem * | item () const |
| bool | addItem (QCPAbstractItem *item) |
| bool | removeItem (QCPAbstractItem *item) |
| bool | removeItem (int index) |
| int | clearItems () |
| int | itemCount () const |
| QList< QCPAbstractItem * > | selectedItems () const |
| QCPAbstractItem * | itemAt (const QPointF &pos, bool onlySelectable=false) const |
| bool | hasItem (QCPAbstractItem *item) const |
| QCPLayer * | layer (const QString &name) const |
| QCPLayer * | layer (int index) const |
| QCPLayer * | currentLayer () const |
| bool | setCurrentLayer (const QString &name) |
| bool | setCurrentLayer (QCPLayer *layer) |
| int | layerCount () const |
| bool | addLayer (const QString &name, QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove) |
| bool | removeLayer (QCPLayer *layer) |
| bool | moveLayer (QCPLayer *layer, QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove) |
| int | axisRectCount () const |
| QCPAxisRect * | axisRect (int index=0) const |
| QList< QCPAxisRect * > | axisRects () const |
| QCPLayoutElement * | layoutElementAt (const QPointF &pos) const |
| Q_SLOT void | rescaleAxes (bool onlyVisiblePlottables=false) |
| QList< QCPAxis * > | selectedAxes () const |
| QList< QCPLegend * > | selectedLegends () const |
| Q_SLOT void | deselectAll () |
| bool | savePdf (const QString &fileName, bool noCosmeticPen=false, int width=0, int height=0, const QString &pdfCreator=QString(), const QString &pdfTitle=QString()) |
| bool | savePng (const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1) |
| bool | saveJpg (const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1) |
| bool | saveBmp (const QString &fileName, int width=0, int height=0, double scale=1.0) |
| bool | saveRastered (const QString &fileName, int width, int height, double scale, const char *format, int quality=-1) |
| QPixmap | toPixmap (int width=0, int height=0, double scale=1.0) |
| void | toPainter (QCPPainter *painter, int width=0, int height=0) |
| Q_SLOT void | replot (QCustomPlot::RefreshPriority refreshPriority=QCustomPlot::rpHint) |
Protected Types | |
| enum | SELECTABLE_ITEMS { NONE , LEFT_AREA , RIGHT_AREA , BOTH_AREAS , LEFT_ARROW , RIGHT_ARROW , BOTH_ARROWS } |
| Selectable items in "SF interaction" mode. More... | |
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. More... | |
| bool | computeBinArrayFromSF (size_t binCount) |
| Dynamically computes histogram bins from scalar field. More... | |
| void | updateOverlayCurveWidth (int w, int h) |
| Updates overlay curve width depending on the widget display size. More... | |
Protected Member Functions inherited from QCustomPlot | |
| virtual QSize | minimumSizeHint () const |
| virtual QSize | sizeHint () const |
| virtual void | paintEvent (QPaintEvent *event) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
| virtual void | mouseReleaseEvent (QMouseEvent *event) |
| virtual void | draw (QCPPainter *painter) |
| virtual void | updateLayout () |
| virtual void | axisRemoved (QCPAxis *axis) |
| virtual void | legendRemoved (QCPLegend *legend) |
| virtual Q_SLOT void | processRectSelection (QRect rect, QMouseEvent *event) |
| virtual Q_SLOT void | processRectZoom (QRect rect, QMouseEvent *event) |
| virtual Q_SLOT void | processPointSelection (QMouseEvent *event) |
| bool | registerPlottable (QCPAbstractPlottable *plottable) |
| bool | registerGraph (QCPGraph *graph) |
| bool | registerItem (QCPAbstractItem *item) |
| void | updateLayerIndices () const |
| QCPLayerable * | layerableAt (const QPointF &pos, bool onlySelectable, QVariant *selectionDetails=0) const |
| QList< QCPLayerable * > | layerableListAt (const QPointF &pos, bool onlySelectable, QList< QVariant > *selectionDetails=0) const |
| void | drawBackground (QCPPainter *painter) |
| void | setupPaintBuffers () |
| QCPAbstractPaintBuffer * | createPaintBuffer () |
| bool | hasInvalidatedPaintBuffers () |
| bool | setupOpenGl () |
| void | freeOpenGl () |
| virtual QSize | minimumSizeHint () const |
| virtual QSize | sizeHint () const |
| virtual void | paintEvent (QPaintEvent *event) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
| virtual void | mouseReleaseEvent (QMouseEvent *event) |
| virtual void | draw (QCPPainter *painter) |
| virtual void | axisRemoved (QCPAxis *axis) |
| virtual void | legendRemoved (QCPLegend *legend) |
| void | updateLayerIndices () const |
| QCPLayerable * | layerableAt (const QPointF &pos, bool onlySelectable, QVariant *selectionDetails=0) const |
| void | drawBackground (QCPPainter *painter) |
Additional Inherited Members | |
Public Attributes inherited from QCustomPlot | |
| QCPAxis * | xAxis |
| QCPAxis * | yAxis |
| QCPAxis * | xAxis2 |
| QCPAxis * | yAxis2 |
| QCPLegend * | legend |
Histogram widget.
Definition at line 28 of file ecvHistogramWindow.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| XAxis | |
| YAxis | |
| All | |
Definition at line 111 of file ecvHistogramWindow.h.
| Enumerator | |
|---|---|
| USE_SOLID_COLOR | |
| USE_CUSTOM_COLOR_SCALE | |
| USE_SF_SCALE | |
Definition at line 75 of file ecvHistogramWindow.h.
|
protected |
Selectable items in "SF interaction" mode.
| Enumerator | |
|---|---|
| NONE | |
| LEFT_AREA | |
| RIGHT_AREA | |
| BOTH_AREAS | |
| LEFT_ARROW | |
| RIGHT_ARROW | |
| BOTH_ARROWS | |
Definition at line 218 of file ecvHistogramWindow.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| DisplayRange | |
| SaturationRange | |
| All | |
Definition at line 120 of file ecvHistogramWindow.h.
|
explicit |
Default constructor.
Definition at line 35 of file ecvHistogramWindow.cpp.
References QCP::aeAll, m_renderingFont, QCustomPlot::setAntialiasedElements(), QCustomPlot::setAutoAddPlottableToLegend(), QCPAxis::setSubTickLength(), QCPAxis::setTickLength(), QCustomPlot::xAxis, and QCustomPlot::yAxis.
|
virtual |
Destructor.
Definition at line 85 of file ecvHistogramWindow.cpp.
| void ccHistogramWindow::clear | ( | ) |
Clears the display.
Definition at line 87 of file ecvHistogramWindow.cpp.
References refresh().
Referenced by ccColorFromScalarDlg::updateChannel(), ccColorLevelsDlg::updateHistogram(), and ccColorFromScalarDlg::updateHistogram().
|
protected |
Dynamically computes histogram bins from scalar field.
Definition at line 179 of file ecvHistogramWindow.cpp.
References count, cloudViewer::ScalarField::currentSize(), CVLog::Error(), cloudViewer::utility::floor(), ccScalarField::getHistogram(), cloudViewer::ScalarField::getValue(), m_associatedSF, m_histoValues, m_maxVal, m_minVal, and CVLog::Warning().
Referenced by setNumberOfClasses().
| 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 |
Definition at line 153 of file ecvHistogramWindow.cpp.
References getMaxHistoVal(), histoValues(), m_histoValues, m_maxHistoVal, m_maxVal, m_minVal, m_numberOfClassesCanBeChanged, maxVal(), minVal(), and CVLog::Warning().
Referenced by ccColorFromScalarDlg::ccColorFromScalarDlg(), ccEntityAction::computeStatParams(), MainWindow::spawnHistogramDialog(), and ccColorLevelsDlg::updateHistogram().
| 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) |
Definition at line 127 of file ecvHistogramWindow.cpp.
References ccScalarField::displayRange(), cloudViewer::ScalarField::getMax(), cloudViewer::ScalarField::getMin(), CCShareable::link(), m_associatedSF, m_maxVal, m_minVal, m_numberOfClassesCanBeChanged, CCShareable::release(), setColorScheme(), setNumberOfClasses(), ccScalarField::Range::start(), ccScalarField::Range::stop(), and USE_SF_SCALE.
Referenced by sfEditDlg::fillDialogWith(), ccComparisonDlg::showHisto(), and ccColorFromScalarDlg::updateChannel().
|
protected |
Returns current maximum bin size.
Definition at line 245 of file ecvHistogramWindow.cpp.
References m_histoValues, and m_maxHistoVal.
Referenced by fromBinArray(), and setNumberOfClasses().
|
inline |
Returns the current histogram bins.
Definition at line 102 of file ecvHistogramWindow.h.
References m_histoValues.
Referenced by ccHistogramWindowDlg::exportToCSV(), and fromBinArray().
|
inline |
Returns the current histogram max value.
Definition at line 108 of file ecvHistogramWindow.h.
References m_maxVal.
Referenced by ccHistogramWindowDlg::exportToCSV(), fromBinArray(), and refresh().
|
inline |
Returns the current histogram min value.
Definition at line 106 of file ecvHistogramWindow.h.
References m_minVal.
Referenced by ccHistogramWindowDlg::exportToCSV(), fromBinArray(), and refresh().
|
protectedvirtual |
Reimplemented from QCustomPlot.
Definition at line 710 of file ecvHistogramWindow.cpp.
References BOTH_AREAS, BOTH_ARROWS, QCPSelectableCursor::currentVal(), event, LEFT_AREA, LEFT_ARROW, m_areaLeft, m_areaRight, m_arrowLeft, m_arrowRight, m_drawVerticalIndicator, m_histogram, m_histoValues, m_lastMouseClick, m_selectedItem, m_sfInteractionModes, m_verticalIndicatorPositionPercent, NONE, QCPSelectableCursor::pixelToKey(), QCPColoredBars::rect(), refresh(), RIGHT_AREA, RIGHT_ARROW, setMaxDispValue(), setMaxSatValue(), setMinDispValue(), and setMinSatValue().
Referenced by mousePressEvent().
|
protectedvirtual |
Reimplemented from QCustomPlot.
Definition at line 676 of file ecvHistogramWindow.cpp.
References BOTH_AREAS, BOTH_ARROWS, DisplayRange, event, QCPSelectableCursor::isSelectable(), LEFT_AREA, LEFT_ARROW, m_areaLeft, m_areaRight, m_arrowLeft, m_arrowRight, m_lastMouseClick, m_selectedItem, m_sfInteractionModes, mouseMoveEvent(), NONE, RIGHT_AREA, RIGHT_ARROW, and SaturationRange.
| void ccHistogramWindow::refresh | ( | ) |
Updates the display.
Definition at line 323 of file ecvHistogramWindow.cpp.
References QCPLayoutGrid::addElement(), QCustomPlot::addGraph(), QCPBarsWithText::appendText(), ecvColor::RgbTpl< Type >::b, QCustomPlot::clearGraphs(), QCustomPlot::clearPlottables(), colors, ecvColor::darkGrey(), ecvGui::ParamStruct::displayedNumPrecision, DisplayRange, ccScalarField::displayRange(), ecvColor::RgbTpl< Type >::g, ccScalarField::getColor(), ccScalarField::getColorRampSteps(), ccScalarField::getColorScale(), ccColorScalesManager::GetDefaultScale(), height, QCPLayoutGrid::insertRow(), ecvColor::lightGrey(), m_areaLeft, m_areaLeftlastValue, m_areaRight, m_areaRightlastValue, m_arrowLeft, m_arrowLeftlastValue, m_arrowRight, m_arrowRightlastValue, m_associatedSF, m_axisDisplayOptions, m_colorScale, m_colorScheme, m_curveValues, m_drawVerticalIndicator, m_histogram, m_histoValues, m_maxHistoVal, m_maxVal, m_minVal, m_overlayCurve, m_renderingFont, m_sfInteractionModes, m_solidColor, m_titlePlot, m_titleStr, m_vertBar, m_verticalIndicatorPositionPercent, ccScalarField::Range::max(), maxVal(), ccScalarField::Range::min(), minVal(), ecvGui::Parameters(), QCustomPlot::plotLayout(), ecvColor::RgbTpl< Type >::r, ecvColor::red(), QCPLayout::remove(), QCustomPlot::replot(), SaturationRange, ccScalarField::saturationRange(), QCPLayerable::setAntialiased(), QCPAbstractPlottable::setAntialiasedFill(), QCPAbstractPlottable::setBrush(), QCPArrow::setColor(), QCPSelectableCursor::setCurrentVal(), QCPColoredBars::setData(), QCPBars::setData(), QCPGraph::setData(), QCPTextElement::setFont(), QCPAbstractPlottable::setName(), QCPAbstractPlottable::setPen(), QCPAxis::setRange(), QCPSelectableCursor::setRange(), QCPBarsWithText::setText(), QCPBarsWithText::setTextAlignment(), QCPLayerable::setVisible(), QCPBars::setWidth(), ccScalarField::Range::start(), ccScalarField::Range::stop(), ccScalarField::symmetricalScale(), updateOverlayCurveWidth(), USE_CUSTOM_COLOR_SCALE, USE_SF_SCALE, USE_SOLID_COLOR, width, x, XAxis, QCustomPlot::xAxis, y, YAxis, and QCustomPlot::yAxis.
Referenced by clear(), ccEntityAction::computeStatParams(), sfEditDlg::logScaleChanged(), mouseMoveEvent(), resizeEvent(), MainWindow::spawnHistogramDialog(), sfEditDlg::symmetricalScaleChanged(), ccColorLevelsDlg::updateHistogram(), ccColorFromScalarDlg::updateHistogram(), and wheelEvent().
| void ccHistogramWindow::refreshBars | ( | ) |
Updates the histogram bars only.
Only works if a SF is associated and color scheme is USE_SF_SCALE.
Definition at line 276 of file ecvHistogramWindow.cpp.
References ecvColor::RgbTpl< Type >::b, QCPColoredBars::clearData(), colors, ecvColor::RgbTpl< Type >::g, ccScalarField::getColor(), ccScalarField::getColorScale(), ecvColor::lightGrey(), m_associatedSF, m_colorScheme, m_histogram, m_histoValues, m_maxVal, m_minVal, ecvColor::RgbTpl< Type >::r, QCustomPlot::replot(), QCustomPlot::rpImmediateRefresh, QCPColoredBars::setData(), and USE_SF_SCALE.
Referenced by setMaxDispValue(), setMaxSatValue(), setMinDispValue(), and setMinSatValue().
|
protectedvirtual |
Reimplemented from QCustomPlot.
Definition at line 667 of file ecvHistogramWindow.cpp.
References event, m_refreshAfterResize, refresh(), QCustomPlot::resizeEvent(), and updateOverlayCurveWidth().
| void ccHistogramWindow::setAxisDisplayOption | ( | AxisDisplayOptions | axisOptions | ) |
Definition at line 315 of file ecvHistogramWindow.cpp.
References m_axisDisplayOptions.
Referenced by ccColorFromScalarDlg::updateHistogram().
| void ccHistogramWindow::setAxisLabels | ( | const QString & | xLabel, |
| const QString & | yLabel | ||
| ) |
Sets axis labels.
Definition at line 108 of file ecvHistogramWindow.cpp.
References QCPAxis::setLabel(), QCPLayerable::setVisible(), QCustomPlot::xAxis, and QCustomPlot::yAxis.
Referenced by ccEntityAction::computeStatParams(), ccComparisonDlg::showHisto(), MainWindow::spawnHistogramDialog(), ccColorLevelsDlg::updateHistogram(), and ccColorFromScalarDlg::updateHistogram().
|
inline |
Sets gradient color scale.
Only used if color scheme is set to USE_CUSTOM_COLOR_SCALE.
Definition at line 90 of file ecvHistogramWindow.h.
References m_colorScale.
Referenced by ccEntityAction::computeStatParams().
|
inline |
Sets how the gradient bars should be colored.
Definition at line 81 of file ecvHistogramWindow.h.
References m_colorScheme.
Referenced by ccColorLevelsDlg::ccColorLevelsDlg(), ccEntityAction::computeStatParams(), and fromSF().
| 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) |
Definition at line 170 of file ecvHistogramWindow.cpp.
References m_curveValues, and CVLog::Warning().
Referenced by ccEntityAction::computeStatParams().
| void ccHistogramWindow::setMaxDispValue | ( | double | val | ) |
Definition at line 605 of file ecvHistogramWindow.cpp.
References QCPSelectableCursor::currentVal(), m_areaRight, m_areaRightlastValue, m_associatedSF, refreshBars(), QCustomPlot::replot(), QCPSelectableCursor::setCurrentVal(), ccScalarField::setMaxDisplayed(), and sfMaxDispValChanged().
Referenced by sfEditDlg::maxValSBChanged(), and mouseMoveEvent().
| void ccHistogramWindow::setMaxSatValue | ( | double | val | ) |
Definition at line 639 of file ecvHistogramWindow.cpp.
References QCPSelectableCursor::currentVal(), m_arrowRight, m_arrowRightlastValue, m_associatedSF, refreshBars(), QCustomPlot::replot(), QCPSelectableCursor::setCurrentVal(), ccScalarField::setSaturationStop(), and sfMaxSatValChanged().
Referenced by ccColorFromScalarDlg::maxChanged(), sfEditDlg::maxSatSBChanged(), mouseMoveEvent(), and ccColorFromScalarDlg::setDefaultSatValuePerChannel().
| void ccHistogramWindow::setMinDispValue | ( | double | val | ) |
Definition at line 588 of file ecvHistogramWindow.cpp.
References QCPSelectableCursor::currentVal(), m_areaLeft, m_areaLeftlastValue, m_associatedSF, refreshBars(), QCustomPlot::replot(), QCPSelectableCursor::setCurrentVal(), ccScalarField::setMinDisplayed(), and sfMinDispValChanged().
Referenced by sfEditDlg::minValSBChanged(), and mouseMoveEvent().
| void ccHistogramWindow::setMinSatValue | ( | double | val | ) |
Definition at line 622 of file ecvHistogramWindow.cpp.
References QCPSelectableCursor::currentVal(), m_arrowLeft, m_arrowLeftlastValue, m_associatedSF, refreshBars(), QCustomPlot::replot(), QCPSelectableCursor::setCurrentVal(), ccScalarField::setSaturationStart(), and sfMinSatValChanged().
Referenced by ccColorFromScalarDlg::minChanged(), sfEditDlg::minSatSBChanged(), mouseMoveEvent(), and ccColorFromScalarDlg::setDefaultSatValuePerChannel().
|
protected |
Changes the current number of classes.
Warning: n should be a multiple of 4.
Definition at line 255 of file ecvHistogramWindow.cpp.
References computeBinArrayFromSF(), getMaxHistoVal(), m_associatedSF, m_histoValues, and m_maxHistoVal.
Referenced by fromSF(), and wheelEvent().
| void ccHistogramWindow::setRefreshAfterResize | ( | bool | refreshAfterResize | ) |
Definition at line 319 of file ecvHistogramWindow.cpp.
References m_refreshAfterResize.
Referenced by ccColorFromScalarDlg::ccColorFromScalarDlg().
| void ccHistogramWindow::setSFInteractionMode | ( | SFInteractionModes | modes | ) |
Enables SF interaction mode.
Definition at line 311 of file ecvHistogramWindow.cpp.
References m_sfInteractionModes.
Referenced by sfEditDlg::sfEditDlg(), and ccColorFromScalarDlg::updateHistogram().
|
inline |
Sets solid color.
Only used if color scheme is set to USE_SOLID_COLOR.
Definition at line 87 of file ecvHistogramWindow.h.
References color, and m_solidColor.
Referenced by ccColorLevelsDlg::ccColorLevelsDlg(), and ccColorLevelsDlg::updateHistogram().
| void ccHistogramWindow::setTitle | ( | const QString & | str | ) |
Sets title.
Definition at line 106 of file ecvHistogramWindow.cpp.
References m_titleStr.
Referenced by ccEntityAction::computeStatParams(), ccComparisonDlg::showHisto(), and MainWindow::spawnHistogramDialog().
|
signal |
Referenced by setMaxDispValue(), and sfEditDlg::sfEditDlg().
|
signal |
Referenced by ccColorFromScalarDlg::ccColorFromScalarDlg(), setMaxSatValue(), and sfEditDlg::sfEditDlg().
|
signal |
Referenced by setMinDispValue(), and sfEditDlg::sfEditDlg().
|
signal |
Referenced by ccColorFromScalarDlg::ccColorFromScalarDlg(), setMinSatValue(), and sfEditDlg::sfEditDlg().
|
protected |
Updates overlay curve width depending on the widget display size.
Definition at line 656 of file ecvHistogramWindow.cpp.
References m_overlayCurve, QCPAbstractPlottable::pen(), and QCPAbstractPlottable::setPen().
Referenced by refresh(), and resizeEvent().
|
protectedvirtual |
Reimplemented from QCustomPlot.
Definition at line 822 of file ecvHistogramWindow.cpp.
References e, m_histoValues, m_numberOfClassesCanBeChanged, qtCompatWheelEventDelta(), refresh(), and setNumberOfClasses().
|
protected |
Left greyed area.
Definition at line 231 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setMinDispValue().
|
protected |
Definition at line 232 of file ecvHistogramWindow.h.
Referenced by refresh(), and setMinDispValue().
|
protected |
Right greyed area.
Definition at line 234 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setMaxDispValue().
|
protected |
Definition at line 235 of file ecvHistogramWindow.h.
Referenced by refresh(), and setMaxDispValue().
|
protected |
Left arrow.
Definition at line 238 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setMinSatValue().
|
protected |
Definition at line 239 of file ecvHistogramWindow.h.
Referenced by refresh(), and setMinSatValue().
|
protected |
Right arrow.
Definition at line 241 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setMaxSatValue().
|
protected |
Definition at line 242 of file ecvHistogramWindow.h.
Referenced by refresh(), and setMaxSatValue().
|
protected |
Associated scalar field.
Definition at line 184 of file ecvHistogramWindow.h.
Referenced by computeBinArrayFromSF(), fromSF(), refresh(), refreshBars(), setMaxDispValue(), setMaxSatValue(), setMinDispValue(), setMinSatValue(), and setNumberOfClasses().
|
protected |
Definition at line 211 of file ecvHistogramWindow.h.
Referenced by refresh(), and setAxisDisplayOption().
|
protected |
Gradient color scale.
Definition at line 181 of file ecvHistogramWindow.h.
Referenced by refresh(), and setColorScale().
|
protected |
Color scheme.
Definition at line 177 of file ecvHistogramWindow.h.
Referenced by refresh(), refreshBars(), and setColorScheme().
|
protected |
Definition at line 201 of file ecvHistogramWindow.h.
Referenced by refresh(), and setCurveValues().
|
protected |
Definition at line 205 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), and refresh().
|
protected |
Definition at line 193 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), refresh(), and refreshBars().
|
protected |
Definition at line 194 of file ecvHistogramWindow.h.
Referenced by computeBinArrayFromSF(), fromBinArray(), getMaxHistoVal(), histoValues(), mouseMoveEvent(), refresh(), refreshBars(), setNumberOfClasses(), and wheelEvent().
|
protected |
Last mouse click.
Definition at line 245 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
protected |
Definition at line 197 of file ecvHistogramWindow.h.
Referenced by fromBinArray(), getMaxHistoVal(), refresh(), and setNumberOfClasses().
|
protected |
Definition at line 196 of file ecvHistogramWindow.h.
Referenced by computeBinArrayFromSF(), fromBinArray(), fromSF(), maxVal(), refresh(), and refreshBars().
|
protected |
Definition at line 195 of file ecvHistogramWindow.h.
Referenced by computeBinArrayFromSF(), fromBinArray(), fromSF(), minVal(), refresh(), and refreshBars().
|
protected |
Only possible with an associated scalar field.
Definition at line 188 of file ecvHistogramWindow.h.
Referenced by fromBinArray(), fromSF(), and wheelEvent().
|
protected |
Overlay curve.
Definition at line 200 of file ecvHistogramWindow.h.
Referenced by refresh(), and updateOverlayCurveWidth().
|
protected |
Definition at line 190 of file ecvHistogramWindow.h.
Referenced by resizeEvent(), and setRefreshAfterResize().
|
protected |
Rendering font.
Definition at line 209 of file ecvHistogramWindow.h.
Referenced by ccHistogramWindow(), and refresh().
|
protected |
Currently selected item.
Definition at line 228 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
protected |
Which SF interaction modes are enabled.
Definition at line 215 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setSFInteractionMode().
|
protected |
Solid color.
Definition at line 179 of file ecvHistogramWindow.h.
Referenced by refresh(), and setSolidColor().
|
protected |
Definition at line 174 of file ecvHistogramWindow.h.
Referenced by refresh().
|
protected |
Definition at line 173 of file ecvHistogramWindow.h.
Referenced by refresh(), and setTitle().
|
protected |
Definition at line 204 of file ecvHistogramWindow.h.
Referenced by refresh().
|
protected |
Definition at line 206 of file ecvHistogramWindow.h.
Referenced by mouseMoveEvent(), and refresh().