MCPcopy Create free account
hub / github.com/KDE/labplot / updateLines

Method updateLines

src/backend/worksheet/plots/cartesian/Histogram.cpp:970–998  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

968 Called each time when the type of this connection is changed.
969 */
970void HistogramPrivate::updateLines() {
971 PERFTRACE(name() + QLatin1String(Q_FUNC_INFO));
972
973 linePath = QPainterPath();
974 lines.clear();
975 linesUnclipped.clear();
976 pointsLogical.clear();
977 pointsScene.clear();
978
979 if (orientation == Histogram::Orientation::Vertical)
980 verticalHistogram();
981 else
982 horizontalHistogram();
983
984 // map the lines and the symbol positions to the scene coordinates
985 linesUnclipped = q->cSystem->mapLogicalToScene(lines, AbstractCoordinateSystem::MappingFlag::SuppressPageClipping);
986 lines = q->cSystem->mapLogicalToScene(lines);
987 visiblePoints = std::vector<bool>(pointsLogical.count(), false);
988 q->cSystem->mapLogicalToScene(pointsLogical, pointsScene, visiblePoints);
989
990 // new line path
991 for (const auto& line : lines) {
992 linePath.moveTo(line.p1());
993 linePath.lineTo(line.p2());
994 }
995
996 updateFilling();
997 recalcShapeAndBoundingRect();
998}
999
1000void HistogramPrivate::histogramValue(double& value, int bin) const {
1001 switch (normalization) {

Callers 1

initMethod · 0.45

Calls 3

mapLogicalToSceneMethod · 0.80
clearMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected