- breaking: geometric elements constructor: removed all styling properties, added setStyle()-functions to replace them. This is necessary to better work with the extended Styling system

- breaking: extended styling system for graphs
This commit is contained in:
jkriege2 2020-09-26 15:58:58 +02:00
parent a65a713ea6
commit fc321f027b
53 changed files with 1738 additions and 1003 deletions

View File

@ -25,6 +25,7 @@ Changes, compared to \ref page_whatsnew_V2019_11 "v2019.11" include:
<li>removed/breaking change: removed the usage of some deprecated functions and objects (e.g. QMatrix)</li>
<li>removed/breaking change: removed the overlay elements (derived from JKQTPOverlayElement), which were not very well set up and are more confusing than useful.</li>
<li>improved/breaking change: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)</li>
<li>improved/breaking change: geometric elements constructor: removed all styling properties, added setStyle()-functions to replace them. This is necessary to better work with the extended Styling system</li>
<li>improved: constructors and access functions for several geometric objects (e.g. more constructors, additional functions to retrieve parameters in diferent forms, iterators for polygons, ...)</li>
<li>improved/breaking change: reworked class hierarchy of parsed function plots and declared several setters as slots.</li>
<li>improved/breaking change: reworked class hierarchy of bar & impulse charts.</li>
@ -34,6 +35,7 @@ Changes, compared to \ref page_whatsnew_V2019_11 "v2019.11" include:
<li>improved/breaking change: reworked class hierarchy of range plot elements (JKQTPVerticalRange and JKQTPHorizontalRange).</li>
<li>improved/breaking change: reworked class hierarchy of boxplots.</li>
<li>improved/breaking change: reworked class hierarchy of violin plots.</li>
<li>improved/breaking change: extended styling system for graphs.</li>
<li>improved/breaking change: reworked graph Base-Classes (promoted several setters to slots, added Q_PROPERTY- and Q_ENUM-declarations...)</li>
<li>improved/breaking change: made more functions and function parameters const</li>
<li>bugfixed/improved: aspect ratio handling in JKQTPlotter.</li>

View File

@ -42,9 +42,12 @@ int main(int argc, char* argv[])
// 3. now we add three semi-transparent, filled curve plots, one for each histogram
JKQTPSpecialLineHorizontalGraph* graphF=new JKQTPSpecialLineHorizontalGraph(&plot);
JKQTPSpecialLineHorizontalGraph* graphF2=new JKQTPSpecialLineHorizontalGraph(&plot);
JKQTPGeoLine* graphL1=new JKQTPGeoLine(&plot, 0, 3, 12, 3.5, Qt::red);
JKQTPGeoLine* graphL2=new JKQTPGeoLine(&plot, 0, 3.8, 12, 4.5, Qt::red);
JKQTPGeoLine* graphL3=new JKQTPGeoLine(&plot, 0, 4.6, 12, 5.5, Qt::red);
JKQTPGeoLine* graphL1=new JKQTPGeoLine(&plot, 0, 3, 12, 3.5);
graphL1->setColor(Qt::red);
JKQTPGeoLine* graphL2=new JKQTPGeoLine(&plot, 0, 3.8, 12, 4.5);
graphL2->setColor(Qt::red);
JKQTPGeoLine* graphL3=new JKQTPGeoLine(&plot, 0, 4.6, 12, 5.5);
graphL3->setColor(Qt::red);
JKQTPBarVerticalGraph* graphBE=new JKQTPBarVerticalGraph(&plot);
JKQTPBarVerticalGraph* graphBF=new JKQTPBarVerticalGraph(&plot);

View File

@ -10,11 +10,16 @@ A first table shows all available arrow tips in different sizes.
```.cpp
for (size_t i=0; i<static_cast<size_t>(JKQTPLineDecoratorCount); i++) {
auto const decor=static_cast<JKQTPLineDecoratorStyle>(i);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.1, arr_y, 0.3, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 0.2));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.4, arr_y, 0.6, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 0.5));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.7, arr_y, 0.9, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 1));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 1.0, arr_y, 1.3, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 2));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 1.4, arr_y, 1.7, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 3));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.1, arr_y, 0.3, arr_y+0.05, decor, JKQTPNoDecorator));
a->setStyle(QColor("red"), 0.2);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.4, arr_y, 0.6, arr_y+0.05, decor, JKQTPNoDecorator));
a->setStyle(QColor("red"), 0.5);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.7, arr_y, 0.9, arr_y+0.05, decor, JKQTPNoDecorator));
a->setStyle(QColor("red"), 1);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 1.0, arr_y, 1.3, arr_y+0.05, decor, JKQTPNoDecorator));
a->setStyle(QColor("red"), 2);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 1.4, arr_y, 1.7, arr_y+0.05, decor, JKQTPNoDecorator));
a->setStyle(QColor("red"), 3);
plot.addGraph(new JKQTPGeoText(&plot, a->getX2()+0.05, a->getY2(), "\\verb{"+JKQTPLineDecoratorStyle2String(decor)+"}", 12, a->getLineColor()));
arr_y+=arr_deltay;
}
@ -44,7 +49,7 @@ Here is an example of how to actiavate them for a JKQTPGeoPolyLines:
```.cpp
QVector<QPointF> points; points<<QPointF(3, 0.6)<<QPointF(4, 0.5)<<QPointF(3, 1.2)<<QPointF(4, 1.0);
JKQTPGeoPolyLines* polyLine=new JKQTPGeoPolyLines(&plot, points, QColor("blue"));
JKQTPGeoPolyLines* polyLine=new JKQTPGeoPolyLines(&plot, points);
polyLine->setHeadDecoratorStyle(JKQTPFilledDoubleArrow);
polyLine->setTailDecoratorStyle(JKQTPCircleDecorator);
plot.addGraph(polyLine);
@ -57,7 +62,7 @@ Here is the result:
For the class JKQTPGeoInfiniteLine the start can be decorated with an arrow (only if two_sided==false!):
```.cpp
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(&plot, 1.5, 0.2, 1, 0.25, QColor("blue"), 2);
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(&plot, 1.5, 0.2, 1, 0.25);
infLine->setHeadDecoratorStyle(JKQTPFilledDoubleArrow);
plot.addGraph(infLine);
```

View File

