ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccHistogramWindow Class Reference

Histogram widget. More...

#include <ecvHistogramWindow.h>

Inheritance diagram for ccHistogramWindow:
Collaboration diagram for ccHistogramWindow:

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
}
 

Signals

void sfMinDispValChanged (double)
 
void sfMaxDispValChanged (double)
 
void sfMinSatValChanged (double)
 
void sfMaxSatValChanged (double)
 
- Signals inherited from QCustomPlot
void mouseDoubleClick (QMouseEvent *event)
 
void mousePress (QMouseEvent *event)
 
void mouseMove (QMouseEvent *event)
 
void mouseRelease (QMouseEvent *event)
 
void mouseWheel (QWheelEvent *event)
 
void plottableClick (QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
 
void plottableDoubleClick (QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
 
void itemClick (QCPAbstractItem *item, QMouseEvent *event)
 
void itemDoubleClick (QCPAbstractItem *item, QMouseEvent *event)
 
void axisClick (QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
 
void axisDoubleClick (QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
 
void legendClick (QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
 
void legendDoubleClick (QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
 
void selectionChangedByUser ()
 
void beforeReplot ()
 
void afterReplot ()
 
void mouseDoubleClick (QMouseEvent *event)
 
void mousePress (QMouseEvent *event)
 
void mouseMove (QMouseEvent *event)
 
void mouseRelease (QMouseEvent *event)
 
void mouseWheel (QWheelEvent *event)
 
void plottableClick (QCPAbstractPlottable *plottable, QMouseEvent *event)
 
void plottableDoubleClick (QCPAbstractPlottable *plottable, QMouseEvent *event)
 
void itemClick (QCPAbstractItem *item, QMouseEvent *event)
 
void itemDoubleClick (QCPAbstractItem *item, QMouseEvent *event)
 
void axisClick (QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
 
void axisDoubleClick (QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
 
void legendClick (QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
 
void legendDoubleClick (QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
 
void titleClick (QMouseEvent *event, QCPPlotTitle *title)
 
void titleDoubleClick (QMouseEvent *event, QCPPlotTitle *title)
 
void selectionChangedByUser ()
 
void beforeReplot ()
 
void afterReplot ()
 

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
 
QCPLayoutGridplotLayout () 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
 
QCPSelectionRectselectionRect () 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 &notAntialiasedElements)
 
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)
 
QCPAbstractPlottableplottable (int index)
 
QCPAbstractPlottableplottable ()
 
bool removePlottable (QCPAbstractPlottable *plottable)
 
bool removePlottable (int index)
 
int clearPlottables ()
 
int plottableCount () const
 
QList< QCPAbstractPlottable * > selectedPlottables () const
 
QCPAbstractPlottableplottableAt (const QPointF &pos, bool onlySelectable=false) const
 
bool hasPlottable (QCPAbstractPlottable *plottable) const
 
QCPGraphgraph (int index) const
 
QCPGraphgraph () const
 
QCPGraphaddGraph (QCPAxis *keyAxis=0, QCPAxis *valueAxis=0)
 
bool removeGraph (QCPGraph *graph)
 
bool removeGraph (int index)
 
int clearGraphs ()
 
int graphCount () const
 
QList< QCPGraph * > selectedGraphs () const
 
QCPAbstractItemitem (int index) const
 
QCPAbstractItemitem () const
 
bool removeItem (QCPAbstractItem *item)
 
bool removeItem (int index)
 
int clearItems ()
 
int itemCount () const
 
QList< QCPAbstractItem * > selectedItems () const
 
QCPAbstractItemitemAt (const QPointF &pos, bool onlySelectable=false) const
 
bool hasItem (QCPAbstractItem *item) const
 
QCPLayerlayer (const QString &name) const
 
QCPLayerlayer (int index) const
 
QCPLayercurrentLayer () 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
 
QCPAxisRectaxisRect (int index=0) const
 
QList< QCPAxisRect * > axisRects () const
 
QCPLayoutElementlayoutElementAt (const QPointF &pos) const
 
QCPAxisRectaxisRectAt (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
 
QCPLayoutGridplotLayout () 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 &notAntialiasedElements)
 
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)
 
QCPAbstractPlottableplottable (int index)
 
QCPAbstractPlottableplottable ()
 
bool addPlottable (QCPAbstractPlottable *plottable)
 
bool removePlottable (QCPAbstractPlottable *plottable)
 
bool removePlottable (int index)
 
int clearPlottables ()
 
int plottableCount () const
 
QList< QCPAbstractPlottable * > selectedPlottables () const
 
QCPAbstractPlottableplottableAt (const QPointF &pos, bool onlySelectable=false) const
 
bool hasPlottable (QCPAbstractPlottable *plottable) const
 
QCPGraphgraph (int index) const
 
QCPGraphgraph () const
 
QCPGraphaddGraph (QCPAxis *keyAxis=0, QCPAxis *valueAxis=0)
 
bool removeGraph (QCPGraph *graph)
 
bool removeGraph (int index)
 
int clearGraphs ()
 
int graphCount () const
 
QList< QCPGraph * > selectedGraphs () const
 
QCPAbstractItemitem (int index) const
 
QCPAbstractItemitem () const
 
bool addItem (QCPAbstractItem *item)
 
bool removeItem (QCPAbstractItem *item)
 
bool removeItem (int index)
 
int clearItems ()
 
int itemCount () const
 
QList< QCPAbstractItem * > selectedItems () const
 
QCPAbstractItemitemAt (const QPointF &pos, bool onlySelectable=false) const
 
bool hasItem (QCPAbstractItem *item) const
 
QCPLayerlayer (const QString &name) const
 
QCPLayerlayer (int index) const
 
QCPLayercurrentLayer () 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
 
QCPAxisRectaxisRect (int index=0) const
 
QList< QCPAxisRect * > axisRects () const
 
QCPLayoutElementlayoutElementAt (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
 
QCPLayerablelayerableAt (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 ()
 
QCPAbstractPaintBuffercreatePaintBuffer ()
 
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
 
QCPLayerablelayerableAt (const QPointF &pos, bool onlySelectable, QVariant *selectionDetails=0) const
 
void drawBackground (QCPPainter *painter)
 

Protected Attributes

QString m_titleStr
 
QCPTextElementm_titlePlot
 
HISTOGRAM_COLOR_SCHEME m_colorScheme
 Color scheme. More...
 
QColor m_solidColor
 Solid color. More...
 
ccColorScale::Shared m_colorScale
 Gradient color scale. More...
 
ccScalarFieldm_associatedSF
 Associated scalar field. More...
 
bool m_numberOfClassesCanBeChanged
 
bool m_refreshAfterResize
 
QCPColoredBarsm_histogram
 
std::vector< unsigned > m_histoValues
 
double m_minVal
 
double m_maxVal
 
unsigned m_maxHistoVal
 
QCPGraphm_overlayCurve
 Overlay curve. More...
 
std::vector< double > m_curveValues
 
QCPBarsWithTextm_vertBar
 
bool m_drawVerticalIndicator
 
double m_verticalIndicatorPositionPercent
 
QFont m_renderingFont
 Rendering font. More...
 
AxisDisplayOptions m_axisDisplayOptions
 
SFInteractionModes m_sfInteractionModes
 Which SF interaction modes are enabled. More...
 
SELECTABLE_ITEMS m_selectedItem
 Currently selected item. More...
 
QCPHiddenAream_areaLeft
 Left greyed area. More...
 
double m_areaLeftlastValue
 
QCPHiddenAream_areaRight
 Right greyed area. More...
 
double m_areaRightlastValue
 
QCPArrowm_arrowLeft
 Left arrow. More...
 
double m_arrowLeftlastValue
 
QCPArrowm_arrowRight
 Right arrow. More...
 
double m_arrowRightlastValue
 
QPoint m_lastMouseClick
 Last mouse click. More...
 
- Protected Attributes inherited from QCustomPlot
QRect mViewport
 
double mBufferDevicePixelRatio
 
QCPLayoutGridmPlotLayout
 
bool mAutoAddPlottableToLegend
 
QList< QCPAbstractPlottable * > mPlottables
 
QList< QCPGraph * > mGraphs
 
QList< QCPAbstractItem * > mItems
 
QList< QCPLayer * > mLayers
 
QCP::AntialiasedElements mAntialiasedElements
 
QCP::AntialiasedElements mNotAntialiasedElements
 
QCP::Interactions mInteractions
 
int mSelectionTolerance
 
bool mNoAntialiasingOnDrag
 
QBrush mBackgroundBrush
 
QPixmap mBackgroundPixmap
 
QPixmap mScaledBackgroundPixmap
 
bool mBackgroundScaled
 
Qt::AspectRatioMode mBackgroundScaledMode
 
QCPLayermCurrentLayer
 
QCP::PlottingHints mPlottingHints
 
Qt::KeyboardModifier mMultiSelectModifier
 
QCP::SelectionRectMode mSelectionRectMode
 
QCPSelectionRectmSelectionRect
 
bool mOpenGl
 
QList< QSharedPointer< QCPAbstractPaintBuffer > > mPaintBuffers
 
QPoint mMousePressPos
 
bool mMouseHasMoved
 
QPointer< QCPLayerablemMouseEventLayerable
 
QPointer< QCPLayerablemMouseSignalLayerable
 
QVariant mMouseEventLayerableDetails
 
QVariant mMouseSignalLayerableDetails
 
bool mReplotting
 
bool mReplotQueued
 
int mOpenGlMultisamples
 
QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup
 
bool mOpenGlCacheLabelsBackup
 
QPixmap mPaintBuffer
 
QPointer< QCPLayoutElementmMouseEventElement
 

Additional Inherited Members

- Public Attributes inherited from QCustomPlot
QCPAxisxAxis
 
QCPAxisyAxis
 
QCPAxisxAxis2
 
QCPAxisyAxis2
 
QCPLegendlegend
 

Detailed Description

Histogram widget.

Definition at line 28 of file ecvHistogramWindow.h.

Member Enumeration Documentation

◆ AxisDisplayOption

Enumerator
None 
XAxis 
YAxis 
All 

Definition at line 111 of file ecvHistogramWindow.h.

◆ HISTOGRAM_COLOR_SCHEME

Enumerator
USE_SOLID_COLOR 
USE_CUSTOM_COLOR_SCALE 
USE_SF_SCALE 

Definition at line 75 of file ecvHistogramWindow.h.

◆ SELECTABLE_ITEMS

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.

◆ SFInteractionMode

Enumerator
None 
DisplayRange 
SaturationRange 
All 

Definition at line 120 of file ecvHistogramWindow.h.

Constructor & Destructor Documentation

◆ ccHistogramWindow()

ccHistogramWindow::ccHistogramWindow ( QWidget *  parent = 0)
explicit

◆ ~ccHistogramWindow()

ccHistogramWindow::~ccHistogramWindow ( )
virtual

Destructor.

Definition at line 85 of file ecvHistogramWindow.cpp.

Member Function Documentation

◆ clear()

void ccHistogramWindow::clear ( )

◆ computeBinArrayFromSF()

bool ccHistogramWindow::computeBinArrayFromSF ( size_t  binCount)
protected

◆ fromBinArray()

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.

Parameters
histoValuesarray of bins
minValminimum value
maxValmaximum value
Returns
success

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().

◆ fromSF()

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).

Parameters
sfassociated scalar field
initialNumberOfClassesinitial number of classes
numberOfClassesCanBeChangedwhether to allow the user to modify the number of classes
showNaNValuesInGreyshow NaN values (in gray)
Returns
success

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().

◆ getMaxHistoVal()

unsigned ccHistogramWindow::getMaxHistoVal ( )
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().

◆ histoValues()

const std::vector<unsigned>& ccHistogramWindow::histoValues ( ) const
inline

Returns the current histogram bins.

Definition at line 102 of file ecvHistogramWindow.h.

References m_histoValues.

Referenced by ccHistogramWindowDlg::exportToCSV(), and fromBinArray().

◆ maxVal()

double ccHistogramWindow::maxVal ( ) const
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().

◆ minVal()

double ccHistogramWindow::minVal ( ) const
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().

◆ mouseMoveEvent()

◆ mousePressEvent()

void ccHistogramWindow::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

◆ refresh()

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().

◆ refreshBars()

◆ resizeEvent()

void ccHistogramWindow::resizeEvent ( QResizeEvent *  event)
protectedvirtual

◆ setAxisDisplayOption()

void ccHistogramWindow::setAxisDisplayOption ( AxisDisplayOptions  axisOptions)

Definition at line 315 of file ecvHistogramWindow.cpp.

References m_axisDisplayOptions.

Referenced by ccColorFromScalarDlg::updateHistogram().

◆ setAxisLabels()

void ccHistogramWindow::setAxisLabels ( const QString &  xLabel,
const QString &  yLabel 
)

◆ setColorScale()

void ccHistogramWindow::setColorScale ( ccColorScale::Shared  scale)
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().

◆ setColorScheme()

void ccHistogramWindow::setColorScheme ( HISTOGRAM_COLOR_SCHEME  scheme)
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().

◆ setCurveValues()

void ccHistogramWindow::setCurveValues ( const std::vector< double > &  curveValues)

Sets overlay curve values.

The curve will only appear over an histogram

Parameters
curveValuescurve 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().

◆ setMaxDispValue()

◆ setMaxSatValue()

◆ setMinDispValue()

◆ setMinSatValue()

◆ setNumberOfClasses()

void ccHistogramWindow::setNumberOfClasses ( size_t  n)
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().

◆ setRefreshAfterResize()

void ccHistogramWindow::setRefreshAfterResize ( bool  refreshAfterResize)

Definition at line 319 of file ecvHistogramWindow.cpp.

References m_refreshAfterResize.

Referenced by ccColorFromScalarDlg::ccColorFromScalarDlg().

◆ setSFInteractionMode()

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().

◆ setSolidColor()

void ccHistogramWindow::setSolidColor ( QColor  color)
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().

◆ setTitle()

void ccHistogramWindow::setTitle ( const QString &  str)

◆ sfMaxDispValChanged

void ccHistogramWindow::sfMaxDispValChanged ( double  )
signal

◆ sfMaxSatValChanged

void ccHistogramWindow::sfMaxSatValChanged ( double  )
signal

◆ sfMinDispValChanged

void ccHistogramWindow::sfMinDispValChanged ( double  )
signal

◆ sfMinSatValChanged

void ccHistogramWindow::sfMinSatValChanged ( double  )
signal

◆ updateOverlayCurveWidth()

void ccHistogramWindow::updateOverlayCurveWidth ( int  w,
int  h 
)
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().

◆ wheelEvent()

void ccHistogramWindow::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Member Data Documentation

◆ m_areaLeft

QCPHiddenArea* ccHistogramWindow::m_areaLeft
protected

Left greyed area.

Definition at line 231 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setMinDispValue().

◆ m_areaLeftlastValue

double ccHistogramWindow::m_areaLeftlastValue
protected

Definition at line 232 of file ecvHistogramWindow.h.

Referenced by refresh(), and setMinDispValue().

◆ m_areaRight

QCPHiddenArea* ccHistogramWindow::m_areaRight
protected

Right greyed area.

Definition at line 234 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setMaxDispValue().

◆ m_areaRightlastValue

double ccHistogramWindow::m_areaRightlastValue
protected

Definition at line 235 of file ecvHistogramWindow.h.

Referenced by refresh(), and setMaxDispValue().

◆ m_arrowLeft

QCPArrow* ccHistogramWindow::m_arrowLeft
protected

Left arrow.

Definition at line 238 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setMinSatValue().

◆ m_arrowLeftlastValue

double ccHistogramWindow::m_arrowLeftlastValue
protected

Definition at line 239 of file ecvHistogramWindow.h.

Referenced by refresh(), and setMinSatValue().

◆ m_arrowRight

QCPArrow* ccHistogramWindow::m_arrowRight
protected

Right arrow.

Definition at line 241 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setMaxSatValue().

◆ m_arrowRightlastValue

double ccHistogramWindow::m_arrowRightlastValue
protected

Definition at line 242 of file ecvHistogramWindow.h.

Referenced by refresh(), and setMaxSatValue().

◆ m_associatedSF

ccScalarField* ccHistogramWindow::m_associatedSF
protected

◆ m_axisDisplayOptions

AxisDisplayOptions ccHistogramWindow::m_axisDisplayOptions
protected

Definition at line 211 of file ecvHistogramWindow.h.

Referenced by refresh(), and setAxisDisplayOption().

◆ m_colorScale

ccColorScale::Shared ccHistogramWindow::m_colorScale
protected

Gradient color scale.

Definition at line 181 of file ecvHistogramWindow.h.

Referenced by refresh(), and setColorScale().

◆ m_colorScheme

HISTOGRAM_COLOR_SCHEME ccHistogramWindow::m_colorScheme
protected

Color scheme.

Definition at line 177 of file ecvHistogramWindow.h.

Referenced by refresh(), refreshBars(), and setColorScheme().

◆ m_curveValues

std::vector<double> ccHistogramWindow::m_curveValues
protected

Definition at line 201 of file ecvHistogramWindow.h.

Referenced by refresh(), and setCurveValues().

◆ m_drawVerticalIndicator

bool ccHistogramWindow::m_drawVerticalIndicator
protected

Definition at line 205 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), and refresh().

◆ m_histogram

QCPColoredBars* ccHistogramWindow::m_histogram
protected

Definition at line 193 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), refresh(), and refreshBars().

◆ m_histoValues

std::vector<unsigned> ccHistogramWindow::m_histoValues
protected

◆ m_lastMouseClick

QPoint ccHistogramWindow::m_lastMouseClick
protected

Last mouse click.

Definition at line 245 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ m_maxHistoVal

unsigned ccHistogramWindow::m_maxHistoVal
protected

Definition at line 197 of file ecvHistogramWindow.h.

Referenced by fromBinArray(), getMaxHistoVal(), refresh(), and setNumberOfClasses().

◆ m_maxVal

double ccHistogramWindow::m_maxVal
protected

◆ m_minVal

double ccHistogramWindow::m_minVal
protected

◆ m_numberOfClassesCanBeChanged

bool ccHistogramWindow::m_numberOfClassesCanBeChanged
protected

Only possible with an associated scalar field.

Definition at line 188 of file ecvHistogramWindow.h.

Referenced by fromBinArray(), fromSF(), and wheelEvent().

◆ m_overlayCurve

QCPGraph* ccHistogramWindow::m_overlayCurve
protected

Overlay curve.

Definition at line 200 of file ecvHistogramWindow.h.

Referenced by refresh(), and updateOverlayCurveWidth().

◆ m_refreshAfterResize

bool ccHistogramWindow::m_refreshAfterResize
protected

Definition at line 190 of file ecvHistogramWindow.h.

Referenced by resizeEvent(), and setRefreshAfterResize().

◆ m_renderingFont

QFont ccHistogramWindow::m_renderingFont
protected

Rendering font.

Definition at line 209 of file ecvHistogramWindow.h.

Referenced by ccHistogramWindow(), and refresh().

◆ m_selectedItem

SELECTABLE_ITEMS ccHistogramWindow::m_selectedItem
protected

Currently selected item.

Definition at line 228 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ m_sfInteractionModes

SFInteractionModes ccHistogramWindow::m_sfInteractionModes
protected

Which SF interaction modes are enabled.

Definition at line 215 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), mousePressEvent(), refresh(), and setSFInteractionMode().

◆ m_solidColor

QColor ccHistogramWindow::m_solidColor
protected

Solid color.

Definition at line 179 of file ecvHistogramWindow.h.

Referenced by refresh(), and setSolidColor().

◆ m_titlePlot

QCPTextElement* ccHistogramWindow::m_titlePlot
protected

Definition at line 174 of file ecvHistogramWindow.h.

Referenced by refresh().

◆ m_titleStr

QString ccHistogramWindow::m_titleStr
protected

Definition at line 173 of file ecvHistogramWindow.h.

Referenced by refresh(), and setTitle().

◆ m_vertBar

QCPBarsWithText* ccHistogramWindow::m_vertBar
protected

Definition at line 204 of file ecvHistogramWindow.h.

Referenced by refresh().

◆ m_verticalIndicatorPositionPercent

double ccHistogramWindow::m_verticalIndicatorPositionPercent
protected

Definition at line 206 of file ecvHistogramWindow.h.

Referenced by mouseMoveEvent(), and refresh().


The documentation for this class was generated from the following files: