"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/backend/worksheet/plots/cartesian/Histogram.cpp" between
labplot-2.8.1.tar.gz and labplot-2.8.2.tar.gz

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.

Histogram.cpp  (labplot-2.8.1):Histogram.cpp  (labplot-2.8.2)
skipping to change at line 950 skipping to change at line 950
DEBUG("min " << binRangesMin) DEBUG("min " << binRangesMin)
DEBUG("max " << binRangesMax) DEBUG("max " << binRangesMax)
DEBUG("number of bins " << m_bins) DEBUG("number of bins " << m_bins)
//calculate the histogram //calculate the histogram
if (m_bins > 0) { if (m_bins > 0) {
m_histogram = gsl_histogram_alloc (m_bins); m_histogram = gsl_histogram_alloc (m_bins);
gsl_histogram_set_ranges_uniform (m_histogram, binRangesM in, binRangesMax); gsl_histogram_set_ranges_uniform (m_histogram, binRangesM in, binRangesMax);
for (int row = 0; row < dataColumn->rowCount(); ++row) { switch (dataColumn->columnMode()) {
if ( dataColumn->isValid(row) && !dataColumn->isM case AbstractColumn::ColumnMode::Numeric:
asked(row) ) case AbstractColumn::ColumnMode::Integer:
gsl_histogram_increment(m_histogram, data case AbstractColumn::ColumnMode::BigInt:
Column->valueAt(row)); for (int row = 0; row < dataColumn->rowCount(); +
+row) {
if ( dataColumn->isValid(row) && !dataCol
umn->isMasked(row) )
gsl_histogram_increment(m_histogr
am, dataColumn->valueAt(row));
}
break;
case AbstractColumn::ColumnMode::DateTime:
for (int row = 0; row < dataColumn->rowCount(); +
+row) {
if ( dataColumn->isValid(row) && !dataCol
umn->isMasked(row) )
gsl_histogram_increment(m_histogr
am, dataColumn->dateTimeAt(row).toMSecsSinceEpoch());
}
break;
case AbstractColumn::ColumnMode::Text:
case AbstractColumn::ColumnMode::Month:
case AbstractColumn::ColumnMode::Day:
break;
} }
} else } else
DEBUG("Number of bins must be positiv integer") DEBUG("Number of bins must be positiv integer")
} }
//histogram changed because of the actual data changes or because of new bin settings, //histogram changed because of the actual data changes or because of new bin settings,
//emit dataChanged() in order to recalculate everything with the new size /shape of the histogram //emit dataChanged() in order to recalculate everything with the new size /shape of the histogram
emit q->dataChanged(); emit q->dataChanged();
} }
skipping to change at line 1429 skipping to change at line 1445
QPainter painter(&pixmap); QPainter painter(&pixmap);
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
painter.translate(-boundingRectangle.topLeft()); painter.translate(-boundingRectangle.topLeft());
draw(&painter); draw(&painter);
painter.end(); painter.end();
m_pixmap = pixmap; m_pixmap = pixmap;
m_hoverEffectImageIsDirty = true; m_hoverEffectImageIsDirty = true;
m_selectionEffectImageIsDirty = true; m_selectionEffectImageIsDirty = true;
update();
} }
/*! /*!
Reimplementation of QGraphicsItem::paint(). This function does the actual pain ting of the curve. Reimplementation of QGraphicsItem::paint(). This function does the actual pain ting of the curve.
\sa QGraphicsItem::paint(). \sa QGraphicsItem::paint().
*/ */
void HistogramPrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { void HistogramPrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) {
Q_UNUSED(option); Q_UNUSED(option);
Q_UNUSED(widget); Q_UNUSED(widget);
if (!isVisible()) if (!isVisible())
skipping to change at line 1488 skipping to change at line 1505
painter->drawImage(boundingRectangle.topLeft(), m_selectionEffect Image, m_pixmap.rect()); painter->drawImage(boundingRectangle.topLeft(), m_selectionEffect Image, m_pixmap.rect());
return; return;
} }
} }
void HistogramPrivate::drawSymbols(QPainter* painter) { void HistogramPrivate::drawSymbols(QPainter* painter) {
QPainterPath path = Symbol::pathFromStyle(symbolsStyle); QPainterPath path = Symbol::pathFromStyle(symbolsStyle);
QTransform trafo; QTransform trafo;
trafo.scale(symbolsSize, symbolsSize); trafo.scale(symbolsSize, symbolsSize);
path = trafo.map(path); if (symbolsRotationAngle != 0)
trafo.reset();
if (symbolsRotationAngle != 0) {
trafo.rotate(-symbolsRotationAngle); trafo.rotate(-symbolsRotationAngle);
path = trafo.map(path);
} path = trafo.map(path);
for (const auto& point : pointsScene) { for (const auto& point : pointsScene) {
trafo.reset(); trafo.reset();
trafo.translate(point.x(), point.y()); trafo.translate(point.x(), point.y());
painter->drawPath(trafo.map(path)); painter->drawPath(trafo.map(path));
} }
} }
void HistogramPrivate::drawValues(QPainter* painter) { void HistogramPrivate::drawValues(QPainter* painter) {
QTransform trafo; QTransform trafo;
QPainterPath path; QPainterPath path;
skipping to change at line 1715 skipping to change at line 1731
writer->writeEndElement(); writer->writeEndElement();
//Values //Values
writer->writeStartElement("values"); writer->writeStartElement("values");
writer->writeAttribute( "type", QString::number(d->valuesType) ); writer->writeAttribute( "type", QString::number(d->valuesType) );
WRITE_COLUMN(d->valuesColumn, valuesColumn); WRITE_COLUMN(d->valuesColumn, valuesColumn);
writer->writeAttribute( "position", QString::number(d->valuesPosition) ); writer->writeAttribute( "position", QString::number(d->valuesPosition) );
writer->writeAttribute( "distance", QString::number(d->valuesDistance) ); writer->writeAttribute( "distance", QString::number(d->valuesDistance) );
writer->writeAttribute( "rotation", QString::number(d->valuesRotationAngl e) ); writer->writeAttribute( "rotation", QString::number(d->valuesRotationAngl e) );
writer->writeAttribute( "opacity", QString::number(d->valuesOpacity) ); writer->writeAttribute( "opacity", QString::number(d->valuesOpacity) );
//TODO values format and precision writer->writeAttribute("numericFormat", QString(d->valuesNumericFormat));
writer->writeAttribute("dateTimeFormat", d->valuesDateTimeFormat);
writer->writeAttribute("precision", QString::number(d->valuesPrecision));
writer->writeAttribute( "prefix", d->valuesPrefix ); writer->writeAttribute( "prefix", d->valuesPrefix );
writer->writeAttribute( "suffix", d->valuesSuffix ); writer->writeAttribute( "suffix", d->valuesSuffix );
WRITE_QCOLOR(d->valuesColor); WRITE_QCOLOR(d->valuesColor);
WRITE_QFONT(d->valuesFont); WRITE_QFONT(d->valuesFont);
writer->writeEndElement(); writer->writeEndElement();
//Filling //Filling
writer->writeStartElement("filling"); writer->writeStartElement("filling");
writer->writeAttribute( "enabled", QString::number(d->fillingEnabled) ); writer->writeAttribute( "enabled", QString::number(d->fillingEnabled) );
writer->writeAttribute( "type", QString::number(static_cast<int>(d->filli ngType)) ); writer->writeAttribute( "type", QString::number(static_cast<int>(d->filli ngType)) );
skipping to change at line 1807 skipping to change at line 1825
} else if (!preview && reader->name() == "values") { } else if (!preview && reader->name() == "values") {
attribs = reader->attributes(); attribs = reader->attributes();
READ_INT_VALUE("type", valuesType, Histogram::ValuesType) ; READ_INT_VALUE("type", valuesType, Histogram::ValuesType) ;
READ_COLUMN(valuesColumn); READ_COLUMN(valuesColumn);
READ_INT_VALUE("position", valuesPosition, Histogram::Val uesPosition); READ_INT_VALUE("position", valuesPosition, Histogram::Val uesPosition);
READ_DOUBLE_VALUE("distance", valuesRotationAngle); READ_DOUBLE_VALUE("distance", valuesRotationAngle);
READ_DOUBLE_VALUE("rotation", valuesRotationAngle); READ_DOUBLE_VALUE("rotation", valuesRotationAngle);
READ_DOUBLE_VALUE("opacity", valuesOpacity); READ_DOUBLE_VALUE("opacity", valuesOpacity);
str = attribs.value("numericFormat").toString();
if (str.isEmpty())
reader->raiseWarning(attributeWarning.subs("numer
icFormat").toString());
else
d->valuesNumericFormat = *(str.toLatin1().data())
;
READ_STRING_VALUE("dateTimeFormat", valuesDateTimeFormat)
;
READ_INT_VALUE("precision", valuesPrecision, int);
//don't produce any warning if no prefix or suffix is set (empty string is allowed here in xml) //don't produce any warning if no prefix or suffix is set (empty string is allowed here in xml)
d->valuesPrefix = attribs.value("prefix").toString(); d->valuesPrefix = attribs.value("prefix").toString();
d->valuesSuffix = attribs.value("suffix").toString(); d->valuesSuffix = attribs.value("suffix").toString();
READ_QCOLOR(d->valuesColor); READ_QCOLOR(d->valuesColor);
READ_QFONT(d->valuesFont); READ_QFONT(d->valuesFont);
} else if (!preview && reader->name() == "filling") { } else if (!preview && reader->name() == "filling") {
attribs = reader->attributes(); attribs = reader->attributes();
READ_INT_VALUE("enabled", fillingEnabled, bool); READ_INT_VALUE("enabled", fillingEnabled, bool);
 End of changes. 6 change blocks. 
11 lines changed or deleted 45 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)