@ -7,6 +7,7 @@
#include <QApplication>
#include "jkqtplotter/jkqtplotter.h"
#include "jkqtplotter/graphs/jkqtpgeometric.h"
#include "jkqtplotter/graphs/jkqtpgeoannotations.h"
int main(int argc, char* argv[])
@ -40,27 +41,33 @@ int main(int argc, char* argv[])
plot.addGraph(new JKQTPGeoText(&plot, 1.4, 3.0, "w_{line}=3", 12, QColor("darkred")));
for (size_t i=0; i<static_cast<size_t>(JKQTPLineDecoratorCount); i++) {
auto const decor=static_cast<JKQTPLineDecoratorStyle>(i);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.1, arr_y, 0.3, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 0.2));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.4, arr_y, 0.6, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 0.5));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.7, arr_y, 0.9, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 1));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 1.0, arr_y, 1.3, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 2));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 1.4, arr_y, 1.7, arr_y+0.05, QColor("red"), decor, JKQTPNoDecorator, 3));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.1, arr_y, 0.3, arr_y+0.05, decor, JKQTPNoDecorator)); a->setStyle(QColor("red"), 0.2);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.4, arr_y, 0.6, arr_y+0.05, decor, JKQTPNoDecorator)); a->setStyle(QColor("red"), 0.5);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 0.7, arr_y, 0.9, arr_y+0.05, decor, JKQTPNoDecorator)); a->setStyle(QColor("red"), 1);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 1.0, arr_y, 1.3, arr_y+0.05, decor, JKQTPNoDecorator)); a->setStyle(QColor("red"), 2);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 1.4, arr_y, 1.7, arr_y+0.05, decor, JKQTPNoDecorator)); a->setStyle(QColor("red"), 3);
plot.addGraph(new JKQTPGeoText(&plot, a->getX2()+0.05, a->getY2(), "\\verb{"+JKQTPLineDecoratorStyle2String(decor)+"}", 12, a->getLineColor()));
arr_y+=arr_deltay;
}
// 3.2 note that all decorators are drawn in a way that lets them end at the intended end-point of the line, even circles!
for (size_t i=0; i<6; i++) {
plot.addGraph(a=new JKQTPGeoArrow(&plot, 3+static_cast<double>(i)*0.15, 3, 3+static_cast<double>(i)*0.15, 2.75, QColor("blue"), static_cast<JKQTPLineDecoratorStyle>(i*4+1), static_cast<JKQTPLineDecoratorStyle>(i*4+2), static_cast<double>(i+1)*0.5));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 3+static_cast<double>(i)*0.15, 2.5, 3+static_cast<double>(i)*0.15, 2.75, QColor("red"), static_cast<JKQTPLineDecoratorStyle>(i*4+3), static_cast<JKQTPLineDecoratorStyle>(i*4+4), static_cast<double>(i+1)*0.5));
plot.addGraph(a=new JKQTPGeoArrow(&plot, 3+static_cast<double>(i)*0.15, 3, 3+static_cast<double>(i)*0.15, 2.75, static_cast<JKQTPLineDecoratorStyle>(i*4+1), static_cast<JKQTPLineDecoratorStyle>(i*4+2))); a->setStyle(QColor("blue"), static_cast<double>(i+1)*0.5);
plot.addGraph(a=new JKQTPGeoArrow(&plot, 3+static_cast<double>(i)*0.15, 2.5, 3+static_cast<double>(i)*0.15, 2.75, static_cast<JKQTPLineDecoratorStyle>(i*4+3), static_cast<JKQTPLineDecoratorStyle>(i*4+4))); a->setStyle(QColor("red"), static_cast<double>(i+1)*0.5);
}
plot.addGraph(new JKQTPGeoLine(&plot, 2.9, 2.5, 4.0, 2.5, QColor("silver"), 0.25, Qt::DashLine));
plot.addGraph(new JKQTPGeoLine(&plot, 2.9, 2.75, 4.0, 2.75, QColor("silver"), 0.25, Qt::DashLine));
plot.addGraph(new JKQTPGeoLine(&plot, 2.9, 3, 4.6, 3, QColor("silver"), 0.25, Qt::DashLine));
JKQTPGeoLine* l;
plot.addGraph(l=new JKQTPGeoLine(&plot, 2.9, 2.5, 4.0, 2.5));
l->setStyle(QColor("silver"), 0.25, Qt::DashLine);
plot.addGraph(l=new JKQTPGeoLine(&plot, 2.9, 2.75, 4.0, 2.75));
l->setStyle(QColor("silver"), 0.25, Qt::DashLine);
plot.addGraph(l=new JKQTPGeoLine(&plot, 2.9, 3, 4.6, 3));
l->setStyle(QColor("silver"), 0.25, Qt::DashLine);
// 3.3 a JKQTPGeoLine with and without errow heads:
JKQTPGeoLine* line=new JKQTPGeoLine(&plot, 2.9, 2.3, 3.6, 2.4, QColor("red"), 2.0);
JKQTPGeoLine* line_heads=new JKQTPGeoLine(&plot, 2.9, 2.1, 3.6, 2.2, QColor("red"), 2.0);
JKQTPGeoLine* line=new JKQTPGeoLine(&plot, 2.9, 2.3, 3.6, 2.4);
line->setStyle(QColor("red"), 2.0);
JKQTPGeoLine* line_heads=new JKQTPGeoLine(&plot, 2.9, 2.1, 3.6, 2.2);
line_heads->setStyle(QColor("red"), 2.0);
line_heads->setHeadDecoratorStyle(JKQTPFilledDoubleArrow);
line_heads->setTailDecoratorStyle(JKQTPCircleDecorator);
plot.addGraph(line);
@ -73,18 +80,21 @@ int main(int argc, char* argv[])
// 3.4 also the class JKQTPGeoPolyLines can decorate its start/end with arrows
QVector<QPointF> points; points<<QPointF(3, 0.8)<<QPointF(4, 0.7)<<QPointF(3, 1.2)<<QPointF(4, 1.0);
JKQTPGeoPolyLines* polyLine=new JKQTPGeoPolyLines(&plot, points, QColor("blue"));
JKQTPGeoPolyLines* polyLine=new JKQTPGeoPolyLines(&plot, points);
polyLine->setColor(QColor("blue"));
polyLine->setHeadDecoratorStyle(JKQTPFilledDoubleArrow);
polyLine->setTailDecoratorStyle(JKQTPCircleDecorator);
plot.addGraph(polyLine);
// 3.5 also the class JKQTPGeoInfiniteLine can decorate its start with arrows (only if two_sided==false!)
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(&plot, 3.5, 0.2, 1, 0.25, QColor("blue"), 2);
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(&plot, 3.5, 0.2, 1, 0.25);
infLine->setStyle(QColor("blue"), 2);
infLine->setHeadDecoratorStyle(JKQTPFilledDoubleArrow);
plot.addGraph(infLine);
plot.addGraph(new JKQTPGeoSymbol(&plot, infLine->getX(), infLine->getY(), JKQTPCirclePlus, 8, QColor("silver")));
plot.addGraph(new JKQTPGeoArrow(&plot, infLine->getX(), infLine->getY(), infLine->getX()+infLine->getDx(), infLine->getY()+infLine->getDy(), QColor("silver"), JKQTPArrow, JKQTPNoDecorator, 1));
plot.addGraph(a=new JKQTPGeoArrow(&plot, infLine->getX(), infLine->getY(), infLine->getX()+infLine->getDx(), infLine->getY()+infLine->getDy(), JKQTPArrow, JKQTPNoDecorator));
infLine->setStyle(QColor("silver"), 1);
/*
infLine=new JKQTPGeoInfiniteLine(&plot, 3.5, 0.1, -1, 0.25, QColor("darkblue"), 2);
infLine->setHeadDecoratorStyle(JKQTPFilledDoubleArrow);

View File

@ -12,21 +12,35 @@
template <class TELLIPSEPART>
void drawExample(JKQTPlotter* plot, double x0, double y0, double wid, double heig, double angleStart, double angleStop) {
plot->addGraph(new JKQTPGeoRectangle(plot,x0, y0, wid, heig, QColor("orange"), 1, Qt::PenStyle::DashLine));
plot->addGraph(new JKQTPGeoEllipse(plot,x0, y0, wid, heig, QColor("orange"), 1, Qt::PenStyle::DashLine));
JKQTPGeoRectangle* rect;
plot->addGraph(rect=new JKQTPGeoRectangle(plot,x0, y0, wid, heig));
rect->setLineColor(QColor("orange"));
rect->setLineStyle(Qt::PenStyle::DashLine);
rect->setFillColor(Qt::transparent);
rect->setLineWidth(1);
JKQTPGeoEllipse* ell;
plot->addGraph(ell=new JKQTPGeoEllipse(plot,x0, y0, wid, heig));
ell->setLineColor(QColor("orange"));
ell->setLineStyle(Qt::PenStyle::DashLine);
ell->setFillColor(Qt::transparent);
ell->setLineWidth(1);
TELLIPSEPART* obj;
plot->addGraph(obj=new TELLIPSEPART(plot,x0, y0, wid, heig, 10, angleStop , QColor("blue"), 4, Qt::PenStyle::SolidLine));
plot->addGraph(obj=new TELLIPSEPART(plot,x0, y0, wid, heig, 10, angleStop));
obj->setLineColor(QColor("blue"));
obj->setLineStyle(Qt::PenStyle::SolidLine);
obj->setLineWidth(4);
JKQTPGeoBaseFilled* fillobj=dynamic_cast<JKQTPGeoBaseFilled*>(obj);
if (fillobj) {
fillobj->setFillColor(QColor("lightblue"));
fillobj->setAlpha(0.8);
}
JKQTPGeoLine* l;
plot->addGraph(new JKQTPGeoSymbol(plot, x0, y0, JKQTPCircle, 5, QColor("red")));
plot->addGraph(new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(angleStart/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(angleStart/180.0*JKQTPSTATISTICS_PI), QColor("orange")));
plot->addGraph(l=new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(angleStart/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(angleStart/180.0*JKQTPSTATISTICS_PI))); l->setColor(QColor("orange"));
plot->addGraph(new JKQTPGeoText(plot, x0+wid*1.1/2.0*cos(angleStart/180.0*JKQTPSTATISTICS_PI),y0+heig*1.1/2.0*sin(angleStart/180.0*JKQTPSTATISTICS_PI), "\\alpha_\\text{start}="+QString::number(angleStart, 'f', 0)+"\\degree", 10, QColor("orange")));
plot->addGraph(new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(angleStop/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(angleStop/180.0*JKQTPSTATISTICS_PI), QColor("red")));
plot->addGraph(new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(angleStop/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(angleStop/180.0*JKQTPSTATISTICS_PI))); l->setColor(QColor("red"));
plot->addGraph(new JKQTPGeoText(plot, x0+wid*1.1/2.0*cos(angleStop/180.0*JKQTPSTATISTICS_PI),y0+heig*1.1/2.0*sin(angleStop/180.0*JKQTPSTATISTICS_PI), "\\alpha_\\text{stop}="+QString::number(angleStop, 'f', 0)+"\\degree", 10, QColor("red")));
plot->addGraph(new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(0/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(0/180.0*JKQTPSTATISTICS_PI), QColor("orange")));
plot->addGraph(new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(0/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(0/180.0*JKQTPSTATISTICS_PI)));l->setColor(QColor("orange"));
plot->addGraph(new JKQTPGeoText(plot, x0+wid*1.1/2.0*cos(0/180.0*JKQTPSTATISTICS_PI),y0+heig*1.1/2.0*sin(0/180.0*JKQTPSTATISTICS_PI), "0\\degree", 10, QColor("orange")));
plot->addGraph(new JKQTPGeoText(plot, x0,y0-0.05*heig, "(x,y)", 10, QColor("red")));
plot->addGraph(new JKQTPGeoText(plot, x0,y0-heig*1.1/2.0, "width="+QString::number(wid, 'f', 1), 10, QColor("red")));
@ -38,10 +52,18 @@ void drawExample(JKQTPlotter* plot, double x0, double y0, double wid, double hei
void drawEllExample(JKQTPlotter* plot, double x0, double y0, double wid, double heig, double angle=0) {
JKQTPGeoRectangle* rec;
plot->addGraph(rec=new JKQTPGeoRectangle(plot,x0, y0, wid, heig, QColor("orange"), 1, Qt::PenStyle::DashLine));
plot->addGraph(rec=new JKQTPGeoRectangle(plot,x0, y0, wid, heig));
rec->setAngle(angle);
rec->setLineColor(QColor("orange"));
rec->setLineStyle(Qt::PenStyle::DashLine);
rec->setFillColor(Qt::transparent);
rec->setLineWidth(1);
JKQTPGeoEllipse* fillobj;
plot->addGraph(fillobj=new JKQTPGeoEllipse(plot,x0, y0, wid, heig, QColor("blue"), 1, Qt::PenStyle::DashLine));
plot->addGraph(fillobj=new JKQTPGeoEllipse(plot,x0, y0, wid, heig));
fillobj->setLineColor(QColor("blue"));
fillobj->setLineStyle(Qt::PenStyle::DashLine);
fillobj->setFillColor(Qt::transparent);
fillobj->setLineWidth(1);
fillobj->setFillColor(QColor("lightblue"));
fillobj->setAlpha(0.8);
fillobj->setAngle(angle);
@ -51,9 +73,10 @@ void drawEllExample(JKQTPlotter* plot, double x0, double y0, double wid, double
plot->addGraph(new JKQTPGeoText(plot, x0,y0-heig*1.1/2.0, "width="+QString::number(wid, 'f', 1), 10, QColor("red")));
plot->addGraph(new JKQTPGeoText(plot, x0-wid*1.05/2.0,y0, "height="+QString::number(heig, 'f', 1), 10, QColor("red")));
} else {
plot->addGraph(new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(angle/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(angle/180.0*JKQTPSTATISTICS_PI), QColor("red")));
JKQTPGeoLine* l;
plot->addGraph(l=new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(angle/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(angle/180.0*JKQTPSTATISTICS_PI))); l->setColor( QColor("red"));
plot->addGraph(new JKQTPGeoText(plot, x0+wid*1.1/2.0*cos(angle/180.0*JKQTPSTATISTICS_PI),y0+heig*1.1/2.0*sin(angle/180.0*JKQTPSTATISTICS_PI), "\\alpha="+QString::number(angle, 'f', 0)+"\\degree", 10, QColor("red")));
plot->addGraph(new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(0/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(0/180.0*JKQTPSTATISTICS_PI), QColor("orange")));
plot->addGraph(l=new JKQTPGeoLine(plot, x0, y0, x0+wid/2.0*cos(0/180.0*JKQTPSTATISTICS_PI),y0+heig/2.0*sin(0/180.0*JKQTPSTATISTICS_PI))); l->setColor( QColor("orange"));
plot->addGraph(new JKQTPGeoText(plot, x0+wid*1.1/2.0*cos(0/180.0*JKQTPSTATISTICS_PI),y0+heig*1.1/2.0*sin(0/180.0*JKQTPSTATISTICS_PI), "0\\degree", 10, QColor("orange")));
}

View File

@ -14,14 +14,17 @@ The source code of the main application can be found in [`geometric.cpp`](https
// a line
plot->addGraph(new JKQTPGeoLine(plot, 1, 0.05, 1.9, 0.9, QColor("red"), 2));
JKQTPGeoLine* l;
plot->addGraph(l=new JKQTPGeoLine(plot, 1, 0.05, 1.9, 0.9));
l->setStyle(QColor("red"), 2));
// an arrow
plot->addGraph(new JKQTPGeoArrow(plot, 0.4, 2.5, 0.4, 2.65, QColor("green"), JKQTPArrowAndStop, JKQTPFilledArrow, 1));
plot->addGraph(new JKQTPGeoArrow(plot, 0.4, 2.5, 0.4, 2.65, JKQTPArrowAndStop, JKQTPFilledArrow));
// a one-sided infinite line with slope dy/dx=0.25/0.2
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(plot, 1.7, 0.2, 0.2, 0.25, QColor("green"), 1.5, Qt::PenStyle::DashLine);
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(plot, 1.7, 0.2, 0.2, 0.25);
infLine->setStyle(QColor("green"), 1.5, Qt::PenStyle::DashLine);
infLine->setTwoSided(false);
infLine->setAlpha(0.5);
plot->addGraph(infLine);
@ -30,24 +33,35 @@ The source code of the main application can be found in [`geometric.cpp`](https
// a polyline
QVector<QPointF> p;
p<<QPointF(2.1, 0.0)<<QPointF(2.2, 0.92)<<QPointF(2.6, 0.3)<<QPointF(2.9, 0.9);
plot->addGraph(new JKQTPGeoPolyLines(plot, p, QColor("darkgreen"), 4, Qt::PenStyle::DashDotLine));
JKQTPGeoPolyLines* poly;
plot->addGraph(poly=new JKQTPGeoPolyLines(plot, p));
poly->setStyleTransparentFill(QColor("darkgreen"), 4, Qt::PenStyle::DashDotLine);
// rectangle:
plot->addGraph(new JKQTPGeoRectangle(plot, QPointF(0.4,1.3), QPointF(0.9,1.6), QColor("blue"), 1, Qt::SolidLine, rfill));
JKQTPGeoRectangle* rec;
plot->addGraph(rec=new JKQTPGeoRectangle(plot, QPointF(0.4,1.3), QPointF(0.9,1.6)));
rec->setStyle(QColor("blue"), 1, Qt::SolidLine, rfill, Qt::SolidPattern);
// a rotated rectangle (rotated by 35 degrees):
plot->addGraph(new JKQTPGeoRectangle(plot, 0.5,1.5,0.8,0.5, 35, QColor("darkblue"), 2, Qt::DashLine));
plot->addGraph(rec=new JKQTPGeoRectangle(plot, 0.5,1.5,0.8,0.5));
rec->setStyleTransparentFill(QColor("darkblue"), 2, Qt::DashLine);
rec->setAngle(35);
// ellipse:
plot->addGraph(new JKQTPGeoEllipse(plot, QPointF(0.4,1.3), QPointF(0.9,1.6), QColor("blue"), 1, Qt::SolidLine, rfill));
// a rotated ellipse (rotated by 35 degrees):
plot->addGraph(new JKQTPGeoEllipse(plot, 0.5,1.5,0.8,0.5, 35, QColor("darkblue"), 2, Qt::DashLine));
JKQTPGeoEllipse* ell;
plot->addGraph(ell=new JKQTPGeoEllipse(plot, QPointF(0.4,1.3), QPointF(0.9,1.6)));
ell->setStyle(QColor("blue"), 1, Qt::SolidLine, rfill, Qt::SolidPattern);
// a rotated rectangle (rotated by 35 degrees):
plot->addGraph(ell=new JKQTPGeoEllipse(plot, 0.5,1.5,0.8,0.5));
ell->setStyleTransparentFill(QColor("darkblue"), 2, Qt::DashLine);
ell->setAngle(35);
// a polygon
JKQTPGeoPolygon* polygongraph=new JKQTPGeoPolygon(plot, QColor("red"), 2, Qt::PenStyle::DashLine, QColor("salmon"));
JKQTPGeoPolygon* polygongraph=new JKQTPGeoPolygon(plot);
polygongraph->setStyle(QColor("red"), 2, Qt::PenStyle::DashLine, QColor("salmon"), Qt::SolidPattern);
polygongraph->appendPoint(2.1, 0.5);
polygongraph->appendPoint(2.9, 0.9);
polygongraph->appendPoint(2.2, 0.8);
@ -59,15 +73,15 @@ The source code of the main application can be found in [`geometric.cpp`](https
// an arc from an ellipse from -10 degrees to 117 degrees, centered at 2.5,1.5 and full axes of 0.5 and 0.5
plot->addGraph(new JKQTPGeoArc(plot,2.5,1.5,0.5,0.5, -10, 117 , QColor("orange"), 4, Qt::PenStyle::DashLine));
plot->addGraph(new JKQTPGeoArc(plot,2.5,1.5,0.5,0.5, -10, 117 ));
// a pie centered at 2.5,2.5 with ellipse axes 0.9 and 0.9 and from angle 0 degrees to 90 degrees
plot->addGraph(new JKQTPGeoPie(plot,2.5,2.5,0.9,0.9, 0, 90 , QColor("blue"), 4, Qt::PenStyle::SolidLine,QColor("lightblue")));
plot->addGraph(new JKQTPGeoPie(plot,2.5,2.5,0.9,0.9, 0, 90));
// a chord centered at 2.5,2.5 with ellipse axes 0.9 and 0.9 and from angle 0 degrees to 90 degrees
plot->addGraph(new JKQTPGeoChord(plot,2.5,2.5,0.9,0.9, 0, 90 , QColor("blue"), 4, Qt::PenStyle::SolidLine,QColor("lightblue")));
plot->addGraph(new JKQTPGeoChord(plot,2.5,2.5,0.9,0.9, 0, 90));
```

View File

@ -85,45 +85,57 @@ int main(int argc, char* argv[])
// 3.2 some lines elements (single lines)
plot->addGraph(new JKQTPGeoText(plot, 1.1,0.95, "\\textbf{Lines:}", 14, QColor("red")));
plot->addGraph(new JKQTPGeoLine(plot, 1, 0.05, 1.9, 0.9, QColor("red"), 2));
plot->addGraph(new JKQTPGeoLine(plot, 1, 0.1, 1.9, 0.8, QColor("blue"), 1, Qt::PenStyle::DashLine));
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(plot, 1.7, 0.2, 0.2, 0.25, QColor("green"), 1.5, Qt::PenStyle::DashLine);
JKQTPGeoLine* l;
plot->addGraph(l=new JKQTPGeoLine(plot, 1, 0.05, 1.9, 0.9)); l->setStyle(QColor("red"), 2);
plot->addGraph(l=new JKQTPGeoLine(plot, 1, 0.1, 1.9, 0.8)); l->setStyle(QColor("blue"), 1, Qt::PenStyle::DashLine);
JKQTPGeoInfiniteLine* infLine=new JKQTPGeoInfiniteLine(plot, 1.7, 0.2, 0.2, 0.25);
infLine->setStyle(QColor("green"), 1.5, Qt::PenStyle::DashLine);
infLine->setTwoSided(false);
infLine->setAlpha(0.5);
plot->addGraph(infLine);
infLine=new JKQTPGeoInfiniteLine(plot, 1.7, 0.2, 0.2, -0.15, QColor("blue"), 1.5, Qt::PenStyle::SolidLine);
infLine=new JKQTPGeoInfiniteLine(plot, 1.7, 0.2, 0.2, -0.15);
infLine->setStyle(QColor("blue"), 1.5, Qt::PenStyle::SolidLine);
infLine->setTwoSided(true);
infLine->setAlpha(0.5);
plot->addGraph(infLine);
// 3.3 some arrows
plot->addGraph(new JKQTPGeoText(plot, 0.1,2.95, "\\textbf{Arrows:}", 14, QColor("red")));
JKQTPGeoArrow* a;
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.3, 2.1, 0.1, 2.9, JKQTPTriangleDecoratorAndBar, JKQTPDiamondDecoratorAndBar)); a->setStyle(QColor("green"), 1);
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.2, 2.1, 0.2, 2.9, JKQTPNoDecorator, JKQTPFilledTriangleDecoratorAndBar)); a->setStyle(QColor("blue"), 2);
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.1, 2.1, 0.3, 2.9, JKQTPDoubleArrowAndBar, JKQTPNoDecorator)); a->setStyle(QColor("orange"), 3);
plot->addGraph(new JKQTPGeoArrow(plot, 0.3, 2.1, 0.1, 2.9, QColor("green"), JKQTPTriangleDecoratorAndBar, JKQTPDiamondDecoratorAndBar, 1));
plot->addGraph(new JKQTPGeoArrow(plot, 0.2, 2.1, 0.2, 2.9, QColor("blue"), JKQTPNoDecorator, JKQTPFilledTriangleDecoratorAndBar, 2));
plot->addGraph(new JKQTPGeoArrow(plot, 0.1, 2.1, 0.3, 2.9, QColor("orange"), JKQTPDoubleArrowAndBar, JKQTPNoDecorator, 3));
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.6, 2.1, 0.4, 2.9, JKQTPTriangleDecorator, JKQTPTriangleDecorator)); a->setStyle(QColor("green"), 0.5);
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.5, 2.1, 0.5, 2.9, JKQTPNoDecorator, JKQTPFilledArrow)); a->setStyle(QColor("blue"), 2);
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.4, 2.1, 0.6, 2.9, JKQTPFilledArrow, JKQTPNoDecorator)); a->setStyle(QColor("orange"), 1);
plot->addGraph(new JKQTPGeoArrow(plot, 0.6, 2.1, 0.4, 2.9, QColor("green"), JKQTPTriangleDecorator, JKQTPTriangleDecorator, 0.5));
plot->addGraph(new JKQTPGeoArrow(plot, 0.5, 2.1, 0.5, 2.9, QColor("blue"), JKQTPNoDecorator, JKQTPFilledArrow, 2));
plot->addGraph(new JKQTPGeoArrow(plot, 0.4, 2.1, 0.6, 2.9, QColor("orange"), JKQTPFilledArrow, JKQTPNoDecorator, 1));
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.7, 2.1, 0.7, 2.5, JKQTPArrowAndBar, JKQTPFilledArrow)); a->setStyle(QColor("green"), 0.5);
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.8, 2.1, 0.8, 2.5, JKQTPArrowAndBar, JKQTPFilledArrow)); a->setStyle(QColor("orange"), 1);
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.9, 2.1, 0.9, 2.5, JKQTPArrowAndBar, JKQTPFilledArrow)); a->setStyle(QColor("orange"), 2);
plot->addGraph(new JKQTPGeoArrow(plot, 0.7, 2.1, 0.7, 2.5, QColor("green"), JKQTPArrowAndBar, JKQTPFilledArrow, 0.5));
plot->addGraph(new JKQTPGeoArrow(plot, 0.8, 2.1, 0.8, 2.5, QColor("orange"), JKQTPArrowAndBar, JKQTPFilledArrow, 1));
plot->addGraph(new JKQTPGeoArrow(plot, 0.9, 2.1, 0.9, 2.5, QColor("orange"), JKQTPArrowAndBar, JKQTPFilledArrow, 2));
plot->addGraph(new JKQTPGeoArrow(plot, 0.7, 2.7, 0.7, 2.9, QColor("green"), JKQTPTriangleDecoratorAndBar, JKQTPFilledCircleDecorator, 0.5));
plot->addGraph(new JKQTPGeoArrow(plot, 0.8, 2.7, 0.8, 2.9, QColor("orange"), JKQTPTriangleDecoratorAndBar, JKQTPFilledCircleDecorator, 1));
plot->addGraph(new JKQTPGeoArrow(plot, 0.9, 2.7, 0.9, 2.9, QColor("orange"), JKQTPTriangleDecoratorAndBar, JKQTPFilledCircleDecorator, 2));
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.7, 2.7, 0.7, 2.9, JKQTPTriangleDecoratorAndBar, JKQTPFilledCircleDecorator)); a->setStyle(QColor("green"), 0.5);
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.8, 2.7, 0.8, 2.9, JKQTPTriangleDecoratorAndBar, JKQTPFilledCircleDecorator)); a->setStyle(QColor("orange"), 1);
plot->addGraph(a=new JKQTPGeoArrow(plot, 0.9, 2.7, 0.9, 2.9, JKQTPTriangleDecoratorAndBar, JKQTPFilledCircleDecorator)); a->setStyle(QColor("orange"), 2);
// 3.4 some rectangles (you give the center and width/height of the rectangle in the contructor)
plot->addGraph(new JKQTPGeoText(plot, 0.1,1.95, "\\textbf{Rectangles:}", 14, QColor("red")));
plot->addGraph(new JKQTPGeoRectangle(plot, 0.5,1.5,0.8,0.8, QColor("blue"), 1, Qt::SolidLine, QColor("lightblue")));
JKQTPGeoBaseFilled* geo;
JKQTPGeoRectangle* rec;
plot->addGraph(geo=new JKQTPGeoRectangle(plot, 0.5,1.5,0.8,0.8));
geo->setStyle(QColor("blue"), 1, Qt::SolidLine, QColor("lightblue"), Qt::SolidPattern);
QColor rfill("lightblue"); rfill.setAlphaF(0.5);
plot->addGraph(new JKQTPGeoRectangle(plot, QPointF(0.4,1.3), QPointF(0.9,1.6), QColor("blue"), 1, Qt::SolidLine, rfill));
plot->addGraph(new JKQTPGeoRectangle(plot, 0.5,1.5,0.8,0.5, 35, QColor("darkblue"), 2, Qt::DashLine));
plot->addGraph(new JKQTPGeoRectangle(plot, 0.5,1.5,0.6,0.6, -7, QColor("orange"), 2, Qt::DotLine, QColor("salmon"), Qt::FDiagPattern));
plot->addGraph(geo=new JKQTPGeoRectangle(plot, QPointF(0.4,1.3), QPointF(0.9,1.6)));
geo->setStyle(QColor("blue"), 1, Qt::SolidLine, rfill, Qt::SolidPattern);
plot->addGraph(rec=new JKQTPGeoRectangle(plot, 0.5,1.5,0.8,0.5));
rec->setStyle(QColor("darkblue"), 2, Qt::DashLine);
rec->setAngle(35);
plot->addGraph(rec=new JKQTPGeoRectangle(plot, 0.5,1.5,0.6,0.6));
rec->setStyle(QColor("orange"), 2, Qt::DotLine, QColor("salmon"), Qt::FDiagPattern);
rec->setAngle(-7);
plot->addGraph(new JKQTPGeoSymbol(plot, 0.5,1.5, JKQTPCircle, 5, QColor("grey")));
plot->addGraph(new JKQTPGeoSymbol(plot, 0.4,1.3, JKQTPCircle, 5, QColor("grey")));
plot->addGraph(new JKQTPGeoSymbol(plot, 0.9,1.6, JKQTPCircle, 5, QColor("grey")));
@ -132,21 +144,33 @@ int main(int argc, char* argv[])
// 3.5 some circles and elllipses
plot->addGraph(new JKQTPGeoText(plot, 1.1,1.95, "\\textbf{Circles/Ellipses:}", 14, QColor("red")));
QColor col=QColor("blue"); col.setAlphaF(0.2);
plot->addGraph(new JKQTPGeoRectangle(plot, 1.5,1.5,0.8,0.8, col, 0.5, Qt::SolidLine));
plot->addGraph(geo=new JKQTPGeoRectangle(plot, 1.5,1.5,0.8,0.8));
geo->setStyleTransparentFill(col, 0.5, Qt::SolidLine);
col.setAlphaF(1);
plot->addGraph(new JKQTPGeoEllipse(plot, 1.5,1.5,0.8,0.8, col, 1, Qt::SolidLine, QColor("lightblue")));
plot->addGraph(geo=new JKQTPGeoEllipse(plot, 1.5,1.5,0.8,0.8));
geo->setStyle(col, 1, Qt::SolidLine, QColor("lightblue"), Qt::SolidPattern);
col=QColor("blue"); col.setAlphaF(0.2);
plot->addGraph(new JKQTPGeoRectangle(plot, QPointF(1.4,1.3), QPointF(1.9,1.6),col, 0.5, Qt::SolidLine));
plot->addGraph(geo=new JKQTPGeoRectangle(plot, QPointF(1.4,1.3), QPointF(1.9,1.6)));
geo->setStyleTransparentFill(col, 0.5, Qt::SolidLine);
col.setAlphaF(1);
plot->addGraph(new JKQTPGeoEllipse(plot, QPointF(1.4,1.3), QPointF(1.9,1.6), col, 1, Qt::SolidLine, rfill));
plot->addGraph(geo=new JKQTPGeoEllipse(plot, QPointF(1.4,1.3), QPointF(1.9,1.6)));
geo->setStyle(col, 1, Qt::SolidLine, rfill, Qt::SolidPattern);
col=QColor("darkblue"); col.setAlphaF(0.2);
plot->addGraph(new JKQTPGeoRectangle(plot, 1.5,1.5,0.8,0.5, 35, col, 0.5, Qt::DashLine));
plot->addGraph(rec=new JKQTPGeoRectangle(plot, 1.5,1.5,0.8,0.5));
rec->setStyleTransparentFill(col, 0.5, Qt::DashLine);
rec->setAngle(35);
col.setAlphaF(1);
plot->addGraph(new JKQTPGeoEllipse(plot, 1.5,1.5,0.8,0.5, 35, col, 2, Qt::DashLine));
plot->addGraph(rec=new JKQTPGeoEllipse(plot, 1.5,1.5,0.8,0.5));
rec->setStyleTransparentFill(col, 2, Qt::DashLine);
rec->setAngle(35);
col=QColor("orange"); col.setAlphaF(0.2);
plot->addGraph(new JKQTPGeoRectangle(plot, 1.5,1.5,0.6,0.6, -7, col, 0.5, Qt::DotLine));
plot->addGraph(rec=new JKQTPGeoRectangle(plot, 1.5,1.5,0.6,0.6));
rec->setStyleTransparentFill(col, 0.5, Qt::DotLine);
rec->setAngle(-7);
col.setAlphaF(1);
plot->addGraph(new JKQTPGeoEllipse(plot, 1.5,1.5,0.6,0.6, -7, col, 2, Qt::DotLine, QColor("salmon"), Qt::FDiagPattern));
plot->addGraph(rec=new JKQTPGeoEllipse(plot, 1.5,1.5,0.6,0.6));
rec->setStyle(col, 2, Qt::DotLine, QColor("salmon"), Qt::FDiagPattern);
rec->setAngle(-7);
plot->addGraph(new JKQTPGeoSymbol(plot, 1.5,1.5, JKQTPCircle, 5, QColor("grey")));
plot->addGraph(new JKQTPGeoSymbol(plot, 1.4,1.3, JKQTPCircle, 5, QColor("grey")));
plot->addGraph(new JKQTPGeoSymbol(plot, 1.9,1.6, JKQTPCircle, 5, QColor("grey")));
@ -156,10 +180,12 @@ int main(int argc, char* argv[])
plot->addGraph(new JKQTPGeoText(plot, 2.1,0.95, "\\textbf{PolyLines/Polygons:}", 14, QColor("red")));
QVector<QPointF> polygon;
polygon<<QPointF(2, 0.1)<<QPointF(2.3, 0.9)<<QPointF(2.6, 0.3)<<QPointF(2, 0.8);
JKQTPGeoPolygon* polygraph=new JKQTPGeoPolygon(plot, polygon, QColor("blue"), 2, Qt::PenStyle::DashLine, QColor("lightblue"));
JKQTPGeoPolygon* polygraph=new JKQTPGeoPolygon(plot, polygon);
polygraph->setStyle(QColor("blue"), 2, Qt::PenStyle::DashLine, QColor("lightblue"), Qt::SolidPattern);
polygraph->setAlpha(0.75);
plot->addGraph(polygraph);
polygraph=new JKQTPGeoPolygon(plot, QColor("red"), 2, Qt::PenStyle::DashLine, QColor("salmon"));
polygraph=new JKQTPGeoPolygon(plot);
polygraph->setStyle(QColor("red"), 2, Qt::PenStyle::DashLine, QColor("salmon"), Qt::SolidPattern);
polygraph->appendPoint(2.1, 0.5);
polygraph->appendPoint(2.9, 0.9);
polygraph->appendPoint(2.2, 0.8);
@ -172,45 +198,59 @@ int main(int argc, char* argv[])
// 3.7 a poly-line element
QVector<QPointF> p;
p<<QPointF(2.1, 0.0)<<QPointF(2.2, 0.92)<<QPointF(2.6, 0.3)<<QPointF(2.9, 0.9);
plot->addGraph(new JKQTPGeoPolyLines(plot, p, QColor("darkgreen"), 4, Qt::PenStyle::DashDotLine));
JKQTPGeoPolyLines* poly;
plot->addGraph(poly=new JKQTPGeoPolyLines(plot, p));
poly->setStyle(QColor("darkgreen"), 4, Qt::PenStyle::DashDotLine);
// 3.8 some arcs
plot->addGraph(new JKQTPGeoText(plot, 2.1,1.95, "\\textbf{Arcs:}", 14, QColor("red")));
plot->addGraph(new JKQTPGeoRectangle(plot, 2.5,1.5,0.9,0.9, QColor("lightgrey"), 0.5, Qt::SolidLine));
plot->addGraph(new JKQTPGeoArc(plot,2.5,1.5,0.9,0.9, 0, 90 , QColor("blue"), 4, Qt::PenStyle::SolidLine));
plot->addGraph(new JKQTPGeoArc(plot,2.5,1.5,0.8,0.8, 90,180 , QColor("red"), 4, Qt::PenStyle::SolidLine));
plot->addGraph(new JKQTPGeoArc(plot,2.5,1.5,0.7,0.7, 180,270 , QColor("darkblue"), 4, Qt::PenStyle::SolidLine));
plot->addGraph(new JKQTPGeoArc(plot,2.5,1.5,0.6,0.6, 270,360 , QColor("maroon"), 4, Qt::PenStyle::DashDotLine));
plot->addGraph(new JKQTPGeoArc(plot,2.5,1.5,0.5,0.5, -10, 117 , QColor("orange"), 4, Qt::PenStyle::DashLine));
plot->addGraph(new JKQTPGeoArc(plot,2.5,1.5,0.4,0.4, 85, 347 , QColor("darkgreen"), 4, Qt::PenStyle::SolidLine));
plot->addGraph(rec=new JKQTPGeoRectangle(plot, 2.5,1.5,0.9,0.9));
rec->setStyleTransparentFill(QColor("lightgrey"), 0.5, Qt::SolidLine);
JKQTPGeoArc* arc;
plot->addGraph(arc=new JKQTPGeoArc(plot,2.5,1.5,0.9,0.9, 0, 90)); arc->setStyle(QColor("blue"), 4, Qt::PenStyle::SolidLine);
plot->addGraph(arc=new JKQTPGeoArc(plot,2.5,1.5,0.8,0.8, 90,180)); arc->setStyle(QColor("red"), 4, Qt::PenStyle::SolidLine);
plot->addGraph(arc=new JKQTPGeoArc(plot,2.5,1.5,0.7,0.7, 180,270)); arc->setStyle( QColor("darkblue"), 4, Qt::PenStyle::SolidLine);
plot->addGraph(arc=new JKQTPGeoArc(plot,2.5,1.5,0.6,0.6, 270,360)); arc->setStyle(QColor("maroon"), 4, Qt::PenStyle::DashDotLine);
plot->addGraph(arc=new JKQTPGeoArc(plot,2.5,1.5,0.5,0.5, -10, 117)); arc->setStyle(QColor("orange"), 4, Qt::PenStyle::DashLine);
plot->addGraph(arc=new JKQTPGeoArc(plot,2.5,1.5,0.4,0.4, 85, 347)); arc->setStyle(QColor("darkgreen"), 4, Qt::PenStyle::SolidLine);
plot->addGraph(new JKQTPGeoSymbol(plot, 2.5,1.5, JKQTPCircle, 5, QColor("grey")));
// 3.9 some pies
plot->addGraph(new JKQTPGeoText(plot, 2.1,2.95, "\\textbf{Pies:}", 14, QColor("red")));
plot->addGraph(new JKQTPGeoRectangle(plot, 2.5,2.5,0.9,0.9, QColor("lightgrey"), 0.5, Qt::SolidLine));
plot->addGraph(rec=new JKQTPGeoRectangle(plot, 2.5,2.5,0.9,0.9));
rec->setStyleTransparentFill(QColor("lightgrey"), 0.5, Qt::SolidLine);
JKQTPGeoPie* pie;
plot->addGraph(pie=new JKQTPGeoPie(plot,2.5,2.5,0.9,0.9, 0, 90 , QColor("blue"), 4, Qt::PenStyle::SolidLine,QColor("lightblue")));
plot->addGraph(pie=new JKQTPGeoPie(plot,2.5,2.5,0.7,0.7, 180,270 , QColor("darkblue"), 4, Qt::PenStyle::SolidLine,QColor("blue")));
plot->addGraph(pie=new JKQTPGeoPie(plot,2.5,2.5,0.9,0.9, 0, 90));
pie->setStyle(QColor("blue"), 4, Qt::PenStyle::SolidLine,QColor("lightblue"), Qt::SolidPattern);
plot->addGraph(pie=new JKQTPGeoPie(plot,2.5,2.5,0.7,0.7, 180,270 ));
pie->setStyle(QColor("darkblue"), 4, Qt::PenStyle::SolidLine,QColor("blue"), Qt::SolidPattern);
pie->setAlpha(0.5);
plot->addGraph(pie=new JKQTPGeoPie(plot,2.5,2.5,0.5,0.3, -25, 117 , QColor("orange"), 4, Qt::PenStyle::DashLine,QColor("red")));
plot->addGraph(pie=new JKQTPGeoPie(plot,2.5,2.5,0.5,0.3, -25, 117));
pie->setStyle(QColor("orange"), 4, Qt::PenStyle::DashLine,QColor("red"), Qt::SolidPattern);
pie->setAlpha(0.5);
plot->addGraph(pie=new JKQTPGeoPie(plot,2.5,2.5,0.25,0.8, 85, 347 , QColor("darkgreen"), 4, Qt::PenStyle::SolidLine,QColor("green")));
plot->addGraph(pie=new JKQTPGeoPie(plot,2.5,2.5,0.25,0.8, 85, 347));
pie->setStyle(QColor("darkgreen"), 4, Qt::PenStyle::SolidLine,QColor("green"), Qt::SolidPattern);
pie->setAlpha(0.5);
plot->addGraph(new JKQTPGeoSymbol(plot, 2.5,2.5, JKQTPCircle, 5, QColor("grey")));
// 3.10 some chords
plot->addGraph(new JKQTPGeoText(plot, 1.1,2.95, "\\textbf{Chords:}", 14, QColor("red")));
plot->addGraph(new JKQTPGeoRectangle(plot, 1.5,2.5,0.9,0.9, QColor("lightgrey"), 0.5, Qt::SolidLine));
plot->addGraph(rec=new JKQTPGeoRectangle(plot, 1.5,2.5,0.9,0.9));
rec->setStyleTransparentFill(QColor("lightgrey"), 0.5, Qt::SolidLine);
JKQTPGeoChord* chord;
plot->addGraph(chord=new JKQTPGeoChord(plot,1.5,2.5,0.9,0.9, 0, 90 , QColor("blue"), 4, Qt::PenStyle::SolidLine,QColor("lightblue")));
plot->addGraph(chord=new JKQTPGeoChord(plot,1.5,2.5,0.7,0.7, 180,270 , QColor("darkblue"), 4, Qt::PenStyle::SolidLine,QColor("blue")));
plot->addGraph(chord=new JKQTPGeoChord(plot,1.5,2.5,0.9,0.9, 0, 90));
chord->setStyle(QColor("blue"), 4, Qt::PenStyle::SolidLine,QColor("lightblue"), Qt::SolidPattern);
plot->addGraph(chord=new JKQTPGeoChord(plot,1.5,2.5,0.7,0.7, 180,270));
chord->setStyle(QColor("darkblue"), 4, Qt::PenStyle::SolidLine,QColor("blue"), Qt::SolidPattern);
chord->setAlpha(0.5);
plot->addGraph(chord=new JKQTPGeoChord(plot,1.5,2.5,0.5,0.3, -25, 117 , QColor("orange"), 4, Qt::PenStyle::DashLine,QColor("red")));
plot->addGraph(chord=new JKQTPGeoChord(plot,1.5,2.5,0.5,0.3, -25, 117));
chord->setStyle(QColor("orange"), 4, Qt::PenStyle::DashLine,QColor("red"), Qt::SolidPattern);
chord->setAlpha(0.5);
plot->addGraph(chord=new JKQTPGeoChord(plot,1.5,2.5,0.25,0.8, 85, 347 , QColor("darkgreen"), 4, Qt::PenStyle::SolidLine,QColor("green")));
plot->addGraph(chord=new JKQTPGeoChord(plot,1.5,2.5,0.25,0.8, 85, 347 ));
chord->setStyle(QColor("darkgreen"), 4, Qt::PenStyle::SolidLine,QColor("green"), Qt::SolidPattern);
chord->setAlpha(0.5);
plot->addGraph(new JKQTPGeoSymbol(plot, 1.5,2.5, JKQTPCircle, 5, QColor("grey")));

View File

@ -35,16 +35,20 @@ TestWidgetGeometry::TestWidgetGeometry(QWidget *parent) :
// JKQTPGeoLine* line2=new JKQTPGeoLine(plotGeo->getPlotter(), 1, -5, 4, 3, QColor("blue"), 4);
//plotGeo->getPlotter()->addGraph(line2);
JKQTPGeoRectangle* rect1=new JKQTPGeoRectangle(plotGeo->getPlotter(), 1,1,2,2, QColor("blue"),2, Qt::SolidLine, QColor("lightblue"));
JKQTPGeoRectangle* rect1=new JKQTPGeoRectangle(plotGeo->getPlotter(), 1,1,2,2);
rect1->setStyle(QColor("blue"),2, Qt::SolidLine, QColor("lightblue"), Qt::SolidPattern);
rect1->setAngle(30);
//plotGeo->getPlotter()->addGraph(rect1);
JKQTPGeoRectangle* rect2=new JKQTPGeoRectangle(plotGeo->getPlotter(), 1,1,2,2, QColor("red"),2);
JKQTPGeoRectangle* rect2=new JKQTPGeoRectangle(plotGeo->getPlotter(), 1,1,2,2);
rect2->setStyleTransparentFill(QColor("red"),2);
rect2->setAngle(45);
//plotGeo->getPlotter()->addGraph(rect2);
JKQTPGeoRectangle* rect3=new JKQTPGeoRectangle(plotGeo->getPlotter(), 1,1,2,4, QColor("green"),2);
JKQTPGeoRectangle* rect3=new JKQTPGeoRectangle(plotGeo->getPlotter(), 1,1,2,4);
rect3->setStyleTransparentFill(QColor("green"),2);
rect3->setAngle(-30);
//plotGeo->getPlotter()->addGraph(rect3);
JKQTPGeoEllipse* ell3=new JKQTPGeoEllipse(plotGeo->getPlotter(), 1,1,2,4, QColor("green"),2, Qt::SolidLine, QColor("lightgreen"), Qt::CrossPattern);
JKQTPGeoEllipse* ell3=new JKQTPGeoEllipse(plotGeo->getPlotter(), 1,1,2,4);
ell3->setStyle(QColor("green"),2, Qt::SolidLine, QColor("lightgreen"), Qt::CrossPattern);
ell3->setAngle(-30);
//plotGeo->getPlotter()->addGraph(ell3);
@ -55,27 +59,21 @@ TestWidgetGeometry::TestWidgetGeometry(QWidget *parent) :
p.append(QPointF(0,-2));
p.append(QPointF(JKQTPSTATISTICS_PI,5.5));
// JKQTPGeoPolygon* poly=new JKQTPGeoPolygon(plotGeo->getPlotter(), p, QColor("black"), 1.5, Qt::SolidLine, QColor(128,128,0,128));
//plotGeo->getPlotter()->addGraph(poly);
// JKQTPGeoPolyLines* lines=new JKQTPGeoPolyLines(plotGeo->getPlotter(), p, QColor(255,255,0), 3);
//plotGeo->getPlotter()->addGraph(lines);
JKQTPGeoEllipse* ell1=new JKQTPGeoEllipse(plotGeo->getPlotter(), 0,0,2,4, QColor("black"),1.5, Qt::DotLine);
JKQTPGeoEllipse* ell1=new JKQTPGeoEllipse(plotGeo->getPlotter(), 0,0,2,4);
ell1->setStyleTransparentFill(QColor("black"),1.5, Qt::DotLine);
plotGeo->getPlotter()->addGraph(ell1);
// JKQTPGeoArc* arc=new JKQTPGeoArc(plotGeo->getPlotter(), 0,0,2,4,0, 135, QColor("blue"),3, Qt::SolidLine);
//plotGeo->getPlotter()->addGraph(arc);
// JKQTPGeoPie* pie=new JKQTPGeoPie(plotGeo->getPlotter(), 0,0,2,4,35, 98, QColor("blue"),3, Qt::SolidLine, QColor(0,0,255,127));
//plotGeo->getPlotter()->addGraph(pie);
// JKQTPGeoChord* chord=new JKQTPGeoChord(plotGeo->getPlotter(), 0,0,2,4,35, 98, QColor("blue"),3, Qt::SolidLine, QColor(0,0,255,127));
//plotGeo->getPlotter()->addGraph(chord);
JKQTPGeoInfiniteLine* iline=new JKQTPGeoInfiniteLine(plotGeo->getPlotter(), 0.5,1,1,1, QColor("blue"), 3);
JKQTPGeoInfiniteLine* iline=new JKQTPGeoInfiniteLine(plotGeo->getPlotter(), 0.5,1,1,1);
iline->setStyle(QColor("blue"), 3);
plotGeo->getPlotter()->addGraph(iline);
JKQTPGeoInfiniteLine* iline1=new JKQTPGeoInfiniteLine(plotGeo->getPlotter(), 0.5,1,-1,0, QColor("red"), 3);
JKQTPGeoInfiniteLine* iline1=new JKQTPGeoInfiniteLine(plotGeo->getPlotter(), 0.5,1,-1,0);
iline->setStyle(QColor("red"), 3);
plotGeo->getPlotter()->addGraph(iline1);
JKQTPGeoInfiniteLine* iline2=new JKQTPGeoInfiniteLine(plotGeo->getPlotter(), 0.5,1,0,1, QColor("red"), 3);
JKQTPGeoInfiniteLine* iline2=new JKQTPGeoInfiniteLine(plotGeo->getPlotter(), 0.5,1,0,1);
iline->setStyle(QColor("red"), 3);
plotGeo->getPlotter()->addGraph(iline2);
JKQTPGeoInfiniteLine* iline3=new JKQTPGeoInfiniteLine(plotGeo->getPlotter(), 0.5,1,-1,0.5, QColor("green"), 3);
JKQTPGeoInfiniteLine* iline3=new JKQTPGeoInfiniteLine(plotGeo->getPlotter(), 0.5,1,-1,0.5);
iline->setStyle(QColor("green"), 3);
iline3->setTwoSided(true);
plotGeo->getPlotter()->addGraph(iline3);

View File

@ -5,6 +5,11 @@
#include "jkqtplotter/graphs/jkqtpbarchart.h"
#include "jkqtplotter/graphs/jkqtpimage.h"
#include "jkqtplotter/graphs/jkqtpgeometric.h"
#include "jkqtplotter/graphs/jkqtpgeoannotations.h"
#include "jkqtplotter/graphs/jkqtpboxplot.h"
#include "jkqtplotter/graphs/jkqtpfilledcurve.h"
#include "jkqtplotter/graphs/jkqtpimpulses.h"
#include <QDir>
#include <QTextStream>
#include <QFileDialog>
@ -126,23 +131,29 @@ void TestStyling::initPlot()
ds->clear();
// 2. now we create data for a simple plot (a sine curve)
QVector<double> X, Y1, Y2, img, X3, Y3, Y3err, Xbar, Ybar, Ybar2;
QVector<double> X, Y1, Y2, img, X3, Y3, Y3err, Xbar, Ybar, Ybar2, Y4, Y5, XImp, YImp;
const int Ndata=100;
for (int i=0; i<Ndata; i++) {
const double x=double(i)/double(Ndata)*8.0*JKQTPSTATISTICS_PI;
X<<x;
Y1<<1.1+sin(x);
Y2<<1.1+sin(x)*exp(-0.2*x);
Y4<<4.5*exp(-x/10.0);
Y5<<2.5*exp(-x/10.0)+1.0;
if (i%5==0) {
X3<<x;
Y3<<(1.5+Y1.last());
Y3err<<(double(i+5)/double(Ndata)*0.5);
}
if (i>0 && i%20==0) {
Xbar<<x;
Xbar<<x/2.0;
Ybar<<(double(i+5)/double(Ndata)*(-1.5));
Ybar2<<(double(i+5)/double(Ndata)*(-1.2));
}
if (i%8==0) {
XImp<<15.0+x/3.0;
YImp<<-1.0+0.5*sin(x);
}
}
auto fgauss=[](double x, double y, double x0, double y0, double sx, double sy) {
return exp(-2.0*(x-x0)*(x-x0)/sx/sx-2.0*(y-y0)*(y-y0)/sy/sy);
@ -168,8 +179,24 @@ void TestStyling::initPlot()
size_t columnXbar=ds->addCopiedColumn(Xbar, "xbar");
size_t columnYbar=ds->addCopiedColumn(Ybar, "ybar");
size_t columnYbar2=ds->addCopiedColumn(Ybar2, "Ybar2");
size_t columnY4=ds->addCopiedColumn(Y4, "y4");
size_t columnY5=ds->addCopiedColumn(Y5, "y5");
size_t columnXImp=ds->addCopiedColumn(XImp, "ximp");
size_t columnYImp=ds->addCopiedColumn(YImp, "yimp");
// 4. create diverse graphs in the plot:
JKQTPFilledCurveXGraph* graphf4=new JKQTPFilledCurveXGraph(ui->plot);
graphf4->setXColumn(columnX);
graphf4->setYColumn(columnY4);
graphf4->setTitle(QObject::tr("filled exp-function"));
ui->plot->addGraph(graphf4);
JKQTPFilledCurveXGraph* graphf5=new JKQTPFilledCurveXGraph(ui->plot);
graphf5->setXColumn(columnX);
graphf5->setYColumn(columnY5);
graphf5->setTitle(QObject::tr("other filled exp-function"));
ui->plot->addGraph(graphf5);
// 4. create a graph in the plot, which plots the dataset X/Y:
JKQTPColumnMathImage* graphI=new JKQTPColumnMathImage(ui->plot);
graphI->setImageColumn(columnImg);
graphI->setNx(Ndata);
@ -177,7 +204,7 @@ void TestStyling::initPlot()
graphI->setColorBarTopVisible(true);
graphI->setColorBarRightVisible(true);
graphI->setX(0.5);
graphI->setY(-1.5);
graphI->setY(-2.0);
graphI->setWidth(5);
graphI->setHeight(1);
graphI->setTitle(QObject::tr("2{\\times}Gauss"));
@ -218,6 +245,29 @@ void TestStyling::initPlot()
ui->plot->addGraph(graphb2);
graphb2->autoscaleBarWidthAndShiftSeparatedGroups();
JKQTPImpulsesVerticalGraph* graphi2=new JKQTPImpulsesVerticalGraph(ui->plot);
graphi2->setXColumn(columnXImp);
graphi2->setYColumn(columnYImp);
graphi2->setTitle(QObject::tr("impulses"));
ui->plot->addGraph(graphi2);
JKQTPBoxplotHorizontalElement* graphBP=new JKQTPBoxplotHorizontalElement(ui->plot);
graphBP->setData(-2, 7, 10,12,13,17,22);
ui->plot->addGraph(graphBP);
JKQTPGeoSymbol* annotSym=new JKQTPGeoSymbol(ui->plot, 15, -3);
ui->plot->addGraph(annotSym);
JKQTPGeoText* annotTxt=new JKQTPGeoText(ui->plot, 15.1, -3, "Annotation $\\int_{0}^{2\\pi}\\sin(x)\\;\\mathrm{d}x$");
ui->plot->addGraph(annotTxt);
JKQTPGeoEllipse* geoEll=new JKQTPGeoEllipse(ui->plot, 5,-3,5,1);
geoEll->setAngle(-25);
ui->plot->addGraph(geoEll);
ui->plot->addGraph(new JKQTPGeoArrow(ui->plot, 5,-3,10,-3.5));
ui->plot->addGraph(new JKQTPGeoLine(ui->plot, 5,-3,10,-4));
// 6. autoscale the plot so the graph is contained
ui->plot->zoomToFit();
@ -249,7 +299,7 @@ void TestStyling::initPlot()
double y=1;
double xmax=15;
int cnt=0;
for (auto s: ui->plot->getPlotter()->getCurrentPlotterStyle().defaultGraphSymbols) {
for (auto s: ui->plot->getPlotter()->getCurrentPlotterStyle().graphsStyle.defaultGraphSymbols) {
plotExtra->addGraph(new JKQTPGeoSymbol(plotExtra.data(), x, y, s, 12, QColor("red"), QColor("salmon") ));
x+=1;
xmax=qMax(x, xmax);
@ -261,16 +311,20 @@ void TestStyling::initPlot()
}
y=y+1;
double ycoltest=y;
for (auto s: ui->plot->getPlotter()->getCurrentPlotterStyle().defaultGraphPenStyles) {
plotExtra->addGraph(new JKQTPGeoLine(plotExtra.data(), 1,y,xlineend,y,QColor("red"), 2, s));
plotExtra->addGraph(new JKQTPGeoLine(plotExtra.data(), 1,y-0.25,xlineend,y-0.25,QColor("maroon"), 1, s));
for (auto s: ui->plot->getPlotter()->getCurrentPlotterStyle().graphsStyle.defaultGraphPenStyles) {
JKQTPGeoLine* l;
plotExtra->addGraph(l=new JKQTPGeoLine(plotExtra.data(), 1,y,xlineend,y)); l->setStyle(QColor("red"), 2, s);
plotExtra->addGraph(l=new JKQTPGeoLine(plotExtra.data(), 1,y-0.25,xlineend,y-0.25)); l->setStyle(QColor("maroon"), 1, s);
y+=0.75;
}
x=xlineend+1;
double dx=(xmax-xlineend-1.0)/static_cast<double>(ui->plot->getPlotter()->getCurrentPlotterStyle().defaultGraphColors.size());
for (auto s: ui->plot->getPlotter()->getCurrentPlotterStyle().defaultGraphColors) {
plotExtra->addGraph(new JKQTPGeoLine(plotExtra.data(), x,ycoltest,x,y-0.5,s,5));
plotExtra->addGraph(new JKQTPGeoRectangle(plotExtra.data(), x+dx/2,(ycoltest+y-0.5)/2.0, dx*0.5, y-ycoltest-0.5, s,1, Qt::SolidLine, JKQTPGetDerivedColor(ui->plot->getPlotter()->getCurrentPlotterStyle().graphFillColorDerivationMode, s)));
double dx=(xmax-xlineend-1.0)/static_cast<double>(ui->plot->getPlotter()->getCurrentPlotterStyle().graphsStyle.defaultGraphColors.size());
for (auto s: ui->plot->getPlotter()->getCurrentPlotterStyle().graphsStyle.defaultGraphColors) {
JKQTPGeoLine* l;
plotExtra->addGraph(l=new JKQTPGeoLine(plotExtra.data(), x,ycoltest,x,y-0.5)); l->setStyle(s,5);
JKQTPGeoRectangle* r;
plotExtra->addGraph(r=new JKQTPGeoRectangle(plotExtra.data(), x+dx/2,(ycoltest+y-0.5)/2.0, dx*0.5, y-ycoltest-0.5));
r->setStyle(s,1, Qt::SolidLine, JKQTPGetDerivedColor(ui->plot->getPlotter()->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.fillColorDerivationMode, s), Qt::SolidPattern);
x+=dx;
}
plotExtra->zoomToFit();

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>863</width>
<height>559</height>
<width>1068</width>
<height>691</height>
</rect>
</property>
<property name="windowTitle">
@ -218,7 +218,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>863</width>
<width>1068</width>
<height>21</height>
</rect>
</property>

View File

@ -23,6 +23,7 @@ isEmpty(JKQTP_PLOTTER_PRI_INCLUDED) {
$$PWD/jkqtplotter/jkqtpbaseplotterstyle.h \
$$PWD/jkqtplotter/jkqtpcoordinateaxes.h \
$$PWD/jkqtplotter/jkqtpcoordinateaxesstyle.h \
$$PWD/jkqtplotter/jkqtpgraphsbasestyle.h \
$$PWD/jkqtplotter/jkqtpimagetools.h \
$$PWD/jkqtplotter/graphs/jkqtpboxplot.h \
$$PWD/jkqtplotter/graphs/jkqtpboxplotbase.h \
@ -75,6 +76,7 @@ isEmpty(JKQTP_PLOTTER_PRI_INCLUDED) {
$$PWD/jkqtplotter/jkqtpbaseplotterstyle.cpp \
$$PWD/jkqtplotter/jkqtpcoordinateaxes.cpp \
$$PWD/jkqtplotter/jkqtpcoordinateaxesstyle.cpp \
$$PWD/jkqtplotter/jkqtpgraphsbasestyle.cpp \
$$PWD/jkqtplotter/graphs/jkqtpboxplot.cpp \
$$PWD/jkqtplotter/graphs/jkqtpboxplotbase.cpp \
$$PWD/jkqtplotter/graphs/jkqtpboxplotstylingmixins.cpp \

View File

@ -35,6 +35,7 @@ set(SOURCES
jkqtpcoordinateaxes.cpp
jkqtpcoordinateaxesstyle.cpp
jkqtpimagetools.cpp
jkqtpgraphsbasestyle.cpp
)
set(SOURCES_GRAPHS
graphs/jkqtpscatter.cpp
@ -90,6 +91,7 @@ set(HEADERS
jkqtpcoordinateaxes.h
jkqtpcoordinateaxesstyle.h
jkqtpimagetools.h
jkqtpgraphsbasestyle.h
jkqtplotter_imexport.h
)
set(HEADERS_GRAPHS

View File

@ -320,7 +320,7 @@ JKQTPBarHorizontalErrorGraph::JKQTPBarHorizontalErrorGraph(JKQTBasePlotter *pare
JKQTPBarHorizontalGraph(parent)
{
setErrorColorFromGraphColor(getKeyLabelColor());
initErrorStyle(parent, parentPlotStyle);
initErrorStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart);
}
JKQTPBarHorizontalErrorGraph::JKQTPBarHorizontalErrorGraph(JKQTPlotter *parent):
@ -414,7 +414,7 @@ JKQTPBarVerticalErrorGraph::JKQTPBarVerticalErrorGraph(JKQTBasePlotter *parent):
JKQTPBarVerticalGraph(parent)
{
setErrorColorFromGraphColor(getKeyLabelColor());
initErrorStyle(parent, parentPlotStyle);
initErrorStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart);
}

View File

@ -39,8 +39,8 @@
JKQTPBarGraphBase::JKQTPBarGraphBase(JKQTBasePlotter* parent):
JKQTPXYBaselineGraph(parent), width(0.9), shift(0)
{
initFillStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle);
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart);
}
@ -109,7 +109,7 @@ void JKQTPBarGraphBase::autoscaleBarWidthAndShiftSeparatedGroups(double groupWid
void JKQTPBarGraphBase::setColor(QColor c)
{
setLineColor(c);
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.barchartStyle.fillColorDerivationMode, c));
c.setAlphaF(0.5);
setHighlightingLineColor(c);
}

View File

@ -381,6 +381,20 @@ void JKQTPBoxplotElementBase::setPercentile75(double __value)
this->percentile75 = __value;
}
void JKQTPBoxplotElementBase::setData(double pos, double min, double q75, double median, double mean, double q25, double max)
{
this->pos=pos;
this->min=min;
this->max=max;
drawMinMax=true;
this->median=median;
drawMedian=true;
this->mean=mean;
drawMean=true;
this->percentile25=q25;
this->percentile75=q75;
}
double JKQTPBoxplotElementBase::getPercentile75() const
{
return this->percentile75;

View File

@ -246,6 +246,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPBoxplotElementBase: public JKQTPPlotElement, p
void setPercentile25(double __value);
/** \copydoc percentile75 */
void setPercentile75(double __value);
/** \brief set all properties of the plot at once \see pos, median, min, mean, max, percentile25, percentile75 */
void setData(double pos, double min, double q75, double median, double mean, double q25, double max);
/** \copydoc drawMedian */
void setDrawMedian(bool __value);
/** \copydoc drawMinMax */
@ -254,6 +257,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPBoxplotElementBase: public JKQTPPlotElement, p
void setDrawNotch(bool __value);
/** \copydoc medianConfidenceIntervalWidth */
void setMedianConfidenceIntervalWidth(double __value);
protected:
/** \brief the position of the boxplot on the "other" axis */

