labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

HistogramPrivate Class Reference

#include <HistogramPrivate.h>

Inheritance diagram for HistogramPrivate:
[legend]
Collaboration diagram for HistogramPrivate:
[legend]

Public Member Functions

 HistogramPrivate (Histogram *owner)
 
 ~HistogramPrivate () override
 
QString name () const
 
QRectF boundingRect () const override
 
QPainterPath shape () const override
 
void retransform ()
 
void recalcHistogram ()
 
void updateType ()
 
void updateOrientation ()
 
void updateLines ()
 
void verticalHistogram ()
 
void horizontalHistogram ()
 
void updateSymbols ()
 
void updateValues ()
 
void updateFilling ()
 
void updateErrorBars ()
 
bool swapVisible (bool on)
 
void recalcShapeAndBoundingRect ()
 
void setHover (bool on)
 
bool activateCurve (QPointF mouseScenePos, double maxDist)
 
void drawSymbols (QPainter *)
 
void drawValues (QPainter *)
 
void drawFilling (QPainter *)
 
void draw (QPainter *)
 
void updatePixmap ()
 
double getYMaximum ()
 
double getYMinimum ()
 
double getXMinimum ()
 
double getXMaximum ()
 
double getMaximumOccuranceofHistogram ()
 

Public Attributes

bool m_printing {false}
 
bool m_hovered {false}
 
bool m_suppressRetransform {false}
 
bool m_suppressRecalc {false}
 
QPixmap m_pixmap
 
QImage m_hoverEffectImage
 
QImage m_selectionEffectImage
 
bool m_hoverEffectImageIsDirty {false}
 
bool m_selectionEffectImageIsDirty {false}
 
const AbstractColumndataColumn {nullptr}
 
QString dataColumnPath
 
Histogram::HistogramType type {Histogram::Ordinary}
 
Histogram::HistogramOrientation orientation {Histogram::Vertical}
 
Histogram::BinningMethod binningMethod {Histogram::SquareRoot}
 
int binCount {10}
 
float binWidth {1.0f}
 
bool autoBinRanges {true}
 
double binRangesMin {0.0}
 
double binRangesMax {1.0}
 
Histogram::LineType lineType {Histogram::Bars}
 
QPen linePen
 
qreal lineOpacity
 
Symbol::Style symbolsStyle
 
QBrush symbolsBrush
 
QPen symbolsPen
 
qreal symbolsOpacity
 
qreal symbolsRotationAngle
 
qreal symbolsSize
 
int value {0}
 
Histogram::ValuesType valuesType {Histogram::NoValues}
 
const AbstractColumnvaluesColumn {nullptr}
 
QString valuesColumnPath
 
Histogram::ValuesPosition valuesPosition {Histogram::ValuesAbove}
 
qreal valuesDistance
 
qreal valuesRotationAngle
 
qreal valuesOpacity
 
char valuesNumericFormat
 
int valuesPrecision
 
QString valuesDateTimeFormat
 
QString valuesPrefix
 
QString valuesSuffix
 
QFont valuesFont
 
QColor valuesColor
 
bool fillingEnabled {true}
 
PlotArea::BackgroundType fillingType
 
PlotArea::BackgroundColorStyle fillingColorStyle
 
PlotArea::BackgroundImageStyle fillingImageStyle
 
Qt::BrushStyle fillingBrushStyle
 
QColor fillingFirstColor
 
QColor fillingSecondColor
 
QString fillingFileName
 
qreal fillingOpacity
 
Histogram::ErrorType errorType {Histogram::NoError}
 
XYCurve::ErrorBarsType errorBarsType
 
double errorBarsCapSize {1}
 
QPen errorBarsPen
 
qreal errorBarsOpacity
 
QPainterPath linePath
 
QPainterPath symbolsPath
 
QPainterPath valuesPath
 
QRectF boundingRectangle
 
QPainterPath curveShape
 
QVector< QLineF > lines
 
QVector< QPointF > pointsLogical
 
QVector< QPointF > pointsScene
 
std::vector< bool > visiblePoints
 
QVector< QPointF > valuesPoints
 
QVector< QString > valuesStrings
 
QPolygonF fillPolygon
 
Histogram *const q
 

Private Member Functions

void contextMenuEvent (QGraphicsSceneContextMenuEvent *) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *) override
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *) override
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *widget=nullptr) override
 

Private Attributes

gsl_histogram * m_histogram {nullptr}
 
size_t m_bins {0}
 

Detailed Description

Definition at line 45 of file HistogramPrivate.h.

Constructor & Destructor Documentation

◆ HistogramPrivate()

HistogramPrivate::HistogramPrivate ( Histogram owner)
explicit

Definition at line 717 of file Histogram.cpp.

◆ ~HistogramPrivate()

HistogramPrivate::~HistogramPrivate ( )
override

Definition at line 722 of file Histogram.cpp.

References m_histogram.

Member Function Documentation

◆ activateCurve()

bool HistogramPrivate::activateCurve ( QPointF  mouseScenePos,
double  maxDist 
)

Definition at line 1638 of file Histogram.cpp.

References curveShape.

◆ boundingRect()

QRectF HistogramPrivate::boundingRect ( ) const
override

Definition at line 731 of file Histogram.cpp.

References boundingRectangle.

◆ contextMenuEvent()

void HistogramPrivate::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
overrideprivate

Definition at line 814 of file Histogram.cpp.

References Histogram::createContextMenu(), and q.

◆ draw()

◆ drawFilling()

◆ drawSymbols()

void HistogramPrivate::drawSymbols ( QPainter *  painter)

Definition at line 1500 of file Histogram.cpp.

References Symbol::pathFromStyle(), pointsScene, symbolsRotationAngle, symbolsSize, and symbolsStyle.

Referenced by draw().

◆ drawValues()

void HistogramPrivate::drawValues ( QPainter *  painter)

Definition at line 1517 of file Histogram.cpp.

References valuesFont, valuesPoints, valuesRotationAngle, and valuesStrings.

Referenced by draw().

◆ getMaximumOccuranceofHistogram()

double HistogramPrivate::getMaximumOccuranceofHistogram ( )

◆ getXMaximum()

◆ getXMinimum()

double HistogramPrivate::getXMinimum ( )

◆ getYMaximum()

◆ getYMinimum()

double HistogramPrivate::getYMinimum ( )

◆ horizontalHistogram()

void HistogramPrivate::horizontalHistogram ( )

◆ hoverEnterEvent()

void HistogramPrivate::hoverEnterEvent ( QGraphicsSceneHoverEvent *  )
overrideprivate

◆ hoverLeaveEvent()

void HistogramPrivate::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  )
overrideprivate

◆ mousePressEvent()

void HistogramPrivate::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprivate

checks if the mousePress event was done near the histogram shape and selects the graphics item if it is the case. event

Definition at line 1651 of file Histogram.cpp.

References Histogram::activateCurve(), CartesianPlot::mouseMode(), AbstractAspect::parentAspect(), q, and CartesianPlot::Selection.

◆ name()

QString HistogramPrivate::name ( ) const

◆ paint()

void HistogramPrivate::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = nullptr 
)
overrideprivate

Reimplementation of QGraphicsItem::paint(). This function does the actual painting of the curve.

See also
QGraphicsItem::paint().

Definition at line 1452 of file Histogram.cpp.

References ImageTools::blurred(), boundingRectangle, draw(), m_hovered, m_hoverEffectImage, m_hoverEffectImageIsDirty, m_pixmap, m_printing, m_selectionEffectImage, m_selectionEffectImageIsDirty, and Origin::Shadow.

◆ recalcHistogram()

◆ recalcShapeAndBoundingRect()

void HistogramPrivate::recalcShapeAndBoundingRect ( )

◆ retransform()

void HistogramPrivate::retransform ( )

called when the size of the plot or its data ranges (manual changes, zooming, etc.) were changed. recalculates the position of the scene points to be drawn. triggers the update of lines, drop lines, symbols etc.

Definition at line 838 of file Histogram.cpp.

References curveShape, dataColumn, fillPolygon, linePath, lines, m_suppressRecalc, m_suppressRetransform, name(), PERFTRACE, pointsLogical, pointsScene, recalcShapeAndBoundingRect(), symbolsPath, updateLines(), updateSymbols(), updateValues(), valuesPath, valuesPoints, valuesStrings, and visiblePoints.

Referenced by Histogram::retransform().

◆ setHover()

void HistogramPrivate::setHover ( bool  on)

Is called in CartesianPlot::hoverMoveEvent where it is determined which curve to hover. on

Definition at line 1672 of file Histogram.cpp.

References WorksheetElement::hovered(), m_hovered, q, and WorksheetElement::unhovered().

◆ shape()

QPainterPath HistogramPrivate::shape ( ) const
override

Returns the shape of the Histogram as a QPainterPath in local coordinates

Definition at line 810 of file Histogram.cpp.

References curveShape.

◆ swapVisible()

bool HistogramPrivate::swapVisible ( bool  on)

◆ updateErrorBars()

void HistogramPrivate::updateErrorBars ( )

Definition at line 1357 of file Histogram.cpp.

◆ updateFilling()

◆ updateLines()

void HistogramPrivate::updateLines ( )

recalculates the painter path for the lines connecting the data points. Called each time when the type of this connection is changed.

Definition at line 995 of file Histogram.cpp.

References horizontalHistogram(), linePath, lines, name(), orientation, AbstractAspect::parentAspect(), PERFTRACE, pointsLogical, pointsScene, q, recalcShapeAndBoundingRect(), updateFilling(), Histogram::Vertical, verticalHistogram(), and visiblePoints.

Referenced by retransform().

◆ updateOrientation()

void HistogramPrivate::updateOrientation ( )

Definition at line 985 of file Histogram.cpp.

References Histogram::dataChanged(), and q.

◆ updatePixmap()

void HistogramPrivate::updatePixmap ( )

◆ updateSymbols()

void HistogramPrivate::updateSymbols ( )

◆ updateType()

void HistogramPrivate::updateType ( )

Definition at line 979 of file Histogram.cpp.

References Histogram::dataChanged(), and q.

◆ updateValues()

◆ verticalHistogram()

Member Data Documentation

◆ autoBinRanges

◆ binCount

int HistogramPrivate::binCount {10}

Definition at line 99 of file HistogramPrivate.h.

Referenced by recalcHistogram().

◆ binningMethod

Histogram::BinningMethod HistogramPrivate::binningMethod {Histogram::SquareRoot}

Definition at line 98 of file HistogramPrivate.h.

Referenced by recalcHistogram().

◆ binRangesMax

◆ binRangesMin

◆ binWidth

float HistogramPrivate::binWidth {1.0f}

Definition at line 100 of file HistogramPrivate.h.

Referenced by recalcHistogram().

◆ boundingRectangle

QRectF HistogramPrivate::boundingRectangle

Definition at line 156 of file HistogramPrivate.h.

Referenced by boundingRect(), paint(), recalcShapeAndBoundingRect(), and updatePixmap().

◆ curveShape

QPainterPath HistogramPrivate::curveShape

Definition at line 157 of file HistogramPrivate.h.

Referenced by activateCurve(), recalcShapeAndBoundingRect(), retransform(), and shape().

◆ dataColumn

const AbstractColumn* HistogramPrivate::dataColumn {nullptr}

◆ dataColumnPath

QString HistogramPrivate::dataColumnPath

Definition at line 95 of file HistogramPrivate.h.

◆ errorBarsCapSize

double HistogramPrivate::errorBarsCapSize {1}

Definition at line 149 of file HistogramPrivate.h.

◆ errorBarsOpacity

qreal HistogramPrivate::errorBarsOpacity

Definition at line 151 of file HistogramPrivate.h.

◆ errorBarsPen

QPen HistogramPrivate::errorBarsPen

Definition at line 150 of file HistogramPrivate.h.

◆ errorBarsType

XYCurve::ErrorBarsType HistogramPrivate::errorBarsType

Definition at line 148 of file HistogramPrivate.h.

◆ errorType

Histogram::ErrorType HistogramPrivate::errorType {Histogram::NoError}

Definition at line 147 of file HistogramPrivate.h.

◆ fillingBrushStyle

Qt::BrushStyle HistogramPrivate::fillingBrushStyle

Definition at line 140 of file HistogramPrivate.h.

Referenced by drawFilling().

◆ fillingColorStyle

PlotArea::BackgroundColorStyle HistogramPrivate::fillingColorStyle

Definition at line 138 of file HistogramPrivate.h.

Referenced by drawFilling().

◆ fillingEnabled

bool HistogramPrivate::fillingEnabled {true}

Definition at line 136 of file HistogramPrivate.h.

Referenced by draw(), and updateFilling().

◆ fillingFileName

QString HistogramPrivate::fillingFileName

Definition at line 143 of file HistogramPrivate.h.

Referenced by drawFilling().

◆ fillingFirstColor

QColor HistogramPrivate::fillingFirstColor

Definition at line 141 of file HistogramPrivate.h.

Referenced by drawFilling().

◆ fillingImageStyle

PlotArea::BackgroundImageStyle HistogramPrivate::fillingImageStyle

Definition at line 139 of file HistogramPrivate.h.

Referenced by drawFilling().

◆ fillingOpacity

qreal HistogramPrivate::fillingOpacity

Definition at line 144 of file HistogramPrivate.h.

Referenced by draw().

◆ fillingSecondColor

QColor HistogramPrivate::fillingSecondColor

Definition at line 142 of file HistogramPrivate.h.

Referenced by drawFilling().

◆ fillingType

PlotArea::BackgroundType HistogramPrivate::fillingType

Definition at line 137 of file HistogramPrivate.h.

Referenced by drawFilling().

◆ fillPolygon

QPolygonF HistogramPrivate::fillPolygon

◆ lineOpacity

qreal HistogramPrivate::lineOpacity

Definition at line 108 of file HistogramPrivate.h.

Referenced by draw().

◆ linePath

QPainterPath HistogramPrivate::linePath

Definition at line 153 of file HistogramPrivate.h.

Referenced by draw(), recalcShapeAndBoundingRect(), retransform(), and updateLines().

◆ linePen

QPen HistogramPrivate::linePen

Definition at line 107 of file HistogramPrivate.h.

Referenced by draw(), and recalcShapeAndBoundingRect().

◆ lines

QVector<QLineF> HistogramPrivate::lines

◆ lineType

◆ m_bins

size_t HistogramPrivate::m_bins {0}
private

◆ m_histogram

gsl_histogram* HistogramPrivate::m_histogram {nullptr}
private

◆ m_hovered

bool HistogramPrivate::m_hovered {false}

Definition at line 55 of file HistogramPrivate.h.

Referenced by hoverEnterEvent(), hoverLeaveEvent(), paint(), and setHover().

◆ m_hoverEffectImage

QImage HistogramPrivate::m_hoverEffectImage

Definition at line 59 of file HistogramPrivate.h.

Referenced by paint().

◆ m_hoverEffectImageIsDirty

bool HistogramPrivate::m_hoverEffectImageIsDirty {false}

Definition at line 61 of file HistogramPrivate.h.

Referenced by paint(), and updatePixmap().

◆ m_pixmap

QPixmap HistogramPrivate::m_pixmap

Definition at line 58 of file HistogramPrivate.h.

Referenced by paint(), and updatePixmap().

◆ m_printing

bool HistogramPrivate::m_printing {false}

Definition at line 54 of file HistogramPrivate.h.

Referenced by paint().

◆ m_selectionEffectImage

QImage HistogramPrivate::m_selectionEffectImage

Definition at line 60 of file HistogramPrivate.h.

Referenced by paint().

◆ m_selectionEffectImageIsDirty

bool HistogramPrivate::m_selectionEffectImageIsDirty {false}

Definition at line 62 of file HistogramPrivate.h.

Referenced by paint(), and updatePixmap().

◆ m_suppressRecalc

bool HistogramPrivate::m_suppressRecalc {false}

Definition at line 57 of file HistogramPrivate.h.

Referenced by retransform().

◆ m_suppressRetransform

bool HistogramPrivate::m_suppressRetransform {false}

Definition at line 56 of file HistogramPrivate.h.

Referenced by retransform().

◆ orientation

Histogram::HistogramOrientation HistogramPrivate::orientation {Histogram::Vertical}

Definition at line 97 of file HistogramPrivate.h.

Referenced by getXMaximum(), getXMinimum(), getYMaximum(), getYMinimum(), and updateLines().

◆ pointsLogical

QVector<QPointF> HistogramPrivate::pointsLogical

◆ pointsScene

QVector<QPointF> HistogramPrivate::pointsScene

◆ q

◆ symbolsBrush

QBrush HistogramPrivate::symbolsBrush

Definition at line 112 of file HistogramPrivate.h.

Referenced by draw().

◆ symbolsOpacity

qreal HistogramPrivate::symbolsOpacity

Definition at line 114 of file HistogramPrivate.h.

Referenced by draw().

◆ symbolsPath

QPainterPath HistogramPrivate::symbolsPath

Definition at line 154 of file HistogramPrivate.h.

Referenced by recalcShapeAndBoundingRect(), retransform(), and updateSymbols().

◆ symbolsPen

QPen HistogramPrivate::symbolsPen

Definition at line 113 of file HistogramPrivate.h.

Referenced by draw().

◆ symbolsRotationAngle

qreal HistogramPrivate::symbolsRotationAngle

Definition at line 115 of file HistogramPrivate.h.

Referenced by drawSymbols(), and updateSymbols().

◆ symbolsSize

qreal HistogramPrivate::symbolsSize

Definition at line 116 of file HistogramPrivate.h.

Referenced by drawSymbols(), and updateSymbols().

◆ symbolsStyle

Symbol::Style HistogramPrivate::symbolsStyle

Definition at line 111 of file HistogramPrivate.h.

Referenced by draw(), drawSymbols(), recalcShapeAndBoundingRect(), and updateSymbols().

◆ type

◆ value

int HistogramPrivate::value {0}

Definition at line 119 of file HistogramPrivate.h.

Referenced by horizontalHistogram(), updateValues(), and verticalHistogram().

◆ valuesColor

QColor HistogramPrivate::valuesColor

Definition at line 133 of file HistogramPrivate.h.

Referenced by draw().

◆ valuesColumn

const AbstractColumn* HistogramPrivate::valuesColumn {nullptr}

Definition at line 121 of file HistogramPrivate.h.

Referenced by updateValues().

◆ valuesColumnPath

QString HistogramPrivate::valuesColumnPath

Definition at line 122 of file HistogramPrivate.h.

◆ valuesDateTimeFormat

QString HistogramPrivate::valuesDateTimeFormat

Definition at line 129 of file HistogramPrivate.h.

Referenced by updateValues().

◆ valuesDistance

qreal HistogramPrivate::valuesDistance

Definition at line 124 of file HistogramPrivate.h.

Referenced by updateValues().

◆ valuesFont

QFont HistogramPrivate::valuesFont

Definition at line 132 of file HistogramPrivate.h.

Referenced by drawValues(), and updateValues().

◆ valuesNumericFormat

char HistogramPrivate::valuesNumericFormat

Definition at line 127 of file HistogramPrivate.h.

Referenced by updateValues().

◆ valuesOpacity

qreal HistogramPrivate::valuesOpacity

Definition at line 126 of file HistogramPrivate.h.

Referenced by draw().

◆ valuesPath

QPainterPath HistogramPrivate::valuesPath

Definition at line 155 of file HistogramPrivate.h.

Referenced by recalcShapeAndBoundingRect(), retransform(), and updateValues().

◆ valuesPoints

QVector<QPointF> HistogramPrivate::valuesPoints

Definition at line 164 of file HistogramPrivate.h.

Referenced by drawValues(), retransform(), and updateValues().

◆ valuesPosition

Histogram::ValuesPosition HistogramPrivate::valuesPosition {Histogram::ValuesAbove}

Definition at line 123 of file HistogramPrivate.h.

Referenced by updateValues().

◆ valuesPrecision

int HistogramPrivate::valuesPrecision

Definition at line 128 of file HistogramPrivate.h.

Referenced by updateValues().

◆ valuesPrefix

QString HistogramPrivate::valuesPrefix

Definition at line 130 of file HistogramPrivate.h.

Referenced by updateValues().

◆ valuesRotationAngle

qreal HistogramPrivate::valuesRotationAngle

Definition at line 125 of file HistogramPrivate.h.

Referenced by drawValues(), and updateValues().

◆ valuesStrings

QVector<QString> HistogramPrivate::valuesStrings

Definition at line 165 of file HistogramPrivate.h.

Referenced by drawValues(), retransform(), and updateValues().

◆ valuesSuffix

QString HistogramPrivate::valuesSuffix

Definition at line 131 of file HistogramPrivate.h.

Referenced by updateValues().

◆ valuesType

Histogram::ValuesType HistogramPrivate::valuesType {Histogram::NoValues}

Definition at line 120 of file HistogramPrivate.h.

Referenced by draw(), recalcShapeAndBoundingRect(), and updateValues().

◆ visiblePoints

std::vector<bool> HistogramPrivate::visiblePoints

Definition at line 163 of file HistogramPrivate.h.

Referenced by retransform(), updateLines(), and updateValues().


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