mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-11-15 10:05:47 +08:00
added optimized line-drawing to JKQTPSpecialLineGraphBase
This commit is contained in:
parent
064f01d0b0
commit
a90cbecd9d
@ -268,13 +268,14 @@ void JKQTPSpecialLineHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
|
||||
QList<QPolygonF> pl_fordrawing;
|
||||
if (isHighlighted() || getDrawLine()) {
|
||||
pl_fordrawing=JKQTPClipPolyLine(pl, cliprect);
|
||||
if (getUseNonvisibleLineCompression()) pl_fordrawing=JKQTPClipPolyLine(JKQTPSimplifyPolyLines(pl, p.widthF()*getNonvisibleLineCompressionAgressiveness()), cliprect);
|
||||
else pl_fordrawing=JKQTPClipPolyLine(pl, cliprect);
|
||||
}
|
||||
|
||||
if (isHighlighted()) {
|
||||
painter.setBrush(Qt::NoBrush);
|
||||
painter.setPen(ph);
|
||||
for (const QPolygonF lines : pl_fordrawing) {
|
||||
for (const QPolygonF& lines : pl_fordrawing) {
|
||||
painter.drawPolyline(lines);
|
||||
}
|
||||
}
|
||||
@ -282,11 +283,12 @@ void JKQTPSpecialLineHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
if (getDrawLine()) {
|
||||
painter.setBrush(Qt::NoBrush);
|
||||
painter.setPen(p);
|
||||
for (const QPolygonF lines : pl_fordrawing) {
|
||||
for (const QPolygonF& lines : pl_fordrawing) {
|
||||
painter.drawPolyline(lines);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (m_drawSymbols) {
|
||||
painter.save();
|
||||
auto __finalpaintsym=JKQTPFinally([&painter]() {painter.restore();});
|
||||
@ -454,13 +456,14 @@ void JKQTPSpecialLineVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
|
||||
QList<QPolygonF> pl_fordrawing;
|
||||
if (isHighlighted() || getDrawLine()) {
|
||||
pl_fordrawing=JKQTPClipPolyLine(pl, cliprect);
|
||||
if (getUseNonvisibleLineCompression()) pl_fordrawing=JKQTPClipPolyLine(JKQTPSimplifyPolyLines(pl, p.widthF()*getNonvisibleLineCompressionAgressiveness()), cliprect);
|
||||
else pl_fordrawing=JKQTPClipPolyLine(pl, cliprect);
|
||||
}
|
||||
|
||||
if (isHighlighted()) {
|
||||
painter.setBrush(Qt::NoBrush);
|
||||
painter.setPen(ph);
|
||||
for (const QPolygonF lines : pl_fordrawing) {
|
||||
for (const QPolygonF& lines : pl_fordrawing) {
|
||||
painter.drawPolyline(lines);
|
||||
}
|
||||
}
|
||||
@ -468,7 +471,7 @@ void JKQTPSpecialLineVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
if (getDrawLine()) {
|
||||
painter.setBrush(Qt::NoBrush);
|
||||
painter.setPen(p);
|
||||
for (const QPolygonF lines : pl_fordrawing) {
|
||||
for (const QPolygonF& lines : pl_fordrawing) {
|
||||
painter.drawPolyline(lines);
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class JKQTPDatastore;
|
||||
*
|
||||
* \see JKQTPSpecialLineHorizontalGraph, JKQTPSpecialLineVerticalGraph
|
||||
*/
|
||||
class JKQTPLOTTER_LIB_EXPORT JKQTPSpecialLineGraphBase: public JKQTPXYBaselineGraph, public JKQTPGraphLineAndFillStyleMixin, public JKQTPGraphSymbolStyleMixin {
|
||||
class JKQTPLOTTER_LIB_EXPORT JKQTPSpecialLineGraphBase: public JKQTPXYBaselineGraph, public JKQTPGraphLineAndFillStyleMixin, public JKQTPGraphSymbolStyleMixin, public JKQTPGraphLinesCompressionMixin {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** \brief class constructor */
|
||||
|
Loading…
Reference in New Issue
Block a user