View File

@ -61,23 +61,25 @@ void JKQTPGraphBoxplotStyleMixin::initBoxplotStyle(JKQTBasePlotter *parent, int
{
setFillStyle(Qt::SolidPattern);
setFillColor(parent->getCurrentPlotterStyle().plotBackgroundBrush.color());
initLineStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Boxplot);
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Boxplot);
if (parent) { // get style settings from parent object
if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle();
m_whiskerLinePen.setColor(parent->getPlotStyle(parentPlotStyle).color());
m_whiskerLinePen.setStyle(parent->getPlotStyle(parentPlotStyle).style());
whiskerLineWidth=parent->getPlotStyle(parentPlotStyle).widthF();
m_whiskerCapLinePen.setColor(parent->getPlotStyle(parentPlotStyle).color());
m_whiskerCapLinePen.setStyle(parent->getPlotStyle(parentPlotStyle).style());
whiskerCapLineWidth=parent->getPlotStyle(parentPlotStyle).widthF();
m_medianLinePen.setColor(parent->getPlotStyle(parentPlotStyle).color());
m_medianLinePen.setStyle(parent->getPlotStyle(parentPlotStyle).style());
medianLineWidth=parent->getPlotStyle(parentPlotStyle).widthF();
m_meanSymbolLinePen=QPen(parent->getPlotStyle(parentPlotStyle).color(), parent->getPlotStyle(parentPlotStyle).style());
m_meanSymbolSize=parent->getPlotStyle(parentPlotStyle).symbolSize();
m_meanSymbolLineWidth=parent->getPlotStyle(parentPlotStyle).symbolLineWidthF();
m_meanSymbolType=parent->getPlotStyle(parentPlotStyle).symbol();
m_meanSymbolFillColor=parent->getPlotStyle(parentPlotStyle).symbolFillColor();
const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle, JKQTPPlotStyleType::Boxplot);
m_whiskerLinePen.setColor(pen.color());
m_whiskerLinePen.setStyle(pen.style());
whiskerLineWidth=pen.widthF();
m_whiskerCapLinePen.setColor(pen.color());
m_whiskerCapLinePen.setStyle(pen.style());
whiskerCapLineWidth=pen.widthF();
m_medianLinePen.setColor(pen.color());
m_medianLinePen.setStyle(pen.style());
medianLineWidth=pen.widthF();
m_meanSymbolLinePen=QPen(pen.color(), pen.style());
m_meanSymbolSize=pen.symbolSize();
m_meanSymbolLineWidth=pen.symbolLineWidthF();
m_meanSymbolType=pen.symbol();
m_meanSymbolFillColor=pen.symbolFillColor();
}
setWhiskerLineColor(getLineColor());
@ -103,9 +105,9 @@ double JKQTPGraphBoxplotStyleMixin::getBoxWidthAbsolute() const
void JKQTPGraphBoxplotStyleMixin::setBoxplotColor(QColor c, JKQTBasePlotter *parent)
{
setLineColor(c);
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.barchartStyle.fillColorDerivationMode, c));
setMeanColor(c);
setMeanFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setMeanFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.barchartStyle.symbolFillColorDerivationMode, c));
setWhiskerLineColor(getLineColor());
setWhiskerCapLineColor(getLineColor());
setMedianLineColor(getLineColor());

View File

@ -40,7 +40,7 @@ JKQTPContourPlot::JKQTPContourPlot(JKQTBasePlotter *parent) :
contourColoringMode=ColorContoursFromPaletteByValue;
relativeLevels=false;
initLineStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
}

View File

@ -36,24 +36,25 @@ JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase::JKQTPEvaluatedFunctionWithErro
drawErrorPolygons(false),
drawErrorLines(false)
{
initLineStyle(parent, parentPlotStyle);
initFillStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
setFillCurve(false);
errorColor=getLineColor().lighter();
errorFillColor=getLineColor().lighter();
errorColor=JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.errorColorDerivationMode, getLineColor());
errorFillColor=JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.errorFillColorDerivationMode, errorColor);
errorStyle=Qt::SolidLine;
errorLineWidth=1;
errorLineWidth=parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.defaultErrorIndicatorWidth;
errorFillStyle=Qt::SolidPattern;
if (parent && parentPlotStyle>=0) { // get style settings from parent object
//std::cout<<"got style settings from parent: "<<parentPlotStyle<<std::endl;
errorColor=parent->getPlotStyle(parentPlotStyle).errorColor();
errorStyle=parent->getPlotStyle(parentPlotStyle).errorStyle();
errorLineWidth=parent->getPlotStyle(parentPlotStyle).errorWidthF();
errorFillStyle=parent->getPlotStyle(parentPlotStyle).errorFillStyle();
errorFillColor=parent->getPlotStyle(parentPlotStyle).errorFillColor();
const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle);
errorColor=pen.errorColor();
errorStyle=pen.errorStyle();
errorLineWidth=pen.errorWidthF();
errorFillStyle=pen.errorFillStyle();
errorFillColor=pen.errorFillColor();
}
errorFillColor.setAlphaF(0.5);
}

View File

@ -38,7 +38,7 @@ JKQTPXYFunctionLineGraphBase::JKQTPXYFunctionLineGraphBase(double tmin_, double
tmin(tmin_),
tmax(tmax_)
{
initLineStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
setMaxRefinementDegree(8);
}

View File

@ -36,8 +36,8 @@ JKQTPFilledCurveGraphBase::JKQTPFilledCurveGraphBase(JKQTBasePlotter *parent):
JKQTPXYBaselineGraph(parent)
{
parentPlotStyle=-1;
initLineStyle(parent, parentPlotStyle);
initFillStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Filled);
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Filled);
setFillCurve(true);
setDrawLine(true);
}
@ -64,7 +64,7 @@ void JKQTPFilledCurveGraphBase::drawKeyMarker(JKQTPEnhancedPainter &painter, QRe
void JKQTPFilledCurveGraphBase::setColor(QColor c)
{
setLineColor(c);
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.filledStyle.fillColorDerivationMode, c));
c.setAlphaF(0.5);
setHighlightingLineColor(c);
}
@ -271,7 +271,7 @@ JKQTPFilledCurveXErrorGraph::JKQTPFilledCurveXErrorGraph(JKQTBasePlotter *parent
JKQTPFilledCurveXGraph(parent)
{
setErrorColorFromGraphColor(getLineColor());
initErrorStyle(parent, parentPlotStyle);
initErrorStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Filled);
}
JKQTPFilledCurveXErrorGraph::JKQTPFilledCurveXErrorGraph(JKQTPlotter *parent):
@ -296,7 +296,7 @@ JKQTPFilledCurveYErrorGraph::JKQTPFilledCurveYErrorGraph(JKQTBasePlotter *parent
JKQTPFilledCurveYGraph(parent)
{
setErrorColorFromGraphColor(getLineColor());
initErrorStyle(parent, parentPlotStyle);
initErrorStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Filled);
}
@ -323,8 +323,8 @@ void JKQTPFilledCurveYErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter)
JKQTPFilledVerticalRangeGraph::JKQTPFilledVerticalRangeGraph(JKQTBasePlotter *parent):
JKQTPXYYGraph(parent)
{
initFillStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle);
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Filled);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Filled);
}
JKQTPFilledVerticalRangeGraph::JKQTPFilledVerticalRangeGraph(JKQTPlotter *parent):
@ -438,8 +438,8 @@ QColor JKQTPFilledVerticalRangeGraph::getKeyLabelColor() const
JKQTPFilledHorizontalRangeGraph::JKQTPFilledHorizontalRangeGraph(JKQTBasePlotter *parent):
JKQTPXXYGraph(parent)
{
initFillStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle);
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Filled);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Filled);
}
JKQTPFilledHorizontalRangeGraph::JKQTPFilledHorizontalRangeGraph(JKQTPlotter *parent):

View File

