improved code style

This commit is contained in:
jkriege2 2020-08-26 11:00:25 +02:00
parent 0a634aabd0
commit 696ce11514
9 changed files with 76 additions and 44 deletions

View File

@ -456,7 +456,7 @@ void JKQTFastPlotter::plotSystem(QPainter& painter) {
painter.drawText(QPointF(internalPlotBorderLeft+plotWidth-fmLabels.width(xAxisLabel), internalPlotBorderTop+plotHeight+fmTicks.height()+fmTicks.width("x")/2.0+fmLabels.ascent()+tickLength), xAxisLabel); painter.drawText(QPointF(internalPlotBorderLeft+plotWidth-fmLabels.width(xAxisLabel), internalPlotBorderTop+plotHeight+fmTicks.height()+fmTicks.width("x")/2.0+fmLabels.ascent()+tickLength), xAxisLabel);
} }
if (yAxisLabelVisible) { if (yAxisLabelVisible) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
painter.translate(fmLabels.ascent(), internalPlotBorderTop+fmLabels.width(yAxisLabel)); painter.translate(fmLabels.ascent(), internalPlotBorderTop+fmLabels.width(yAxisLabel));
painter.rotate(-90); painter.rotate(-90);
painter.drawText(QPointF(0, 0), yAxisLabel); painter.drawText(QPointF(0, 0), yAxisLabel);

View File

@ -916,7 +916,7 @@ double JKQTMathText::MTfracNode::draw(QPainter& painter, double x, double y, JKQ
double ybrace=y-ascent1-bw/2.0; double ybrace=y-ascent1-bw/2.0;
{ {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
painter.translate(x+xw/2.0+(width1)/2.0, ybrace); painter.translate(x+xw/2.0+(width1)/2.0, ybrace);
painter.rotate(180); painter.rotate(180);
QPainterPath path=makeHBracePath(0,0, width, bw); QPainterPath path=makeHBracePath(0,0, width, bw);

View File

@ -760,7 +760,7 @@ void JKQTPGraphBoxplotStyleMixin::plotVerticalKeyMarker(JKQTBasePlotter *parent,
painter.setPen(p); painter.setPen(p);
{ {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintrect=JKQTPFinally([&painter]() {painter.restore();});
painter.setBrush(b); painter.setBrush(b);
if (getDrawBox()) painter.drawRect(QRectF(xmi, p75, fabs(xma-xmi), fabs(p75-p25))); if (getDrawBox()) painter.drawRect(QRectF(xmi, p75, fabs(xma-xmi), fabs(p75-p25)));
} }

View File

@ -326,7 +326,7 @@ void JKQTPGeoInfiniteLine::draw(JKQTPEnhancedPainter& painter) {
addHitTestData(x2, y2); addHitTestData(x2, y2);
if (two_sided==false && x>=xmin && x<=xmax && y>=ymin && y<=ymax) { if (two_sided==false && x>=xmin && x<=xmax && y>=ymin && y<=ymax) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpainttwosided=JKQTPFinally([&painter]() {painter.restore();});
painter.setPen(getLinePen(painter, parent)); painter.setPen(getLinePen(painter, parent));
painter.setBrush(getLineColor()); painter.setBrush(getLineColor());
QPointF xx1(transformX(x),transformY(y)); QPointF xx1(transformX(x),transformY(y));

View File

@ -110,7 +110,7 @@ void JKQTPImpulsesHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
painter.setPen(p); painter.setPen(p);
if (lines.size()>0) painter.drawLines(lines); if (lines.size()>0) painter.drawLines(lines);
if (drawSymbols && points.size()>0) { if (drawSymbols && points.size()>0) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintsym=JKQTPFinally([&painter]() {painter.restore();});
for (auto& p: points) { for (auto& p: points) {
plotStyledSymbol(parent, painter, p.x(), p.y()); plotStyledSymbol(parent, painter, p.x(), p.y());
} }
@ -247,7 +247,7 @@ void JKQTPImpulsesVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
painter.setPen(p); painter.setPen(p);
if (lines.size()>0) painter.drawLines(lines); if (lines.size()>0) painter.drawLines(lines);
if (drawSymbols && points.size()>0) { if (drawSymbols && points.size()>0) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintsym=JKQTPFinally([&painter]() {painter.restore();});
for (auto& p: points) { for (auto& p: points) {
plotStyledSymbol(parent, painter, p.x(), p.y()); plotStyledSymbol(parent, painter, p.x(), p.y());
} }

View File

@ -171,7 +171,7 @@ void JKQTPSingleColumnSymbolsGraph::draw(JKQTPEnhancedPainter &painter)
if (positionScatterStyle!=RugPlot) { if (positionScatterStyle!=RugPlot) {
plotStyledSymbol(parent, painter, x, y); plotStyledSymbol(parent, painter, x, y);
} else { } else {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
painter.setPen(p); painter.setPen(p);
painter.drawLine(QLineF(x, y-symSize,x,y+symSize)); painter.drawLine(QLineF(x, y-symSize,x,y+symSize));
} }
@ -203,7 +203,7 @@ void JKQTPSingleColumnSymbolsGraph::draw(JKQTPEnhancedPainter &painter)
if (positionScatterStyle!=RugPlot) { if (positionScatterStyle!=RugPlot) {
plotStyledSymbol(parent, painter, x, y); plotStyledSymbol(parent, painter, x, y);
} else { } else {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
painter.setPen(p); painter.setPen(p);
painter.drawLine(QLineF(x-symSize, y,x+symSize,y)); painter.drawLine(QLineF(x-symSize, y,x+symSize,y));
} }

View File

@ -307,7 +307,7 @@ void JKQTPSpecialLineHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
if (m_drawSymbols) { if (m_drawSymbols) {
painter.save(); painter.save();
auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); auto __finalpaintsym=JKQTPFinally([&painter]() {painter.restore();});
for (auto& p: ps) { for (auto& p: ps) {
plotStyledSymbol(parent, painter, p.x(), p.y()); plotStyledSymbol(parent, painter, p.x(), p.y());
} }

View File

@ -1422,7 +1422,7 @@ void JKQTBasePlotter::gridPaint(JKQTPEnhancedPainter& painter, QSizeF pageRect,
{ {
// plot this plotter // plot this plotter
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
int t_x=0; int t_x=0;
int t_y=0; int t_y=0;
//std::cout<<"printing this ...\n"; //std::cout<<"printing this ...\n";
@ -1437,7 +1437,7 @@ void JKQTBasePlotter::gridPaint(JKQTPEnhancedPainter& painter, QSizeF pageRect,
// plot all the other plotters // plot all the other plotters
for (int i=0; i< gridPrintingList.size(); i++) { for (int i=0; i< gridPrintingList.size(); i++) {
//std::cout<<"printing "<<i<<" ...\n"; //std::cout<<"printing "<<i<<" ...\n";
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinnerloop=JKQTPFinally([&painter]() {painter.restore();});
int t_x=0; int t_x=0;
int t_y=0; int t_y=0;
//std::cout<<"printing "<<i<<" @g "<<gridPrintingList[i].x<<", "<<gridPrintingList[i].y<<" ...\n"; //std::cout<<"printing "<<i<<" @g "<<gridPrintingList[i].x<<", "<<gridPrintingList[i].y<<" ...\n";
@ -1489,7 +1489,7 @@ void JKQTBasePlotter::gridPaintOverlays(JKQTPEnhancedPainter &painter, QSizeF pa
{ {
// plot this plotter // plot this plotter
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
size_t t_x=0; size_t t_x=0;
size_t t_y=0; size_t t_y=0;
//std::cout<<"printing this ...\n"; //std::cout<<"printing this ...\n";
@ -1504,7 +1504,7 @@ void JKQTBasePlotter::gridPaintOverlays(JKQTPEnhancedPainter &painter, QSizeF pa
// plot all the other plotters // plot all the other plotters
for (int i=0; i< gridPrintingList.size(); i++) { for (int i=0; i< gridPrintingList.size(); i++) {
//std::cout<<"printing "<<i<<" ...\n"; //std::cout<<"printing "<<i<<" ...\n";
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinnerloop=JKQTPFinally([&painter]() {painter.restore();});
int t_x=0; int t_x=0;
int t_y=0; int t_y=0;
//std::cout<<"printing "<<i<<" @g "<<gridPrintingList[i].x<<", "<<gridPrintingList[i].y<<" ...\n"; //std::cout<<"printing "<<i<<" @g "<<gridPrintingList[i].x<<", "<<gridPrintingList[i].y<<" ...\n";
@ -2430,7 +2430,7 @@ void JKQTBasePlotter::drawNonGrid(JKQTPEnhancedPainter& painter, const QPoint& p
if ((scale*static_cast<double>(widgetWidth)/paintMagnification>static_cast<double>(rect.width())) || (scale*static_cast<double>(widgetHeight)/paintMagnification>static_cast<double>(rect.height()))) { if ((scale*static_cast<double>(widgetWidth)/paintMagnification>static_cast<double>(rect.width())) || (scale*static_cast<double>(widgetHeight)/paintMagnification>static_cast<double>(rect.height()))) {
scale=static_cast<double>(rect.height())/static_cast<double>(widgetHeight)*paintMagnification; scale=static_cast<double>(rect.height())/static_cast<double>(widgetHeight)*paintMagnification;
} }
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
// scale the plot so it fits on the page // scale the plot so it fits on the page
painter.scale(scale, scale); painter.scale(scale, scale);
#ifdef JKQTBP_DEBUGTIMING #ifdef JKQTBP_DEBUGTIMING
@ -2461,7 +2461,7 @@ void JKQTBasePlotter::drawNonGridOverlays(JKQTPEnhancedPainter& painter, const Q
scale=static_cast<double>(rect.height())/static_cast<double>(widgetHeight)*paintMagnification; scale=static_cast<double>(rect.height())/static_cast<double>(widgetHeight)*paintMagnification;
} }
{ {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
// scale the plot so it fits on the page // scale the plot so it fits on the page
painter.scale(scale, scale); painter.scale(scale, scale);
drawOverlaysWithHints(painter); drawOverlaysWithHints(painter);
@ -2480,15 +2480,25 @@ bool JKQTBasePlotter::isEmittingPlotSignalsEnabled() const
return this->emitPlotSignals; return this->emitPlotSignals;
} }
int JKQTBasePlotter::getPlotBorderTop() const { return this->plotterStyle.plotBorderTop; } int JKQTBasePlotter::getPlotBorderTop() const {
return this->plotterStyle.plotBorderTop;
}
int JKQTBasePlotter::getPlotBorderLeft() const { return this->plotterStyle.plotBorderLeft; } int JKQTBasePlotter::getPlotBorderLeft() const {
return this->plotterStyle.plotBorderLeft;
}
int JKQTBasePlotter::getPlotBorderBottom() const { return this->plotterStyle.plotBorderBottom; } int JKQTBasePlotter::getPlotBorderBottom() const {
return this->plotterStyle.plotBorderBottom;
}
int JKQTBasePlotter::getPlotBorderRight() const { return this->plotterStyle.plotBorderRight; } int JKQTBasePlotter::getPlotBorderRight() const {
return this->plotterStyle.plotBorderRight;
}
bool JKQTBasePlotter::doesMaintainAspectRatio() const { return this->maintainAspectRatio; } bool JKQTBasePlotter::doesMaintainAspectRatio() const {
return this->maintainAspectRatio;
}
void JKQTBasePlotter::setAspectRatio(double __value) void JKQTBasePlotter::setAspectRatio(double __value)
{ {
@ -2503,7 +2513,9 @@ double JKQTBasePlotter::getAspectRatio() const
return this->aspectRatio; return this->aspectRatio;
} }
bool JKQTBasePlotter::doesMaintainAxisAspectRatio() const { return this->maintainAxisAspectRatio; } bool JKQTBasePlotter::doesMaintainAxisAspectRatio() const {
return this->maintainAxisAspectRatio;
}
double JKQTBasePlotter::getAxisAspectRatio() const double JKQTBasePlotter::getAxisAspectRatio() const
{ {
@ -4304,7 +4316,7 @@ void JKQTBasePlotter::drawKeyContents(JKQTPEnhancedPainter& painter, double x, d
//y=y+itheight+(plotterStyle.keyStyle.ySeparation)*kfm.height(); //y=y+itheight+(plotterStyle.keyStyle.ySeparation)*kfm.height();
y=y+key_text_height+(plotterStyle.keyStyle.ySeparation)*kfm.width('X'); y=y+key_text_height+(plotterStyle.keyStyle.ySeparation)*kfm.width('X');
if (plotterStyle.debugShowRegionBoxes) { if (plotterStyle.debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
QPen p("orange"); QPen p("orange");
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
p.setWidthF(plotterStyle.debugRegionLineWidth/2.0); p.setWidthF(plotterStyle.debugRegionLineWidth/2.0);
@ -4338,7 +4350,7 @@ void JKQTBasePlotter::drawKeyContents(JKQTPEnhancedPainter& painter, double x, d
QRectF txtRect(x+(plotterStyle.keyStyle.sampleLineLength+plotterStyle.keyStyle.xSeparation)*kfm.width('X'),y, fs.width(), itheight); QRectF txtRect(x+(plotterStyle.keyStyle.sampleLineLength+plotterStyle.keyStyle.xSeparation)*kfm.width('X'),y, fs.width(), itheight);
mathText.draw(painter, Qt::AlignLeft|Qt::AlignVCenter, txtRect); mathText.draw(painter, Qt::AlignLeft|Qt::AlignVCenter, txtRect);
if (plotterStyle.debugShowRegionBoxes) { if (plotterStyle.debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
QPen p("orange"); QPen p("orange");
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
p.setWidthF(plotterStyle.debugRegionLineWidth/2.0); p.setWidthF(plotterStyle.debugRegionLineWidth/2.0);
@ -4386,7 +4398,7 @@ void JKQTBasePlotter::drawKeyContents(JKQTPEnhancedPainter& painter, double x, d
mathText.draw(painter, Qt::AlignLeft|Qt::AlignVCenter, txtRect); mathText.draw(painter, Qt::AlignLeft|Qt::AlignVCenter, txtRect);
if (plotterStyle.debugShowRegionBoxes) { if (plotterStyle.debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
QPen p("orange"); QPen p("orange");
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
p.setWidthF(plotterStyle.debugRegionLineWidth/2.0); p.setWidthF(plotterStyle.debugRegionLineWidth/2.0);

View File

@ -1515,7 +1515,7 @@ void JKQTPVerticalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
QRectF rect(0,0, getParentPlotWidth(), ascent+descent);//plotBorderLeft-30); QRectF rect(0,0, getParentPlotWidth(), ascent+descent);//plotBorderLeft-30);
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintiner=JKQTPFinally([&painter]() {painter.restore();});
painter.translate(QPointF(left-parent->pt2px(painter, axisStyle.tickOutsideLength+axisStyle.tickLabelDistance+axisStyle.labelDistance)-descent-labelMax.width()-labelMax.height(), bottom)); painter.translate(QPointF(left-parent->pt2px(painter, axisStyle.tickOutsideLength+axisStyle.tickLabelDistance+axisStyle.labelDistance)-descent-labelMax.width()-labelMax.height(), bottom));
painter.rotate(-90); painter.rotate(-90);
//JKQTPEnhancedPainter::RenderHints h=painter.renderHints(); //JKQTPEnhancedPainter::RenderHints h=painter.renderHints();
@ -1533,7 +1533,7 @@ void JKQTPVerticalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
break; break;
} }
if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) { if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinnerif=JKQTPFinally([&painter]() {painter.restore();});
QPen p("magenta"); QPen p("magenta");
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth/2.0); p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth/2.0);
@ -1555,7 +1555,7 @@ void JKQTPVerticalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
QRectF rect(0,0, getParentPlotWidth(), getParentMathText()->getSize(painter).height());//plotBorderLeft-30); QRectF rect(0,0, getParentPlotWidth(), getParentMathText()->getSize(painter).height());//plotBorderLeft-30);
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
painter.translate(QPointF(right+parent->pt2px(painter, axisStyle.tickOutsideLength+axisStyle.tickLabelDistance+axisStyle.labelDistance)+labelMax.width(), bottom)); painter.translate(QPointF(right+parent->pt2px(painter, axisStyle.tickOutsideLength+axisStyle.tickLabelDistance+axisStyle.labelDistance)+labelMax.width(), bottom));
painter.rotate(-90); painter.rotate(-90);
//JKQTPEnhancedPainter::RenderHints h=painter.renderHints(); //JKQTPEnhancedPainter::RenderHints h=painter.renderHints();
@ -1573,7 +1573,7 @@ void JKQTPVerticalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
break; break;
} }
if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) { if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinnerif=JKQTPFinally([&painter]() {painter.restore();});
QPen p("magenta"); QPen p("magenta");
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth/2.0); p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth/2.0);
@ -1588,7 +1588,7 @@ void JKQTPVerticalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) { if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintif=JKQTPFinally([&painter]() {painter.restore();});
QPen p("cyan"); QPen p("cyan");
p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth); p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth);
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
@ -1659,15 +1659,25 @@ void JKQTPVerticalIndependentAxis::setOtherAxisInverted(bool __value) {
redrawPlot(); redrawPlot();
} }
double JKQTPVerticalIndependentAxis::getParentPlotWidth() const { return axisWidth; } double JKQTPVerticalIndependentAxis::getParentPlotWidth() const {
return axisWidth;
}
double JKQTPVerticalIndependentAxis::getParentPlotOffset() const { return axisOffset; } double JKQTPVerticalIndependentAxis::getParentPlotOffset() const {
return axisOffset;
}
double JKQTPVerticalIndependentAxis::getParentOtheraxisWidth() const { return otherAxisWidth; } double JKQTPVerticalIndependentAxis::getParentOtheraxisWidth() const {
return otherAxisWidth;
}
bool JKQTPVerticalIndependentAxis::getParentOtheraxisInverted() const { return otherAxisInverted; } bool JKQTPVerticalIndependentAxis::getParentOtheraxisInverted() const {
return otherAxisInverted;
}
double JKQTPVerticalIndependentAxis::getParentOtheraxisOffset() const { return otherAxisOffset; } double JKQTPVerticalIndependentAxis::getParentOtheraxisOffset() const {
return otherAxisOffset;
}
@ -2102,7 +2112,7 @@ void JKQTPHorizontalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
QRectF rect(0,0, getParentPlotWidth(), ascent+descent);//plotBorderLeft-30); QRectF rect(0,0, getParentPlotWidth(), ascent+descent);//plotBorderLeft-30);
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
painter.translate(QPointF(left, bottom+parent->pt2px(painter, axisStyle.tickOutsideLength+axisStyle.tickLabelDistance+axisStyle.labelDistance)+labelMax.height())); painter.translate(QPointF(left, bottom+parent->pt2px(painter, axisStyle.tickOutsideLength+axisStyle.tickLabelDistance+axisStyle.labelDistance)+labelMax.height()));
//JKQTPEnhancedPainter::RenderHints h=painter.renderHints(); //JKQTPEnhancedPainter::RenderHints h=painter.renderHints();
//painter.drawRect(rect); //painter.drawRect(rect);
@ -2119,7 +2129,7 @@ void JKQTPHorizontalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
break; break;
} }
if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) { if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinnerif=JKQTPFinally([&painter]() {painter.restore();});
QPen p("magenta"); QPen p("magenta");
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth/2.0); p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth/2.0);
@ -2141,7 +2151,7 @@ void JKQTPHorizontalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
QRectF rect(0,0, getParentPlotWidth(), getParentMathText()->getSize(painter).height());//plotBorderLeft-30); QRectF rect(0,0, getParentPlotWidth(), getParentMathText()->getSize(painter).height());//plotBorderLeft-30);
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinner=JKQTPFinally([&painter]() {painter.restore();});
painter.translate(QPointF(left, top-parent->pt2px(painter, axisStyle.tickOutsideLength+axisStyle.tickLabelDistance+axisStyle.labelDistance)-labelMax.height()-rect.height())); painter.translate(QPointF(left, top-parent->pt2px(painter, axisStyle.tickOutsideLength+axisStyle.tickLabelDistance+axisStyle.labelDistance)-labelMax.height()-rect.height()));
//JKQTPEnhancedPainter::RenderHints h=painter.renderHints(); //JKQTPEnhancedPainter::RenderHints h=painter.renderHints();
//painter.drawRect(rect); //painter.drawRect(rect);
@ -2158,7 +2168,7 @@ void JKQTPHorizontalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
break; break;
} }
if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) { if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintinnerif=JKQTPFinally([&painter]() {painter.restore();});
QPen p("magenta"); QPen p("magenta");
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth/2.0); p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth/2.0);
@ -2172,7 +2182,7 @@ void JKQTPHorizontalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
} }
if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) { if (getParent()->getCurrentPlotterStyle().debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); painter.save(); auto __finalpaintif=JKQTPFinally([&painter]() {painter.restore();});
QPen p("cyan"); QPen p("cyan");
QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col); QColor col=p.color(); col.setAlphaF(0.8); p.setColor(col);
p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth); p.setWidthF(getParent()->getCurrentPlotterStyle().debugRegionLineWidth);
@ -2240,14 +2250,24 @@ void JKQTPHorizontalIndependentAxis::setOtherAxisInverted(bool __value) {
redrawPlot(); redrawPlot();
} }
double JKQTPHorizontalIndependentAxis::getParentPlotWidth() const { return axisWidth; } double JKQTPHorizontalIndependentAxis::getParentPlotWidth() const {
return axisWidth;
}
double JKQTPHorizontalIndependentAxis::getParentPlotOffset() const { return axisOffset; } double JKQTPHorizontalIndependentAxis::getParentPlotOffset() const {
return axisOffset;
}
double JKQTPHorizontalIndependentAxis::getParentOtheraxisWidth() const { return otherAxisWidth; } double JKQTPHorizontalIndependentAxis::getParentOtheraxisWidth() const {
return otherAxisWidth;
}
bool JKQTPHorizontalIndependentAxis::getParentOtheraxisInverted() const { return otherAxisInverted; } bool JKQTPHorizontalIndependentAxis::getParentOtheraxisInverted() const {
return otherAxisInverted;
}
double JKQTPHorizontalIndependentAxis::getParentOtheraxisOffset() const { return otherAxisOffset; } double JKQTPHorizontalIndependentAxis::getParentOtheraxisOffset() const {
return otherAxisOffset;
}