@ -31,9 +31,8 @@
JKQTPGeoText::JKQTPGeoText(JKQTBasePlotter* parent, double x_, double y_, const QString& text_, double fontSize, QColor color):
JKQTPGeoText(parent, x_, y_, text_)
JKQTPGeoText(parent, x_, y_, text_, fontSize)
{
setTextFontSize(fontSize);
setTextColor(color);
}
@ -42,10 +41,21 @@ JKQTPGeoText::JKQTPGeoText(JKQTPlotter* parent, double x, double y, const QStrin
{
}
JKQTPGeoText::JKQTPGeoText(JKQTBasePlotter* parent, double x_, double y_, const QString& text_, double fontSize):
JKQTPGeoText(parent, x_, y_, text_)
{
setTextFontSize(fontSize);
}
JKQTPGeoText::JKQTPGeoText(JKQTPlotter* parent, double x, double y, const QString& text, double fontSize):
JKQTPGeoText(parent->getPlotter(),x,y,text,fontSize)
{
}
JKQTPGeoText::JKQTPGeoText(JKQTBasePlotter *parent, double x_, double y_, const QString& text_):
JKQTPPlotAnnotationElement(parent), JKQTPGraphTextStyleMixin(parent), x(x_),y(y_),text(text_)
{
initTextStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Annotation);
}
JKQTPGeoText::JKQTPGeoText(JKQTPlotter *parent, double x, double y, const QString &text):
@ -78,6 +88,17 @@ void JKQTPGeoText::setY(double __value)
this->y = __value;
}
void JKQTPGeoText::setP(const QPointF &p)
{
x=p.x();
y=p.y();
}
QPointF JKQTPGeoText::getP() const
{
return QPointF(x,y);
}
double JKQTPGeoText::getY() const
{
return this->y;
@ -131,27 +152,74 @@ QColor JKQTPGeoText::getKeyLabelColor() const {
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTBasePlotter *parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize, QColor color, QColor fillColor):
JKQTPPlotAnnotationElement(parent)
JKQTPGeoSymbol(parent, x, y, symbol, symbolSize)
{
this->x=x;
this->y=y;
setSymbolType(symbol);
setSymbolSize(symbolSize);
setSymbolColor(color);
setSymbolFillColor(fillColor);
setSymbolLineWidth(1);
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTBasePlotter *parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize):
JKQTPGeoSymbol(parent, x, y, symbol)
{
setSymbolSize(symbolSize);
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTPlotter *parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize):
JKQTPGeoSymbol(parent->getPlotter(), x, y, symbol, symbolSize)
{
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTPlotter *parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize, QColor color, QColor fillColor):
JKQTPGeoSymbol(parent->getPlotter(), x, y, symbol, symbolSize, color, fillColor)
{
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTBasePlotter *parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize, QColor color):
JKQTPGeoSymbol(parent, x, y, symbol, symbolSize)
{
setSymbolColor(color);
if (parent) {
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.annotationStyle.symbolFillColorDerivationMode, color));
}
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTPlotter *parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize, QColor color):
JKQTPGeoSymbol(parent->getPlotter(), x, y, symbol, symbolSize, color)
{
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTBasePlotter *parent, double x, double y, JKQTPGraphSymbols symbol):
JKQTPGeoSymbol(parent, x, y)
{
setSymbolType(symbol);
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTPlotter *parent, double x, double y, JKQTPGraphSymbols symbol):
JKQTPGeoSymbol(parent->getPlotter(), x, y, symbol)
{
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTBasePlotter *parent, double x, double y):
JKQTPPlotAnnotationElement(parent)
{
this->x=x;
this->y=y;
initSymbolStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Annotation);
}
JKQTPGeoSymbol::JKQTPGeoSymbol(JKQTPlotter *parent, double x, double y):
JKQTPGeoSymbol(parent->getPlotter(), x, y)
{
}
void JKQTPGeoSymbol::setColor(QColor c)
{
setSymbolColor(c);
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.annotationStyle.fillColorDerivationMode, c));
}
void JKQTPGeoSymbol::setX(double __value)
@ -174,6 +242,17 @@ double JKQTPGeoSymbol::getY() const
return this->y;
}
void JKQTPGeoSymbol::setP(const QPointF &p)
{
x=p.x();
y=p.y();
}
QPointF JKQTPGeoSymbol::getP() const
{
return QPointF(x,y);
}
bool JKQTPGeoSymbol::getXMinMax(double &minx, double &maxx, double &smallestGreaterZero)
{
minx=x;

View File

@ -52,7 +52,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoSymbol: public JKQTPPlotAnnotationElement,
\param color color of drawing
\param fillColor fill color of the symbol (if filled)
*/
JKQTPGeoSymbol(JKQTBasePlotter* parent, double x, double y, JKQTPGraphSymbols symbol=JKQTPCross, double symbolSize=10, QColor color=QColor("black"), QColor fillColor=QColor("grey"));
JKQTPGeoSymbol(JKQTBasePlotter* parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize);
/*! \brief class contructor
\param parent parent plotter widget
@ -63,12 +63,90 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoSymbol: public JKQTPPlotAnnotationElement,
\param color color of drawing
\param fillColor fill color of the symbol (if filled)
*/
JKQTPGeoSymbol(JKQTPlotter* parent, double x, double y, JKQTPGraphSymbols symbol=JKQTPCross, double symbolSize=10, QColor color=QColor("black"), QColor fillColor=QColor("grey"));
JKQTPGeoSymbol(JKQTPlotter* parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of symbol center
\param y y-coordinate of symbol center
\param symbol symbol type
\param symbolSize size of the symbol in pt
\param color color of drawing
\param fillColor fill color of the symbol (if filled)
*/
JKQTPGeoSymbol(JKQTBasePlotter* parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize, QColor color, QColor fillColor);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of symbol center
\param y y-coordinate of symbol center
\param symbol symbol type
\param symbolSize size of the symbol in pt
\param color color of drawing
\param fillColor fill color of the symbol (if filled)
*/
JKQTPGeoSymbol(JKQTPlotter* parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize, QColor color, QColor fillColor);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of symbol center
\param y y-coordinate of symbol center
\param symbol symbol type
\param symbolSize size of the symbol in pt
\param color color of drawing
*/
JKQTPGeoSymbol(JKQTBasePlotter* parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize, QColor color);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of symbol center
\param y y-coordinate of symbol center
\param symbol symbol type
\param symbolSize size of the symbol in pt
\param color color of drawing
*/
JKQTPGeoSymbol(JKQTPlotter* parent, double x, double y, JKQTPGraphSymbols symbol, double symbolSize, QColor color);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of symbol center
\param y y-coordinate of symbol center
\param symbol symbol type
*/
JKQTPGeoSymbol(JKQTBasePlotter* parent, double x, double y, JKQTPGraphSymbols symbol);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of symbol center
\param y y-coordinate of symbol center
\param symbol symbol type
*/
JKQTPGeoSymbol(JKQTPlotter* parent, double x, double y, JKQTPGraphSymbols symbol);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of symbol center
\param y y-coordinate of symbol center
*/
JKQTPGeoSymbol(JKQTBasePlotter* parent, double x, double y);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of symbol center
\param y y-coordinate of symbol center
*/
JKQTPGeoSymbol(JKQTPlotter* parent, double x, double y);
/** \copydoc x */
double getX() const;
/** \copydoc y */
double getY() const;
/** \brief returns x and y at the same time \see x, y */
QPointF getP() const;
/** \copydoc JKQTPPlotAnnotationElement::getXMinMax() */
virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
@ -90,6 +168,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoSymbol: public JKQTPPlotAnnotationElement,
void setX(double __value);
/** \copydoc y */
void setY(double __value);
/** \brief set x and y at the same time \see x, y */
void setP(const QPointF& p);
protected:
/** \brief x-position (in plot coordinates) of the symbol (symbol center) */
@ -129,6 +209,27 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoText: public JKQTPPlotAnnotationElement, pu
\param fontSize base font size of text
*/
JKQTPGeoText(JKQTPlotter* parent, double x, double y, const QString& text, double fontSize, QColor color);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of text
\param y y-coordinate of text
\param text the text to display
\param fontSize base font size of text
*/
JKQTPGeoText(JKQTBasePlotter* parent, double x, double y, const QString& text, double fontSize);
/*! \brief class contructor
\param parent parent plotter widget
\param x x-coordinate of text
\param y y-coordinate of text
\param text the text to display
\param fontSize base font size of text
*/
JKQTPGeoText(JKQTPlotter* parent, double x, double y, const QString& text, double fontSize);
/*! \brief class contructor
\param parent parent plotter widget
@ -152,6 +253,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoText: public JKQTPPlotAnnotationElement, pu
double getX() const;
/** \copydoc y */
double getY() const;
/** \brief returns x and y at the same time \see x, y */
QPointF getP() const;
/** \copydoc JKQTPPlotAnnotationElement::getXMinMax() */
@ -176,6 +279,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoText: public JKQTPPlotAnnotationElement, pu
void setX(double __value);
/** \copydoc y */
void setY(double __value);
/** \brief set x and y at the same time \see x, y */
void setP(const QPointF& p);
protected:
/** \brief x-position (in plot coordinates) of the text (left/baseline) */

View File

@ -27,19 +27,29 @@
#include <QApplication>
#define SmallestGreaterZeroCompare_xvsgz() if ((xvsgz>10.0*DBL_MIN)&&((smallestGreaterZero<10.0*DBL_MIN) || (xvsgz<smallestGreaterZero))) smallestGreaterZero=xvsgz;
JKQTPGeoBaseLine::JKQTPGeoBaseLine(QColor color, double lineWidth, Qt::PenStyle style, JKQTBasePlotter* parent, DrawMode drawMode):
JKQTPGeoBaseLine::JKQTPGeoBaseLine(JKQTBasePlotter *parent, DrawMode drawMode):
JKQTPGeometricPlotElement(drawMode, parent)
{
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Geometric);
}
void JKQTPGeoBaseLine::setStyle(QColor color, double lineWidth)
{
setLineColor(color);
setLineWidth(lineWidth);
}
void JKQTPGeoBaseLine::setStyle(QColor color, double lineWidth, Qt::PenStyle style)
{
setLineColor(color);
setLineWidth(lineWidth);
setLineStyle(style);
}
JKQTPGeoBaseLine::JKQTPGeoBaseLine(JKQTBasePlotter *parent, DrawMode drawMode):
JKQTPGeometricPlotElement(drawMode, parent)
void JKQTPGeoBaseLine::setStyle(QColor color, Qt::PenStyle style)
{
}
setLineColor(color);
setLineStyle(style);}
void JKQTPGeoBaseLine::setAlpha(float alpha)
{
@ -67,28 +77,11 @@ QColor JKQTPGeoBaseLine::getKeyLabelColor() const {
}
JKQTPGeoBaseFilled::JKQTPGeoBaseFilled(QColor color, QColor fillColor, double lineWidth, Qt::PenStyle style, Qt::BrushStyle fillStyle, JKQTBasePlotter* parent, DrawMode drawMode):
JKQTPGeoBaseLine(color, lineWidth, style, parent, drawMode)
{
setFillColor(fillColor);
setFillStyle(fillStyle);
}
JKQTPGeoBaseFilled::JKQTPGeoBaseFilled(QColor color, QColor fillColor, double lineWidth, Qt::PenStyle style, JKQTBasePlotter* parent, DrawMode drawMode):
JKQTPGeoBaseFilled(color, fillColor, lineWidth, style, Qt::SolidPattern, parent, drawMode)
{
}
JKQTPGeoBaseFilled::JKQTPGeoBaseFilled(QColor color, QColor fillColor, double lineWidth, JKQTBasePlotter* parent, DrawMode drawMode):
JKQTPGeoBaseFilled(color, fillColor, lineWidth, Qt::SolidLine, Qt::SolidPattern, parent, drawMode)
{
}
JKQTPGeoBaseFilled::JKQTPGeoBaseFilled(QColor color, QColor fillColor, JKQTBasePlotter* parent, DrawMode drawMode):
JKQTPGeoBaseFilled(color, fillColor, 2.0, Qt::SolidLine, Qt::SolidPattern, parent, drawMode)
JKQTPGeoBaseFilled::JKQTPGeoBaseFilled(JKQTBasePlotter *parent, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoBaseLine(parent, drawMode)
{
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Geometric);
}
void JKQTPGeoBaseFilled::setAlpha(float alpha)
@ -110,7 +103,73 @@ void JKQTPGeoBaseFilled::setAlpha(float alphaLine, float alphaFill)
void JKQTPGeoBaseFilled::setColor(QColor c)
{
JKQTPGeoBaseLine::setColor(c);
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.geometricStyle.fillColorDerivationMode, c));
}
void JKQTPGeoBaseFilled::setStyle(QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle)
{
setLineColor(color);
setLineWidth(lineWidth);
setLineStyle(style);
setFillColor(fillColor);
setFillStyle(fillStyle);
}
void JKQTPGeoBaseFilled::setStyle(QColor color, double lineWidth, Qt::PenStyle style)
{
setLineColor(color);
setLineWidth(lineWidth);
setLineStyle(style);
}
void JKQTPGeoBaseFilled::setStyle(QColor color, Qt::PenStyle style)
{
setLineStyle(style);
setLineColor(color);
}
void JKQTPGeoBaseFilled::setStyle(QColor color, double lineWidth)
{
setLineColor(color);
setLineWidth(lineWidth);
}
void JKQTPGeoBaseFilled::setStyle(QColor color, QColor fillColor)
{
setLineColor(color);
setFillColor(fillColor);
}
void JKQTPGeoBaseFilled::setStyleTransparentFill(QColor color, double lineWidth, Qt::PenStyle style)
{
setLineColor(color);
setLineWidth(lineWidth);
setLineStyle(style);
setFillColor(Qt::transparent);
setFillStyle(Qt::SolidPattern);
}
void JKQTPGeoBaseFilled::setStyleTransparentFill(QColor color, Qt::PenStyle style)
{
setLineColor(color);
setLineStyle(style);
setFillColor(Qt::transparent);
setFillStyle(Qt::SolidPattern);
}
void JKQTPGeoBaseFilled::setStyleTransparentFill(QColor color, double lineWidth)
{
setLineColor(color);
setLineWidth(lineWidth);
setFillColor(Qt::transparent);
setFillStyle(Qt::SolidPattern);
}
void JKQTPGeoBaseFilled::setStyleTransparentFill(QColor color)
{
setLineColor(color);
setFillColor(Qt::transparent);
setFillStyle(Qt::SolidPattern);
}
@ -123,19 +182,37 @@ void JKQTPGeoBaseFilled::drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& re
}
JKQTPGeoBaseDecoratedHeadLine::JKQTPGeoBaseDecoratedHeadLine(QColor color, double lineWidth, JKQTPLineDecoratorStyle headStyle, Qt::PenStyle style, JKQTBasePlotter *parent, DrawMode drawMode):
JKQTPGeoBaseDecoratedHeadLine::JKQTPGeoBaseDecoratedHeadLine(JKQTPLineDecoratorStyle headStyle, JKQTBasePlotter *parent, DrawMode drawMode):
JKQTPGeometricPlotElement(drawMode, parent)
{
setLineColor(color);
setLineWidth(lineWidth);
setLineStyle(style);
int parStyleDummy=0;
initDecoratedHeadLineStyle(parent, parStyleDummy, JKQTPPlotStyleType::Geometric);
setHeadDecoratorStyle(headStyle);
}
JKQTPGeoBaseDecoratedHeadLine::JKQTPGeoBaseDecoratedHeadLine(JKQTBasePlotter *parent, DrawMode drawMode):
JKQTPGeometricPlotElement(drawMode, parent)
{
initDecoratedHeadLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Geometric);
}
void JKQTPGeoBaseDecoratedHeadLine::setStyle(QColor color, double lineWidth)
{
setLineColor(color);
setLineWidth(lineWidth);
}
void JKQTPGeoBaseDecoratedHeadLine::setStyle(QColor color, double lineWidth, Qt::PenStyle style)
{
setLineColor(color);
setLineWidth(lineWidth);
setLineStyle(style);
}
void JKQTPGeoBaseDecoratedHeadLine::setStyle(QColor color, Qt::PenStyle style)
{
setLineColor(color);
setLineStyle(style);
}
void JKQTPGeoBaseDecoratedHeadLine::setAlpha(float alpha)
@ -164,12 +241,11 @@ QColor JKQTPGeoBaseDecoratedHeadLine::getKeyLabelColor() const
}
JKQTPGeoBaseDecoratedLine::JKQTPGeoBaseDecoratedLine(QColor color, double lineWidth, JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle, Qt::PenStyle style, JKQTBasePlotter *parent, DrawMode drawMode):
JKQTPGeoBaseDecoratedLine::JKQTPGeoBaseDecoratedLine(JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle, JKQTBasePlotter *parent, DrawMode drawMode):
JKQTPGeometricPlotElement(drawMode, parent)
{
setLineColor(color);
setLineWidth(lineWidth);
setLineStyle(style);
int parStyleDummy=0;
initDecoratedLineStyle(parent, parStyleDummy, JKQTPPlotStyleType::Geometric);
setTailDecoratorStyle(tailStyle);
setHeadDecoratorStyle(headStyle);
}
@ -177,7 +253,27 @@ JKQTPGeoBaseDecoratedLine::JKQTPGeoBaseDecoratedLine(QColor color, double lineWi
JKQTPGeoBaseDecoratedLine::JKQTPGeoBaseDecoratedLine(JKQTBasePlotter *parent, DrawMode drawMode):
JKQTPGeometricPlotElement(drawMode, parent)
{
initDecoratedLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Geometric);
}
void JKQTPGeoBaseDecoratedLine::setStyle(QColor color, double lineWidth)
{
setLineColor(color);
setLineWidth(lineWidth);
}
void JKQTPGeoBaseDecoratedLine::setStyle(QColor color, double lineWidth, Qt::PenStyle style)
{
setLineColor(color);
setLineWidth(lineWidth);
setLineStyle(style);
}
void JKQTPGeoBaseDecoratedLine::setStyle(QColor color, Qt::PenStyle style)
{
setLineColor(color);
setLineStyle(style);
}
void JKQTPGeoBaseDecoratedLine::setAlpha(float alpha)

View File

@ -41,18 +41,18 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoBaseLine: public JKQTPGeometricPlotElement,
public:
/*! \brief class contructor
\param color color of drawing
\param style line style of drawing
\param lineWidth lineWidth of drawing
\param parent the parent plotter object
*/
explicit JKQTPGeoBaseLine(QColor color, double lineWidth, Qt::PenStyle style=Qt::SolidLine, JKQTBasePlotter* parent=nullptr, DrawMode drawMode=DrawAsGraphicElement);
/*! \brief class contructor
\param drawMode how to draw te element (as geometric or graphic element)
*/
explicit JKQTPGeoBaseLine(JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, Qt::PenStyle style);
@ -83,20 +83,26 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoBaseDecoratedHeadLine: public JKQTPGeometri
public:
/*! \brief class contructor
\param color color of drawing
\param lineWidth lineWidth of drawing
\param headStyle style of the head decoration
\param style line style of drawing
\param parent the parent plotter object
\param drawMode how to draw te element (as geometric or graphic element)
*/
explicit JKQTPGeoBaseDecoratedHeadLine(QColor color, double lineWidth, JKQTPLineDecoratorStyle headStyle, Qt::PenStyle style=Qt::SolidLine, JKQTBasePlotter* parent=nullptr, DrawMode drawMode=DrawAsGraphicElement);
explicit JKQTPGeoBaseDecoratedHeadLine(JKQTPLineDecoratorStyle headStyle, JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/*! \brief class contructor
\param parent the parent plotter object
\param drawMode how to draw te element (as geometric or graphic element)
*/
explicit JKQTPGeoBaseDecoratedHeadLine(JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, Qt::PenStyle style);
/** \brief sets the alpha-channel of the \a color (i.e. its transparency) */
@ -126,17 +132,26 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoBaseDecoratedLine: public JKQTPGeometricPlo
public:
/*! \brief class contructor
\param color color of drawing
\param lineWidth lineWidth of drawing
\param headStyle style of the head decoration
\param tailStyle style of the tail decoration
\param style line style of drawing
\param parent the parent plotter object
\param drawMode how to draw te element (as geometric or graphic element)
*/
explicit JKQTPGeoBaseDecoratedLine(QColor color, double lineWidth, JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle, Qt::PenStyle style=Qt::SolidLine, JKQTBasePlotter* parent=nullptr, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class contructor */
explicit JKQTPGeoBaseDecoratedLine(JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle, JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class contructor
*
* \param parent the parent plotter object
* \param drawMode how to draw te element (as geometric or graphic element)
*/
explicit JKQTPGeoBaseDecoratedLine(JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style);
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, Qt::PenStyle style);
/** \brief sets the alpha-channel of the \a color (i.e. its transparency) */
@ -164,38 +179,10 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoBaseFilled: public JKQTPGeoBaseLine, public
public:
/*! \brief class contructor
\param color color of drawing
\param fillColor color of the filling in the drawing
\param style line style of drawing
\param fillStyle filling style of the graph
\param lineWidth lineWidth of drawing
\param parent the parent plotter object
\param drawMode how to draw te element (as geometric or graphic element)
*/
JKQTPGeoBaseFilled(QColor color, QColor fillColor, double lineWidth, Qt::PenStyle style=Qt::SolidLine, Qt::BrushStyle fillStyle=Qt::SolidPattern, JKQTBasePlotter* parent=nullptr, DrawMode drawMode=DrawAsGraphicElement);
/*! \brief class contructor
\param color color of drawing
\param fillColor color of the filling in the drawing
\param style line style of drawing
\param lineWidth lineWidth of drawing
\param parent the parent plotter object
*/
JKQTPGeoBaseFilled(QColor color, QColor fillColor, double lineWidth, Qt::PenStyle style, JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/*! \brief class contructor
\param color color of drawing
\param fillColor color of the filling in the drawing
\param lineWidth lineWidth of drawing
\param parent the parent plotter object
*/
JKQTPGeoBaseFilled(QColor color, QColor fillColor, double lineWidth, JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/*! \brief class contructor
\param color color of drawing
\param fillColor color of the filling in the drawing
\param parent the parent plotter object
*/
JKQTPGeoBaseFilled(QColor color, QColor fillColor, JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoBaseFilled(JKQTBasePlotter *parent, DrawMode drawMode=DrawAsGraphicElement);
/** \brief sets the alpha-channel of the \a color and \a fillColor (i.e. its transparency) to the same value */
virtual void setAlpha(float alpha) override;
@ -203,6 +190,24 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoBaseFilled: public JKQTPGeoBaseLine, public
virtual void setAlpha(float alphaLine, float alphaFill);
/** \brief set line and fill color */
virtual void setColor(QColor c) override;
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle) ;
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth, Qt::PenStyle style) override;
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, Qt::PenStyle style) override;
/** \brief set several of the style properties with one call */
virtual void setStyle(QColor color, double lineWidth) override;
/** \brief set several of the style properties with one call */
void setStyle(QColor color, QColor fillColor);
/** \brief set several of the style properties with one call, sets fill to transparent */
void setStyleTransparentFill(QColor color, double lineWidth, Qt::PenStyle style);
/** \brief set several of the style properties with one call, sets fill to transparent */
void setStyleTransparentFill(QColor color, Qt::PenStyle style);
/** \brief set several of the style properties with one call, sets fill to transparent */
void setStyleTransparentFill(QColor color, double lineWidth);
/** \brief set several of the style properties with one call, sets fill to transparent */
void setStyleTransparentFill(QColor color);
/** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect) override;

View File

@ -33,19 +33,7 @@
JKQTPGeoLine::JKQTPGeoLine(JKQTBasePlotter* parent, double x1, double y1, double x2, double y2, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoBaseDecoratedLine(color, lineWidth, JKQTPNoDecorator, JKQTPNoDecorator, style, parent)
{
this->x1=x1;
this->y1=y1;
this->x2=x2;
this->y2=y2;
}
JKQTPGeoLine::JKQTPGeoLine(JKQTPlotter* parent, double x1, double y1, double x2, double y2, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoLine(parent->getPlotter(), x1,y1,x2,y2,color, lineWidth, style)
{
}
JKQTPGeoLine::JKQTPGeoLine(JKQTBasePlotter *parent, double x1_, double y1_, double x2_, double y2_):
JKQTPGeoBaseDecoratedLine(parent), x1(x1_), y1(y1_), x2(x2_), y2(y2_)
@ -59,17 +47,7 @@ JKQTPGeoLine::JKQTPGeoLine(JKQTPlotter *parent, double x1, double y1, double x2,
{
}
JKQTPGeoLine::JKQTPGeoLine(JKQTBasePlotter *parent, const QPointF &p1, const QPointF &p2, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoLine(parent, p1.x(), p1.y(), p2.x(), p2.y(), color, lineWidth, style)
{
}
JKQTPGeoLine::JKQTPGeoLine(JKQTPlotter *parent, const QPointF &p1, const QPointF &p2, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoLine(parent, p1.x(), p1.y(), p2.x(), p2.y(), color, lineWidth, style)
{
}
JKQTPGeoLine::JKQTPGeoLine(JKQTBasePlotter *parent, const QPointF &p1, const QPointF &p2):
JKQTPGeoLine(parent, p1.x(), p1.y(), p2.x(), p2.y())
@ -83,17 +61,6 @@ JKQTPGeoLine::JKQTPGeoLine(JKQTPlotter *parent, const QPointF &p1, const QPointF
}
JKQTPGeoLine::JKQTPGeoLine(JKQTBasePlotter *parent, const QLineF &line, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoLine(parent, line.x1(), line.y1(), line.x2(), line.y2(), color, lineWidth, style)
{
}
JKQTPGeoLine::JKQTPGeoLine(JKQTPlotter *parent, const QLineF &line, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoLine(parent, line.x1(), line.y1(), line.x2(), line.y2(), color, lineWidth, style)
{
}
JKQTPGeoLine::JKQTPGeoLine(JKQTBasePlotter *parent, const QLineF &line):
JKQTPGeoLine(parent, line.x1(), line.y1(), line.x2(), line.y2())
@ -269,23 +236,23 @@ void JKQTPGeoLine::setLine(const QLineF &line)
JKQTPGeoArrow::JKQTPGeoArrow(JKQTBasePlotter* parent, double x1, double y1, double x2, double y2, QColor color, JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle, double lineWidth, Qt::PenStyle style):
JKQTPGeoLine(parent, x1,y1,x2,y2,color, lineWidth, style)
JKQTPGeoArrow::JKQTPGeoArrow(JKQTBasePlotter* parent, double x1, double y1, double x2, double y2, JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle):
JKQTPGeoLine(parent, x1,y1,x2,y2)
{
setHeadDecoratorStyle(headStyle);
setTailDecoratorStyle(tailStyle);
}
JKQTPGeoArrow::JKQTPGeoArrow(JKQTPlotter* parent, double x1, double y1, double x2, double y2, QColor color, JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle, double lineWidth, Qt::PenStyle style):
JKQTPGeoArrow(parent->getPlotter(), x1,y1,x2,y2,color, headStyle, tailStyle, lineWidth, style)
JKQTPGeoArrow::JKQTPGeoArrow(JKQTPlotter* parent, double x1, double y1, double x2, double y2, JKQTPLineDecoratorStyle headStyle, JKQTPLineDecoratorStyle tailStyle):
JKQTPGeoArrow(parent->getPlotter(), x1,y1,x2,y2, headStyle, tailStyle)
{
}
JKQTPGeoInfiniteLine::JKQTPGeoInfiniteLine(JKQTBasePlotter* parent, double x, double y, double dx, double dy, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoBaseDecoratedHeadLine(color, lineWidth, JKQTPNoDecorator, style, parent)
JKQTPGeoInfiniteLine::JKQTPGeoInfiniteLine(JKQTBasePlotter* parent, double x, double y, double dx, double dy):
JKQTPGeoBaseDecoratedHeadLine(parent)
{
this->x=x;
this->y=y;
@ -294,8 +261,8 @@ JKQTPGeoInfiniteLine::JKQTPGeoInfiniteLine(JKQTBasePlotter* parent, double x, do
this->two_sided=false;
}
JKQTPGeoInfiniteLine::JKQTPGeoInfiniteLine(JKQTPlotter* parent, double x, double y, double dx, double dy, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoInfiniteLine(parent->getPlotter(), x, y, dx, dy, color, lineWidth, style)
JKQTPGeoInfiniteLine::JKQTPGeoInfiniteLine(JKQTPlotter* parent, double x, double y, double dx, double dy):
JKQTPGeoInfiniteLine(parent->getPlotter(), x, y, dx, dy)
{
}
@ -544,25 +511,25 @@ void JKQTPGeoInfiniteLine::setP(const QPointF &p)
JKQTPGeoPolyLines::JKQTPGeoPolyLines(JKQTBasePlotter* parent, const QVector<QPointF>& points, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoBaseDecoratedLine(color, lineWidth, JKQTPNoDecorator, JKQTPNoDecorator, style, parent)
JKQTPGeoPolyLines::JKQTPGeoPolyLines(JKQTBasePlotter* parent, const QVector<QPointF>& points):
JKQTPGeoBaseDecoratedLine(parent)
{
this->points=points;
}
JKQTPGeoPolyLines::JKQTPGeoPolyLines(JKQTPlotter* parent, const QVector<QPointF>& points, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoPolyLines(parent->getPlotter(), points, color, lineWidth, style)
JKQTPGeoPolyLines::JKQTPGeoPolyLines(JKQTPlotter* parent, const QVector<QPointF>& points):
JKQTPGeoPolyLines(parent->getPlotter(), points)
{
}
JKQTPGeoPolyLines::JKQTPGeoPolyLines(JKQTBasePlotter *parent, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoBaseDecoratedLine(color, lineWidth, JKQTPNoDecorator, JKQTPNoDecorator, style, parent)
JKQTPGeoPolyLines::JKQTPGeoPolyLines(JKQTBasePlotter *parent):
JKQTPGeoBaseDecoratedLine(parent)
{
}
JKQTPGeoPolyLines::JKQTPGeoPolyLines(JKQTPlotter *parent, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoPolyLines(parent->getPlotter(), color, lineWidth, style)
JKQTPGeoPolyLines::JKQTPGeoPolyLines(JKQTPlotter *parent):
JKQTPGeoPolyLines(parent->getPlotter())
{
}
@ -728,8 +695,8 @@ QVector<QPointF>::const_iterator JKQTPGeoPolyLines::pointsCEnd() const
}
JKQTPGeoArc::JKQTPGeoArc(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoBaseLine(color, lineWidth, style, parent)
JKQTPGeoArc::JKQTPGeoArc(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop):
JKQTPGeoBaseLine(parent)
{
this->angleStart=angleStart;
this->angleStop=angleStop;
@ -740,8 +707,8 @@ JKQTPGeoArc::JKQTPGeoArc(JKQTBasePlotter* parent, double x, double y, double wid
this->angle=0;
}
JKQTPGeoArc::JKQTPGeoArc(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, QColor color, double lineWidth, Qt::PenStyle style):
JKQTPGeoArc(parent->getPlotter(), x, y, width, height, angleStart, angleStop, color, lineWidth, style)
JKQTPGeoArc::JKQTPGeoArc(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop):
JKQTPGeoArc(parent->getPlotter(), x, y, width, height, angleStart, angleStop)
{
}

View File

@ -62,32 +62,6 @@
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoLine: public JKQTPGeoBaseDecoratedLine {
Q_OBJECT
public:
/** \brief class constructor
*
* \param parent the parent plotter object
* \param x1 x-coordinate of first point of line
* \param y1 y-coordinate of first point of line
* \param x2 x-coordinate of second point of line
* \param y2 y-coordinate of second point of line
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param parent the parent plotter object
*/
JKQTPGeoLine(JKQTBasePlotter* parent, double x1, double y1, double x2, double y2, QColor color, double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param x1 x-coordinate of first point of line
* \param y1 y-coordinate of first point of line
* \param x2 x-coordinate of second point of line
* \param y2 y-coordinate of second point of line
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param parent the parent plotter object
*/
JKQTPGeoLine(JKQTPlotter* parent, double x1, double y1, double x2, double y2, QColor color, double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -111,28 +85,6 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoLine: public JKQTPGeoBaseDecoratedLine {
/** \brief class constructor
*
* \param parent the parent plotter object
* \param p1 first point of line (tail)
* \param p2 second point of line (head)
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param parent the parent plotter object
*/
JKQTPGeoLine(JKQTBasePlotter* parent, const QPointF& p1, const QPointF& p2, QColor color, double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param p1 first point of line (tail)
* \param p2 second point of line (head)
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param parent the parent plotter object
*/
JKQTPGeoLine(JKQTPlotter* parent, const QPointF& p1, const QPointF& p2, QColor color, double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -152,26 +104,6 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoLine: public JKQTPGeoBaseDecoratedLine {
/** \brief class constructor
*
* \param parent the parent plotter object
* \param line the line
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param parent the parent plotter object
*/
JKQTPGeoLine(JKQTBasePlotter* parent, const QLineF& line, QColor color, double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param line the line
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param parent the parent plotter object
*/
JKQTPGeoLine(JKQTPlotter* parent, const QLineF& line, QColor color, double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -265,12 +197,10 @@ public:
* \param y1 y-coordinate of first point of line
* \param x2 x-coordinate of second point of line
* \param y2 y-coordinate of second point of line
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param parent the parent plotter object
* \param headStyle decorator/arrow style of the head
* \param tailStyle decorator/arrow style of the tail
*/
JKQTPGeoArrow(JKQTBasePlotter* parent, double x1, double y1, double x2, double y2, QColor color, JKQTPLineDecoratorStyle headStyle=JKQTPDefaultLineDecorator, JKQTPLineDecoratorStyle tailStyle=JKQTPNoDecorator, double lineWidth=1.0, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoArrow(JKQTBasePlotter* parent, double x1, double y1, double x2, double y2, JKQTPLineDecoratorStyle headStyle=JKQTPDefaultLineDecorator, JKQTPLineDecoratorStyle tailStyle=JKQTPNoDecorator);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -278,13 +208,42 @@ public:
* \param y1 y-coordinate of first point of line
* \param x2 x-coordinate of second point of line
* \param y2 y-coordinate of second point of line
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param parent the parent plotter object
* \param headStyle decorator/arrow style of the head
* \param tailStyle decorator/arrow style of the tail
*/
JKQTPGeoArrow(JKQTPlotter* parent, double x1, double y1, double x2, double y2, QColor color, JKQTPLineDecoratorStyle headStyle=JKQTPDefaultLineDecorator, JKQTPLineDecoratorStyle tailStyle=JKQTPNoDecorator, double lineWidth=1.0, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoArrow(JKQTPlotter* parent, double x1, double y1, double x2, double y2, JKQTPLineDecoratorStyle headStyle=JKQTPDefaultLineDecorator, JKQTPLineDecoratorStyle tailStyle=JKQTPNoDecorator);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param p1 first point of line (tail)
* \param p2 second point of line (head)
*
*/
JKQTPGeoArrow(JKQTBasePlotter* parent, const QPointF& p1, const QPointF& p2, JKQTPLineDecoratorStyle headStyle=JKQTPDefaultLineDecorator, JKQTPLineDecoratorStyle tailStyle=JKQTPNoDecorator);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param p1 first point of line (tail)
* \param p2 second point of line (head)
*/
JKQTPGeoArrow(JKQTPlotter* parent, const QPointF& p1, const QPointF& p2, JKQTPLineDecoratorStyle headStyle=JKQTPDefaultLineDecorator, JKQTPLineDecoratorStyle tailStyle=JKQTPNoDecorator);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param line the line
*
*/
JKQTPGeoArrow(JKQTBasePlotter* parent, const QLineF& line, JKQTPLineDecoratorStyle headStyle=JKQTPDefaultLineDecorator, JKQTPLineDecoratorStyle tailStyle=JKQTPNoDecorator);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param line the line
*/
JKQTPGeoArrow(JKQTPlotter* parent, const QLineF& line, JKQTPLineDecoratorStyle headStyle=JKQTPDefaultLineDecorator, JKQTPLineDecoratorStyle tailStyle=JKQTPNoDecorator);
};
@ -324,7 +283,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoInfiniteLine: public JKQTPGeoBaseDecoratedH
* \param lineWidth width of line
* \param style line style
*/
JKQTPGeoInfiniteLine(JKQTBasePlotter* parent, double x, double y, double dx, double dy, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoInfiniteLine(JKQTBasePlotter* parent, double x, double y, double dx, double dy);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -336,7 +295,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoInfiniteLine: public JKQTPGeoBaseDecoratedH
* \param lineWidth width of line
* \param style line style
*/
JKQTPGeoInfiniteLine(JKQTPlotter* parent, double x, double y, double dx, double dy, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoInfiniteLine(JKQTPlotter* parent, double x, double y, double dx, double dy);
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
@ -426,7 +385,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolyLines: public JKQTPGeoBaseDecoratedLine
* \param lineWidth width of line
* \param style line style
*/
JKQTPGeoPolyLines(JKQTBasePlotter* parent, const QVector<QPointF>& points, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoPolyLines(JKQTBasePlotter* parent, const QVector<QPointF>& points);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -435,7 +394,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolyLines: public JKQTPGeoBaseDecoratedLine
* \param lineWidth width of line
* \param style line style
*/
JKQTPGeoPolyLines(JKQTPlotter* parent, const QVector<QPointF>& points, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoPolyLines(JKQTPlotter* parent, const QVector<QPointF>& points);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -443,7 +402,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolyLines: public JKQTPGeoBaseDecoratedLine
* \param lineWidth width of line
* \param style line style
*/
JKQTPGeoPolyLines(JKQTBasePlotter* parent, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoPolyLines(JKQTBasePlotter* parent);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -451,7 +410,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolyLines: public JKQTPGeoBaseDecoratedLine
* \param lineWidth width of line
* \param style line style
*/
JKQTPGeoPolyLines(JKQTPlotter* parent, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoPolyLines(JKQTPlotter* parent);
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
@ -535,7 +494,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoArc: public JKQTPGeoBaseLine {
* \param style line style
*/
JKQTPGeoArc(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoArc(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop);
/** \brief class constructor
* \param parent the parent plotter object
@ -550,7 +509,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoArc: public JKQTPGeoBaseLine {
* \param style line style
*/
JKQTPGeoArc(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine);
JKQTPGeoArc(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop);
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;

View File

@ -32,38 +32,26 @@
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter* parent, double x, double y, double width, double height, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoBaseFilled(color, fillColor, lineWidth, style, fillStyle, parent, drawMode)
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter *parent, double x, double y, double width, double height, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoBaseFilled(parent, drawMode)
{
this->x=x;
this->y=y;
angle=0;
this->angle=0;
this->width=width;
this->height=height;
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTPlotter* parent, double x, double y, double width, double height, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoRectangle(parent->getPlotter(), x, y, width, height, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTPlotter *parent, double x, double y, double width, double height, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent->getPlotter(), x, y, width, height, drawMode)
{
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter *parent, double x, double y, double width, double height, double angle, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoBaseFilled(color, fillColor, lineWidth, style, fillStyle, parent, drawMode)
{
this->x=x;
this->y=y;
this->angle=angle;
this->width=width;
this->height=height;
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTPlotter *parent, double x, double y, double width, double height, double angle, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoRectangle(parent->getPlotter(), x, y, width, height, angle, color, lineWidth, style, fillColor, fillStyle, drawMode)
{
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter *parent, QPointF bottomleft, QPointF topright, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoBaseFilled(color, fillColor, lineWidth, style, fillStyle, parent, drawMode)
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter *parent, QPointF bottomleft, QPointF topright, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoBaseFilled(parent, drawMode)
{
this->angle=0;
this->width=fabs(topright.x()-bottomleft.x());
@ -72,34 +60,29 @@ JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter *parent, QPointF bottomleft
this->y=bottomleft.y()+this->height/2.0;
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTPlotter *parent, QPointF bottomleft, QPointF topright, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoRectangle(parent->getPlotter(), bottomleft, topright, color, lineWidth, style, fillColor, fillStyle, drawMode)
{
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter *parent, const QPointF &center, const QSizeF &size, double angle, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent, center.x(), center.y(), size.width(), size.height(), angle, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTPlotter *parent, QPointF bottomleft, QPointF topright, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent->getPlotter(), bottomleft, topright, drawMode)
{
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTPlotter *parent, const QPointF &center, const QSizeF &size, double angle, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent->getPlotter(), center, size, angle, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter *parent, const QPointF &center, const QSizeF &size, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoBaseFilled(parent, drawMode)
{
this->x=center.x();
this->y=center.y();
this->angle=0;
this->width=size.width();
this->height=size.height();
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTPlotter *parent, const QPointF &center, const QSizeF &size, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent->getPlotter(), center, size, drawMode)
{
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTBasePlotter *parent, const QPointF &center, const QSizeF &size, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent, center.x(), center.y(), size.width(), size.height(), color, lineWidth, style, fillColor, fillStyle, drawMode)
{
}
JKQTPGeoRectangle::JKQTPGeoRectangle(JKQTPlotter *parent, const QPointF &center, const QSizeF &size, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent->getPlotter(), center, size, color, lineWidth, style, fillColor, fillStyle, drawMode)
{
}
QTransform JKQTPGeoRectangle::getTransform() {
QTransform trans;
@ -259,24 +242,29 @@ QRectF JKQTPGeoRectangle::getBottomLeftRectangle() const
JKQTPGeoPolygon::JKQTPGeoPolygon(JKQTBasePlotter* parent, const QVector<QPointF>& points, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoBaseFilled(color, fillColor, lineWidth, style, fillStyle, parent, drawMode)
JKQTPGeoPolygon::JKQTPGeoPolygon(JKQTBasePlotter *parent, const QVector<QPointF> &points, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoBaseFilled(parent, drawMode)
{
this->points=points;
}
JKQTPGeoPolygon::JKQTPGeoPolygon(JKQTPlotter* parent, const QVector<QPointF>& points, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoPolygon(parent->getPlotter(), points, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoPolygon::JKQTPGeoPolygon(JKQTPlotter *parent, const QVector<QPointF> &points, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoPolygon(parent->getPlotter(), points, drawMode)
{
}
JKQTPGeoPolygon::JKQTPGeoPolygon(JKQTBasePlotter* parent, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoBaseFilled(color, fillColor, lineWidth, style, fillStyle, parent, drawMode)
JKQTPGeoPolygon::JKQTPGeoPolygon(JKQTBasePlotter *parent, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoBaseFilled(parent, drawMode)
{
}
JKQTPGeoPolygon::JKQTPGeoPolygon(JKQTPlotter* parent, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoPolygon(parent->getPlotter(), color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoPolygon::JKQTPGeoPolygon(JKQTPlotter *parent, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoPolygon(parent->getPlotter(), drawMode)
{
}
bool JKQTPGeoPolygon::getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) {
@ -412,41 +400,44 @@ QVector<QPointF>::const_iterator JKQTPGeoPolygon::pointsCEnd() const
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTBasePlotter* parent, double x, double y, double width, double height, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoRectangle(parent, x, y, width, height, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTBasePlotter *parent, double x, double y, double width, double height, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent, x, y, width, height, drawMode)
{
}
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTPlotter *parent, double x, double y, double width, double height, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoEllipse(parent->getPlotter(), x, y, width, height, drawMode)
{
}
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTPlotter* parent, double x, double y, double width, double height, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoEllipse(parent->getPlotter(), x, y, width, height, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTBasePlotter *parent, QPointF bottomleft, QPointF topright, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent, bottomleft, topright, drawMode)
{
}
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTPlotter *parent, QPointF bottomleft, QPointF topright, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoEllipse(parent->getPlotter(), bottomleft, topright, drawMode)
{
}
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTBasePlotter *parent, double x, double y, double width, double height, double angle, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoRectangle(parent, x, y, width, height, angle, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTBasePlotter *parent, const QPointF &center, const QSizeF &size, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoRectangle(parent, center, size, drawMode)
{
}
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTPlotter *parent, const QPointF &center, const QSizeF &size, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoEllipse(parent->getPlotter(), center, size, drawMode)
{
}
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTPlotter *parent, double x, double y, double width, double height, double angle, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoEllipse(parent->getPlotter(), x, y, width, height, angle, color, lineWidth, style, fillColor, fillStyle, drawMode)
{
}
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTBasePlotter *parent, QPointF bottomleft, QPointF topright, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoRectangle(parent, bottomleft, topright, color, lineWidth, style, fillColor, fillStyle, drawMode)
{
}
JKQTPGeoEllipse::JKQTPGeoEllipse(JKQTPlotter *parent, QPointF bottomleft, QPointF topright, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoEllipse(parent->getPlotter(), bottomleft, topright, color, lineWidth, style, fillColor, fillStyle, drawMode)
{
}
void JKQTPGeoEllipse::draw(JKQTPEnhancedPainter& painter) {
@ -465,16 +456,16 @@ void JKQTPGeoEllipse::drawInternal(JKQTPEnhancedPainter& painter, double angleSt
auto fTransform=std::bind([](const JKQTPGeometricPlotElement* plot, const QPointF& p) { return plot->transform(p); }, this, std::placeholders::_1);
QPolygonF rect;
if(mode==InternalDrawMode::Ellipse) {
rect=JKQTPSplitEllipseIntoPoints(fTransform, x,y,width/2.0, height/2.0,0,360, angle);
rect=JKQTPSplitEllipseIntoPoints(fTransform, x,y,width/2.0, height/2.0,0,360);
} else if (mode==InternalDrawMode::Pie) {
QPointF first, last;
rect=JKQTPSplitEllipseIntoPoints(fTransform, x,y,width/2.0, height/2.0,angleStart,angleStop, angle, nullptr, nullptr, &first, &last);
rect=JKQTPSplitEllipseIntoPoints(fTransform, x,y,width/2.0, height/2.0, angleStart, angleStop, 0, nullptr, nullptr, &first, &last);
QVector<QPointF> pie;
pie<<last<<QPointF(x,y)<<first;
rect.append(JKQTPSimplyfyLineSegemnts(JKQTPSplitPolylineIntoPoints(pie, fTransform)));
} else if (mode==InternalDrawMode::Chord) {
QPointF first, last;
rect=JKQTPSplitEllipseIntoPoints(fTransform, x,y,width/2.0, height/2.0,angleStart,angleStop, angle, nullptr, nullptr, &first, &last);
rect=JKQTPSplitEllipseIntoPoints(fTransform, x,y,width/2.0, height/2.0, angleStart, angleStop, 0, nullptr, nullptr, &first, &last);
rect.append(JKQTPSimplyfyLineSegemnts(JKQTPSplitLineIntoPoints(QLineF(last, first), fTransform)));
}
painter.drawPolygon(rect);
@ -487,21 +478,19 @@ void JKQTPGeoEllipse::drawInternal(JKQTPEnhancedPainter& painter, double angleSt
JKQTPGeoPie::JKQTPGeoPie(JKQTBasePlotter* parent, double x, double y, double width, double height,double angleStart, double angleStop, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoEllipse(parent, x, y, width, height, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoPie::JKQTPGeoPie(JKQTBasePlotter *parent, double x, double y, double width, double height, double angleStart, double angleStop, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoEllipse(parent, x, y, width, height, drawMode)
{
this->angleStart=angleStart;
this->angleStop=angleStop;
}
JKQTPGeoPie::JKQTPGeoPie(JKQTPlotter* parent, double x, double y, double width, double height,double angleStart, double angleStop, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoPie(parent->getPlotter(), x, y, width, height, angleStart, angleStop, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoPie::JKQTPGeoPie(JKQTPlotter *parent, double x, double y, double width, double height, double angleStart, double angleStop, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoPie(parent->getPlotter(), x, y, width, height, angleStart, angleStop, drawMode)
{
}
void JKQTPGeoPie::draw(JKQTPEnhancedPainter& painter) {
drawInternal(painter, angleStart, angleStop, InternalDrawMode::Pie);
}
@ -527,7 +516,7 @@ double JKQTPGeoPie::getAngleStop() const
}
bool JKQTPGeoPie::getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) {
QPolygonF rect=QPolygonF(JKQTPSplitEllipseIntoPoints(x,y,width/2.0, height/2.0,angleStart,angleStop,angle, 180));
QPolygonF rect=QPolygonF(JKQTPSplitEllipseIntoPoints(x,y,width/2.0, height/2.0, angleStart, angleStop, 180));
rect.append(QPointF(x,y));
minx=rect.boundingRect().left();
maxx=rect.boundingRect().right();
@ -540,7 +529,7 @@ bool JKQTPGeoPie::getXMinMax(double& minx, double& maxx, double& smallestGreater
}
bool JKQTPGeoPie::getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) {
QPolygonF rect=QPolygonF(JKQTPSplitEllipseIntoPoints(x,y,width/2.0, height/2.0,angleStart,angleStop,angle, 180));
QPolygonF rect=QPolygonF(JKQTPSplitEllipseIntoPoints(x,y,width/2.0, height/2.0, angleStart, angleStop, 180));
rect.append(QPointF(x,y));
miny=rect.boundingRect().bottom();
maxy=rect.boundingRect().top();
@ -555,25 +544,26 @@ bool JKQTPGeoPie::getYMinMax(double& miny, double& maxy, double& smallestGreater
JKQTPGeoChord::JKQTPGeoChord(JKQTBasePlotter* parent, double x, double y, double width, double height,double angleStart, double angleStop, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoPie(parent, x, y, width, height, angleStart, angleStop, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoChord::JKQTPGeoChord(JKQTBasePlotter *parent, double x, double y, double width, double height, double angleStart, double angleStop, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoPie(parent, x, y, width, height, angleStart, angleStop, drawMode)
{
}
JKQTPGeoChord::JKQTPGeoChord(JKQTPlotter* parent, double x, double y, double width, double height,double angleStart, double angleStop, QColor color, double lineWidth, Qt::PenStyle style, QColor fillColor, Qt::BrushStyle fillStyle, DrawMode drawMode):
JKQTPGeoChord(parent->getPlotter(), x, y, width, height, angleStart, angleStop, color, lineWidth, style, fillColor, fillStyle, drawMode)
JKQTPGeoChord::JKQTPGeoChord(JKQTPlotter *parent, double x, double y, double width, double height, double angleStart, double angleStop, JKQTPGeometricPlotElement::DrawMode drawMode):
JKQTPGeoChord(parent->getPlotter(), x, y, width, height, angleStart, angleStop, drawMode)
{
}
void JKQTPGeoChord::draw(JKQTPEnhancedPainter& painter) {
drawInternal(painter, angleStart, angleStop, InternalDrawMode::Chord);
}
bool JKQTPGeoChord::getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) {
const QPolygonF rect=QPolygonF(JKQTPSplitEllipseIntoPoints(x,y,width/2.0, height/2.0,angleStart,angleStop,angle, 180));
const QPolygonF rect=QPolygonF(JKQTPSplitEllipseIntoPoints(x,y,width/2.0, height/2.0, angleStart, angleStop, 180));
minx=rect.boundingRect().left();
maxx=rect.boundingRect().right();
if (minx>maxx) std::swap(minx, maxx);
@ -584,7 +574,7 @@ bool JKQTPGeoChord::getXMinMax(double& minx, double& maxx, double& smallestGreat
}
bool JKQTPGeoChord::getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) {
const QPolygonF rect=QPolygonF(JKQTPSplitEllipseIntoPoints(x,y,width/2.0, height/2.0,angleStart,angleStop,angle, 180));
const QPolygonF rect=QPolygonF(JKQTPSplitEllipseIntoPoints(x,y,width/2.0, height/2.0, angleStart, angleStop, 180));
miny=rect.boundingRect().bottom();
maxy=rect.boundingRect().top();
if (miny>maxy) std::swap(miny, maxy);

View File

@ -49,6 +49,9 @@
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoRectangle: public JKQTPGeoBaseFilled {
Q_OBJECT
public:
/** \brief class constructor
*
* \param parent the parent plotter object
@ -56,13 +59,10 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoRectangle: public JKQTPGeoBaseFilled {
* \param y y-coordinate of center of rectangle
* \param width width of rectangle
* \param height of rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoRectangle(JKQTBasePlotter* parent, double x, double y, double width, double height, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoRectangle(JKQTBasePlotter* parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -70,117 +70,48 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoRectangle: public JKQTPGeoBaseFilled {
* \param y y-coordinate of center of rectangle
* \param width width of rectangle
* \param height of rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
*/
JKQTPGeoRectangle(JKQTPlotter* parent, double x, double y, double width, double height, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param x x-coordinate of center of rectangle
* \param y y-coordinate of center of rectangle
* \param width width of rectangle
* \param height of rectangle
* \param angle rotation angle of the rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoRectangle(JKQTBasePlotter* parent, double x, double y, double width, double height, double angle, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param x x-coordinate of center of rectangle
* \param y y-coordinate of center of rectangle
* \param width width of rectangle
* \param height of rectangle
* \param angle rotation angle of the rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
*/
JKQTPGeoRectangle(JKQTPlotter* parent, double x, double y, double width, double height, double angle, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoRectangle(JKQTPlotter* parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param bottomleft bottom left corner of rectangle
* \param topright top right corner of rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoRectangle(JKQTBasePlotter* parent, QPointF bottomleft, QPointF topright, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoRectangle(JKQTBasePlotter* parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param bottomleft bottom left corner of rectangle
* \param topright top right corner of rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoRectangle(JKQTPlotter* parent, QPointF bottomleft, QPointF topright, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoRectangle(JKQTPlotter* parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param center center of rectangle
* \param size width and heigt of rectangle
* \param angle rotation angle of the rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoRectangle(JKQTBasePlotter* parent, const QPointF& center, const QSizeF& size, double angle, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoRectangle(JKQTBasePlotter* parent, const QPointF& center, const QSizeF& size, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param center center of rectangle
* \param size width and heigt of rectangle
* \param angle rotation angle of the rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
*/
JKQTPGeoRectangle(JKQTPlotter* parent, const QPointF& center, const QSizeF& size, double angle, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param center center of rectangle
* \param size width and heigt of rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoRectangle(JKQTBasePlotter* parent, const QPointF& center, const QSizeF& size, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param center center of rectangle
* \param size width and heigt of rectangle
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of rectangle
* \param fillStyle filling style of rectangle
*/
JKQTPGeoRectangle(JKQTPlotter* parent, const QPointF& center, const QSizeF& size, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoRectangle(JKQTPlotter* parent, const QPointF& center, const QSizeF& size, DrawMode drawMode=DrawAsGraphicElement);
@ -275,45 +206,29 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolygon: public JKQTPGeoBaseFilled {
*
* \param parent the parent plotter object
* \param points points on the polygon
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor color of the filling
* \param fillStyle style of the filling
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoPolygon(JKQTBasePlotter* parent, const QVector<QPointF>& points, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoPolygon(JKQTBasePlotter* parent, const QVector<QPointF>& points, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param points points on the polygon
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor color of the filling
* \param fillStyle style of the filling
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoPolygon(JKQTPlotter* parent, const QVector<QPointF>& points, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoPolygon(JKQTPlotter* parent, const QVector<QPointF>& points, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor color of the filling
* \param fillStyle style of the filling
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoPolygon(JKQTBasePlotter* parent, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoPolygon(JKQTBasePlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor color of the filling
* \param fillStyle style of the filling
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoPolygon(JKQTPlotter* parent, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoPolygon(JKQTPlotter* parent, DrawMode drawMode=DrawAsGraphicElement);
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
@ -385,89 +300,69 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPolygon: public JKQTPGeoBaseFilled {
class JKQTPLOTTER_LIB_EXPORT JKQTPGeoEllipse: public JKQTPGeoRectangle {
Q_OBJECT
public:
/** \brief class constructor
*
* \param parent the parent plotter object
* \param x x-coordinate of center of ellipse
* \param y y-coordinate of center of ellipse
* \param width width of ellipse (2 * half axis)
* \param height of ellipse (2 * half axis)
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
*/
JKQTPGeoEllipse(JKQTBasePlotter* parent, double x, double y, double width, double height, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param x x-coordinate of center of ellipse
* \param y y-coordinate of center of ellipse
* \param width width of ellipse (2 * half axis)
* \param height of ellipse (2 * half axis)
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
*/
JKQTPGeoEllipse(JKQTPlotter* parent, double x, double y, double width, double height, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param x x-coordinate of center of ellipse
* \param y y-coordinate of center of ellipse
* \param x x-coordinate of center of rectangle
* \param y y-coordinate of center of rectangle
* \param width width of rectangle
* \param height of rectangle
* \param angle rotation angle of the ellipse
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoEllipse(JKQTBasePlotter* parent, double x, double y, double width, double height, double angle, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoEllipse(JKQTBasePlotter* parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param x x-coordinate of center of ellipse
* \param y y-coordinate of center of ellipse
* \param x x-coordinate of center of rectangle
* \param y y-coordinate of center of rectangle
* \param width width of rectangle
* \param height of rectangle
* \param angle rotation angle of the ellipse
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoEllipse(JKQTPlotter* parent, double x, double y, double width, double height, double angle, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoEllipse(JKQTPlotter* parent, double x, double y, double width, double height, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param bottomleft bottom left corner of ellipse
* \param topright top right corner of ellipse
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
* \param bottomleft bottom left corner of rectangle
* \param topright top right corner of rectangle
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoEllipse(JKQTBasePlotter* parent, QPointF bottomleft, QPointF topright, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoEllipse(JKQTBasePlotter* parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param bottomleft bottom left corner of ellipse
* \param topright top right corner of ellipse
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
* \param bottomleft bottom left corner of rectangle
* \param topright top right corner of rectangle
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoEllipse(JKQTPlotter* parent, QPointF bottomleft, QPointF topright, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoEllipse(JKQTPlotter* parent, QPointF bottomleft, QPointF topright, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param center center of rectangle
* \param size width and heigt of rectangle
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoEllipse(JKQTBasePlotter* parent, const QPointF& center, const QSizeF& size, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
* \param center center of rectangle
* \param size width and heigt of rectangle
*
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoEllipse(JKQTPlotter* parent, const QPointF& center, const QSizeF& size, DrawMode drawMode=DrawAsGraphicElement);
/** \brief plots the graph to the plotter object specified as parent
@ -500,18 +395,6 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoEllipse: public JKQTPGeoRectangle {
* A pie on linear and log-log axes (start angle: 10deg and end-angle 110deg):
* \image html plot_geopie.png
*
* Here is the code to generate the plots above:
* \code
* plot->addGraph(new JKQTPGeoRectangle(plot,3.5,0.5,0.9,0.9, QColor("silver"), 1, Qt::PenStyle::DashLine));
* plot->addGraph(new JKQTPGeoEllipse(plot,3.5,0.5,0.9,0.9, QColor("silver"), 1, Qt::PenStyle::DashLine));
* plot->addGraph(new JKQTPGeoPie(plot,3.5,0.5,0.9,0.9, 10, 110 , QColor("blue"), 4, Qt::PenStyle::SolidLine,QColor("lightblue")));
* plot->addGraph(new JKQTPGeoSymbol(plot, 3.5,0.5, JKQTPCircle, 5, QColor("grey")));
* plot->addGraph(new JKQTPGeoLine(plot, 3.5,0.5,3.5+0.5*cos(10.0/180.0*JKQTPSTATISTICS_PI),0.5+0.5*sin(10.0/180.0*JKQTPSTATISTICS_PI), QColor("grey")));
* plot->addGraph(new JKQTPGeoText(plot, 3.5+0.55*cos(10.0/180.0*JKQTPSTATISTICS_PI),0.5+0.55*sin(10.0/180.0*JKQTPSTATISTICS_PI), "10\\degree", 10, QColor("grey")));
* plot->addGraph(new JKQTPGeoLine(plot, 3.5,0.5,3.5+0.5*cos(110.0/180.0*JKQTPSTATISTICS_PI),0.5+0.5*sin(110.0/180.0*JKQTPSTATISTICS_PI), QColor("grey")));
* plot->addGraph(new JKQTPGeoText(plot, 3.5+0.55*cos(110.0/180.0*JKQTPSTATISTICS_PI),0.5+0.55*sin(110.0/180.0*JKQTPSTATISTICS_PI), "110\\degree", 10, QColor("grey")));
* \endcode
*
* \note This function support the JKQTPGeometricPlotElement::DrawMode::DrawAsMathematicalCurve only.
* This means that pies are always treated as mathematical curves, as no meaningful
* parametrization for pies on non-linear axes could be found!
@ -530,13 +413,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPie: public JKQTPGeoEllipse {
* \param height of ellipse (2 * half axis)
* \param angleStart if we only draw an arc, this is the starting angle in degrees
* \param angleStop if we only draw an arc, this is the ending angle in degrees
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoPie(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoPie(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -546,13 +425,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoPie: public JKQTPGeoEllipse {
* \param height of ellipse (2 * half axis)
* \param angleStart if we only draw an arc, this is the starting angle in degrees
* \param angleStop if we only draw an arc, this is the ending angle in degrees
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoPie(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoPie(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement);
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
@ -611,13 +486,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoChord: public JKQTPGeoPie {
* \param height of ellipse (2 * half axis)
* \param angleStart if we only draw an arc, this is the starting angle in degrees
* \param angleStop if we only draw an arc, this is the ending angle in degrees
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoChord(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoChord(JKQTBasePlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement);
/** \brief class constructor
*
* \param parent the parent plotter object
@ -627,13 +498,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGeoChord: public JKQTPGeoPie {
* \param height of ellipse (2 * half axis)
* \param angleStart if we only draw an arc, this is the starting angle in degrees
* \param angleStop if we only draw an arc, this is the ending angle in degrees
* \param color color of line
* \param lineWidth width of line
* \param style line style
* \param fillColor filling color of ellipse
* \param fillStyle filling style of ellipse
* \param drawMode draw the rectangle as a graphic or geometric element
*/
JKQTPGeoChord(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, QColor color=QColor("black"), double lineWidth=1, Qt::PenStyle style=Qt::SolidLine, QColor fillColor=QColor("transparent"), Qt::BrushStyle fillStyle=Qt::SolidPattern, DrawMode drawMode=DrawAsGraphicElement);
JKQTPGeoChord(JKQTPlotter* parent, double x, double y, double width, double height, double angleStart, double angleStop, DrawMode drawMode=DrawAsGraphicElement);
/** \copydoc JKQTPGeometricPlotElement::getXMinMax() */
virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;

View File

@ -742,7 +742,7 @@ JKQTPMathImage::JKQTPMathImage(JKQTBasePlotter *parent):
JKQTPColorPaletteWithModifierStyleAndToolsMixin(parent)
{
initJKQTPMathImage();
if (parent) this->palette=parent->getCurrentPlotterStyle().defaultPalette;
if (parent) this->palette=parent->getCurrentPlotterStyle().graphsStyle.defaultPalette;
}

View File

@ -38,9 +38,8 @@
JKQTPImpulsesGraphBase::JKQTPImpulsesGraphBase(JKQTBasePlotter* parent):
JKQTPXYBaselineGraph(parent), drawSymbols(false)
{
initLineStyle(parent, parentPlotStyle);
initSymbolStyle(parent, parentPlotStyle);
setLineWidth(3);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Impulses);
initSymbolStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Impulses);
}
QColor JKQTPImpulsesGraphBase::getKeyLabelColor() const {
@ -51,7 +50,7 @@ void JKQTPImpulsesGraphBase::setColor(QColor c)
{
setLineColor(c);
setSymbolColor(c);
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.impulseStyle.fillColorDerivationMode, c));
c.setAlphaF(0.5);
setHighlightingLineColor(c);
}
@ -246,7 +245,7 @@ JKQTPImpulsesHorizontalErrorGraph::JKQTPImpulsesHorizontalErrorGraph(JKQTBasePlo
JKQTPImpulsesHorizontalGraph(parent)
{
setErrorColorFromGraphColor(getLineColor());
initErrorStyle(parent, parentPlotStyle);
initErrorStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Impulses);
}
JKQTPImpulsesHorizontalErrorGraph::JKQTPImpulsesHorizontalErrorGraph(JKQTPlotter *parent):
@ -270,7 +269,7 @@ JKQTPImpulsesVerticalErrorGraph::JKQTPImpulsesVerticalErrorGraph(JKQTBasePlotter
JKQTPImpulsesVerticalGraph(parent)
{
setErrorColorFromGraphColor(getLineColor());
initErrorStyle(parent, parentPlotStyle);
initErrorStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Impulses);
}
JKQTPImpulsesVerticalErrorGraph::JKQTPImpulsesVerticalErrorGraph(JKQTPlotter *parent):

View File

@ -40,7 +40,7 @@ JKQTPPeakStreamGraph::JKQTPPeakStreamGraph(JKQTBasePlotter *parent):
yPeaks=true;
peakHeight=1;
drawBaseline=true;
initLineStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
}

View File

@ -49,8 +49,8 @@ JKQTPRangeBase::JKQTPRangeBase(JKQTBasePlotter* parent):
if (parent) { // get style settings from parent object
initLineStyle(parent, parentPlotStyle);
initFillStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
centerColor=parent->getPlotStyle(parentPlotStyle).color();
}
@ -77,7 +77,7 @@ void JKQTPRangeBase::setColor(QColor c)
{
setLineColor(c);
centerColor=c;
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.fillColorDerivationMode, c));
}

View File

@ -52,8 +52,8 @@ JKQTPXYLineGraph::JKQTPXYLineGraph(JKQTBasePlotter* parent):
sortData=JKQTPXYGraph::Unsorted;
drawLine=true;
initLineStyle(parent, parentPlotStyle);
initSymbolStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
initSymbolStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
}
void JKQTPXYLineGraph::draw(JKQTPEnhancedPainter& painter) {
@ -168,7 +168,7 @@ void JKQTPXYLineGraph::setColor(QColor c)
{
setLineColor(c);
setSymbolColor(c);
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.fillColorDerivationMode, c));
c.setAlphaF(0.5);
setHighlightingLineColor(c);
}
@ -310,7 +310,7 @@ JKQTPXYParametrizedScatterGraph::JKQTPXYParametrizedScatterGraph(JKQTBasePlotter
gridSymbolFractionSize=0.9;
symbolFillDerivationMode=JKQTPFFCMLighterColor;
if (parent) {
symbolFillDerivationMode=parent->getCurrentPlotterStyle().graphFillColorDerivationMode;
symbolFillDerivationMode=parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.fillColorDerivationMode;
}
clearSizeColumnFunctor();

View File

@ -43,7 +43,7 @@ JKQTPSingleColumnSymbolsGraph::JKQTPSingleColumnSymbolsGraph(JKQTBasePlotter *pa
position=0;
width=1;
initSymbolStyle(parent, parentPlotStyle);
initSymbolStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
}
@ -257,7 +257,7 @@ QColor JKQTPSingleColumnSymbolsGraph::getKeyLabelColor() const
void JKQTPSingleColumnSymbolsGraph::setColor(QColor col)
{
setSymbolColor(col);
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, col));
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.fillColorDerivationMode, col));
}
void JKQTPSingleColumnSymbolsGraph::setPosition(double __value)

View File

@ -38,9 +38,9 @@ JKQTPSpecialLineGraphBase::JKQTPSpecialLineGraphBase(JKQTBasePlotter* parent):
JKQTPXYBaselineGraph(parent), m_drawSymbols(false), m_specialLineType(JKQTPStepLeft)
{
parentPlotStyle=-1;
initLineStyle(parent, parentPlotStyle);
initFillStyle(parent, parentPlotStyle);
initSymbolStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
initFillStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
initSymbolStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Default);
setFillCurve(false);
}
@ -92,8 +92,8 @@ void JKQTPSpecialLineGraphBase::setColor(QColor c)
{
setLineColor(c);
setSymbolColor(c);
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.symbolFillColorDerivationMode, c));
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.defaultGraphStyle.fillColorDerivationMode, c));
c.setAlphaF(0.5);
setHighlightingLineColor(c);
}

View File

@ -60,23 +60,24 @@ void JKQTPGraphViolinplotStyleMixin::initViolinplotStyle(JKQTBasePlotter *parent
{
setFillStyle(Qt::SolidPattern);
setFillColor(parent->getCurrentPlotterStyle().plotBackgroundBrush.color());
initLineStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, JKQTPPlotStyleType::Barchart);
if (parent) { // get style settings from parent object
if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle();
m_whiskerLinePen.setColor(parent->getPlotStyle(parentPlotStyle).color());
m_whiskerLinePen.setStyle(parent->getPlotStyle(parentPlotStyle).style());
whiskerLineWidth=parent->getPlotStyle(parentPlotStyle).widthF();
m_whiskerCapLinePen.setColor(parent->getPlotStyle(parentPlotStyle).color());
m_whiskerCapLinePen.setStyle(parent->getPlotStyle(parentPlotStyle).style());
whiskerCapLineWidth=parent->getPlotStyle(parentPlotStyle).widthF();
m_medianLinePen.setColor(parent->getPlotStyle(parentPlotStyle).color());
m_medianLinePen.setStyle(parent->getPlotStyle(parentPlotStyle).style());
medianLineWidth=parent->getPlotStyle(parentPlotStyle).widthF();
m_meanSymbolLinePen=QPen(parent->getPlotStyle(parentPlotStyle).color(), parent->getPlotStyle(parentPlotStyle).style());
m_meanSymbolSize=parent->getPlotStyle(parentPlotStyle).symbolSize();
m_meanSymbolLineWidth=parent->getPlotStyle(parentPlotStyle).symbolLineWidthF();
m_meanSymbolType=parent->getPlotStyle(parentPlotStyle).symbol();
m_meanSymbolFillColor=parent->getPlotStyle(parentPlotStyle).symbolFillColor();
const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle, JKQTPPlotStyleType::Barchart);
m_whiskerLinePen.setColor(pen.color());
m_whiskerLinePen.setStyle(pen.style());
whiskerLineWidth=pen.widthF();
m_whiskerCapLinePen.setColor(pen.color());
m_whiskerCapLinePen.setStyle(pen.style());
whiskerCapLineWidth=pen.widthF();
m_medianLinePen.setColor(pen.color());
m_medianLinePen.setStyle(pen.style());
medianLineWidth=pen.widthF();
m_meanSymbolLinePen=QPen(pen.color(), pen.style());
m_meanSymbolSize=pen.symbolSize();
m_meanSymbolLineWidth=pen.symbolLineWidthF();
m_meanSymbolType=pen.symbol();
m_meanSymbolFillColor=pen.symbolFillColor();
}
setWhiskerLineColor(getLineColor());
@ -102,9 +103,9 @@ double JKQTPGraphViolinplotStyleMixin::getViolinWidthAbsolute() const
void JKQTPGraphViolinplotStyleMixin::setViolinplotColor(QColor c, JKQTBasePlotter *parent)
{
setLineColor(c);
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.filledStyle.fillColorDerivationMode, c));
setMeanColor(c);
setMeanFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
setMeanFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphsStyle.filledStyle.symbolFillColorDerivationMode, c));
setWhiskerLineColor(getLineColor());
setWhiskerCapLineColor(getLineColor());
setMedianLineColor(getLineColor());

View File

@ -975,22 +975,22 @@ void JKQTBasePlotter::drawSystemYAxis(JKQTPEnhancedPainter& painter) {
}
JKQTBasePlotter::JKQTPPen JKQTBasePlotter::getPlotStyle(int i) const{
JKQTBasePlotter::JKQTPPen JKQTBasePlotter::getPlotStyle(int i, JKQTPPlotStyleType type) const{
int colorI=-1;
int styleI=0;
int symbolI=0;
int brushI=0;
for (int k=0; k<=i; k++) {
colorI++;
if (colorI>=plotterStyle.defaultGraphColors.size()) {
if (colorI>=plotterStyle.graphsStyle.defaultGraphColors.size()) {
styleI++;
brushI++;
colorI=0;
if (styleI>=plotterStyle.defaultGraphPenStyles.size()) styleI=0;
if (brushI>=plotterStyle.defaultGraphFillStyles.size()) brushI=0;
if (styleI>=plotterStyle.graphsStyle.defaultGraphPenStyles.size()) styleI=0;
if (brushI>=plotterStyle.graphsStyle.defaultGraphFillStyles.size()) brushI=0;
}
symbolI++;
if (symbolI>=plotterStyle.defaultGraphSymbols.size()) {
if (symbolI>=plotterStyle.graphsStyle.defaultGraphSymbols.size()) {
symbolI=0;
}
}
@ -998,19 +998,33 @@ JKQTBasePlotter::JKQTPPen JKQTBasePlotter::getPlotStyle(int i) const{
//std::cout<<"plotstyle "<<i<<std::endl;
//std::cout<<"color "<<colorI<<std::endl;
//std::cout<<"style "<<styleI<<std::endl;
p.setColor(plotterStyle.defaultGraphColors[colorI]);
p.setFillColor(JKQTPGetDerivedColor(plotterStyle.graphFillColorDerivationMode, p.color()));
p.setErrorLineColor(JKQTPGetDerivedColor(plotterStyle.graphErrorColorDerivationMode, p.color()));
p.setErrorFillColor(JKQTPGetDerivedColor(plotterStyle.graphErrorFillColorDerivationMode, p.errorColor()));
p.setWidthF(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphWidth));
p.setErrorLineWidth(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphWidth));
p.setSymbolSize(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphSymbolSize));
p.setSymbolFillColor(JKQTPGetDerivedColor(plotterStyle.graphFillColorDerivationMode, p.color()));
p.setSymbolLineWidthF(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphSymbolLineWidth));
p.setStyle(plotterStyle.defaultGraphPenStyles[styleI]);
p.setSymbolType(plotterStyle.defaultGraphSymbols[symbolI]);
p.setFillStyle(plotterStyle.defaultGraphFillStyles[brushI]);
p.setErrorFillStyle(plotterStyle.defaultGraphFillStyles[brushI]);
const JKQTGraphsSpecificStyleProperties& baseProps=plotterStyle.graphsStyle.getGraphStyleByType(type);
Qt::PenStyle basePenStyle=plotterStyle.graphsStyle.defaultGraphPenStyles[styleI];
Qt::BrushStyle basebrushStyle=plotterStyle.graphsStyle.defaultGraphFillStyles[brushI];
JKQTPGraphSymbols baseSymbol=plotterStyle.graphsStyle.defaultGraphSymbols[symbolI];
QColor baseColor=plotterStyle.graphsStyle.defaultGraphColors[colorI];
if (type==JKQTPPlotStyleType::Annotation || type==JKQTPPlotStyleType::Geometric) {
baseColor=plotterStyle.graphsStyle.annotationStyle.defaultColor;
basePenStyle=plotterStyle.graphsStyle.annotationStyle.defaultLineStyle;
basebrushStyle=plotterStyle.graphsStyle.annotationStyle.defaultFillStyle;
baseSymbol=plotterStyle.graphsStyle.annotationStyle.defaultSymbol;
}
const QColor lineColor=JKQTPGetDerivedColor(baseProps.graphColorDerivationMode, baseColor);
const QColor errorColor=JKQTPGetDerivedColor(baseProps.errorColorDerivationMode, baseColor);
p.setColor(lineColor);
p.setStyle(basePenStyle);
p.setSymbolType(baseSymbol);
p.setFillStyle(basebrushStyle);
p.setErrorFillStyle(basebrushStyle);
p.setWidthF(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, baseProps.defaultLineWidth));
p.setFillColor(JKQTPGetDerivedColor(baseProps.fillColorDerivationMode, baseColor));
p.setErrorLineColor(errorColor);
p.setErrorFillColor(JKQTPGetDerivedColor(baseProps.errorFillColorDerivationMode, baseColor));
p.setErrorLineWidth(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, baseProps.defaultErrorIndicatorWidth));
p.setSymbolSize(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, baseProps.defaultSymbolSize));
p.setSymbolFillColor(JKQTPGetDerivedColor(baseProps.symbolFillColorDerivationMode, baseColor));
p.setSymbolLineWidthF(qMax(JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH, baseProps.defaultSymbolLineSize));
return p;
}
@ -1258,7 +1272,7 @@ void JKQTBasePlotter::drawPlot(JKQTPEnhancedPainter& painter) {
}
}
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, plotterStyle.useAntiAliasingForGraphs);
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, plotterStyle.graphsStyle.useAntiAliasingForGraphs);
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, plotterStyle.useAntiAliasingForText);
{
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
@ -1270,7 +1284,7 @@ void JKQTBasePlotter::drawPlot(JKQTPEnhancedPainter& painter) {
drawSystemXAxis(painter);
drawSystemYAxis(painter);
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, plotterStyle.useAntiAliasingForGraphs);
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, plotterStyle.graphsStyle.useAntiAliasingForGraphs);
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, plotterStyle.useAntiAliasingForText);
if (plotterStyle.keyStyle.visible) drawKey(painter);
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, plotterStyle.useAntiAliasingForText);
@ -2411,7 +2425,7 @@ bool JKQTBasePlotter::isUsingAntiAliasingForSystem() const
bool JKQTBasePlotter::isUsingAntiAliasingForGraphs() const
{
return this->plotterStyle.useAntiAliasingForGraphs;
return this->plotterStyle.graphsStyle.useAntiAliasingForGraphs;
}
bool JKQTBasePlotter::isUsingAntiAliasingForText() const
@ -2420,19 +2434,6 @@ bool JKQTBasePlotter::isUsingAntiAliasingForText() const
}
void JKQTBasePlotter::setGraphWidth(double __value)
{
if (jkqtp_approximatelyUnequal(this->plotterStyle.defaultGraphWidth , __value)) {
this->plotterStyle.defaultGraphWidth = __value;
redrawPlot();
}
}
double JKQTBasePlotter::getGraphWidth() const
{
return this->plotterStyle.defaultGraphWidth;
}
void JKQTBasePlotter::setBackgroundColor(const QColor &__value)
{
if (this->plotterStyle.widgetBackgroundBrush != QBrush(__value)) {
@ -3025,8 +3026,8 @@ void JKQTBasePlotter::setUseAntiAliasingForText(bool __value)
void JKQTBasePlotter::setUseAntiAliasingForGraphs(bool __value)
{
if (this->plotterStyle.useAntiAliasingForGraphs != __value) {
this->plotterStyle.useAntiAliasingForGraphs = __value;
if (this->plotterStyle.graphsStyle.useAntiAliasingForGraphs != __value) {
this->plotterStyle.graphsStyle.useAntiAliasingForGraphs = __value;
redrawPlot();
}
}

View File

@ -614,8 +614,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
};
/** \brief returns a QPen object for the i-th plot style */
JKQTPPen getPlotStyle(int i) const;
JKQTPPen getPlotStyle(int i, JKQTPPlotStyleType type=JKQTPPlotStyleType::Default) const;
/*! \brief draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
\param painter JKQTPEnhancedPainter to which the plot should be drawn
@ -673,8 +674,6 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
bool isUsingAntiAliasingForGraphs() const;
/** \copydoc JKQTBasePlotterStyle::useAntiAliasingForText */
bool isUsingAntiAliasingForText() const;
/** \copydoc JKQTBasePlotterStyle::defaultGraphWidth */
double getGraphWidth() const;
/** \copydoc JKQTBasePlotterStyle::widgetBackgroundBrush */
QColor getBackgroundColor() const;
/** \copydoc JKQTBasePlotterStyle::exportBackgroundBrush */
@ -1459,8 +1458,6 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
void setUseAntiAliasingForGraphs(bool __value);
/** \copydoc JKQTBasePlotterStyle::useAntiAliasingForText */
void setUseAntiAliasingForText(bool __value);
/** \copydoc JKQTBasePlotterStyle::defaultGraphWidth */
void setGraphWidth(double __value);
/** \copydoc JKQTBasePlotterStyle::widgetBackgroundBrush */
void setBackgroundColor(const QColor & __value);
/** \copydoc JKQTBasePlotterStyle::exportBackgroundBrush */

View File

@ -12,9 +12,6 @@ JKQTBasePlotterStyle::JKQTBasePlotterStyle():
plotBorderLeft(5),
plotBorderBottom(5),
plotBorderRight(5),
defaultGraphWidth(2),
defaultGraphSymbolSize(10),
defaultGraphSymbolLineWidth(1),
widgetBackgroundBrush(QApplication::palette().color(QPalette::Window)),
exportBackgroundBrush(QColor("white")),
plotBackgroundBrush(QColor("white")),
@ -25,37 +22,17 @@ JKQTBasePlotterStyle::JKQTBasePlotterStyle():
plotLabelFontName(QApplication::font().family()+"+XITS"),
plotLabelFontSize(12),
useAntiAliasingForSystem(true),
useAntiAliasingForGraphs(true),
useAntiAliasingForText(true),
defaultTextColor(QColor("black")),
defaultFontSize(8),
defaultFontName(QApplication::font().family()+"+XITS"),
defaultPalette(JKQTPMathImageMATLAB),
graphFillColorDerivationMode(JKQTPFFCMLighterColor),
graphErrorColorDerivationMode(JKQTPFFCMDarkerColor),
graphErrorFillColorDerivationMode(JKQTPFFCMEvenLighterColor),
defaultGraphColors(), defaultGraphPenStyles(), defaultGraphSymbols(), defaultGraphFillStyles(),
keyStyle(*this),
xAxisStyle(*this),
yAxisStyle(*this),
rightColorbarAxisStyle(*this),
topColorbarAxisStyle(*this)
topColorbarAxisStyle(*this),
graphsStyle(*this)
{
/*
keyStyle=JKQTPKeyStyle(*this);
xAxisStyle=JKQTPCoordinateAxisStyle(*this);
yAxisStyle=JKQTPCoordinateAxisStyle(*this);
rightColorbarAxisStyle=JKQTPCoordinateAxisStyle(*this);
topColorbarAxisStyle=JKQTPCoordinateAxisStyle(*this);
*/
defaultGraphColors<<QColor("red")<<QColor("green")<<QColor("blue")<<QColor("fuchsia")<<QColor("darkorange")
<<QColor("navy")<<QColor("firebrick")<<QColor("darkgreen")<<QColor("darkmagenta")
<<QColor("darkgreen")<<QColor("darkslateblue")<<QColor("maroon")<<QColor("indianred")
<<QColor("darkolivegreen")<<QColor("mediumpurple")<<QColor("darkcyan");
defaultGraphPenStyles<<Qt::SolidLine<<Qt::DashLine<<Qt::DotLine<<Qt::DashDotLine<<Qt::DashDotDotLine;
for (int i=2; i<=JKQTPMaxSymbolID; i++) defaultGraphSymbols.push_back(static_cast<JKQTPGraphSymbols>(i));
defaultGraphFillStyles<<Qt::SolidPattern;
}
void JKQTBasePlotterStyle::loadSettings(const QSettings &settings, const QString &group, const JKQTBasePlotterStyle &defaultStyle)
@ -78,99 +55,29 @@ void JKQTBasePlotterStyle::loadSettings(const QSettings &settings, const QString
plotFrameVisible=settings.value(group+"plot_frame_visible", defaultStyle.plotFrameVisible).toBool();
plotFrameRounding=settings.value(group+"plot_frame_rounded", defaultStyle.plotFrameRounding).toDouble();
useAntiAliasingForSystem=settings.value(group+"antialiase_system", defaultStyle.useAntiAliasingForSystem).toBool();
useAntiAliasingForGraphs=settings.value(group+"antialiase_graphs", defaultStyle.useAntiAliasingForGraphs).toBool();
useAntiAliasingForText=settings.value(group+"antialiase_text", defaultStyle.useAntiAliasingForText).toBool();
defaultTextColor=jkqtp_String2QColor(settings.value(group+"text_default_color", jkqtp_QColor2String(defaultStyle.defaultTextColor)).toString());
defaultFontSize=settings.value(group+"text_default_size", defaultStyle.defaultFontSize).toDouble();
defaultFontName=settings.value(group+"text_default_font_name", defaultStyle.defaultFontName).toString();
defaultPalette=JKQTPImageTools::String2JKQTPMathImageColorPalette(settings.value(group+"graph_default_palette", JKQTPImageTools::JKQTPMathImageColorPalette2String(defaultStyle.defaultPalette)).toString());
defaultGraphWidth=settings.value(group+"graph_default_linewidth", defaultStyle.debugRegionLineWidth).toDouble();
defaultGraphSymbolSize=settings.value(group+"graph_default_symbolsize", defaultStyle.defaultGraphSymbolSize).toDouble();
defaultGraphSymbolLineWidth=settings.value(group+"graph_default_symbol_linewidtht", defaultStyle.defaultGraphSymbolLineWidth).toDouble();
graphFillColorDerivationMode=String2JKQTPColorDerivationMode(settings.value(group+"graph_default_fill_color_mode", JKQTPColorDerivationMode2String(defaultStyle.graphFillColorDerivationMode)).toString());
graphErrorFillColorDerivationMode=String2JKQTPColorDerivationMode(settings.value(group+"graph_default_error_fill_color_mode", JKQTPColorDerivationMode2String(defaultStyle.graphErrorFillColorDerivationMode)).toString());
graphErrorColorDerivationMode=String2JKQTPColorDerivationMode(settings.value(group+"graph_default_error_color_mode", JKQTPColorDerivationMode2String(defaultStyle.graphErrorColorDerivationMode)).toString());
keyStyle.loadSettings(settings, group+"key/", defaultStyle.keyStyle);
xAxisStyle.loadSettings(settings, group+"axis_x/", defaultStyle.xAxisStyle);
yAxisStyle.loadSettings(settings, group+"axis_y/", defaultStyle.yAxisStyle);
rightColorbarAxisStyle.loadSettings(settings, group+"axis_colorbar_right/", defaultStyle.rightColorbarAxisStyle);
topColorbarAxisStyle.loadSettings(settings, group+"axis_colorbar_top/", defaultStyle.topColorbarAxisStyle);
graphsStyle.loadSettings(settings, group+"graphs/", defaultStyle.graphsStyle, *this);
auto readID=[](const QString& k, const QString& start) {
if (k.startsWith(start)) {
QString kk=k;
kk.remove(0, start.size());
QString num="";
while (!kk.isEmpty() && kk.at(0).isDigit()) {
num+=kk.at(0);
kk.remove(0, 1);
}
bool ok=false;
int id=num.toInt(&ok);
if (ok) {
return id;
}
}
return -1;
};
defaultGraphColors.clear();
defaultGraphPenStyles.clear();
defaultGraphSymbols.clear();
defaultGraphFillStyles.clear();
QStringList allk=settings.allKeys();
for (auto& k: allk) {
int id=readID(k, group+"default_graph_styles/color");
if (id>=0) {
defaultGraphColors.push_back(jkqtp_String2QColor(settings.value(group+"default_graph_styles/color"+QString::number(id), jkqtp_QColor2String(QColor("red"))).toString()));
}
id=readID(k, group+"default_graph_styles/line_style");
if (id>=0) {
defaultGraphPenStyles.push_back(jkqtp_String2QPenStyle(settings.value(group+"default_graph_styles/line_style"+QString::number(id), jkqtp_QPenStyle2String(Qt::SolidLine)).toString()));
}
id=readID(k, group+"default_graph_styles/symbol");
if (id>=0) {
defaultGraphSymbols.push_back(String2JKQTPGraphSymbols(settings.value(group+"default_graph_styles/symbol"+QString::number(id), JKQTPGraphSymbols2String(JKQTPCross)).toString()));
}
id=readID(k, group+"default_graph_styles/fill_style");
if (id>=0) {
defaultGraphFillStyles.push_back(jkqtp_String2QBrushStyle(settings.value(group+"default_graph_styles/fill_style"+QString::number(id), jkqtp_QBrushStyle2String(Qt::SolidPattern)).toString()));
}
}
if (defaultGraphColors.size()==0) {
for (int i=defaultGraphColors.size(); i<defaultStyle.defaultGraphColors.size(); i++) {
defaultGraphColors.push_back(defaultStyle.defaultGraphColors[i]);
}
}
if (defaultGraphPenStyles.size()==0) {
for (int i=defaultGraphPenStyles.size(); i<defaultStyle.defaultGraphPenStyles.size(); i++) {
defaultGraphPenStyles.push_back(defaultStyle.defaultGraphPenStyles[i]);
}
}
if (defaultGraphSymbols.size()==0) {
for (int i=defaultGraphSymbols.size(); i<defaultStyle.defaultGraphSymbols.size(); i++) {
defaultGraphSymbols.push_back(defaultStyle.defaultGraphSymbols[i]);
}
}
if (defaultGraphFillStyles.size()==0) {
for (int i=defaultGraphFillStyles.size(); i<defaultStyle.defaultGraphFillStyles.size(); i++) {
defaultGraphFillStyles.push_back(defaultStyle.defaultGraphFillStyles[i]);
}
}
}
void JKQTBasePlotterStyle::saveSettings(QSettings &settings, const QString &group) const
{
settings.setValue(group+"csv_decimal_separator", CSVdecimalSeparator);
settings.setValue(group+"csv_comment_initializer", CSVcommentInitializer);
settings.setValue(group+"debug_show_region_boxes", debugShowRegionBoxes);
settings.setValue(group+"debug_region_linewidth", debugRegionLineWidth);
settings.setValue(group+"antialiase_system", useAntiAliasingForSystem);
settings.setValue(group+"antialiase_graphs", useAntiAliasingForGraphs);
settings.setValue(group+"antialiase_text", useAntiAliasingForText);
settings.setValue(group+"widget_background_color", jkqtp_QColor2String(widgetBackgroundBrush.color()));
settings.setValue(group+"widget_background_color_for_export", jkqtp_QColor2String(exportBackgroundBrush.color()));
@ -179,13 +86,6 @@ void JKQTBasePlotterStyle::saveSettings(QSettings &settings, const QString &grou
settings.setValue(group+"plot_border_right", plotBorderRight);
settings.setValue(group+"plot_border_top", plotBorderTop);
settings.setValue(group+"plot_border_bottom", plotBorderBottom);
settings.setValue(group+"graph_default_linewidth", defaultGraphWidth);
settings.setValue(group+"graph_default_symbolsize", defaultGraphSymbolSize);
settings.setValue(group+"graph_default_symbol_linewidtht", defaultGraphSymbolLineWidth);
settings.setValue(group+"graph_default_palette", JKQTPImageTools::JKQTPMathImageColorPalette2String(defaultPalette));
settings.setValue(group+"graph_default_fill_color_mode", JKQTPColorDerivationMode2String(graphFillColorDerivationMode));
settings.setValue(group+"graph_default_error_color_mode", JKQTPColorDerivationMode2String(graphErrorColorDerivationMode));
settings.setValue(group+"graph_default_error_fill_color_mode", JKQTPColorDerivationMode2String(graphErrorFillColorDerivationMode));
settings.setValue(group+"text_default_color", jkqtp_QColor2String(defaultTextColor));
settings.setValue(group+"text_default_size", defaultFontSize);
settings.setValue(group+"text_default_font_name", defaultFontName);
@ -201,27 +101,8 @@ void JKQTBasePlotterStyle::saveSettings(QSettings &settings, const QString &grou
yAxisStyle.saveSettings(settings, group+"axis_y/");
rightColorbarAxisStyle.saveSettings(settings, group+"axis_colorbar_right/");
topColorbarAxisStyle.saveSettings(settings, group+"axis_colorbar_top/");
graphsStyle.saveSettings(settings, group+"graphs/");
int cnt=0;
for (auto& gs: defaultGraphColors) {
settings.setValue(group+"default_graph_styles/color"+QString::number(cnt), jkqtp_QColor2String(gs));
cnt++;
}
cnt=0;
for (auto& gs: defaultGraphPenStyles) {
settings.setValue(group+"default_graph_styles/line_style"+QString::number(cnt), jkqtp_QPenStyle2String(gs));
cnt++;
}
cnt=0;
for (auto& gs: defaultGraphSymbols) {
settings.setValue(group+"default_graph_styles/symbol"+QString::number(cnt), JKQTPGraphSymbols2String(gs));
cnt++;
}
cnt=0;
for (auto& gs: defaultGraphFillStyles) {
settings.setValue(group+"default_graph_styles/fill_style"+QString::number(cnt), jkqtp_QBrushStyle2String(gs));
cnt++;
}
}
JKQTBasePlotterStyle &JKQTPGetSystemDefaultBaseStyle()

View File

@ -25,6 +25,7 @@
#include "jkqtplotter/jkqtpcoordinateaxesstyle.h"
#include "jkqtplotter/jkqtpkeystyle.h"
#include "jkqtplotter/jkqtpimagetools.h"
#include "jkqtplotter/jkqtpgraphsbasestyle.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtcommon/jkqtpdrawingtools.h"
#include "jkqtcommon/jkqtpbasicimagetools.h"
@ -37,7 +38,7 @@
#include <QSettings>
/** \brief Support Class for JKQTBasePlotter, which summarizes all proeprties that define the visual styling of a JKQTBasePlotter
/** \brief Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of a JKQTBasePlotter
* \ingroup jkqtpplotter_styling
*
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
@ -107,12 +108,6 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle {
* \see JKQTBasePlotter::setBorder(), \ref jkqtplotter_base_plotsize
*/
int plotBorderRight;
/** \brief width (in pt) of lines used for newly added graphs */
double defaultGraphWidth;
/** \brief size (in pt) of symbols used for newly added graphs */
double defaultGraphSymbolSize;
/** \brief with (in pt) of symbol lines used for newly added graphs */
double defaultGraphSymbolLineWidth;
/** \brief color of the background of the plot (widget area) when drawing (to the screen) */
QBrush widgetBackgroundBrush;
/** \brief color of the background of the plot (widget area) when exporting*/
@ -133,12 +128,6 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle {
double plotLabelFontSize;
/** \brief specifies whether to use antialiasing for plotting the coordinate system */
bool useAntiAliasingForSystem;
/** \brief specifies whether to use antialiasing for plotting the graphs
*
* \note You can set this property \c false to increase plotting speed of complex plots (with many graphs inside). You can reach a
* roughly three-fold speed improvement!
*/
bool useAntiAliasingForGraphs;
/** \brief specifies whether to use antialiasing when drawing any text
* \note You can set this property \c false to increase plotting speed of complex plots (with many graphs inside). You can reach a
* roughly three-fold speed improvement!
@ -150,24 +139,6 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle {
double defaultFontSize;
/** \brief default font name in the plot */
QString defaultFontName;
/** \brief color palette used by default for new graphs */
JKQTPMathImageColorPalette defaultPalette;
/** \brief defines how to derive a fill color for a new graph */
JKQTPColorDerivationMode graphFillColorDerivationMode;
/** \brief defines how to derive an error color for a new graph */
JKQTPColorDerivationMode graphErrorColorDerivationMode;
/** \brief defines how to derive an error fill color from the error color for a new graph */
JKQTPColorDerivationMode graphErrorFillColorDerivationMode;
/** \brief colors used to automatically collor different graphs differently */
QVector<QColor> defaultGraphColors;
/** \brief Qt::PenStyle used to automatically style different graphs differently */
QVector<Qt::PenStyle> defaultGraphPenStyles;
/** \brief JKQTPGraphSymbols used to automatically assign to different graphs */
QVector<JKQTPGraphSymbols> defaultGraphSymbols;
/** \brief Qt::BrushStyle used to automatically style different graphs differently */
QVector<Qt::BrushStyle> defaultGraphFillStyles;
/** \brief style of the plot key/legend */
@ -180,6 +151,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle {
JKQTPCoordinateAxisStyle rightColorbarAxisStyle;
/** \brief style of the coordinate axes used to display colorbars at the top */
JKQTPCoordinateAxisStyle topColorbarAxisStyle;
/** \brief style of the graphs */
JKQTGraphsBaseStyle graphsStyle;
};

View File

@ -28,7 +28,7 @@
class JKQTBasePlotterStyle; // forward
/** \brief Support Class for JKQTPCoordinateAxis, which summarizes all proeprties that define the visual styling of a JKQTPCoordinateAxis
/** \brief Support Class for JKQTPCoordinateAxis, which summarizes all properties that define the visual styling of a JKQTPCoordinateAxis
* \ingroup jkqtpplotter_styling
*
* \see JKQTPCoordinateAxis, \ref jkqtpplotter_styling

View File

@ -46,16 +46,17 @@ JKQTPGraphErrorStyleMixin::JKQTPGraphErrorStyleMixin() {
m_errorBarCapSize=7;
}
void JKQTPGraphErrorStyleMixin::initErrorStyle(JKQTBasePlotter *parent, int &parentPlotStyle)
void JKQTPGraphErrorStyleMixin::initErrorStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype)
{
if (parent) { // get style settings from parent object
if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle();
m_errorFillColor=parent->getPlotStyle(parentPlotStyle).errorFillColor();
const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle, styletype);
m_errorFillColor=pen.errorFillColor();
m_errorFillBrush.setColor(m_errorFillColor);
m_errorFillBrush.setStyle(parent->getPlotStyle(parentPlotStyle).errorFillStyle());
m_errorLinePen.setColor(parent->getPlotStyle(parentPlotStyle).errorColor());
m_errorLinePen.setStyle(parent->getPlotStyle(parentPlotStyle).errorStyle());
m_errorLineWidth=parent->getPlotStyle(parentPlotStyle).errorWidthF();
m_errorFillBrush.setStyle(pen.errorFillStyle());
m_errorLinePen.setColor(pen.errorColor());
m_errorLinePen.setStyle(pen.errorStyle());
m_errorLineWidth=pen.errorWidthF();
}
}

View File

@ -49,7 +49,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphErrorStyleMixin {
virtual ~JKQTPGraphErrorStyleMixin()=default;
/** \brief initiaize the error indicator style (from the parent plotter) */
void initErrorStyle(JKQTBasePlotter* parent, int &parentPlotStyle);
void initErrorStyle(JKQTBasePlotter* parent, int &parentPlotStyle, JKQTPPlotStyleType styletype=JKQTPPlotStyleType::Default);

View File

@ -0,0 +1,324 @@
#include "jkqtpgraphsbasestyle.h"
#include <QPalette>
#include <QApplication>
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtpbaseplotterstyle.h"
JKQTGraphsSpecificStyleProperties::JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType type, const JKQTBasePlotterStyle &/*parent*/):
defaultLineWidth(2),
defaultSymbolSize(10),
defaultSymbolLineSize(1),
defaultErrorIndicatorWidth(1),
defaultHeadDecoratorStyle(JKQTPLineDecoratorStyle::JKQTPDefaultLineDecorator),
defaultHeadDecoratorSizeFactor(8.0),
graphColorDerivationMode(JKQTPFFCMSameColor),
fillColorDerivationMode(JKQTPFFCMLighterColor),
errorColorDerivationMode(JKQTPFFCMDarkerColor),
errorFillColorDerivationMode(JKQTPFFCMEvenLighterColor),
symbolFillColorDerivationMode(JKQTPFFCMLighterColor)
{
switch(type) {
case JKQTPPlotStyleType::Default:
break;
case JKQTPPlotStyleType::Filled:
break;
case JKQTPPlotStyleType::Impulses:
defaultLineWidth=3;
break;
case JKQTPPlotStyleType::Barchart:
defaultLineWidth=0;
graphColorDerivationMode=JKQTPFFCMLighterColor;
fillColorDerivationMode=JKQTPFFCMLighterColor;
break;
case JKQTPPlotStyleType::Boxplot:
defaultLineWidth=1;
fillColorDerivationMode=JKQTPFFCMWhite;
break;
case JKQTPPlotStyleType::Annotation:
defaultSymbolSize=16;
break;
case JKQTPPlotStyleType::Geometric:
fillColorDerivationMode=JKQTPFFCMFullyTransparentColor;
break;
}
}
void JKQTGraphsSpecificStyleProperties::loadSettings(const QSettings &settings, const QString &group, const JKQTGraphsSpecificStyleProperties &defaultStyle)
{
defaultLineWidth=settings.value(group+"linewidth", defaultStyle.defaultLineWidth).toDouble();
defaultSymbolSize=settings.value(group+"symbol_size", defaultStyle.defaultSymbolSize).toDouble();
defaultSymbolLineSize=settings.value(group+"symbol_line_size", defaultStyle.defaultLineWidth).toDouble();
defaultErrorIndicatorWidth=settings.value(group+"error_indicator_width", defaultStyle.defaultLineWidth).toDouble();
defaultHeadDecoratorStyle=String2JKQTPLineDecoratorStyle(settings.value(group+"head_decorator_type", JKQTPLineDecoratorStyle2String(defaultStyle.defaultHeadDecoratorStyle)).toString());
defaultHeadDecoratorSizeFactor=settings.value(group+"head_decorator_size_factor", defaultStyle.defaultHeadDecoratorSizeFactor).toDouble();
graphColorDerivationMode=String2JKQTPColorDerivationMode(settings.value(group+"graph_color_mode", JKQTPColorDerivationMode2String(defaultStyle.graphColorDerivationMode)).toString());
fillColorDerivationMode=String2JKQTPColorDerivationMode(settings.value(group+"fill_color_mode", JKQTPColorDerivationMode2String(defaultStyle.fillColorDerivationMode)).toString());
errorColorDerivationMode=String2JKQTPColorDerivationMode(settings.value(group+"error_color_mode", JKQTPColorDerivationMode2String(defaultStyle.errorColorDerivationMode)).toString());
errorFillColorDerivationMode=String2JKQTPColorDerivationMode(settings.value(group+"error_fill_color_mode", JKQTPColorDerivationMode2String(defaultStyle.errorFillColorDerivationMode)).toString());
symbolFillColorDerivationMode=String2JKQTPColorDerivationMode(settings.value(group+"symbol_fill_color_mode", JKQTPColorDerivationMode2String(defaultStyle.symbolFillColorDerivationMode)).toString());
}
void JKQTGraphsSpecificStyleProperties::saveSettings(QSettings &settings, const QString &group) const
{
settings.setValue(group+"linewidth", defaultLineWidth);
settings.setValue(group+"symbol_size", defaultSymbolSize);
settings.setValue(group+"symbol_line_size", defaultSymbolLineSize);
settings.setValue(group+"error_indicator_width", defaultErrorIndicatorWidth);
settings.setValue(group+"head_decorator_size_factor", defaultHeadDecoratorSizeFactor);
settings.setValue(group+"head_decorator_type", JKQTPLineDecoratorStyle2String(defaultHeadDecoratorStyle));
settings.setValue(group+"graph_color_mode", JKQTPColorDerivationMode2String(graphColorDerivationMode));
settings.setValue(group+"fill_color_mode", JKQTPColorDerivationMode2String(fillColorDerivationMode));
settings.setValue(group+"error_color_mode", JKQTPColorDerivationMode2String(errorColorDerivationMode));
settings.setValue(group+"error_fill_color_mode", JKQTPColorDerivationMode2String(errorFillColorDerivationMode));
settings.setValue(group+"symbol_fill_color_mode", JKQTPColorDerivationMode2String(symbolFillColorDerivationMode));
}
JKQTGeometricSpecificStyleProperties::JKQTGeometricSpecificStyleProperties(const JKQTBasePlotterStyle& parent):
JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType::Geometric, parent),
defaultColor(parent.defaultTextColor),
defaultLineStyle(Qt::SolidLine),
defaultSymbol(JKQTPGraphSymbols::JKQTPCross),
defaultFillStyle(Qt::SolidPattern)
{
}
JKQTGeometricSpecificStyleProperties::JKQTGeometricSpecificStyleProperties(const JKQTBasePlotterStyle& parent, const JKQTGraphsSpecificStyleProperties &other):
JKQTGraphsSpecificStyleProperties(other),
defaultColor(parent.defaultTextColor),
defaultLineStyle(Qt::SolidLine),
defaultSymbol(JKQTPGraphSymbols::JKQTPCross),
defaultFillStyle(Qt::SolidPattern)
{
}
JKQTGeometricSpecificStyleProperties::JKQTGeometricSpecificStyleProperties(JKQTPPlotStyleType type, const JKQTBasePlotterStyle &parent):
JKQTGraphsSpecificStyleProperties(type, parent),
defaultColor(parent.defaultTextColor),
defaultLineStyle(Qt::SolidLine),
defaultSymbol(JKQTPGraphSymbols::JKQTPCross),
defaultFillStyle(Qt::SolidPattern)
{
}
void JKQTGeometricSpecificStyleProperties::loadSettings(const QSettings &settings, const QString &group, const JKQTGraphsSpecificStyleProperties &defaultStyle)
{
JKQTGraphsSpecificStyleProperties::loadSettings(settings, group, defaultStyle);
defaultColor=jkqtp_String2QColor(settings.value(group+"color", jkqtp_QColor2String(defaultColor)).toString());
defaultLineStyle=jkqtp_String2QPenStyle(settings.value(group+"line_style", jkqtp_QPenStyle2String(defaultLineStyle)).toString());
defaultSymbol=String2JKQTPGraphSymbols(settings.value(group+"symbol", JKQTPGraphSymbols2String(defaultSymbol)).toString());
defaultFillStyle=jkqtp_String2QBrushStyle(settings.value(group+"fill_style", jkqtp_QBrushStyle2String(defaultFillStyle)).toString());
}
void JKQTGeometricSpecificStyleProperties::saveSettings(QSettings &settings, const QString &group) const
{
JKQTGraphsSpecificStyleProperties::saveSettings(settings, group);
settings.setValue(group+"color", jkqtp_QColor2String(defaultColor));
settings.setValue(group+"line_style", jkqtp_QPenStyle2String(defaultLineStyle));
settings.setValue(group+"symbol", JKQTPGraphSymbols2String(defaultSymbol));
settings.setValue(group+"fill_style", jkqtp_QBrushStyle2String(defaultFillStyle));
}
JKQTAnnotationsSpecificStyleProperties::JKQTAnnotationsSpecificStyleProperties(const JKQTBasePlotterStyle& parent):
JKQTGeometricSpecificStyleProperties(JKQTPPlotStyleType::Geometric, parent),
defaultTextColor(parent.defaultTextColor),
defaultFontSize(12),
defaultFontName(parent.defaultFontName)
{
}
JKQTAnnotationsSpecificStyleProperties::JKQTAnnotationsSpecificStyleProperties(const JKQTBasePlotterStyle& parent, const JKQTGraphsSpecificStyleProperties &other):
JKQTGeometricSpecificStyleProperties(parent, other),
defaultTextColor(parent.defaultTextColor),
defaultFontSize(12),
defaultFontName(parent.defaultFontName)
{
}
void JKQTAnnotationsSpecificStyleProperties::loadSettings(const QSettings &settings, const QString &group, const JKQTAnnotationsSpecificStyleProperties &defaultStyle)
{
JKQTGeometricSpecificStyleProperties::loadSettings(settings, group, defaultStyle);
defaultTextColor=jkqtp_String2QColor(settings.value(group+"text_color", jkqtp_QColor2String(defaultStyle.defaultTextColor)).toString());
defaultFontSize=settings.value(group+"font_size", defaultStyle.defaultFontSize).toDouble();
defaultFontName=settings.value(group+"font_name", defaultStyle.defaultFontName).toString();
}
void JKQTAnnotationsSpecificStyleProperties::saveSettings(QSettings &settings, const QString &group) const
{
JKQTGeometricSpecificStyleProperties::saveSettings(settings, group);
settings.setValue(group+"text_color", jkqtp_QColor2String(defaultTextColor));
settings.setValue(group+"font_size", defaultFontSize);
settings.setValue(group+"font_name", defaultFontName);
}
JKQTGraphsBaseStyle::JKQTGraphsBaseStyle(const JKQTBasePlotterStyle& parent):
useAntiAliasingForGraphs(true),
defaultGraphStyle(JKQTPPlotStyleType::Default, parent),
barchartStyle(JKQTPPlotStyleType::Barchart, parent),
boxplotStyle(JKQTPPlotStyleType::Boxplot, parent),
filledStyle(JKQTPPlotStyleType::Filled, parent),
impulseStyle(JKQTPPlotStyleType::Impulses, parent),
geometricStyle(parent),
annotationStyle(parent),
defaultPalette(JKQTPMathImageColorPalette::JKQTPMathImageMATLAB)
{
defaultGraphColors<<QColor("red")<<QColor("green")<<QColor("blue")<<QColor("fuchsia")<<QColor("darkorange")
<<QColor("navy")<<QColor("firebrick")<<QColor("darkgreen")<<QColor("darkmagenta")
<<QColor("darkgreen")<<QColor("darkslateblue")<<QColor("maroon")<<QColor("indianred")
<<QColor("darkolivegreen")<<QColor("mediumpurple")<<QColor("darkcyan");
defaultGraphPenStyles<<Qt::SolidLine<<Qt::DashLine<<Qt::DotLine<<Qt::DashDotLine<<Qt::DashDotDotLine;
for (int i=2; i<=JKQTPMaxSymbolID; i++) defaultGraphSymbols.push_back(static_cast<JKQTPGraphSymbols>(i));
defaultGraphFillStyles<<Qt::SolidPattern;
}
void JKQTGraphsBaseStyle::loadSettings(const QSettings &settings, const QString &group, const JKQTGraphsBaseStyle &defaultStyle, const JKQTBasePlotterStyle& parent)
{
useAntiAliasingForGraphs=settings.value(group+"antialiase", defaultStyle.useAntiAliasingForGraphs).toBool();
defaultPalette=JKQTPImageTools::String2JKQTPMathImageColorPalette(settings.value(group+"palette", JKQTPImageTools::JKQTPMathImageColorPalette2String(defaultStyle.defaultPalette)).toString());
auto readID=[](const QString& k, const QString& start) {
if (k.startsWith(start)) {
QString kk=k;
kk.remove(0, start.size());
QString num="";
while (!kk.isEmpty() && kk.at(0).isDigit()) {
num+=kk.at(0);
kk.remove(0, 1);
}
bool ok=false;
int id=num.toInt(&ok);
if (ok) {
return id;
}
}
return -1;
};
defaultGraphColors.clear();
defaultGraphPenStyles.clear();
defaultGraphSymbols.clear();
defaultGraphFillStyles.clear();
QStringList allk=settings.allKeys();
for (auto& k: allk) {
int id=readID(k, group+"auto_styles/color");
if (id>=0) {
defaultGraphColors.push_back(jkqtp_String2QColor(settings.value(group+"auto_styles/color"+QString::number(id), jkqtp_QColor2String(QColor("red"))).toString()));
}
id=readID(k, group+"auto_styles/line_style");
if (id>=0) {
defaultGraphPenStyles.push_back(jkqtp_String2QPenStyle(settings.value(group+"auto_styles/line_style"+QString::number(id), jkqtp_QPenStyle2String(Qt::SolidLine)).toString()));
}
id=readID(k, group+"auto_styles/symbol");
if (id>=0) {
defaultGraphSymbols.push_back(String2JKQTPGraphSymbols(settings.value(group+"auto_styles/symbol"+QString::number(id), JKQTPGraphSymbols2String(JKQTPCross)).toString()));
}
id=readID(k, group+"auto_styles/fill_style");
if (id>=0) {
defaultGraphFillStyles.push_back(jkqtp_String2QBrushStyle(settings.value(group+"auto_styles/fill_style"+QString::number(id), jkqtp_QBrushStyle2String(Qt::SolidPattern)).toString()));
}
}
if (defaultGraphColors.size()==0) {
for (int i=defaultGraphColors.size(); i<defaultStyle.defaultGraphColors.size(); i++) {
defaultGraphColors.push_back(defaultStyle.defaultGraphColors[i]);
}
}
if (defaultGraphPenStyles.size()==0) {
for (int i=defaultGraphPenStyles.size(); i<defaultStyle.defaultGraphPenStyles.size(); i++) {
defaultGraphPenStyles.push_back(defaultStyle.defaultGraphPenStyles[i]);
}
}
if (defaultGraphSymbols.size()==0) {
for (int i=defaultGraphSymbols.size(); i<defaultStyle.defaultGraphSymbols.size(); i++) {
defaultGraphSymbols.push_back(defaultStyle.defaultGraphSymbols[i]);
}
}
if (defaultGraphFillStyles.size()==0) {
for (int i=defaultGraphFillStyles.size(); i<defaultStyle.defaultGraphFillStyles.size(); i++) {
defaultGraphFillStyles.push_back(defaultStyle.defaultGraphFillStyles[i]);
}
}
defaultGraphStyle.loadSettings(settings, group+"graphs_base/", JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType::Default, parent));
barchartStyle.loadSettings(settings, group+"graphs_barchart/", defaultGraphStyle);
boxplotStyle.loadSettings(settings, group+"graphs_boxplot/", defaultGraphStyle);
filledStyle.loadSettings(settings, group+"graphs_filled/", defaultGraphStyle);
impulseStyle.loadSettings(settings, group+"graphs_impulses/", defaultGraphStyle);
geometricStyle.loadSettings(settings, group+"graphs_geometric/", JKQTGeometricSpecificStyleProperties(parent, defaultGraphStyle));
annotationStyle.loadSettings(settings, group+"graphs_annotation/", JKQTAnnotationsSpecificStyleProperties(parent, defaultGraphStyle));
}
void JKQTGraphsBaseStyle::saveSettings(QSettings &settings, const QString &group) const
{
settings.setValue(group+"antialiase", useAntiAliasingForGraphs);
settings.setValue(group+"palette", JKQTPImageTools::JKQTPMathImageColorPalette2String(defaultPalette));
int cnt=0;
for (auto& gs: defaultGraphColors) {
settings.setValue(group+"auto_styles/color"+QString::number(cnt), jkqtp_QColor2String(gs));
cnt++;
}
cnt=0;
for (auto& gs: defaultGraphPenStyles) {
settings.setValue(group+"auto_styles/line_style"+QString::number(cnt), jkqtp_QPenStyle2String(gs));
cnt++;
}
cnt=0;
for (auto& gs: defaultGraphSymbols) {
settings.setValue(group+"auto_styles/symbol"+QString::number(cnt), JKQTPGraphSymbols2String(gs));
cnt++;
}
cnt=0;
for (auto& gs: defaultGraphFillStyles) {
settings.setValue(group+"auto_styles/fill_style"+QString::number(cnt), jkqtp_QBrushStyle2String(gs));
cnt++;
}
defaultGraphStyle.saveSettings(settings, group+"graphs_base/");
barchartStyle.saveSettings(settings, group+"graphs_barchart/");
boxplotStyle.saveSettings(settings, group+"graphs_boxplot/");
filledStyle.saveSettings(settings, group+"graphs_filled/");
impulseStyle.saveSettings(settings, group+"graphs_impulses/");
geometricStyle.saveSettings(settings, group+"graphs_geometric/");
annotationStyle.saveSettings(settings, group+"graphs_annotation/");
}
const JKQTGraphsSpecificStyleProperties &JKQTGraphsBaseStyle::getGraphStyleByType(JKQTPPlotStyleType type) const
{
switch (type) {
case JKQTPPlotStyleType::Default:
return defaultGraphStyle;
case JKQTPPlotStyleType::Barchart:
return barchartStyle;
case JKQTPPlotStyleType::Boxplot:
return boxplotStyle;
case JKQTPPlotStyleType::Filled:
return filledStyle;
case JKQTPPlotStyleType::Impulses:
return impulseStyle;
case JKQTPPlotStyleType::Geometric:
return geometricStyle;
case JKQTPPlotStyleType::Annotation:
return annotationStyle;
}
return defaultGraphStyle;
}

View File

@ -0,0 +1,264 @@
/*
Copyright (c) 2008-2020 Jan W. Krieger (<jan@jkrieger.de>)
This software is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef JKQTPGRAPHSBASESTYLE_H
#define JKQTPGRAPHSBASESTYLE_H
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtpimagetools.h"
#include "jkqtplotter/jkqtpcoordinateaxesstyle.h"
#include "jkqtplotter/jkqtpkeystyle.h"
#include "jkqtplotter/jkqtpimagetools.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtcommon/jkqtpdrawingtools.h"
#include "jkqtcommon/jkqtpbasicimagetools.h"
#include <QColor>
#include <QPainter>
#include <QString>
#include <QHash>
#include <QPair>
#include <QVector>
#include <QSettings>
class JKQTBasePlotterStyle; // forward
/** \brief Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of graphs
* \ingroup jkqtpplotter_styling
*
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
*/
class JKQTPLOTTER_LIB_EXPORT JKQTGraphsSpecificStyleProperties {
Q_GADGET
public:
JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType type, const JKQTBasePlotterStyle& parent);
JKQTGraphsSpecificStyleProperties(const JKQTGraphsSpecificStyleProperties& other)=default;
JKQTGraphsSpecificStyleProperties(JKQTGraphsSpecificStyleProperties&& other)=default;
JKQTGraphsSpecificStyleProperties& operator=(const JKQTGraphsSpecificStyleProperties& other)=default;
JKQTGraphsSpecificStyleProperties& operator=(JKQTGraphsSpecificStyleProperties&& other)=default;
/** \brief loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object
*
* \param settings QSettings-object to read from
* \param group Group in the QSettings-object to read from
* \param defaultStyle If a setting cannot be found in \a settings, default values are taken from this object
* By default, this is a default-constructed object
*/
void loadSettings(const QSettings &settings, const QString& group, const JKQTGraphsSpecificStyleProperties &defaultStyle);
/** \brief saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object.
*
* \param settings QSettings-object to save to
* \param group Group in the QSettings-object to save to
*/
void saveSettings(QSettings& settings, const QString& group) const;
/** \brief width (in pt) of lines used for newly added graphs */
double defaultLineWidth;
/** \brief size (in pt) of symbols used for newly added graphs */
double defaultSymbolSize;
/** \brief width (in pt) of the outline of symbols used for newly added graphs */
double defaultSymbolLineSize;
/** \brief width (in pt) of lines used for the error indicators of newly added graphs */
double defaultErrorIndicatorWidth;
/** \brief head decorator style */
JKQTPLineDecoratorStyle defaultHeadDecoratorStyle;
/** \brief head decorator size-factor, used to calculate the size of the arrow from the line width */
double defaultHeadDecoratorSizeFactor;
/** \brief defines how to derive the basic graph color for a new graph from the color selected from JKQTGraphsBaseStyle::defaultGraphColors
*
* This property is usually JKQTPFFCMSameColor, but can be changed to allow to e.g. fill
* barcharts always with a lighter color than the full color ...
*/
JKQTPColorDerivationMode graphColorDerivationMode;
/** \brief defines how to derive a fill color for a new graph */
JKQTPColorDerivationMode fillColorDerivationMode;
/** \brief defines how to derive an error color for a new graph */
JKQTPColorDerivationMode errorColorDerivationMode;
/** \brief defines how to derive an error fill color from the error color for a new graph */
JKQTPColorDerivationMode errorFillColorDerivationMode;
/** \brief defines how to derive a symbol fill color for a new graph */
JKQTPColorDerivationMode symbolFillColorDerivationMode;
};
/** \brief Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of geometric elements
* \ingroup jkqtpplotter_styling
*
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
*/
class JKQTPLOTTER_LIB_EXPORT JKQTGeometricSpecificStyleProperties: public JKQTGraphsSpecificStyleProperties {
Q_GADGET
public:
JKQTGeometricSpecificStyleProperties(const JKQTBasePlotterStyle& parent);
JKQTGeometricSpecificStyleProperties(const JKQTBasePlotterStyle& parent, const JKQTGraphsSpecificStyleProperties& other);
JKQTGeometricSpecificStyleProperties(JKQTPPlotStyleType type, const JKQTBasePlotterStyle& parent);
JKQTGeometricSpecificStyleProperties(const JKQTGeometricSpecificStyleProperties& other)=default;
JKQTGeometricSpecificStyleProperties(JKQTGeometricSpecificStyleProperties&& other)=default;
JKQTGeometricSpecificStyleProperties& operator=(const JKQTGeometricSpecificStyleProperties& other)=default;
JKQTGeometricSpecificStyleProperties& operator=(JKQTGeometricSpecificStyleProperties&& other)=default;
/** \brief loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object
*
* \param settings QSettings-object to read from
* \param group Group in the QSettings-object to read from
* \param defaultStyle If a setting cannot be found in \a settings, default values are taken from this object
* By default, this is a default-constructed object
*/
void loadSettings(const QSettings &settings, const QString& group, const JKQTGraphsSpecificStyleProperties &defaultStyle);
/** \brief saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object.
*
* \param settings QSettings-object to save to
* \param group Group in the QSettings-object to save to
*/
void saveSettings(QSettings& settings, const QString& group) const;
/** \brief graph color used */
QColor defaultColor;
/** \brief graph line style used */
Qt::PenStyle defaultLineStyle;
/** \brief graph symbol used */
JKQTPGraphSymbols defaultSymbol;
/** \brief graph fill style used */
Qt::BrushStyle defaultFillStyle;
};
/** \brief Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of annotation elements
* \ingroup jkqtpplotter_styling
*
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
*/
class JKQTPLOTTER_LIB_EXPORT JKQTAnnotationsSpecificStyleProperties: public JKQTGeometricSpecificStyleProperties {
Q_GADGET
public:
JKQTAnnotationsSpecificStyleProperties(const JKQTBasePlotterStyle& parent);
JKQTAnnotationsSpecificStyleProperties(const JKQTBasePlotterStyle& parent, const JKQTGraphsSpecificStyleProperties& other);
JKQTAnnotationsSpecificStyleProperties(const JKQTAnnotationsSpecificStyleProperties& other)=default;
JKQTAnnotationsSpecificStyleProperties(JKQTAnnotationsSpecificStyleProperties&& other)=default;
JKQTAnnotationsSpecificStyleProperties& operator=(const JKQTAnnotationsSpecificStyleProperties& other)=default;
JKQTAnnotationsSpecificStyleProperties& operator=(JKQTAnnotationsSpecificStyleProperties&& other)=default;
/** \brief loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object
*
* \param settings QSettings-object to read from
* \param group Group in the QSettings-object to read from
* \param defaultStyle If a setting cannot be found in \a settings, default values are taken from this object
* By default, this is a default-constructed object
*/
void loadSettings(const QSettings &settings, const QString& group, const JKQTAnnotationsSpecificStyleProperties &defaultStyle);
/** \brief saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object.
*
* \param settings QSettings-object to save to
* \param group Group in the QSettings-object to save to
*/
void saveSettings(QSettings& settings, const QString& group) const;
/** \brief defines how to derive a text color for a new graph */
JKQTPColorDerivationMode textColorDerivationMode;
/** \brief default text color in the plot */
QColor defaultTextColor;
/** \brief default font size in the plot [pt] */
double defaultFontSize;
/** \brief default font name in the plot */
QString defaultFontName;
};
/** \brief Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of a JKQTBasePlotter
* \ingroup jkqtpplotter_styling
*
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
*/
class JKQTPLOTTER_LIB_EXPORT JKQTGraphsBaseStyle {
Q_GADGET
public:
JKQTGraphsBaseStyle(const JKQTBasePlotterStyle& parent);
/** \brief loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object
*
* \param settings QSettings-object to read from
* \param group Group in the QSettings-object to read from
* \param defaultStyle If a setting cannot be found in \a settings, default values are taken from this object
* By default, this is a default-constructed object
*/
void loadSettings(const QSettings &settings, const QString& group, const JKQTGraphsBaseStyle &defaultStyle, const JKQTBasePlotterStyle& parent);
/** \brief saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object.
*
* \param settings QSettings-object to save to
* \param group Group in the QSettings-object to save to
*/
void saveSettings(QSettings& settings, const QString& group=QString("graphs_styling/")) const;
/** \brief specifies whether to use antialiasing for plotting the graphs
*
* \note You can set this property \c false to increase plotting speed of complex plots (with many graphs inside). You can reach a
* roughly three-fold speed improvement!
*/
bool useAntiAliasingForGraphs;
/** \brief styling options for standard graphs */
JKQTGraphsSpecificStyleProperties defaultGraphStyle;
/** \brief styling options for bargraph graphs */
JKQTGraphsSpecificStyleProperties barchartStyle;
/** \brief styling options for boxplots graphs */
JKQTGraphsSpecificStyleProperties boxplotStyle;
/** \brief styling options for filled graphs */
JKQTGraphsSpecificStyleProperties filledStyle;
/** \brief styling options for impulses graphs */
JKQTGraphsSpecificStyleProperties impulseStyle;
/** \brief styling options for geometric elements */
JKQTGeometricSpecificStyleProperties geometricStyle;
/** \brief styling options for annotation elements */
JKQTAnnotationsSpecificStyleProperties annotationStyle;
/** \brief returns defaultGraphStyle, barchartStyle, ..., depending on the value of \a type */
const JKQTGraphsSpecificStyleProperties& getGraphStyleByType(JKQTPPlotStyleType type) const;
/** \brief color palette used by default for new graphs */
JKQTPMathImageColorPalette defaultPalette;
/** \brief colors used to automatically collor different graphs differently */
QVector<QColor> defaultGraphColors;
/** \brief Qt::PenStyle used to automatically style different graphs differently */
QVector<Qt::PenStyle> defaultGraphPenStyles;
/** \brief JKQTPGraphSymbols used to automatically assign to different graphs */
QVector<JKQTPGraphSymbols> defaultGraphSymbols;
/** \brief Qt::BrushStyle used to automatically style different graphs differently */
QVector<Qt::BrushStyle> defaultGraphFillStyles;
};
#endif // JKQTPGRAPHSBASESTYLE_H

View File

@ -34,13 +34,14 @@ JKQTPGraphLineStyleMixin::JKQTPGraphLineStyleMixin()
m_highlightingLineColor.setAlphaF(0.5);
}
void JKQTPGraphLineStyleMixin::initLineStyle(JKQTBasePlotter* parent, int &parentPlotStyle)
void JKQTPGraphLineStyleMixin::initLineStyle(JKQTBasePlotter* parent, int &parentPlotStyle, JKQTPPlotStyleType styletype)
{
if (parent) { // get style settings from parent object
if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle();
m_linePen.setColor(parent->getPlotStyle(parentPlotStyle).color());
m_linePen.setStyle(parent->getPlotStyle(parentPlotStyle).style());
m_lineWidth=parent->getPlotStyle(parentPlotStyle).widthF();
const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle, styletype);
m_linePen.setColor(pen.color());
m_linePen.setStyle(pen.style());
m_lineWidth=pen.widthF();
m_highlightingLineColor=getLineColor();
m_highlightingLineColor.setAlphaF(0.5);
}
@ -169,15 +170,16 @@ JKQTPGraphSymbolStyleMixin::JKQTPGraphSymbolStyleMixin()
m_symbolLineWidth=1;
}
void JKQTPGraphSymbolStyleMixin::initSymbolStyle(JKQTBasePlotter *parent, int& parentPlotStyle)
void JKQTPGraphSymbolStyleMixin::initSymbolStyle(JKQTBasePlotter *parent, int& parentPlotStyle, JKQTPPlotStyleType styletype)
{
if (parent) { // get style settings from parent object
if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle();
m_symbolColor=parent->getPlotStyle(parentPlotStyle).color();
m_symbolSize=parent->getPlotStyle(parentPlotStyle).symbolSize();
m_symbolLineWidth=parent->getPlotStyle(parentPlotStyle).symbolLineWidthF();
m_symbolType=parent->getPlotStyle(parentPlotStyle).symbol();
m_symbolFillColor=parent->getPlotStyle(parentPlotStyle).symbolFillColor();
const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle, styletype);
m_symbolColor=pen.color();
m_symbolSize=pen.symbolSize();
m_symbolLineWidth=pen.symbolLineWidthF();
m_symbolType=pen.symbol();
m_symbolFillColor=pen.symbolFillColor();
}
}
@ -286,13 +288,14 @@ JKQTPGraphFillStyleMixin::JKQTPGraphFillStyleMixin()
}
void JKQTPGraphFillStyleMixin::initFillStyle(JKQTBasePlotter *parent, int &parentPlotStyle)
void JKQTPGraphFillStyleMixin::initFillStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype)
{
if (parent) { // get style settings from parent object
if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle();
m_fillColor=parent->getPlotStyle(parentPlotStyle).fillColor();
const JKQTBasePlotter::JKQTPPen pen=parent->getPlotStyle(parentPlotStyle, styletype);
m_fillColor=pen.fillColor();
m_fillBrush.setColor(m_fillColor);
m_fillBrush.setStyle(parent->getPlotStyle(parentPlotStyle).fillStyle());
m_fillBrush.setStyle(pen.fillStyle());
}
}
@ -403,16 +406,17 @@ QPen JKQTPGraphLineStyleMixin::getHighlightingLinePenForRects(JKQTPEnhancedPaint
JKQTPGraphTextStyleMixin::JKQTPGraphTextStyleMixin(JKQTBasePlotter *parent)
{
m_textFontName=parent->getDefaultTextFontName();
m_textFontSize=parent->getDefaultTextSize();
m_textColor=parent->getDefaultTextColor();
m_textFontSize=parent->getCurrentPlotterStyle().graphsStyle.annotationStyle.defaultFontSize;
m_textColor=parent->getCurrentPlotterStyle().graphsStyle.annotationStyle.defaultTextColor;
m_textFontName=parent->getCurrentPlotterStyle().graphsStyle.annotationStyle.defaultFontName;
}
void JKQTPGraphTextStyleMixin::initTextStyle(JKQTBasePlotter *parent, int &parentPlotStyle)
void JKQTPGraphTextStyleMixin::initTextStyle(JKQTBasePlotter *parent, int &/*parentPlotStyle*/, JKQTPPlotStyleType styletype)
{
if (parent) { // get style settings from parent object
if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle();
m_textColor=parent->getPlotStyle(parentPlotStyle).color();
if (parent && styletype==JKQTPPlotStyleType::Annotation) { // get style settings from parent object
m_textFontSize=parent->getCurrentPlotterStyle().graphsStyle.annotationStyle.defaultFontSize;
m_textColor=parent->getCurrentPlotterStyle().graphsStyle.annotationStyle.defaultTextColor;
m_textFontName=parent->getCurrentPlotterStyle().graphsStyle.annotationStyle.defaultFontName;
}
}
@ -459,9 +463,13 @@ JKQTPGraphDecoratedLineStyleMixin::JKQTPGraphDecoratedLineStyleMixin():
m_tailDecoratorSizeFactor=m_headDecoratorSizeFactor=8.0;
}
void JKQTPGraphDecoratedLineStyleMixin::initDecoratedLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle)
void JKQTPGraphDecoratedLineStyleMixin::initDecoratedLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype)
{
initLineStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, styletype);
if (parent) { // get style settings from parent object
m_headDecoratorStyle=parent->getCurrentPlotterStyle().graphsStyle.getGraphStyleByType(styletype).defaultHeadDecoratorStyle;
m_headDecoratorSizeFactor=m_tailDecoratorSizeFactor=parent->getCurrentPlotterStyle().graphsStyle.getGraphStyleByType(styletype).defaultHeadDecoratorSizeFactor;
}
}
JKQTPGraphDecoratedLineStyleMixin::~JKQTPGraphDecoratedLineStyleMixin()
@ -528,9 +536,13 @@ JKQTPGraphDecoratedHeadLineStyleMixin::JKQTPGraphDecoratedHeadLineStyleMixin():
m_headDecoratorSizeFactor=8.0;
}
void JKQTPGraphDecoratedHeadLineStyleMixin::initDecoratedHeadLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle)
void JKQTPGraphDecoratedHeadLineStyleMixin::initDecoratedHeadLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype)
{
initLineStyle(parent, parentPlotStyle);
initLineStyle(parent, parentPlotStyle, styletype);
if (parent) { // get style settings from parent object
m_headDecoratorStyle=parent->getCurrentPlotterStyle().graphsStyle.getGraphStyleByType(styletype).defaultHeadDecoratorStyle;
m_headDecoratorSizeFactor=parent->getCurrentPlotterStyle().graphsStyle.getGraphStyleByType(styletype).defaultHeadDecoratorSizeFactor;
}
}
JKQTPGraphDecoratedHeadLineStyleMixin::~JKQTPGraphDecoratedHeadLineStyleMixin()

View File

@ -24,6 +24,7 @@
#include <QBrush>
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtpbaseplotter.h"
#include "jkqtcommon/jkqtpdrawingtools.h"
@ -31,7 +32,6 @@
#define jkqtpgraphsbasestylingmixins_H
class JKQTBasePlotter; // forward
class JKQTPlotter; // forward
@ -51,7 +51,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphLineStyleMixin {
/** \brief class constructor */
JKQTPGraphLineStyleMixin();
/** \brief initiaize the line style (from the parent plotter) */
void initLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle);
void initLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype=JKQTPPlotStyleType::Default);
virtual ~JKQTPGraphLineStyleMixin();
@ -161,7 +161,7 @@ public:
/** \brief class constructor */
JKQTPGraphDecoratedHeadLineStyleMixin();
/** \brief initiaize the line style (from the parent plotter) */
void initDecoratedHeadLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle);
void initDecoratedHeadLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype=JKQTPPlotStyleType::Default);
virtual ~JKQTPGraphDecoratedHeadLineStyleMixin();
@ -212,7 +212,7 @@ public:
/** \brief class constructor */
JKQTPGraphDecoratedLineStyleMixin();
/** \brief initiaize the line style (from the parent plotter) */
void initDecoratedLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle);
void initDecoratedLineStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype=JKQTPPlotStyleType::Default);
virtual ~JKQTPGraphDecoratedLineStyleMixin();
@ -283,7 +283,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphSymbolStyleMixin {
/** \brief class constructor */
JKQTPGraphSymbolStyleMixin();
/** \brief initiaize the symbol style (from the parent plotter) */
void initSymbolStyle(JKQTBasePlotter *parent, int &parentPlotStyle);
void initSymbolStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype=JKQTPPlotStyleType::Default);
virtual ~JKQTPGraphSymbolStyleMixin();
@ -399,7 +399,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphFillStyleMixin {
JKQTPGraphFillStyleMixin();
/** \brief initiaize the fill style (from the parent plotter) */
void initFillStyle(JKQTBasePlotter* parent, int &parentPlotStyle);
void initFillStyle(JKQTBasePlotter* parent, int &parentPlotStyle, JKQTPPlotStyleType styletype=JKQTPPlotStyleType::Default);
virtual ~JKQTPGraphFillStyleMixin();
@ -497,7 +497,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphTextStyleMixin {
JKQTPGraphTextStyleMixin(JKQTBasePlotter *parent);
/** \brief initiaize the fill style (from the parent plotter) */
void initTextStyle(JKQTBasePlotter* parent, int &parentPlotStyle);
void initTextStyle(JKQTBasePlotter* parent, int &parentPlotStyle, JKQTPPlotStyleType styletype=JKQTPPlotStyleType::Default);
virtual ~JKQTPGraphTextStyleMixin();

View File

@ -77,7 +77,7 @@ JKQTPColorPaletteStyleAndToolsMixin::JKQTPColorPaletteStyleAndToolsMixin(JKQTBas
this->colorBarTopVisible=false;
this->colorBarRightVisible=true;
if (parent) this->palette=parent->getCurrentPlotterStyle().defaultPalette;
if (parent) this->palette=parent->getCurrentPlotterStyle().graphsStyle.defaultPalette;
}

View File

@ -28,7 +28,7 @@
class JKQTBasePlotterStyle; // forward
/** \brief Support Class for JKQTBasePlotter, which summarizes all proeprties that define the visual styling of the key in a JKQTBasePlotter
/** \brief Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of the key in a JKQTBasePlotter
* \ingroup jkqtpplotter_styling
*
* \see JKQTBasePlotter, JKQTBasePlotterStyle, \ref jkqtpplotter_styling

View File

@ -31,7 +31,7 @@
#include <QSettings>
/** \brief Support Class for JKQTPlotter, which summarizes all proeprties that define the visual styling of a JKQTPlotter
/** \brief Support Class for JKQTPlotter, which summarizes all properties that define the visual styling of a JKQTPlotter
* \ingroup jkqtpplotter_styling
*
* \see JKQTPlotter, \ref jkqtpplotter_styling

View File

@ -379,6 +379,12 @@ bool JKQTPCADrawModeHasAxisLabel(JKQTPCADrawMode pos)
QString JKQTPColorDerivationMode2String(JKQTPColorDerivationMode mode)
{
switch(mode) {
case JKQTPFFCMFullyTransparentColor: return "transparent";
case JKQTPFFCMBlack: return "black";
case JKQTPFFCMWhite: return "white";
case JKQTPFFCMGrey25: return "grey25";
case JKQTPFFCMGrey50: return "grey50";
case JKQTPFFCMGrey75: return "grey75";
case JKQTPFFCMSameColor: return "same";
case JKQTPFFCMInvertedColor: return "inverted";
case JKQTPFFCMLighterColor: return "lighter";
@ -395,8 +401,14 @@ QString JKQTPColorDerivationMode2String(JKQTPColorDerivationMode mode)
JKQTPColorDerivationMode String2JKQTPColorDerivationMode(const QString &mode)
{
QString m=mode.trimmed().toLower();
const QString m=mode.trimmed().toLower();
if (m=="transparent" || m=="no_color") return JKQTPFFCMFullyTransparentColor;
if (m=="same") return JKQTPFFCMSameColor;
if (m=="black") return JKQTPFFCMBlack;
if (m=="white") return JKQTPFFCMWhite;
if (m=="grey25") return JKQTPFFCMGrey25;
if (m=="grey50") return JKQTPFFCMGrey50;
if (m=="grey75") return JKQTPFFCMGrey75;
if (m=="inverted") return JKQTPFFCMInvertedColor;
if (m=="lighter") return JKQTPFFCMLighterColor;
if (m=="even_lighter") return JKQTPFFCMEvenLighterColor;
@ -409,21 +421,27 @@ JKQTPColorDerivationMode String2JKQTPColorDerivationMode(const QString &mode)
return JKQTPFFCMSameColor;
}
QColor JKQTPGetDerivedColor(JKQTPColorDerivationMode mode, const QColor &col)
QColor JKQTPGetDerivedColor(JKQTPColorDerivationMode mode, const QColor &basecolor)
{
switch(mode) {
case JKQTPFFCMSameColor: return col;
case JKQTPFFCMInvertedColor: return QColor(255-col.red(), 255-col.green(), 255-col.blue(), col.alpha());
case JKQTPFFCMLighterColor: return col.lighter();
case JKQTPFFCMEvenLighterColor: return col.lighter().lighter();
case JKQTPFFCMDarkerColor: return col.darker();
case JKQTPFFCMEvenDarkerColor: return col.darker().darker();
case JKQTPFFCMMoreTransparentColor: { QColor c=col; c.setAlphaF(0.66*c.alphaF()); return c; }
case JKQTPFFCMEvenMoreTransparentColor: { QColor c=col; c.setAlphaF(0.33*c.alphaF()); return c; }
case JKQTPFFCMLessTransparentColor: { QColor c=col; c.setAlphaF(c.alphaF()+(1.0-c.alphaF())*0.33); return c; }
case JKQTPFFCMEvenLessTransparentColor: { QColor c=col; c.setAlphaF(c.alphaF()+(1.0-c.alphaF())*0.66); return c; }
case JKQTPFFCMSameColor: return basecolor;
case JKQTPFFCMFullyTransparentColor: return QColor(Qt::transparent);
case JKQTPFFCMBlack: return QColor(Qt::black);
case JKQTPFFCMWhite: return QColor(Qt::white);
case JKQTPFFCMGrey25: return QColor(static_cast<uint8_t>(0.25*255.0),static_cast<uint8_t>(0.25*255.0),static_cast<uint8_t>(0.25*255.0));
case JKQTPFFCMGrey50: return QColor(static_cast<uint8_t>(0.50*255.0),static_cast<uint8_t>(0.50*255.0),static_cast<uint8_t>(0.50*255.0));
case JKQTPFFCMGrey75: return QColor(static_cast<uint8_t>(0.75*255.0),static_cast<uint8_t>(0.75*255.0),static_cast<uint8_t>(0.75*255.0));
case JKQTPFFCMInvertedColor: return QColor(255-basecolor.red(), 255-basecolor.green(), 255-basecolor.blue(), basecolor.alpha());
case JKQTPFFCMLighterColor: return basecolor.lighter();
case JKQTPFFCMEvenLighterColor: return basecolor.lighter().lighter();
case JKQTPFFCMDarkerColor: return basecolor.darker();
case JKQTPFFCMEvenDarkerColor: return basecolor.darker().darker();
case JKQTPFFCMMoreTransparentColor: { QColor c=basecolor; c.setAlphaF(0.66*c.alphaF()); return c; }
case JKQTPFFCMEvenMoreTransparentColor: { QColor c=basecolor; c.setAlphaF(0.33*c.alphaF()); return c; }
case JKQTPFFCMLessTransparentColor: { QColor c=basecolor; c.setAlphaF(c.alphaF()+(1.0-c.alphaF())*0.33); return c; }
case JKQTPFFCMEvenLessTransparentColor: { QColor c=basecolor; c.setAlphaF(c.alphaF()+(1.0-c.alphaF())*0.66); return c; }
}
return col;
return basecolor;
}
QString JKQTPUserActionMarkerType2String(JKQTPUserActionMarkerType act)

View File

@ -57,10 +57,21 @@ class JKQTPEnhancedPainter; // forward
class JKQTBasePlotter; // forward declaration
/** \brief used to specify teh type of graph when calling getPlotStyle()
* \ingroup jkqtpplottersupprt
*/
enum class JKQTPPlotStyleType {
Default, /*!< general graphs */
Barchart, /*!< barchart-type graphs */
Boxplot, /*!< boxplot-type graphs */
Filled, /*!< filled graphs */
Impulses, /*!< impulse-type graphs */
Geometric, /*!< geometric elements (e.g. rectangles, circles, lines, ...) */
Annotation, /*!< annotation elements */
};
/** \brief Styles in which to mark single positions during user actions in JKQTPlotter
* \ingroup jkqtpplottersupprt
*/
enum JKQTPUserActionMarkerType {
jkqtpuamtCircle=0, /*!< \brief a small circle around the position to mark */
@ -212,6 +223,13 @@ typedef JKQTPMouseDoubleClickActionsHashMap::const_iterator JKQTPMouseDoubleClic
*/
enum JKQTPColorDerivationMode {
JKQTPFFCMFullyTransparentColor, /*!< \brief fully transparent color */
JKQTPFFCMNoColor=JKQTPFFCMFullyTransparentColor, /*!< \brief fully transparent color */
JKQTPFFCMBlack, /*!< \brief fill with black */
JKQTPFFCMGrey75, /*!< \brief fill with 75% grey */
JKQTPFFCMGrey50, /*!< \brief fill with 50% grey */
JKQTPFFCMGrey25, /*!< \brief fill with 25% grey */
JKQTPFFCMWhite, /*!< \brief fill with white */
JKQTPFFCMSameColor, /*!< \brief fill with the same color */
JKQTPFFCMInvertedColor, /*!< \brief fill with the inverted color */
JKQTPFFCMLighterColor, /*!< \brief fill with the a lighter color */
@ -227,9 +245,12 @@ enum JKQTPColorDerivationMode {
/** \brief use a JKQTPColorDerivationMode to derive a color from \a col as specified
* \ingroup jkqtpplotter_styling
*
* \param mode the mode of how to modify the given color \a basecolor
* \param basecolor the color in which to base the derivation
*
* \see JKQTPColorDerivationMode
*/
JKQTPLOTTER_LIB_EXPORT QColor JKQTPGetDerivedColor(JKQTPColorDerivationMode mode, const QColor& col);
JKQTPLOTTER_LIB_EXPORT QColor JKQTPGetDerivedColor(JKQTPColorDerivationMode mode, const QColor& basecolor);
/** \brief construct a QColor, based on the given \a color, but with alpha set to the specified value \a alphaF
* \ingroup jkqtpplotter_styling