new: user-interaction tool that shows coordinates of data points near the current mouse position (when mouse is dragged, while mouse button is pressed)
new: user-interaction tool that measures distances and angles when mouse is dragged, while mouse button is pressed) update: reworked error indicator base classes and styling settings update: improved boxplot styling with a separate full-featured pen for the whiskers
@ -39,11 +39,14 @@ Changes, compared to \ref WHATSNEW_V2018_08 "v2018.08" include:
|
||||
<li> new: additional options for graph filling (color gradients, textures, ...) as provided by QBrush </li>
|
||||
<li> new: added a general feature to JKQTPPlotElement which allows to show a graph in a highlighted state (if supported by the derived graph class!) </li>
|
||||
<li> new: JKQTPXYParametrizedScatterGraph: added functors to transform column values into symbol type+size and line-width to give even more control </li>
|
||||
<li> new: user-interaction tool that shows coordinates of data points near the current mouse position (when mouse is dragged, while mouse button is pressed) \see jkqtpmdaToolTipForClosestDataPoint </li>
|
||||
<li> new: user-interaction tool that measures distances and angles when mouse is dragged, while mouse button is pressed) \see jkqtpmdaRuler </li>
|
||||
<li> changed: removed old selection-code and replaced by general highlighting feature </li>
|
||||
<li> changed: JKQTPStepHorizontalGraph has been renamed to JKQTPSpecialLineHorizontalGraph (vertical variants also) and have gained additional features (baseline for filling and drawing of symbols) </li>
|
||||
<li> changed: filled curve graphs (e.g. JKQTPSpecialLineHorizontalGraph) are now merely a specializedly initialized JKQTPSpecialLineHorizontalGraph </li>
|
||||
<li> deprecated: Removed datarange-feature </li>
|
||||
<li> update: \ref JKQTPLOTTER_USERINTERACTION "reworked user interactions API" </li>
|
||||
<li> update: \ref jkqtplotter_basegraphserrors "reworked error indicator base classes" </li>
|
||||
<li> fixed: colorbars at top were positioned over the plot label </li>
|
||||
<li> fixed: RGB-image plots now work properly with inverted axes (image is inverted, befor image was not shown at all) </li>
|
||||
</ul></li>
|
||||
|
BIN
doc/images/rulertool.gif
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
doc/images/rulertool_example.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
doc/images/tooltip_boxplot.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
doc/images/tooltiptool.gif
Normal file
After Width: | Height: | Size: 137 KiB |
BIN
doc/images/tooltiptool_example.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
@ -84,8 +84,8 @@ void TestWidgetFunctionPlots::setPFuncStyle()
|
||||
{
|
||||
pfunc->setDrawErrorLines(false);
|
||||
pfunc->setDrawErrorPolygons(false);
|
||||
if (pfuncErrorStyle->getErrorStyle()==JKQTPErrorLines) pfunc->setDrawErrorLines(true);
|
||||
if (pfuncErrorStyle->getErrorStyle()==JKQTPErrorPolygons) pfunc->setDrawErrorPolygons(true);
|
||||
if (pfuncErrorStyle->getErrorLineStyle()==JKQTPErrorLines) pfunc->setDrawErrorLines(true);
|
||||
if (pfuncErrorStyle->getErrorLineStyle()==JKQTPErrorPolygons) pfunc->setDrawErrorPolygons(true);
|
||||
pfunc->setDrawLine(chkPFuncDrawLine->isChecked());
|
||||
pfunc->setDisplaySamplePoints(chkPFuncDrawSamples->isChecked());
|
||||
plotFuncPlt->redrawPlot();
|
||||
|
@ -111,7 +111,7 @@ TestWidgetGraphs::TestWidgetGraphs(QWidget *parent) :
|
||||
|
||||
size_t yeb=plot->getPlotter()->addGraphWithXYError(cx2, cy21, cy22, cy22, "sine with errors", JKQTPFilledCurveX);
|
||||
plteErrors=plot->getPlotter()->getGraph(yeb);
|
||||
setErrorStyle(0);
|
||||
setErrorLineStyle(0);
|
||||
yeb=plot->getPlotter()->addGraph(cx2, cy21, "$5\\cdot\\sin(x)$", JKQTPLinesPoints);
|
||||
plteSymbols=plot->getPlotter()->getGraph(yeb);
|
||||
|
||||
@ -237,7 +237,7 @@ TestWidgetGraphs::TestWidgetGraphs(QWidget *parent) :
|
||||
layout->addWidget(cmbJKQTPPlotSymbol);
|
||||
JKQTPErrorPlotstyleComboBox* cmbErrors=new JKQTPErrorPlotstyleComboBox(this);
|
||||
cmbErrors->setCurrentErrorStyle(JKQTPErrorBars);
|
||||
connect(cmbErrors, SIGNAL(currentIndexChanged(int)), this, SLOT(setErrorStyle(int)));
|
||||
connect(cmbErrors, SIGNAL(currentIndexChanged(int)), this, SLOT(setErrorLineStyle(int)));
|
||||
layout->addWidget(cmbErrors);
|
||||
QDoubleSpinBox* spinScale=new QDoubleSpinBox(this);
|
||||
spinScale->setRange(0.1,5);
|
||||
@ -298,7 +298,7 @@ void TestWidgetGraphs::moveovl() {
|
||||
}
|
||||
|
||||
|
||||
void TestWidgetGraphs::setErrorStyle(int /*index*/)
|
||||
void TestWidgetGraphs::setErrorLineStyle(int /*index*/)
|
||||
{
|
||||
QComboBox* cmb=qobject_cast<QComboBox*>(sender());
|
||||
if (cmb) {
|
||||
|
@ -37,7 +37,7 @@ class TestWidgetGraphs : public QWidget
|
||||
public slots:
|
||||
void moveovl();
|
||||
|
||||
void setErrorStyle(int index);
|
||||
void setErrorLineStyle(int index);
|
||||
void setESSymbol(int index);
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* \ref JKQTPlotterBoxplotsGraphs
|
||||
*/
|
||||
|
||||
|
||||
#include <QApplication>
|
||||
#include "jkqtplotter/jkqtplotter.h"
|
||||
#include "jkqtplotter/jkqtpgraphsscatter.h"
|
||||
|
@ -44,9 +44,9 @@ First some data is added to the internal datastore (mostly, like explained in se
|
||||
c.setAlphaF(0.3);
|
||||
graph->setErrorFillColor(c);
|
||||
// set error indicator line width
|
||||
graph->setErrorWidth(1);
|
||||
graph->setErrorLineWidth(1);
|
||||
// set length of small bars at the end of error bars
|
||||
graph->setErrorbarSize(15);
|
||||
graph->setErrorBarCapSize(15);
|
||||
|
||||
|
||||
// set symbol (cross/X) + pen style (and color)dashed)
|
||||
@ -84,9 +84,9 @@ There are several variables that can be used to further style the error indicato
|
||||
c.setAlphaF(0.3);
|
||||
graph->setErrorFillColor(c);
|
||||
// set error indicator line width
|
||||
graph->setErrorWidth(1);
|
||||
graph->setErrorLineWidth(1);
|
||||
// set length of small bars at the end of error bars
|
||||
graph->setErrorbarSize(15);
|
||||
graph->setErrorBarCapSize(15);
|
||||
```
|
||||
|
||||
There are more properties that you can find in the documentation of the mix-in classes `JKQTPXYGraphErrors`, `JKQTPXGraphErrors`, `JKQTPYGraphErrors`, `JKQTPGraphErrors`.
|
||||
|
@ -73,9 +73,9 @@ int main(int argc, char* argv[])
|
||||
c.setAlphaF(0.3);
|
||||
graph->setErrorFillColor(c);
|
||||
// set error indicator line width
|
||||
graph->setErrorWidth(1);
|
||||
graph->setErrorLineWidth(1);
|
||||
// set length of small bars at the end of error bars
|
||||
graph->setErrorbarSize(15);
|
||||
graph->setErrorBarCapSize(15);
|
||||
|
||||
|
||||
// set symbol (cross/X) + pen style (and color)dashed)
|
||||
|
@ -98,6 +98,20 @@ There are several options to zoom, using the mouse:
|
||||
![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/doc/images/zoomin_mouse_contextmenu.gif)
|
||||
|
||||
Again these actions are limited to a single axis, if the mouse is above that axis (and not inside the actual plot rectangle).
|
||||
|
||||
### Ruler/Measurement Tool
|
||||
|
||||
JKQTPlotter provides a pre-built ruler tool that measures x- and y-distance between the start and end point, as well as the length of the connecting line and the angle of that line.<br>
|
||||
|
||||
![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/doc/images/rulertool.gif)
|
||||
|
||||
|
||||
### Data ToolTip Tool
|
||||
|
||||
JKQTPlotter provides a pre-built tool that, while the mouse button is pressed and the cursor is dragged over the plot, finds data points (of most graphs) near the mouse and displays their coordinates (and errors) inside a small tooltip:<br>
|
||||
|
||||
![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/doc/images/tooltiptool.gif)
|
||||
|
||||
|
||||
### Drawing Geometrical Forms
|
||||
|
||||
|
@ -19,15 +19,19 @@ TestUserInteraction::TestUserInteraction(QWidget *parent) :
|
||||
// setup layouts for form
|
||||
layout=new QGridLayout;
|
||||
layForm=new QFormLayout;
|
||||
layForm2=new QFormLayout;
|
||||
layLab=new QFormLayout;
|
||||
layChk=new QHBoxLayout;
|
||||
layChk2=new QHBoxLayout;
|
||||
layout->addLayout(layChk,0,0);
|
||||
layout->addLayout(layChk2,1,0);
|
||||
layout->addLayout(layForm,2,0);
|
||||
layout->addLayout(layForm2,2,1);
|
||||
layout->addLayout(layLab,3,0, 1,2);
|
||||
|
||||
// generate a JKQTPlotter and initialize some plot data
|
||||
plot=new JKQTPlotter(this);
|
||||
layout->addWidget(plot,3,0);
|
||||
layout->addWidget(plot,4,0, 1,2);
|
||||
initPlot();
|
||||
|
||||
// add some of the default QActions from the JKQTPlotter to the window menu
|
||||
@ -102,6 +106,8 @@ TestUserInteraction::TestUserInteraction(QWidget *parent) :
|
||||
cmbLeftNoModMouseAction->addItem("jkqtpmdaDrawEllipseForEvent");
|
||||
cmbLeftNoModMouseAction->addItem("jkqtpmdaDrawLineForEvent");
|
||||
cmbLeftNoModMouseAction->addItem("jkqtpmdaScribbleForEvents");
|
||||
cmbLeftNoModMouseAction->addItem("jkqtpmdaToolTipForClosestDataPoint");
|
||||
cmbLeftNoModMouseAction->addItem("jkqtpmdaRuler");
|
||||
cmbLeftNoModMouseAction->addItem("NoMouseAction");
|
||||
cmbLeftNoModMouseAction->setCurrentIndex(2);
|
||||
connect(cmbLeftNoModMouseAction, SIGNAL(currentIndexChanged(int)), this, SLOT(setLeftMouseAction(int)));
|
||||
@ -118,6 +124,8 @@ TestUserInteraction::TestUserInteraction(QWidget *parent) :
|
||||
cmbLeftCtrlModMouseAction->addItem("jkqtpmdaDrawEllipseForEvent");
|
||||
cmbLeftCtrlModMouseAction->addItem("jkqtpmdaDrawLineForEvent");
|
||||
cmbLeftCtrlModMouseAction->addItem("jkqtpmdaScribbleForEvents");
|
||||
cmbLeftCtrlModMouseAction->addItem("jkqtpmdaToolTipForClosestDataPoint");
|
||||
cmbLeftCtrlModMouseAction->addItem("jkqtpmdaRuler");
|
||||
cmbLeftCtrlModMouseAction->addItem("NoMouseAction");
|
||||
cmbLeftCtrlModMouseAction->setCurrentIndex(0);
|
||||
connect(cmbLeftCtrlModMouseAction, SIGNAL(currentIndexChanged(int)), this, SLOT(setLeftCtrlMouseAction(int)));
|
||||
@ -134,6 +142,8 @@ TestUserInteraction::TestUserInteraction(QWidget *parent) :
|
||||
cmbRightNoModMouseAction->addItem("jkqtpmdaDrawEllipseForEvent");
|
||||
cmbRightNoModMouseAction->addItem("jkqtpmdaDrawLineForEvent");
|
||||
cmbRightNoModMouseAction->addItem("jkqtpmdaScribbleForEvents");
|
||||
cmbRightNoModMouseAction->addItem("jkqtpmdaToolTipForClosestDataPoint");
|
||||
cmbRightNoModMouseAction->addItem("jkqtpmdaRuler");
|
||||
cmbRightNoModMouseAction->addItem("ContextMenu");
|
||||
cmbRightNoModMouseAction->setCurrentIndex(5);
|
||||
connect(cmbRightNoModMouseAction, SIGNAL(currentIndexChanged(int)), this, SLOT(setRightMouseAction(int)));
|
||||
@ -193,16 +203,100 @@ TestUserInteraction::TestUserInteraction(QWidget *parent) :
|
||||
connect(cmbMouseWheelAction, SIGNAL(currentIndexChanged(int)), this, SLOT(setMouseWheelNoModAction(int)));
|
||||
setMouseWheelNoModAction(cmbMouseWheelAction->currentIndex());
|
||||
|
||||
// add a QComboBox that allows to set the type of user-action markers
|
||||
cmbUserActionMarkerType=new QComboBox(this);
|
||||
layForm2->addRow("mouse action: marker type", cmbUserActionMarkerType);
|
||||
cmbUserActionMarkerType->addItem("jkqtpuamtCircle");
|
||||
cmbUserActionMarkerType->addItem("jkqtpuamtCrossHair");
|
||||
cmbUserActionMarkerType->addItem("jkqtpuamtCircleAndCrossHair");
|
||||
cmbUserActionMarkerType->setCurrentIndex(0);
|
||||
connect(cmbUserActionMarkerType, SIGNAL(currentIndexChanged(int)), this, SLOT(setUserActionMarkerType(int)));
|
||||
setUserActionMarkerType(cmbUserActionMarkerType->currentIndex());
|
||||
|
||||
// add a QComboBox that allows to set the fill&outline of user-action markers
|
||||
cmbUserActionMarkerColor=new QComboBox(this);
|
||||
layForm2->addRow("mouse action: marker color", cmbUserActionMarkerColor);
|
||||
cmbUserActionMarkerColor->addItem(jkqtp_QColor2String(plot->getUserActionMarkerPen().color()));
|
||||
cmbUserActionMarkerColor->addItem("red");
|
||||
cmbUserActionMarkerColor->addItem("blue");
|
||||
cmbUserActionMarkerColor->addItem("green");
|
||||
cmbUserActionMarkerColor->addItem("yellow");
|
||||
cmbUserActionMarkerColor->addItem("silver");
|
||||
cmbUserActionMarkerColor->addItem("black");
|
||||
cmbUserActionMarkerColor->addItem("white");
|
||||
cmbUserActionMarkerColor->setCurrentIndex(0);
|
||||
connect(cmbUserActionMarkerColor, SIGNAL(currentIndexChanged(int)), this, SLOT(setUserActionMarkerColor(int)));
|
||||
setUserActionMarkerColor(cmbUserActionMarkerColor->currentIndex());
|
||||
|
||||
// add a QComboBox that allows to set the outline color of user-action Opaques
|
||||
cmbUserActionOpaqueColor=new QComboBox(this);
|
||||
layForm2->addRow("mouse action: opaque outline color", cmbUserActionOpaqueColor);
|
||||
cmbUserActionOpaqueColor->addItem(jkqtp_QColor2String(plot->getUserActionOpaquePen().color()));
|
||||
cmbUserActionOpaqueColor->addItem("red");
|
||||
cmbUserActionOpaqueColor->addItem("blue");
|
||||
cmbUserActionOpaqueColor->addItem("green");
|
||||
cmbUserActionOpaqueColor->addItem("yellow");
|
||||
cmbUserActionOpaqueColor->addItem("silver");
|
||||
cmbUserActionOpaqueColor->addItem("black");
|
||||
cmbUserActionOpaqueColor->addItem("white");
|
||||
cmbUserActionOpaqueColor->setCurrentIndex(0);
|
||||
connect(cmbUserActionOpaqueColor, SIGNAL(currentIndexChanged(int)), this, SLOT(setUserActionOpaqueColor(int)));
|
||||
setUserActionOpaqueColor(cmbUserActionOpaqueColor->currentIndex());
|
||||
|
||||
// add a QComboBox that allows to set the fill color of user-action Opaques
|
||||
cmbUserActionOpaqueFillColor=new QComboBox(this);
|
||||
layForm2->addRow("mouse action: opaque fill color", cmbUserActionOpaqueFillColor);
|
||||
cmbUserActionOpaqueFillColor->addItem(jkqtp_QColor2String(plot->getUserActionOpaqueBrush().color()));
|
||||
cmbUserActionOpaqueFillColor->addItem("salmon");
|
||||
cmbUserActionOpaqueFillColor->addItem("aliceblue");
|
||||
cmbUserActionOpaqueFillColor->addItem("honeydew");
|
||||
cmbUserActionOpaqueFillColor->addItem("lightyellow");
|
||||
cmbUserActionOpaqueFillColor->addItem("lightgray");
|
||||
cmbUserActionOpaqueFillColor->addItem("silver");
|
||||
cmbUserActionOpaqueFillColor->addItem("white");
|
||||
cmbUserActionOpaqueFillColor->setCurrentIndex(0);
|
||||
connect(cmbUserActionOpaqueFillColor, SIGNAL(currentIndexChanged(int)), this, SLOT(setUserActionOpaqueFillColor(int)));
|
||||
setUserActionOpaqueFillColor(cmbUserActionOpaqueFillColor->currentIndex());
|
||||
|
||||
// add a QComboBox that allows to set the outline color of user-action Overlays
|
||||
cmbUserActionOverlayColor=new QComboBox(this);
|
||||
layForm2->addRow("mouse action: overlay outline color", cmbUserActionOverlayColor);
|
||||
cmbUserActionOverlayColor->addItem(jkqtp_QColor2String(plot->getUserActionOverlayPen().color()));
|
||||
cmbUserActionOverlayColor->addItem("red");
|
||||
cmbUserActionOverlayColor->addItem("blue");
|
||||
cmbUserActionOverlayColor->addItem("green");
|
||||
cmbUserActionOverlayColor->addItem("yellow");
|
||||
cmbUserActionOverlayColor->addItem("silver");
|
||||
cmbUserActionOverlayColor->addItem("black");
|
||||
cmbUserActionOverlayColor->addItem("white");
|
||||
cmbUserActionOverlayColor->setCurrentIndex(0);
|
||||
connect(cmbUserActionOverlayColor, SIGNAL(currentIndexChanged(int)), this, SLOT(setUserActionOverlayColor(int)));
|
||||
setUserActionOverlayColor(cmbUserActionOverlayColor->currentIndex());
|
||||
|
||||
// add a QComboBox that allows to set the fill color of user-action Overlays
|
||||
cmbUserActionOverlayFillColor=new QComboBox(this);
|
||||
layForm2->addRow("mouse action: overlay fill color", cmbUserActionOverlayFillColor);
|
||||
cmbUserActionOverlayFillColor->addItem(jkqtp_QColor2String(plot->getUserActionOverlayBrush().color()));
|
||||
cmbUserActionOverlayFillColor->addItem("red");
|
||||
cmbUserActionOverlayFillColor->addItem("blue");
|
||||
cmbUserActionOverlayFillColor->addItem("green");
|
||||
cmbUserActionOverlayFillColor->addItem("yellow");
|
||||
cmbUserActionOverlayFillColor->addItem("silver");
|
||||
cmbUserActionOverlayFillColor->addItem("black");
|
||||
cmbUserActionOverlayFillColor->addItem("white");
|
||||
cmbUserActionOverlayFillColor->setCurrentIndex(0);
|
||||
connect(cmbUserActionOverlayFillColor, SIGNAL(currentIndexChanged(int)), this, SLOT(setUserActionOverlayFillColor(int)));
|
||||
setUserActionOverlayFillColor(cmbUserActionOverlayFillColor->currentIndex());
|
||||
|
||||
|
||||
|
||||
// and add a QLabel to show the different events of the JKQTPlotter:
|
||||
labMouseMoved=new QLabel(this);
|
||||
layForm->addRow("last mouse moved:", labMouseMoved);
|
||||
layLab->addRow("last mouse moved:", labMouseMoved);
|
||||
labMouseClicked=new QLabel(this);
|
||||
layForm->addRow("last mouse clicked:", labMouseClicked);
|
||||
layLab->addRow("last mouse clicked:", labMouseClicked);
|
||||
labMouseAction=new QLabel(this);
|
||||
layForm->addRow("last plotter signal:", labMouseAction);
|
||||
layLab->addRow("last plotter signal:", labMouseAction);
|
||||
connect(plot, SIGNAL(plotMouseMove(double, double)), this, SLOT(plotMouseMove(double, double)));
|
||||
connect(plot, SIGNAL(plotMouseClicked(double, double, Qt::KeyboardModifiers , Qt::MouseButton)), this, SLOT(plotMouseClicked(double, double, Qt::KeyboardModifiers, Qt::MouseButton)));
|
||||
connect(plot, SIGNAL(plotMouseDoubleClicked(double, double, Qt::KeyboardModifiers, Qt::MouseButton)), this, SLOT(plotMouseDoubleClicked(double, double, Qt::KeyboardModifiers, Qt::MouseButton)));
|
||||
@ -215,6 +309,8 @@ TestUserInteraction::TestUserInteraction(QWidget *parent) :
|
||||
connect(plot, SIGNAL(userLineFinished(double, double, double, double, Qt::KeyboardModifiers)), this, SLOT(userLineFinished(double, double, double, double, Qt::KeyboardModifiers)));
|
||||
connect(plot, SIGNAL(userCircleFinished(double, double, double, Qt::KeyboardModifiers)), this, SLOT(userCircleFinished(double, double, double, Qt::KeyboardModifiers)));
|
||||
connect(plot, SIGNAL(userEllipseFinished(double, double, double, double, Qt::KeyboardModifiers)), this, SLOT(userEllipseFinished(double, double, double, double, Qt::KeyboardModifiers)));
|
||||
connect(plot, SIGNAL(rulerDisplayed(double, double, double, double, Qt::KeyboardModifiers)), this, SLOT(rulerDisplayed(double, double, double, double, Qt::KeyboardModifiers)));
|
||||
connect(plot, SIGNAL(tooltipDisplayed(double, double, const QStringList&, const QList<JKQTPPlotElement*>& )), this, SLOT(tooltipDisplayed(double, double, const QStringList&, const QList<JKQTPPlotElement*>&)));
|
||||
|
||||
|
||||
w->setLayout(layout);
|
||||
@ -267,6 +363,57 @@ void TestUserInteraction::setMouseWheelNoModAction(int index)
|
||||
else plot->registerMouseWheelAction(Qt::NoModifier, static_cast<JKQTPMouseWheelActions>(index));
|
||||
}
|
||||
|
||||
void TestUserInteraction::setUserActionMarkerType(int index)
|
||||
{
|
||||
plot->setUserActionMarkerType(static_cast<JKQTPUserActionMarkerType>(index)) ;
|
||||
}
|
||||
|
||||
void TestUserInteraction::setUserActionMarkerColor(int index)
|
||||
{
|
||||
QColor c=jkqtp_String2QColor(cmbUserActionMarkerColor->itemText(index));
|
||||
QPen p=plot->getUserActionMarkerPen();
|
||||
p.setColor(c);
|
||||
plot->setUserActionMarkerPen(p) ;
|
||||
QBrush b=plot->getUserActionMarkerBrush();
|
||||
c.setAlphaF(0.4);
|
||||
b.setColor(c);
|
||||
plot->setUserActionMarkerBrush(b) ;
|
||||
}
|
||||
|
||||
void TestUserInteraction::setUserActionOpaqueColor(int index)
|
||||
{
|
||||
QColor c=jkqtp_String2QColor(cmbUserActionOpaqueColor->itemText(index));
|
||||
QPen p=plot->getUserActionOpaquePen();
|
||||
p.setColor(c);
|
||||
plot->setUserActionOpaquePen(p) ;
|
||||
}
|
||||
|
||||
void TestUserInteraction::setUserActionOpaqueFillColor(int index)
|
||||
{
|
||||
QColor c=jkqtp_String2QColor(cmbUserActionOpaqueFillColor->itemText(index));
|
||||
QBrush b=plot->getUserActionOpaqueBrush();
|
||||
b.setColor(c.lighter());
|
||||
plot->setUserActionOpaqueBrush(b) ;
|
||||
|
||||
}
|
||||
|
||||
void TestUserInteraction::setUserActionOverlayColor(int index)
|
||||
{
|
||||
QColor c=jkqtp_String2QColor(cmbUserActionOverlayColor->itemText(index));
|
||||
QPen p=plot->getUserActionOverlayPen();
|
||||
p.setColor(c);
|
||||
plot->setUserActionOverlayPen(p) ;
|
||||
}
|
||||
|
||||
void TestUserInteraction::setUserActionOverlayFillColor(int index)
|
||||
{
|
||||
QColor c=jkqtp_String2QColor(cmbUserActionOverlayColor->itemText(index));
|
||||
QBrush b=plot->getUserActionOverlayBrush();
|
||||
c.setAlphaF(0.4);
|
||||
b.setColor(c);
|
||||
plot->setUserActionOverlayBrush(b) ;
|
||||
}
|
||||
|
||||
void TestUserInteraction::plotMouseMove(double x, double y)
|
||||
{
|
||||
labMouseMoved->setText(QString("plotMouseMove(%1, %2)").arg(x).arg(y));
|
||||
@ -343,6 +490,16 @@ void TestUserInteraction::userEllipseFinished(double x, double y, double radiusX
|
||||
labMouseAction->setText(QString("userEllipseFinished(x=%1, y=%2, radiusX=%3, radiusY=%4, modifiers=%5)").arg(x).arg(y).arg(radiusX).arg(radiusY).arg(KeyboradMod2String(modifiers)));
|
||||
}
|
||||
|
||||
void TestUserInteraction::tooltipDisplayed(double x, double y, const QStringList& entries, const QList<JKQTPPlotElement*>& graphs)
|
||||
{
|
||||
labMouseAction->setText(QString("tooltipDisplayed(x=%1, y=%2, entries=%3)").arg(x).arg(y).arg(entries.join(";;")));
|
||||
}
|
||||
|
||||
void TestUserInteraction::rulerDisplayed(double x1, double y1, double x2, double y2, Qt::KeyboardModifiers modifiers)
|
||||
{
|
||||
labMouseAction->setText(QString("rulerDisplayed(x1=%1/%2, x2=%3/%4, modifiers=%5)").arg(x1).arg(y1).arg(x2).arg(y2).arg(KeyboradMod2String(modifiers)));
|
||||
}
|
||||
|
||||
QString TestUserInteraction::KeyboradMod2String(Qt::KeyboardModifiers modifiers) {
|
||||
QString mod="";
|
||||
if ((modifiers & Qt::ShiftModifier) != 0) mod+="SHIFT ";
|
||||
@ -370,13 +527,14 @@ void TestUserInteraction::initPlot()
|
||||
JKQTPDatastore* ds=plot->getDatastore();
|
||||
|
||||
// 2. now we create data for a simple plot (a sine curve)
|
||||
QVector<double> X, Y1, Y2;
|
||||
QVector<double> X, Y1, Y2, EY2;
|
||||
const int Ndata=100;
|
||||
for (int i=0; i<Ndata; i++) {
|
||||
const double x=double(i)/double(Ndata)*8.0*M_PI;
|
||||
X<<x;
|
||||
Y1<<sin(x);
|
||||
Y2<<sin(x)*exp(-0.2*x);
|
||||
EY2<<fabs(0.2*sin(x));
|
||||
}
|
||||
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
@ -387,11 +545,13 @@ void TestUserInteraction::initPlot()
|
||||
size_t columnX=ds->addCopiedColumn(X, "x");
|
||||
size_t columnY1=ds->addCopiedColumn(Y1, "y1");
|
||||
size_t columnY2=ds->addCopiedColumn(Y2, "y2");
|
||||
size_t columnEY2=ds->addCopiedColumn(EY2, "ey2");
|
||||
|
||||
// 4. create a graph in the plot, which plots the dataset X/Y:
|
||||
JKQTPXYLineGraph* graph1=new JKQTPXYLineGraph(plot);
|
||||
JKQTPXYLineErrorGraph* graph1=new JKQTPXYLineErrorGraph(plot);
|
||||
graph1->setXColumn(columnX);
|
||||
graph1->setYColumn(columnY1);
|
||||
graph1->setYErrorColumn(columnEY2);
|
||||
graph1->setTitle(QObject::tr("sine graph"));
|
||||
plot->addGraph(graph1);
|
||||
|
||||
|
@ -29,6 +29,12 @@ class TestUserInteraction : public QMainWindow
|
||||
void setLeftDoubleClickMouseAction(int index);
|
||||
void setRightDoubleClickMouseAction(int index);
|
||||
void setMouseWheelNoModAction(int index);
|
||||
void setUserActionMarkerType(int index);
|
||||
void setUserActionMarkerColor(int index);
|
||||
void setUserActionOverlayColor(int index);
|
||||
void setUserActionOverlayFillColor(int index);
|
||||
void setUserActionOpaqueColor(int index);
|
||||
void setUserActionOpaqueFillColor(int index);
|
||||
|
||||
void plotMouseMove(double x, double y);
|
||||
void plotMouseClicked(double x, double y, Qt::KeyboardModifiers modifiers, Qt::MouseButton button);
|
||||
@ -42,6 +48,8 @@ class TestUserInteraction : public QMainWindow
|
||||
void userLineFinished(double x1, double y1, double x2, double y2, Qt::KeyboardModifiers modifiers);
|
||||
void userCircleFinished(double x, double y, double radius, Qt::KeyboardModifiers modifiers);
|
||||
void userEllipseFinished(double x, double y, double radiusX, double radiusY, Qt::KeyboardModifiers modifiers);
|
||||
void tooltipDisplayed(double x, double y, const QStringList& entries, const QList<JKQTPPlotElement*>& graphs);
|
||||
void rulerDisplayed(double x1, double y1, double x2, double y2, Qt::KeyboardModifiers modifiers);
|
||||
protected:
|
||||
void initPlot();
|
||||
JKQTPlotter* plot;
|
||||
@ -49,6 +57,8 @@ class TestUserInteraction : public QMainWindow
|
||||
QHBoxLayout* layChk;
|
||||
QHBoxLayout* layChk2;
|
||||
QFormLayout* layForm;
|
||||
QFormLayout* layForm2;
|
||||
QFormLayout* layLab;
|
||||
QCheckBox* chkPositionDisplay;
|
||||
QCheckBox* chkShowToolbar;
|
||||
QCheckBox* chkToolbarAlwaysOn;
|
||||
@ -60,6 +70,12 @@ class TestUserInteraction : public QMainWindow
|
||||
QComboBox* cmbRightDoubleClickMouseAction;
|
||||
QComboBox* cmbLeftDoubleClickMouseAction;
|
||||
QComboBox* cmbMouseWheelAction;
|
||||
QComboBox* cmbUserActionMarkerType;
|
||||
QComboBox* cmbUserActionMarkerColor;
|
||||
QComboBox* cmbUserActionOverlayColor;
|
||||
QComboBox* cmbUserActionOverlayFillColor;
|
||||
QComboBox* cmbUserActionOpaqueColor;
|
||||
QComboBox* cmbUserActionOpaqueFillColor;
|
||||
QCheckBox* chkLogX;
|
||||
QCheckBox* chkLogY;
|
||||
QLabel* labMouseAction;
|
||||
|
@ -700,7 +700,7 @@ class JKQTP_LIB_EXPORT JKQTFastPlotter : public QGLWidget {
|
||||
/*! \brief sets the property gridStyle ( \copybrief gridStyle ) to the specified \a __value.
|
||||
\details Description of the parameter gridStyle is: <BLOCKQUOTE>\copydoc JKQTFastPlotter::gridStyle </BLOCKQUOTE>
|
||||
\see gridStyle for more information */
|
||||
inline void setGridStyle(const Qt::PenStyle & __value)
|
||||
inline void setGridStyle(Qt::PenStyle __value)
|
||||
{
|
||||
if (this->gridStyle != __value) {
|
||||
this->gridStyle = __value;
|
||||
@ -1381,7 +1381,7 @@ class JKQTP_LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
|
||||
/*! \brief sets the property style ( \copybrief style ) to the specified \a __value.
|
||||
\details Description of the parameter style is: <BLOCKQUOTE>\copydoc JKQTFastPlotter::style </BLOCKQUOTE>
|
||||
\see style for more information */
|
||||
inline void setStyle(const Qt::PenStyle & __value)
|
||||
inline void setStyle(Qt::PenStyle __value)
|
||||
{
|
||||
if (this->style != __value) {
|
||||
this->style = __value;
|
||||
@ -1415,7 +1415,7 @@ class JKQTP_LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
|
||||
/*! \brief sets the property errorColor ( \copybrief errorColor ) to the specified \a __value.
|
||||
\details Description of the parameter errorColor is: <BLOCKQUOTE>\copydoc JKQTFastPlotter::errorColor </BLOCKQUOTE>
|
||||
\see errorColor for more information */
|
||||
inline void setErrorColor(const QColor & __value)
|
||||
inline void setErrorLineColor(const QColor & __value)
|
||||
{
|
||||
if (this->errorColor != __value) {
|
||||
this->errorColor = __value;
|
||||
@ -1425,14 +1425,14 @@ class JKQTP_LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
|
||||
/*! \brief returns the property errorColor ( \copybrief errorColor ).
|
||||
\details Description of the parameter errorColor is: <BLOCKQUOTE>\copydoc JKQTFastPlotter::errorColor </BLOCKQUOTE>
|
||||
\see errorColor for more information */
|
||||
inline QColor getErrorColor() const
|
||||
inline QColor getErrorLineColor() const
|
||||
{
|
||||
return this->errorColor;
|
||||
}
|
||||
/*! \brief sets the property errorStyle ( \copybrief errorStyle ) to the specified \a __value.
|
||||
\details Description of the parameter errorStyle is: <BLOCKQUOTE>\copydoc JKQTFastPlotter::errorStyle </BLOCKQUOTE>
|
||||
\see errorStyle for more information */
|
||||
inline void setErrorStyle(const Qt::PenStyle & __value)
|
||||
inline void setErrorLineStyle(Qt::PenStyle __value)
|
||||
{
|
||||
if (this->errorStyle != __value) {
|
||||
this->errorStyle = __value;
|
||||
@ -1442,14 +1442,14 @@ class JKQTP_LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
|
||||
/*! \brief returns the property errorStyle ( \copybrief errorStyle ).
|
||||
\details Description of the parameter errorStyle is: <BLOCKQUOTE>\copydoc JKQTFastPlotter::errorStyle </BLOCKQUOTE>
|
||||
\see errorStyle for more information */
|
||||
inline Qt::PenStyle getErrorStyle() const
|
||||
inline Qt::PenStyle getErrorLineStyle() const
|
||||
{
|
||||
return this->errorStyle;
|
||||
}
|
||||
/*! \brief sets the property errorWidth ( \copybrief errorWidth ) to the specified \a __value.
|
||||
\details Description of the parameter errorWidth is: <BLOCKQUOTE>\copydoc JKQTFastPlotter::errorWidth </BLOCKQUOTE>
|
||||
\see errorWidth for more information */
|
||||
inline void setErrorWidth(double __value)
|
||||
inline void setErrorLineWidth(double __value)
|
||||
{
|
||||
if (this->errorWidth != __value) {
|
||||
this->errorWidth = __value;
|
||||
@ -1459,7 +1459,7 @@ class JKQTP_LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
|
||||
/*! \brief returns the property errorWidth ( \copybrief errorWidth ).
|
||||
\details Description of the parameter errorWidth is: <BLOCKQUOTE>\copydoc JKQTFastPlotter::errorWidth </BLOCKQUOTE>
|
||||
\see errorWidth for more information */
|
||||
inline double getErrorWidth() const
|
||||
inline double getErrorLineWidth() const
|
||||
{
|
||||
return this->errorWidth;
|
||||
}
|
||||
@ -1639,7 +1639,7 @@ class JKQTP_LIB_EXPORT JKQTFPXRangePlot: public JKQTFPPlot {
|
||||
/*! \brief sets the property fillStyle ( \copybrief fillStyle ) to the specified \a __value.
|
||||
\details Description of the parameter fillStyle is: <BLOCKQUOTE>\copydoc JKQTFPXRangePlot::fillStyle </BLOCKQUOTE>
|
||||
\see fillStyle for more information */
|
||||
inline void setFillStyle(const Qt::BrushStyle & __value)
|
||||
inline void setFillStyle(Qt::BrushStyle __value)
|
||||
{
|
||||
if (this->fillStyle != __value) {
|
||||
this->fillStyle = __value;
|
||||
@ -1656,7 +1656,7 @@ class JKQTP_LIB_EXPORT JKQTFPXRangePlot: public JKQTFPPlot {
|
||||
/*! \brief sets the property style ( \copybrief style ) to the specified \a __value.
|
||||
\details Description of the parameter style is: <BLOCKQUOTE>\copydoc JKQTFPXRangePlot::style </BLOCKQUOTE>
|
||||
\see style for more information */
|
||||
inline void setStyle(const Qt::PenStyle & __value)
|
||||
inline void setStyle(Qt::PenStyle __value)
|
||||
{
|
||||
if (this->style != __value) {
|
||||
this->style = __value;
|
||||
@ -1833,7 +1833,7 @@ class JKQTP_LIB_EXPORT JKQTFPYRangePlot: public JKQTFPPlot {
|
||||
/*! \brief sets the property fillStyle ( \copybrief fillStyle ) to the specified \a __value.
|
||||
\details Description of the parameter fillStyle is: <BLOCKQUOTE>\copydoc JKQTFPYRangePlot::fillStyle </BLOCKQUOTE>
|
||||
\see fillStyle for more information */
|
||||
inline void setFillStyle(const Qt::BrushStyle & __value)
|
||||
inline void setFillStyle(Qt::BrushStyle __value)
|
||||
{
|
||||
if (this->fillStyle != __value) {
|
||||
this->fillStyle = __value;
|
||||
@ -1850,7 +1850,7 @@ class JKQTP_LIB_EXPORT JKQTFPYRangePlot: public JKQTFPPlot {
|
||||
/*! \brief sets the property style ( \copybrief style ) to the specified \a __value.
|
||||
\details Description of the parameter style is: <BLOCKQUOTE>\copydoc JKQTFPYRangePlot::style </BLOCKQUOTE>
|
||||
\see style for more information */
|
||||
inline void setStyle(const Qt::PenStyle & __value)
|
||||
inline void setStyle(Qt::PenStyle __value)
|
||||
{
|
||||
if (this->style != __value) {
|
||||
this->style = __value;
|
||||
@ -3889,7 +3889,7 @@ class JKQTP_LIB_EXPORT JKQTFPQOverlayLinearGridPlot: public JKQTFPPlot {
|
||||
/*! \brief sets the property style ( \copybrief style ) to the specified \a __value.
|
||||
\details Description of the parameter style is: <BLOCKQUOTE>\copydoc JKQTFPQOverlayLinearGridPlot::style </BLOCKQUOTE>
|
||||
\see style for more information */
|
||||
inline void setStyle(const Qt::PenStyle & __value)
|
||||
inline void setStyle(Qt::PenStyle __value)
|
||||
{
|
||||
if (this->style != __value) {
|
||||
this->style = __value;
|
||||
|
@ -518,13 +518,14 @@ bool JKQTMathText::MTinstruction1Node::setupMTenvironment(JKQTMathText::MTenviro
|
||||
else if (name=="em") ev.italic=!ev.italic;
|
||||
else if (name=="it" || name=="textit" || name=="mathit") ev.italic=true;
|
||||
else if (name=="textcolor" || name=="mathcolor" || name=="color") ev.color=QColor(parameters.value(0, ev.color.name()));
|
||||
else if (name=="equation") { ev.italic=true; ev.insideMath=true; }
|
||||
else if (name=="ensuremath" || name=="equation") { ev.italic=true; ev.insideMath=true; }
|
||||
else if (name=="sc" || name=="textsc" || name=="mathsc") ev.smallCaps=true;
|
||||
else if (name=="ul" || name=="underline" || name=="underlined") ev.underlined=true;
|
||||
else if (name=="ol" || name=="overline" || name=="overlined") ev.overline=true;
|
||||
else if (name=="strike") ev.strike=true;
|
||||
else if (name=="rm" || name=="textrm") { ev.font=JKQTMathText::MTEroman; }
|
||||
else if (name=="mathrm" || name=="text" || name=="mbox" || name=="operatorname") { ev.font=JKQTMathText::MTEroman; ev.italic=false; }
|
||||
else if (name=="mathrm" || name=="operatorname") { ev.font=JKQTMathText::MTEroman; ev.italic=false; }
|
||||
else if (name=="text" || name=="mbox" || name=="ensuretext") { ev.insideMath=false; ev.font=JKQTMathText::MTEroman; ev.italic=false; }
|
||||
else if (name=="mat") { ev.font=JKQTMathText::MTEroman; ev.italic=false; ev.bold=true; }
|
||||
else if (name=="cal" || name=="textcal" || name=="mathcal") { ev.font=JKQTMathText::MTEcaligraphic; }
|
||||
else if (name=="bb" || name=="textbb" || name=="mathbb") { ev.font=JKQTMathText::MTEblackboard; }
|
||||
@ -1574,7 +1575,7 @@ JKQTMathText::MTlistNode::MTlistNode(JKQTMathText* parent):
|
||||
subsupOperations<<"sum"<<"prod"<<"coprod"
|
||||
<<"bigcap"<<"bigcup"<<"bigvee"<<"bighat"
|
||||
<<"int"<<"iint"<<"iiint"<<"oint"<<"oiint"<<"oiiint"
|
||||
<<"max"<<"min"<<"argmax"<<"argmin"<<"sup"<<"inf"
|
||||
<<"mod"<<"median"<<"max"<<"min"<<"argmax"<<"argmin"<<"sup"<<"inf"
|
||||
<<"liminf"<<"limsup"<<"lim"<<"max"<<"min";
|
||||
}
|
||||
|
||||
@ -2027,7 +2028,11 @@ JKQTMathText::MTsymbolNode::MTsymbolNode(JKQTMathText* parent, const QString& na
|
||||
simpleTranslations.insert("argmin", "argmin");
|
||||
simpleTranslations.insert("argmax", "argmax");
|
||||
simpleTranslations.insert("max", "max");
|
||||
simpleTranslations.insert("mod", "mod");
|
||||
simpleTranslations.insert("min", "min");
|
||||
simpleTranslations.insert("median", "median");
|
||||
simpleTranslations.insert("sign", "sign");
|
||||
simpleTranslations.insert("sgn", "sgn");
|
||||
simpleTranslations.insert("sec", "sec");
|
||||
simpleTranslations.insert("gcd", "gcd");
|
||||
simpleTranslations.insert("hom", "hom");
|
||||
@ -2045,6 +2050,7 @@ JKQTMathText::MTsymbolNode::MTsymbolNode(JKQTMathText* parent, const QString& na
|
||||
static QHash<QString, QString> simpleTranslations_heightIsAscent;
|
||||
if (simpleTranslations_heightIsAscent.isEmpty()) {
|
||||
simpleTranslations_heightIsAscent.insert("erf", "erf");
|
||||
simpleTranslations_heightIsAscent.insert("median", "median");
|
||||
simpleTranslations_heightIsAscent.insert("min", "min");
|
||||
simpleTranslations_heightIsAscent.insert("max", "max");
|
||||
simpleTranslations_heightIsAscent.insert("inf", "inf");
|
||||
@ -2751,7 +2757,7 @@ JKQTMathText::MTsymbolNode::MTsymbolNode(JKQTMathText* parent, const QString& na
|
||||
|
||||
static QSet<QString> extraSymbolName = {
|
||||
"infty",
|
||||
"|", " ", "quad", ";", ":", ",", "!",
|
||||
"|", " ", "quad", "qquad", "space", ";", ":", ",", "!",
|
||||
"longleftarrow", "longrightarrow",
|
||||
"Longleftarrow", "Longrightarrow",
|
||||
"longleftrightarrow", "Longleftrightarrow"
|
||||
@ -2804,8 +2810,8 @@ void JKQTMathText::MTsymbolNode::getSizeInternal(QPainter& painter, JKQTMathText
|
||||
width=fm.width("a");
|
||||
if (symbolName=="|") width=fm.width("1")*0.8;
|
||||
else if (symbolName=="infty") width=fm.width("M");
|
||||
else if (symbolName=="quad") width=parent->getTightBoundingRect(f, "M", painter.device()).width();
|
||||
else if (symbolName==" ") width=parent->getTightBoundingRect(f, "x", painter.device()).width();
|
||||
else if (symbolName=="quad" || symbolName=="qquad") width=parent->getTightBoundingRect(f, "M", painter.device()).width();
|
||||
else if (symbolName==" " || symbolName=="space") width=parent->getTightBoundingRect(f, "x", painter.device()).width();
|
||||
else if (symbolName==";") width=parent->getTightBoundingRect(f, "x", painter.device()).width()*0.75;
|
||||
else if (symbolName==":") width=parent->getTightBoundingRect(f, "x", painter.device()).width()*0.5;
|
||||
else if (symbolName==",") width=parent->getTightBoundingRect(f, "x", painter.device()).width()*0.25;
|
||||
@ -2904,8 +2910,10 @@ double JKQTMathText::MTsymbolNode::draw(QPainter& painter, double x, double y, J
|
||||
|
||||
|
||||
// here are some spaces
|
||||
} else if (symbolName==" ") { // full space
|
||||
} else if (symbolName=="quad") { // 75% space
|
||||
} else if (symbolName==" ") { // full space (width of x)
|
||||
} else if (symbolName=="space") { // full space (width of x)
|
||||
} else if (symbolName=="qquad") { // full space(width of M)
|
||||
} else if (symbolName=="quad") { // full space(width of M)
|
||||
} else if (symbolName==";") { // 75% space
|
||||
} else if (symbolName==":") { // 50% space
|
||||
} else if (symbolName==",") { // 25% space
|
||||
@ -2982,6 +2990,8 @@ bool JKQTMathText::MTsymbolNode::toHtml(QString &html, JKQTMathText::MTenvironme
|
||||
entitylut.insert("ld", "ld");
|
||||
entitylut.insert("lb", "lb");
|
||||
entitylut.insert("erf", "erf");
|
||||
entitylut.insert("mod", "mod");
|
||||
entitylut.insert("median", "median");
|
||||
entitylut.insert("min", "min");
|
||||
entitylut.insert("max", "max");
|
||||
entitylut.insert("argmin", "argmin");
|
||||
@ -2991,8 +3001,6 @@ bool JKQTMathText::MTsymbolNode::toHtml(QString &html, JKQTMathText::MTenvironme
|
||||
entitylut.insert("liminf", "liminf");
|
||||
entitylut.insert("limsup", "limsup");
|
||||
entitylut.insert("lim", "lim");
|
||||
entitylut.insert("max", "max");
|
||||
entitylut.insert("min", "min");
|
||||
entitylut.insert("sec", "sec");
|
||||
entitylut.insert("gcd", "gcd");
|
||||
entitylut.insert("hom", "hom");
|
||||
@ -3002,6 +3010,8 @@ bool JKQTMathText::MTsymbolNode::toHtml(QString &html, JKQTMathText::MTenvironme
|
||||
entitylut.insert("arg", "arg");
|
||||
entitylut.insert("det", "det");
|
||||
entitylut.insert("deg", "deg");
|
||||
entitylut.insert("sign", "sign");
|
||||
entitylut.insert("sgn", "sgn");
|
||||
entitylut.insert("Pr", "Pr");
|
||||
entitylut.insert("coth", "coth");
|
||||
entitylut.insert("alpha", "α");
|
||||
@ -3235,8 +3245,8 @@ JKQTMathText::JKQTMathText(QObject* parent):
|
||||
|
||||
|
||||
default_fontSize=fontSize=10;
|
||||
default_fontRoman=fontRoman=serifFont;
|
||||
default_fontSans=fontSans=sansFont;
|
||||
default_fontRoman=fontRoman=fontReplacements.value(serifFont, serifFont);
|
||||
default_fontSans=fontSans=fontReplacements.value(sansFont, sansFont);
|
||||
default_fontTypewriter=fontTypewriter=typewriterFont;
|
||||
default_fontScript=fontScript=scriptFont;
|
||||
default_fontGreek=fontGreek=symbolFont;
|
||||
@ -3290,13 +3300,13 @@ JKQTMathText::~JKQTMathText() {
|
||||
void JKQTMathText::loadSettings(const QSettings& settings, const QString& group){
|
||||
fontSize=settings.value(group+"font_size", fontSize).toDouble();
|
||||
fontColor=jkqtp_String2QColor(settings.value(group+"font_color", jkqtp_QColor2String(fontColor)).toString());
|
||||
fontRoman=settings.value(group+"font_roman", fontRoman).toString();
|
||||
fontSans=settings.value(group+"font_sans", fontSans).toString();
|
||||
setFontRoman(settings.value(group+"font_roman", fontRoman).toString());
|
||||
setFontSans(settings.value(group+"font_sans", fontSans).toString());
|
||||
fontTypewriter=settings.value(group+"font_typewriter", fontTypewriter).toString();
|
||||
fontScript=settings.value(group+"font_script", fontScript).toString();
|
||||
fontGreek=settings.value(group+"font_greek", fontGreek).toString();
|
||||
fontSymbol=settings.value(group+"font_symbol", fontSymbol).toString();
|
||||
fontBraces=settings.value(group+"font_braces", fontRoman).toString();
|
||||
fontBraces=settings.value(group+"font_braces", fontBraces).toString();
|
||||
fontIntegrals=settings.value(group+"font_integrals", fontSans).toString();
|
||||
fontBlackboard=settings.value(group+"font_blackboard", fontSans).toString();
|
||||
fontCaligraphic=settings.value(group+"font_caligraphics", fontSans).toString();
|
||||
@ -3525,6 +3535,10 @@ QString JKQTMathText::toHtml(bool *ok, double fontPointSize) {
|
||||
return s;
|
||||
}
|
||||
|
||||
void JKQTMathText::addReplacementFont(const QString &nonUseFont, const QString &useFont) {
|
||||
fontReplacements.insert(nonUseFont, useFont);
|
||||
}
|
||||
|
||||
void JKQTMathText::setFontRomanOrSpecial(const QString &__value)
|
||||
{
|
||||
if (__value.toUpper()=="XITS") {
|
||||
@ -3551,8 +3565,8 @@ void JKQTMathText::setFontRomanOrSpecial(const QString &__value)
|
||||
|
||||
|
||||
void JKQTMathText::useAnyUnicode(QString timesFont, const QString& sansFont, bool fullMathUnicodeFont) {
|
||||
if (!timesFont.isEmpty()) { fontRoman=timesFont; }
|
||||
if (!sansFont.isEmpty()) { fontSans=sansFont; }
|
||||
if (!timesFont.isEmpty()) { setFontRoman(timesFont); }
|
||||
if (!sansFont.isEmpty()) { setFontSans(sansFont); }
|
||||
useSTIXfonts=false;
|
||||
useXITSfonts=false;
|
||||
useASANAfonts=false;
|
||||
@ -4161,17 +4175,28 @@ void JKQTMathText::draw(QPainter& painter, double x, double y, bool drawBoxes){
|
||||
MTenvironment ev;
|
||||
ev.color=fontColor;
|
||||
ev.fontSize=fontSize;
|
||||
QPen pp=painter.pen();
|
||||
QPen p=pp;
|
||||
p.setStyle(Qt::SolidLine);
|
||||
painter.setPen(p);
|
||||
getTree()->setDrawBoxes(drawBoxes);
|
||||
painter.setPen(p);
|
||||
getTree()->draw(painter, x, y, ev);
|
||||
painter.setPen(pp);
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTMathText::draw(QPainter& painter, unsigned int flags, QRectF rect, bool drawBoxes) {
|
||||
if (getTree()!=nullptr) {
|
||||
QPen pp=painter.pen();
|
||||
QPen p=pp;
|
||||
p.setStyle(Qt::SolidLine);
|
||||
painter.setPen(p);
|
||||
MTenvironment ev;
|
||||
ev.color=fontColor;
|
||||
ev.fontSize=fontSize;
|
||||
getTree()->setDrawBoxes(drawBoxes);
|
||||
painter.setPen(p);
|
||||
|
||||
double width=0;
|
||||
double baselineHeight=0;
|
||||
@ -4192,6 +4217,7 @@ void JKQTMathText::draw(QPainter& painter, unsigned int flags, QRectF rect, bool
|
||||
|
||||
// finally draw
|
||||
getTree()->draw(painter, x, y, ev);
|
||||
painter.setPen(pp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,12 +330,23 @@ class JKQTP_LIB_EXPORT JKQTMathText : public QObject {
|
||||
{
|
||||
return this->fontSize;
|
||||
}
|
||||
/** \brief add a font pair to the table with font replacements
|
||||
*
|
||||
* e.g. if it is known that a certain font is not good for rendering, you can add an alternative with this function.
|
||||
* These are automatically applied, when setting a new font name!
|
||||
*
|
||||
* \param nonUseFont the font not to use
|
||||
* \param useFont replacement font for nonUseFont
|
||||
*/
|
||||
void addReplacementFont(const QString& nonUseFont, const QString& useFont);
|
||||
|
||||
|
||||
/*! \brief sets the property fontRoman ( \copybrief fontRoman ) to the specified \a __value.
|
||||
\details Description of the parameter fontRoman is: <BLOCKQUOTE>\copydoc fontRoman </BLOCKQUOTE>
|
||||
\see fontRoman for more information */
|
||||
inline void setFontRoman(const QString & __value)
|
||||
{
|
||||
this->fontRoman = __value;
|
||||
this->fontRoman = fontReplacements.value(__value, __value);
|
||||
}
|
||||
/*! \brief sets the property fontRoman ( \copybrief fontRoman ) to \a __value, or calls useXITS() if \a __value \c =="XITS". calls useSTIX() if \a __value \c =="STIX", ...
|
||||
|
||||
@ -349,7 +360,7 @@ class JKQTP_LIB_EXPORT JKQTMathText : public QObject {
|
||||
/*! \copydoc fontSans \see fontSans */
|
||||
inline void setFontSans(const QString & __value)
|
||||
{
|
||||
this->fontSans = __value;
|
||||
this->fontSans = fontReplacements.value(__value, __value);
|
||||
}
|
||||
/*! \copydoc fontSans \see fontSans */
|
||||
inline QString getFontSans() const
|
||||
@ -1200,7 +1211,9 @@ class JKQTP_LIB_EXPORT JKQTMathText : public QObject {
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
/** \brief table with font replacements to use (e.g. if it is known that a certain font is not good for rendering, you can add
|
||||
* an alternative using addReplacementFont(). These are automatically applied, when setting a new font name! */
|
||||
QMap<QString, QString> fontReplacements;
|
||||
|
||||
/** \brief font color */
|
||||
QColor fontColor;
|
||||
|
@ -200,6 +200,14 @@ JKQTBasePlotter::JKQTBasePlotter(bool datastore_internal, QObject* parent, JKQTP
|
||||
datastoreInternal=false;
|
||||
}
|
||||
|
||||
// some fonts that are know to deliver bad rendering quality
|
||||
mathText.addReplacementFont("MS Shell Dlg 2", "Arial");
|
||||
mathText.addReplacementFont("MS Shell Dlg", "Arial");
|
||||
mathText.addReplacementFont("MS Sans Serif", "Arial");
|
||||
mathText.addReplacementFont("MS Serif", "Times New Roman");
|
||||
mathText.addReplacementFont("MS Sans Serif Standard", "Arial");
|
||||
mathText.addReplacementFont("MS Serif Standard", "Times New Roman");
|
||||
|
||||
xAxis=new JKQTPHorizontalAxis(this);
|
||||
yAxis=new JKQTPVerticalAxis(this);
|
||||
m_plotsModel=new JKQTPGraphsModel(this);
|
||||
@ -216,49 +224,49 @@ JKQTBasePlotter::JKQTBasePlotter(bool datastore_internal, QObject* parent, JKQTP
|
||||
|
||||
emitSignals=true;
|
||||
|
||||
actSavePlot=new QAction(QIcon(":/JKQTPlotter/jkqtp_saveplot.png"), "Save Plot", this);
|
||||
actSavePlot->setToolTip("Save plot as image file (PDF, PS; PNG, ...).");
|
||||
actSaveData=new QAction(QIcon(":/JKQTPlotter/jkqtp_savedata.png"), "Save Data", this);
|
||||
actSaveData->setToolTip("Save Data of the plot as file (CSV, ...).");
|
||||
actCopyData=new QAction(QIcon(":/JKQTPlotter/jkqtp_copydata.png"), "Copy Data", this);
|
||||
actCopyData->setToolTip("Copy Data of the plot to the clipboard to be pasted into Excel etc.");
|
||||
actCopyMatlab=new QAction(QIcon(":/JKQTPlotter/jkqtp_copymatlab.png"), "Copy Data to Matlab", this);
|
||||
actCopyMatlab->setToolTip("Copy Data of the plot to the clipboard in Matlab script format.");
|
||||
actCopyPixelImage=new QAction(QIcon(":/JKQTPlotter/jkqtp_copyimg.png"), "Copy Image", this);
|
||||
actCopyPixelImage->setToolTip("Copy the plot as a pixel image to the clipboard");
|
||||
actSavePlot=new QAction(QIcon(":/JKQTPlotter/jkqtp_saveplot.png"), tr("Save Plot"), this);
|
||||
actSavePlot->setToolTip(tr("Save plot as image file (PDF, PS; PNG, ...)."));
|
||||
actSaveData=new QAction(QIcon(":/JKQTPlotter/jkqtp_savedata.png"), tr("Save Data"), this);
|
||||
actSaveData->setToolTip(tr("Save Data of the plot as file (CSV, ...)."));
|
||||
actCopyData=new QAction(QIcon(":/JKQTPlotter/jkqtp_copydata.png"), tr("Copy Data"), this);
|
||||
actCopyData->setToolTip(tr("Copy Data of the plot to the clipboard to be pasted into Excel etc."));
|
||||
actCopyMatlab=new QAction(QIcon(":/JKQTPlotter/jkqtp_copymatlab.png"), tr("Copy Data to Matlab"), this);
|
||||
actCopyMatlab->setToolTip(tr("Copy Data of the plot to the clipboard in Matlab script format."));
|
||||
actCopyPixelImage=new QAction(QIcon(":/JKQTPlotter/jkqtp_copyimg.png"), tr("Copy Image"), this);
|
||||
actCopyPixelImage->setToolTip(tr("Copy the plot as a pixel image to the clipboard"));
|
||||
|
||||
|
||||
actSavePDF=new QAction(QIcon(":/JKQTPlotter/jkqtp_savepdf.png"), "Save P&DF", this);
|
||||
actSavePDF->setToolTip("Save as PDF");
|
||||
actSavePDF=new QAction(QIcon(":/JKQTPlotter/jkqtp_savepdf.png"), tr("Save P&DF"), this);
|
||||
actSavePDF->setToolTip(tr("Save as PDF"));
|
||||
//toolbar->addAction(actSavePDF);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
|
||||
actSavePS=new QAction(QIcon(":/JKQTPlotter/jkqtp_saveps.png"), "Save P&S", this);
|
||||
actSavePS->setToolTip("Save as PostScript");
|
||||
//toolbar->addAction(actSavePS);
|
||||
#endif
|
||||
actSaveSVG=new QAction(QIcon(":/JKQTPlotter/jkqtp_savesvg.png"), "Save S&VG", this);
|
||||
actSaveSVG->setToolTip("Save as Scalable Vector Graphics (SVG)");
|
||||
actSaveSVG=new QAction(QIcon(":/JKQTPlotter/jkqtp_savesvg.png"), tr("Save S&VG"), this);
|
||||
actSaveSVG->setToolTip(tr("Save as Scalable Vector Graphics (SVG)"));
|
||||
//toolbar->addAction(actSaveSVG);
|
||||
actSavePix=new QAction(QIcon(":/JKQTPlotter/jkqtp_savepix.png"), "Save &Image", this);
|
||||
actSavePix->setToolTip("Save as Pixel Image (PNG, JPEG, TIFF ...)");
|
||||
actSavePix=new QAction(QIcon(":/JKQTPlotter/jkqtp_savepix.png"), tr("Save &Image"), this);
|
||||
actSavePix->setToolTip(tr("Save as Pixel Image (PNG, JPEG, TIFF ...)"));
|
||||
//toolbar->addAction(actSavePix);
|
||||
|
||||
actPrint=new QAction(QIcon(":/JKQTPlotter/jkqtp_print.png"), "&Print", this);
|
||||
actPrint=new QAction(QIcon(":/JKQTPlotter/jkqtp_print.png"), tr("&Print"), this);
|
||||
actPrint->setToolTip("Print");
|
||||
//toolbar->addSeparator();
|
||||
actSaveCSV=new QAction(QIcon(":/JKQTPlotter/jkqtp_savecsv.png"), "Save &CSV", this);
|
||||
actSaveCSV->setToolTip("Save the data which is used for the plot as Comma Separated Values (CSV)");
|
||||
actSaveCSV=new QAction(QIcon(":/JKQTPlotter/jkqtp_savecsv.png"), tr("Save &CSV"), this);
|
||||
actSaveCSV->setToolTip(tr("Save the data which is used for the plot as Comma Separated Values (CSV)"));
|
||||
//toolbar->addAction(actSaveCSV);
|
||||
//toolbar->addSeparator();
|
||||
actZoomAll=new QAction(QIcon(":/JKQTPlotter/jkqtp_zoomall.png"), "Zoom &All", this);
|
||||
actZoomAll->setToolTip("Zoom to view all data");
|
||||
actZoomIn=new QAction(QIcon(":/JKQTPlotter/jkqtp_zoomin.png"), "Zoom &In", this);
|
||||
actZoomIn->setToolTip("Zoom in around the center of the plot");
|
||||
actZoomOut=new QAction(QIcon(":/JKQTPlotter/jkqtp_zoomout.png"), "Zoom &Out", this);
|
||||
actZoomOut->setToolTip("Zoom out");
|
||||
actZoomAll=new QAction(QIcon(":/JKQTPlotter/jkqtp_zoomall.png"), tr("Zoom &All"), this);
|
||||
actZoomAll->setToolTip(tr("Zoom to view all data"));
|
||||
actZoomIn=new QAction(QIcon(":/JKQTPlotter/jkqtp_zoomin.png"), tr("Zoom &In"), this);
|
||||
actZoomIn->setToolTip(tr("Zoom in around the center of the plot"));
|
||||
actZoomOut=new QAction(QIcon(":/JKQTPlotter/jkqtp_zoomout.png"), tr("Zoom &Out"), this);
|
||||
actZoomOut->setToolTip(tr("Zoom out"));
|
||||
|
||||
actShowPlotData=new QAction(QIcon(":/JKQTPlotter/jkqtp_showplotdata.png"), "&Show Plot Data", this);
|
||||
actShowPlotData->setToolTip("opens a dialog that contains all data used for the plot in a table.");
|
||||
actShowPlotData=new QAction(QIcon(":/JKQTPlotter/jkqtp_showplotdata.png"), tr("&Show Plot Data"), this);
|
||||
actShowPlotData->setToolTip(tr("Opens a dialog that contains all data used for the plot in a table."));
|
||||
|
||||
|
||||
|
||||
@ -947,10 +955,10 @@ JKQTBasePlotter::JKQTPPen JKQTBasePlotter::getPlotStyle(int i) const{
|
||||
//std::cout<<"style "<<styleI<<std::endl;
|
||||
p.setColor(plotterStyle.defaultGraphColors[colorI]);
|
||||
p.setFillColor(JKQTPGetDerivedColor(plotterStyle.graphFillColorDerivationMode, p.color()));
|
||||
p.setErrorColor(JKQTPGetDerivedColor(plotterStyle.graphErrorColorDerivationMode, p.color()));
|
||||
p.setErrorLineColor(JKQTPGetDerivedColor(plotterStyle.graphErrorColorDerivationMode, p.color()));
|
||||
p.setErrorFillColor(JKQTPGetDerivedColor(plotterStyle.graphErrorFillColorDerivationMode, p.errorColor()));
|
||||
p.setWidthF(qMax(JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphWidth));
|
||||
p.setErrorWidth(qMax(JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphWidth));
|
||||
p.setErrorLineWidth(qMax(JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphWidth));
|
||||
p.setSymbolSize(qMax(JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphSymbolSize));
|
||||
p.setSymbolFillColor(JKQTPGetDerivedColor(plotterStyle.graphFillColorDerivationMode, p.color()));
|
||||
p.setSymbolLineWidthF(qMax(JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH, plotterStyle.defaultGraphSymbolLineWidth));
|
||||
@ -4280,7 +4288,7 @@ size_t JKQTBasePlotter::addGraphWithXError(size_t xColumn, size_t yColumn, size_
|
||||
gr->setYColumn(yColumn);
|
||||
gr->setXErrorStyle(errorStyle);
|
||||
gr->setXErrorColumn(xErrorColumn);
|
||||
gr->setErrorColor(gr->getLineColor().darker());
|
||||
gr->setErrorLineColor(gr->getLineColor().darker());
|
||||
QColor fc=gr->getLineColor();
|
||||
fc.setAlphaF(0.5);
|
||||
gr->setErrorFillColor(fc);
|
||||
@ -4292,7 +4300,7 @@ size_t JKQTBasePlotter::addGraphWithXError(size_t xColumn, size_t yColumn, size_
|
||||
gr->setYColumn(yColumn);
|
||||
gr->setXErrorStyle(errorStyle);
|
||||
gr->setXErrorColumn(xErrorColumn);
|
||||
gr->setErrorColor(gr->getLineColor());
|
||||
gr->setErrorLineColor(gr->getLineColor());
|
||||
QColor fc=gr->getLineColor();
|
||||
fc.setAlphaF(0.5);
|
||||
gr->setErrorFillColor(fc);
|
||||
@ -4305,7 +4313,7 @@ size_t JKQTBasePlotter::addGraphWithXError(size_t xColumn, size_t yColumn, size_
|
||||
gr->setYErrorColumn(xErrorColumn);
|
||||
gr->setYErrorStyle(errorStyle);
|
||||
gr->setXErrorStyle(JKQTPNoError);
|
||||
gr->setErrorColor(gr->getSymbolColor());
|
||||
gr->setErrorLineColor(gr->getSymbolColor());
|
||||
QColor fc=gr->getSymbolColor();
|
||||
fc.setAlphaF(0.5);
|
||||
gr->setErrorFillColor(fc);
|
||||
@ -4324,8 +4332,8 @@ size_t JKQTBasePlotter::addGraphWithYError(size_t xColumn, size_t yColumn, size_
|
||||
gr->setYColumn(yColumn);
|
||||
gr->setYErrorStyle(errorStyle);
|
||||
gr->setYErrorColumn(yErrorColumn);
|
||||
gr->setErrorColor(gr->getLineColor().darker());
|
||||
gr->setErrorWidth(gr->getLineWidth()/3.0);
|
||||
gr->setErrorLineColor(gr->getLineColor().darker());
|
||||
gr->setErrorLineWidth(gr->getLineWidth()/3.0);
|
||||
QColor fc=gr->getLineColor();
|
||||
fc.setAlphaF(0.5);
|
||||
gr->setErrorFillColor(fc);
|
||||
@ -4337,7 +4345,7 @@ size_t JKQTBasePlotter::addGraphWithYError(size_t xColumn, size_t yColumn, size_
|
||||
gr->setYColumn(yColumn);
|
||||
gr->setYErrorStyle(errorStyle);
|
||||
gr->setYErrorColumn(yErrorColumn);
|
||||
gr->setErrorColor(gr->getLineColor());
|
||||
gr->setErrorLineColor(gr->getLineColor());
|
||||
QColor fc=gr->getLineColor();
|
||||
fc.setAlphaF(0.5);
|
||||
gr->setErrorFillColor(fc);
|
||||
@ -4350,7 +4358,7 @@ size_t JKQTBasePlotter::addGraphWithYError(size_t xColumn, size_t yColumn, size_
|
||||
gr->setYErrorColumn(yErrorColumn);
|
||||
gr->setYErrorStyle(errorStyle);
|
||||
gr->setXErrorStyle(JKQTPNoError);
|
||||
gr->setErrorColor(gr->getSymbolColor());
|
||||
gr->setErrorLineColor(gr->getSymbolColor());
|
||||
QColor fc=gr->getSymbolColor();
|
||||
fc.setAlphaF(0.5);
|
||||
gr->setErrorFillColor(fc);
|
||||
@ -4369,7 +4377,7 @@ size_t JKQTBasePlotter::addGraphWithXYError(size_t xColumn, size_t yColumn, size
|
||||
gr->setYErrorStyle(JKQTPErrorBars);
|
||||
gr->setXErrorColumn(xErrorColumn);
|
||||
gr->setXErrorStyle(JKQTPErrorBars);
|
||||
gr->setErrorColor(gr->getSymbolColor());
|
||||
gr->setErrorLineColor(gr->getSymbolColor());
|
||||
QColor fc=gr->getSymbolColor();
|
||||
fc.setAlphaF(0.5);
|
||||
gr->setErrorFillColor(fc);
|
||||
@ -5469,7 +5477,7 @@ void JKQTBasePlotter::JKQTPPen::setWidth(double w) {
|
||||
m_width=w;
|
||||
}
|
||||
|
||||
void JKQTBasePlotter::JKQTPPen::setErrorWidth(double w)
|
||||
void JKQTBasePlotter::JKQTPPen::setErrorLineWidth(double w)
|
||||
{
|
||||
m_errorWidth=w;
|
||||
}
|
||||
@ -5541,7 +5549,7 @@ void JKQTBasePlotter::JKQTPPen::setErrorFillColor(const QColor &col)
|
||||
m_errorFillColor=col;
|
||||
}
|
||||
|
||||
void JKQTBasePlotter::JKQTPPen::setErrorColor(const QColor &col)
|
||||
void JKQTBasePlotter::JKQTPPen::setErrorLineColor(const QColor &col)
|
||||
{
|
||||
m_errorColor=col;
|
||||
}
|
||||
|
@ -587,7 +587,7 @@ class JKQTP_LIB_EXPORT JKQTBasePlotter: public QObject {
|
||||
void setSymbolLineWidthF(double w);
|
||||
void setWidthF(double w);
|
||||
void setWidth(double w);
|
||||
void setErrorWidth(double w);
|
||||
void setErrorLineWidth(double w);
|
||||
double width() const;
|
||||
double widthF() const;
|
||||
double errorWidthF() const;
|
||||
@ -603,7 +603,7 @@ class JKQTP_LIB_EXPORT JKQTBasePlotter: public QObject {
|
||||
QColor fillColor() const;
|
||||
void setFillColor(const QColor& col);
|
||||
void setErrorFillColor(const QColor& col);
|
||||
void setErrorColor(const QColor& col);
|
||||
void setErrorLineColor(const QColor& col);
|
||||
void setFillStyle(Qt::BrushStyle s);
|
||||
void setErrorFillStyle(Qt::BrushStyle s);
|
||||
Qt::BrushStyle fillStyle() const;
|
||||
|
@ -876,16 +876,16 @@ inline void JKQTPColumn::incValue(size_t n, double increment){
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
inline double JKQTPColumn::getValue(size_t n) const {
|
||||
if (!datastore) return 0;
|
||||
if (!datastore->getItem(datastoreItem)) return 0;
|
||||
if (!datastore) return nan("");
|
||||
if (!datastore->getItem(datastoreItem)) return nan("");
|
||||
return datastore->getItem(datastoreItem)->get(datastoreOffset, n);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
inline double JKQTPColumn::getValue(int n) const {
|
||||
if (!datastore) return 0;
|
||||
if (!datastore->getItem(datastoreItem)) return 0;
|
||||
if (n<0) return 0;
|
||||
if (!datastore) return nan("");
|
||||
if (!datastore->getItem(datastoreItem)) return nan("");
|
||||
if (n<0) return nan("");
|
||||
return datastore->getItem(datastoreItem)->get(datastoreOffset, static_cast<size_t>(n));
|
||||
}
|
||||
|
||||
|
@ -576,10 +576,10 @@ void JKQTPBarVerticalGraph::setFillColor_and_darkenedColor(QColor fill, int colo
|
||||
}
|
||||
|
||||
JKQTPBarHorizontalErrorGraph::JKQTPBarHorizontalErrorGraph(JKQTBasePlotter *parent):
|
||||
JKQTPBarHorizontalGraph(parent), JKQTPXGraphErrors(getKeyLabelColor(), parent)
|
||||
JKQTPBarHorizontalGraph(parent)
|
||||
{
|
||||
setErrorColorFromGraphColor(getKeyLabelColor());
|
||||
if (parentPlotStyle>=0) setErrorStyleFromPen(parent->getPlotStyle(parentPlotStyle));
|
||||
initErrorStyle(parent, parentPlotStyle);
|
||||
}
|
||||
|
||||
JKQTPBarHorizontalErrorGraph::JKQTPBarHorizontalErrorGraph(JKQTPlotter *parent):
|
||||
@ -642,10 +642,10 @@ void JKQTPBarHorizontalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter
|
||||
}
|
||||
|
||||
JKQTPBarVerticalErrorGraph::JKQTPBarVerticalErrorGraph(JKQTBasePlotter *parent):
|
||||
JKQTPBarVerticalGraph(parent), JKQTPYGraphErrors(getKeyLabelColor(), parent)
|
||||
JKQTPBarVerticalGraph(parent)
|
||||
{
|
||||
setErrorColorFromGraphColor(getKeyLabelColor());
|
||||
if (parentPlotStyle>=0) setErrorStyleFromPen(parent->getPlotStyle(parentPlotStyle));
|
||||
initErrorStyle(parent, parentPlotStyle);
|
||||
|
||||
}
|
||||
|
||||
|
@ -131,13 +131,13 @@ bool JKQTPGraph::getDataMinMax(int column, double &minx, double &maxx, double &s
|
||||
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
int imin=0;
|
||||
int imax=datastore->getColumn(column).getRows();
|
||||
int imax=static_cast<int>(datastore->getColumn(column).getRows());
|
||||
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
|
||||
for (int i=imin; i<imax; i++) {
|
||||
double xv=datastore->get(column,i);
|
||||
double xv=datastore->get(column,static_cast<size_t>(i));
|
||||
if (start || xv>maxx) maxx=xv;
|
||||
if (start || xv<minx) minx=xv;
|
||||
double xvsgz;
|
||||
@ -158,6 +158,79 @@ void JKQTPPlotElement::drawOutside(JKQTPEnhancedPainter& /*painter*/, QRect /*le
|
||||
|
||||
}
|
||||
|
||||
|
||||
QString JKQTPPlotElement::formatHitTestDefaultLabel(double x, double y, int index, JKQTPDatastore* datastore) const {
|
||||
const JKQTPXGraphErrorData* errgx=dynamic_cast<const JKQTPXGraphErrorData*>(this);
|
||||
QString xerrstr;
|
||||
// retrieve x-error data
|
||||
if (errgx && datastore) {
|
||||
if (errgx->getXErrorColumn()>=0) {
|
||||
if (errgx->getXErrorColumnLower()>=0) {
|
||||
xerrstr=QString("\\:+%1\\:-%2")
|
||||
.arg(QString::fromStdString(jkqtp_floattolatexstr(datastore->get(errgx->getXErrorColumn(),static_cast<size_t>(index)), 3)))
|
||||
.arg(QString::fromStdString(jkqtp_floattolatexstr(datastore->get(errgx->getXErrorColumnLower(),static_cast<size_t>(index)), 3)));
|
||||
} else {
|
||||
xerrstr=QString("{\\:}{\\pm}%1")
|
||||
.arg(QString::fromStdString(jkqtp_floattolatexstr(datastore->get(errgx->getXErrorColumn(),static_cast<size_t>(index)), 3)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// retrieve y-error data
|
||||
const JKQTPYGraphErrorData* errgy=dynamic_cast<const JKQTPYGraphErrorData*>(this);
|
||||
QString yerrstr;
|
||||
if (errgy && datastore) {
|
||||
if (errgy->getYErrorColumn()>=0) {
|
||||
if (errgy->getYErrorColumnLower()>=0) {
|
||||
yerrstr=QString("\\:+%1\\:-%2")
|
||||
.arg(QString::fromStdString(jkqtp_floattolatexstr(datastore->get(errgy->getYErrorColumn(),static_cast<size_t>(index)), 3)))
|
||||
.arg(QString::fromStdString(jkqtp_floattolatexstr(datastore->get(errgy->getYErrorColumnLower(),static_cast<size_t>(index)), 3)));
|
||||
} else {
|
||||
yerrstr=QString("{\\:}{\\pm}%1")
|
||||
.arg(QString::fromStdString(jkqtp_floattolatexstr(datastore->get(errgy->getYErrorColumn(),static_cast<size_t>(index)), 3)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return QString("\\ensuremath{\\left[{\\:}%1%3{\\;},{\\;}%2%4{\\:}\\right]}").arg(QString::fromStdString(jkqtp_floattolatexstr(x, 3))).arg(QString::fromStdString(jkqtp_floattolatexstr(y, 3))).arg(xerrstr).arg(yerrstr);
|
||||
|
||||
}
|
||||
|
||||
double JKQTPPlotElement::hitTest(const QPointF & posSystem, QPointF* closestSpotSystem, QString* label, HitTestMode mode) const
|
||||
{
|
||||
if (parent==nullptr) return nan("");
|
||||
|
||||
int closest=-1;
|
||||
double closedist=nan("");
|
||||
double closedistsec=nan("");
|
||||
QPointF closestPos;
|
||||
QPointF posF=transform(posSystem);
|
||||
for (int i=0; i<m_hitTestData.count(); i++) {
|
||||
const QPointF x=m_hitTestData[i].pos;
|
||||
const QPointF xpix = transform(x);
|
||||
if (JKQTPIsOKFloat(xpix.x())&&JKQTPIsOKFloat(xpix.y())) {
|
||||
double d=0, dsecondary=0;
|
||||
switch (mode) {
|
||||
case HitTestXY: d=sqrt(jkqtp_sqr(xpix.x()-posF.x())+jkqtp_sqr(xpix.y()-posF.y())); dsecondary=0; break;
|
||||
case HitTestXOnly: d=fabs(xpix.x()-posF.x()); dsecondary=fabs(xpix.y()-posF.y()); break;
|
||||
case HitTestYOnly: d=fabs(xpix.y()-posF.y()); dsecondary=fabs(xpix.x()-posF.x()); break;
|
||||
}
|
||||
if (closest<0 || d<closedist || (jkqtp_approximatelyEqual(d,closedist) && dsecondary<closedistsec)) {
|
||||
closest=i;
|
||||
closedist=d;
|
||||
closedistsec=dsecondary;
|
||||
closestPos=x;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (closest>=0) {
|
||||
if (closestSpotSystem) *closestSpotSystem=closestPos;
|
||||
if (label) *label=m_hitTestData[closest].label;
|
||||
return closedist;
|
||||
} else {
|
||||
return nan("");
|
||||
}
|
||||
}
|
||||
|
||||
double JKQTPPlotElement::transformX(double x) const {
|
||||
return parent->getXAxis()->x2p(x);
|
||||
}
|
||||
@ -190,7 +263,7 @@ void JKQTPGraph::drawErrorsAfter(JKQTPEnhancedPainter &)
|
||||
|
||||
}
|
||||
|
||||
QVector<QPointF> JKQTPPlotElement::transform(const QVector<QPointF> &x) {
|
||||
QVector<QPointF> JKQTPPlotElement::transform(const QVector<QPointF> &x) const {
|
||||
QVector<QPointF> res;
|
||||
for (int i=0; i<x.size(); i++) {
|
||||
res.append(transform(x[i]));
|
||||
@ -198,7 +271,7 @@ QVector<QPointF> JKQTPPlotElement::transform(const QVector<QPointF> &x) {
|
||||
return res;
|
||||
}
|
||||
|
||||
QPainterPath JKQTPPlotElement::transformToLinePath(const QVector<QPointF> &x) {
|
||||
QPainterPath JKQTPPlotElement::transformToLinePath(const QVector<QPointF> &x) const {
|
||||
QPainterPath res;
|
||||
if (x.size()>0) {
|
||||
res.moveTo(transform(x[0]));
|
||||
@ -241,14 +314,8 @@ bool JKQTPXYGraph::getXMinMax(double& minx, double& maxx, double& smallestGreate
|
||||
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
int imin=0;
|
||||
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
|
||||
if (imax<imin) {
|
||||
int h=imin;
|
||||
imin=imax;
|
||||
imax=h;
|
||||
}
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
int imax=0;
|
||||
getIndexRange(imin, imax);
|
||||
|
||||
for (int i=imin; i<imax; i++) {
|
||||
double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i));
|
||||
@ -273,14 +340,9 @@ bool JKQTPXYGraph::getYMinMax(double& miny, double& maxy, double& smallestGreate
|
||||
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
int imin=0;
|
||||
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
|
||||
if (imax<imin) {
|
||||
int h=imin;
|
||||
imin=imax;
|
||||
imax=h;
|
||||
}
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
int imax=0;
|
||||
getIndexRange(imin, imax);
|
||||
|
||||
|
||||
for (int i=imin; i<imax; i++) {
|
||||
double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i));
|
||||
@ -300,8 +362,92 @@ bool JKQTPXYGraph::usesColumn(int column) const
|
||||
return (column==xColumn)||(column==yColumn);
|
||||
}
|
||||
|
||||
void JKQTPXYGraph::setXColumn(int __value)
|
||||
{
|
||||
this->xColumn = __value;
|
||||
}
|
||||
|
||||
int JKQTPXYGraph::getXColumn() const
|
||||
{
|
||||
return this->xColumn;
|
||||
}
|
||||
|
||||
void JKQTPXYGraph::setXColumn(size_t __value) {
|
||||
this->xColumn = static_cast<int>(__value);
|
||||
}
|
||||
|
||||
void JKQTPXYGraph::setYColumn(int __value)
|
||||
{
|
||||
this->yColumn = __value;
|
||||
}
|
||||
|
||||
int JKQTPXYGraph::getYColumn() const
|
||||
{
|
||||
return this->yColumn;
|
||||
}
|
||||
|
||||
void JKQTPXYGraph::setYColumn(size_t __value) { this->yColumn = static_cast<int>(__value); }
|
||||
|
||||
void JKQTPXYGraph::setDataSortOrder(JKQTPXYGraph::DataSortOrder __value)
|
||||
{
|
||||
this->sortData = __value;
|
||||
}
|
||||
|
||||
JKQTPXYGraph::DataSortOrder JKQTPXYGraph::getDataSortOrder() const
|
||||
{
|
||||
return this->sortData;
|
||||
}
|
||||
|
||||
void JKQTPXYGraph::setDataSortOrder(int __value) {
|
||||
sortData=(DataSortOrder)__value;
|
||||
sortData=static_cast<DataSortOrder>(__value);
|
||||
}
|
||||
|
||||
|
||||
double JKQTPXYGraph::hitTest(const QPointF &posSystem, QPointF *closestSpotSystem, QString *label, HitTestMode mode) const
|
||||
{
|
||||
if (parent==nullptr) return nan("");
|
||||
|
||||
// check base-class implementation and use it, if it returns a vaid value
|
||||
const double baseclassResult=JKQTPPlotElement::hitTest(posSystem, closestSpotSystem, label, mode);
|
||||
if (JKQTPIsOKFloat(baseclassResult)) return baseclassResult;
|
||||
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
int imin=0;
|
||||
int imax=0;
|
||||
if (!getIndexRange(imin, imax)) return nan("");
|
||||
|
||||
|
||||
int closest=-1;
|
||||
double closedist=nan("");
|
||||
double closedistsec=nan("");
|
||||
QPointF closestPos;
|
||||
QPointF posF=transform(posSystem);
|
||||
for (int i=imin; i<imax; i++) {
|
||||
const QPointF x(datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i)), datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i)));
|
||||
const QPointF xpix = transform(x);
|
||||
if (JKQTPIsOKFloat(xpix.x())&&JKQTPIsOKFloat(xpix.y())) {
|
||||
double d=0, dsecondary=0;
|
||||
switch (mode) {
|
||||
case HitTestXY: d=sqrt(jkqtp_sqr(xpix.x()-posF.x())+jkqtp_sqr(xpix.y()-posF.y())); dsecondary=0; break;
|
||||
case HitTestXOnly: d=fabs(xpix.x()-posF.x()); dsecondary=fabs(xpix.y()-posF.y()); break;
|
||||
case HitTestYOnly: d=fabs(xpix.y()-posF.y()); dsecondary=fabs(xpix.x()-posF.x()); break;
|
||||
}
|
||||
if (closest<0 || d<closedist || (jkqtp_approximatelyEqual(d,closedist) && dsecondary<closedistsec)) {
|
||||
closest=i;
|
||||
closedist=d;
|
||||
closedistsec=dsecondary;
|
||||
closestPos=x;
|
||||
//qDebug()<<"hitTest("<<posSystem<<"[="<<posF<<"pix]...): found closest="<<closest<<", closedist="<<closedist<<", closedistsec="<<closedistsec<<", closestPos="<<closestPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (closest>=0) {
|
||||
if (label) *label=formatHitTestDefaultLabel(closestPos.x(), closestPos.y(), closest);
|
||||
if (closestSpotSystem) *closestSpotSystem=closestPos;
|
||||
return closedist;
|
||||
} else {
|
||||
return nan("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -346,7 +492,7 @@ JKQTPSingleColumnGraph::DataSortOrder JKQTPSingleColumnGraph::getDataSortOrder()
|
||||
}
|
||||
|
||||
void JKQTPSingleColumnGraph::setDataSortOrder(int __value) {
|
||||
sortData=(DataSortOrder)__value;
|
||||
sortData=static_cast<DataSortOrder>(__value);
|
||||
if (__value>0) sortData=Sorted;
|
||||
}
|
||||
|
||||
@ -376,21 +522,15 @@ void JKQTPSingleColumnGraph::intSortData()
|
||||
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
int imin=0;
|
||||
int imax=datastore->getColumn(dataColumn).getRows();
|
||||
if (imax<imin) {
|
||||
int h=imin;
|
||||
imin=imax;
|
||||
imax=h;
|
||||
}
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
int imax=0;
|
||||
getIndexRange(imin, imax);
|
||||
|
||||
QVector<double> datas;
|
||||
|
||||
if (sortData==JKQTPSingleColumnGraph::Sorted) {
|
||||
|
||||
for (int i=0; i<imax; i++) {
|
||||
double xv=datastore->get(dataColumn,i);
|
||||
double xv=datastore->get(dataColumn,static_cast<size_t>(i));
|
||||
sortedIndices<<i;
|
||||
datas<<xv;
|
||||
}
|
||||
@ -401,6 +541,24 @@ void JKQTPSingleColumnGraph::intSortData()
|
||||
}
|
||||
}
|
||||
|
||||
bool JKQTPSingleColumnGraph::getIndexRange(int &imin, int &imax) const
|
||||
{
|
||||
if (parent==nullptr) return false;
|
||||
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
imin=0;
|
||||
imax=static_cast<int>(datastore->getColumn(static_cast<size_t>(dataColumn)).getRows());
|
||||
if (imax<imin) {
|
||||
int h=imin;
|
||||
imin=imax;
|
||||
imax=h;
|
||||
}
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
|
||||
return imin>=0 && imax>=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -425,14 +583,8 @@ void JKQTPXYGraph::intSortData()
|
||||
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
int imin=0;
|
||||
int imax=qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows());
|
||||
if (imax<imin) {
|
||||
int h=imin;
|
||||
imin=imax;
|
||||
imax=h;
|
||||
}
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
int imax=0;
|
||||
getIndexRange(imin, imax);
|
||||
|
||||
QVector<double> datas;
|
||||
|
||||
@ -459,6 +611,24 @@ void JKQTPXYGraph::intSortData()
|
||||
}
|
||||
}
|
||||
|
||||
bool JKQTPXYGraph::getIndexRange(int& imin, int& imax) const
|
||||
{
|
||||
if (parent==nullptr) return false;
|
||||
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
imin=0;
|
||||
imax=static_cast<int>(qMin(datastore->getColumn(static_cast<size_t>(xColumn)).getRows(), datastore->getColumn(static_cast<size_t>(yColumn)).getRows()));
|
||||
if (imax<imin) {
|
||||
int h=imin;
|
||||
imin=imax;
|
||||
imax=h;
|
||||
}
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
|
||||
return imin>=0 && imax>=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
JKQTPPlotObject::JKQTPPlotObject(JKQTBasePlotter *parent):
|
||||
|
@ -33,6 +33,7 @@
|
||||
// forward declarations
|
||||
class JKQTPlotter;
|
||||
class JKQTPDatastore;
|
||||
class JKQTPGraphErrorStyleMixin;
|
||||
|
||||
/** \brief this virtual base class of every element, which is part of a JKQTPlotter plot and may appear in its key
|
||||
* (basically any type of graph, except overlay elements!)
|
||||
@ -61,6 +62,7 @@ class JKQTPDatastore;
|
||||
class JKQTP_LIB_EXPORT JKQTPPlotElement: public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/** \brief class constructor */
|
||||
explicit JKQTPPlotElement(JKQTBasePlotter* parent=nullptr);
|
||||
/** \brief class constructor */
|
||||
@ -127,6 +129,73 @@ class JKQTP_LIB_EXPORT JKQTPPlotElement: public QObject {
|
||||
*/
|
||||
virtual void drawOutside(JKQTPEnhancedPainter& painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace);
|
||||
|
||||
/** \brief modes of operation for the function hitTest() */
|
||||
enum HitTestMode {
|
||||
HitTestXY, /*!< \brief find closest point in x- and y-direction simulatneously (i.e. measure direct distance) */
|
||||
HitTestXOnly, /*!< \brief find closest point in x-direction only */
|
||||
HitTestYOnly, /*!< \brief find closest point in y-direction only */
|
||||
};
|
||||
|
||||
/*! \brief returns the closest distance of the plot element to the (screen pixel) position \a pos, or \c NAN
|
||||
|
||||
This function is used to implement hit tests, i.e. to test whether a graph is close to a given position \a posSystem.
|
||||
The function will then return the distance of the closes graph-point and a label for this point. An example of what
|
||||
can be done with this function is the tooltip tool that JKQTPlotter provides via its context-menu/toolbar. This tool
|
||||
uses just the information of the closest point and its label to display a tooltip for that datapoint:
|
||||
|
||||
\see jkqtpmdaToolTipForClosestDataPoint for details.
|
||||
|
||||
|
||||
\param posSystem position to test in system coordinates
|
||||
\param[out] closestSpotSystem optional output of the closest point found on the plot element in system coordinates
|
||||
\param[out] label optional output of a label for the closest point (that might e.g. be used in a tooltip)
|
||||
\param mode search mode, i.e. use sqrt(dx*dx+dy*dy) as distance, or just the absoulte values along one of the
|
||||
two coordinate axes. Note that the returned distance depends on this parameter!
|
||||
\return NAN if not implemented, or if \a pos is very far from the plot element, or the closest distance (in screen pixels)
|
||||
of \a pos from the plot element. Note that the returned distance depends on the choosen \a mode !!!
|
||||
You can use JKQTPIsOKFloat() to check whether a valid distance was returned!
|
||||
|
||||
|
||||
Since tha graph base class does not have any knowledge about how to perform a hit test on you specific graph, there is only a
|
||||
very general implementation in this class, which does not actually search through the graph itself, but searches through
|
||||
extra data that hs to be written during draw() and is stored in m_hitTestData. The implentation this base-class only searches this
|
||||
list of points+metadata to implement a basic hit-test. If the list is empty, of no close-by points are found (default), then
|
||||
hitTest() will simply return \a NAN.
|
||||
|
||||
When writing a new graph, you can therefore implement hitTest() in one of these ways:
|
||||
# You simply fill m_hitTestData with appropriate data and rely on the implementation in JKQTPPlotElement to do the work for you:
|
||||
You then need to call clearHitTestData() at the start of your draw() function and whenever you draw a datapoint, you add
|
||||
its location and metadata to the internal storage with addHitTestData().
|
||||
# You derive from a graph class that already has an implementation. JKQTPXYGraph is an example of this. That class searches
|
||||
through all x-/y-coordinates in the internally known columns and even takes into account possible graph errors in the label,
|
||||
when the graph is also derived from JKQTPXGraphErrorData or JKQTPYGraphErrorData. This implementation therefore covers
|
||||
most graph types pre-packaged with JKQTPlotter.
|
||||
# You implement the function from scratch.
|
||||
.
|
||||
|
||||
\see addHitTestData(), clearHitTestData(), m_hitTestData, HitTestLocation
|
||||
|
||||
*/
|
||||
virtual double hitTest(const QPointF & posSystem, QPointF* closestSpotSystem=nullptr, QString* label=nullptr, HitTestMode mode=HitTestXY) const;
|
||||
|
||||
/** \brief Dataset for a single point on the graph, associated with its data-column index and a label that can be used by a basic implementation of hitTest()
|
||||
*
|
||||
* \see hitTest()
|
||||
*/
|
||||
struct HitTestLocation {
|
||||
inline HitTestLocation(): pos(nan(""), nan("")), index(-1), label("") {}
|
||||
inline HitTestLocation(double x_, double y_, const QString& label_): pos(x_,y_), index(-1), label(label_) {}
|
||||
inline HitTestLocation(const QPointF& pos_, const QString& label_): pos(pos_), index(-1), label(label_) {}
|
||||
inline HitTestLocation(double x_, double y_, int index_, const QString& label_): pos(x_,y_), index(index_), label(label_) {}
|
||||
inline HitTestLocation(const QPointF& pos_, int index_, const QString& label_): pos(pos_), index(index_), label(label_) {}
|
||||
/** \brief position of the hit-test point */
|
||||
QPointF pos;
|
||||
/** \brief index of the hit-test point in the linked data-columns (or -1) */
|
||||
int index;
|
||||
/** \brief label for that specific hit-test point */
|
||||
QString label;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@ -145,36 +214,124 @@ class JKQTP_LIB_EXPORT JKQTPPlotElement: public QObject {
|
||||
|
||||
|
||||
/** \brief tool routine that transforms a QPointF according to the parent's transformation rules (plot coordinate --> pixels) */
|
||||
inline QPointF transform(const QPointF& x) {
|
||||
inline QPointF transform(const QPointF& x) const {
|
||||
return QPointF(transformX(x.x()), transformY(x.y()));
|
||||
}
|
||||
|
||||
/** \brief tool routine that back-transforms a QPointF according to the parent's transformation rules (pixels --> plot coordinate) */
|
||||
inline QPointF backTransform(const QPointF& x) {
|
||||
inline QPointF backTransform(const QPointF& x) const {
|
||||
return QPointF(backtransformX(x.x()), backtransformY(x.y()));
|
||||
}
|
||||
|
||||
/** \brief tool routine that transforms a QPointF according to the parent's transformation rules (plot coordinate --> pixels) */
|
||||
inline QPointF transform(double x, double y) {
|
||||
inline QPointF transform(double x, double y) const {
|
||||
return transform(QPointF(x,y));
|
||||
}
|
||||
/** \brief tool routine that back-transforms a QPointF according to the parent's transformation rules (pixels --> plot coordinate) */
|
||||
inline QPointF backTransform(double x, double y) {
|
||||
inline QPointF backTransform(double x, double y) const {
|
||||
return backTransform(QPointF(x,y));
|
||||
}
|
||||
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules (plot coordinate --> pixels) */
|
||||
QVector<QPointF> transform(const QVector<QPointF>& x);
|
||||
QVector<QPointF> transform(const QVector<QPointF>& x) const;
|
||||
|
||||
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules
|
||||
* and returns a (non-closed) path consisting of lines (plot coordinate --> pixels) */
|
||||
QPainterPath transformToLinePath(const QVector<QPointF>& x);
|
||||
QPainterPath transformToLinePath(const QVector<QPointF>& x) const;
|
||||
|
||||
/** \brief tool routine that transforms a QVector<QPointF> according to the parent's transformation rules
|
||||
* and returns a polygon (plot coordinate --> pixels) */
|
||||
inline QPolygonF transformToPolygon(const QVector<QPointF>& x) {
|
||||
inline QPolygonF transformToPolygon(const QVector<QPointF>& x) const {
|
||||
return QPolygonF(transform(x));
|
||||
}
|
||||
|
||||
|
||||
/** \brief clear the internal datastore for hitTest()
|
||||
*
|
||||
* \note This function has to be called at the start of draw()
|
||||
* \see hitTest(), addHitTestData(), m_hitTestData, HitTestLocation
|
||||
*/
|
||||
inline void clearHitTestData() { m_hitTestData.clear(); }
|
||||
/** \brief reserve list entries for up to \a points graph points in the internal datastore for hitTest()
|
||||
*
|
||||
* \note Call this after clearHitTestData() for improved speed of subsequent addHitTestData() calls!
|
||||
* \see hitTest(), addHitTestData(), m_hitTestData, HitTestLocation
|
||||
*/
|
||||
inline void reserveHitTestData(int points) { m_hitTestData.reserve(qMax(10, abs(points))); }
|
||||
/** \brief clear the internal datastore for hitTest()
|
||||
*
|
||||
* \note This function has to be called at the start of draw()
|
||||
* \see hitTest(), clearHitTestData(), m_hitTestData, HitTestLocation, reserveHitTestData()
|
||||
*/
|
||||
inline void addHitTestData(const HitTestLocation& loc) { m_hitTestData<<loc; }
|
||||
/** \brief add a new point on the graph to the internal datastore for hitTest()
|
||||
*
|
||||
* \param x_ x-position of the graph point in system coordinates
|
||||
* \param y_ y-position of the graph point in system coordinates
|
||||
* \param label_ a label for this datapoint, that can e.g. be displayed in a tooltip for this point
|
||||
*
|
||||
* \see hitTest(), clearHitTestData(), m_hitTestData, HitTestLocation, reserveHitTestData()
|
||||
*/
|
||||
inline void addHitTestData(double x_, double y_, const QString& label_) { addHitTestData(HitTestLocation(x_,y_,label_)); }
|
||||
/** \brief clear the internal datastore for hitTest()
|
||||
*
|
||||
* \param pos_ position of the graph point in system coordinates
|
||||
* \param label_ a label for this datapoint, that can e.g. be displayed in a tooltip for this point
|
||||
*
|
||||
* \see hitTest(), clearHitTestData(), m_hitTestData, HitTestLocation, reserveHitTestData()
|
||||
*/
|
||||
inline void addHitTestData(const QPointF& pos_, const QString& label_) { addHitTestData(HitTestLocation(pos_,label_)); }
|
||||
/** \brief add a new point on the graph to the internal datastore for hitTest(),
|
||||
* this variant uses formatHitTestDefaultLabel() to auto-generate the label
|
||||
*
|
||||
* \param x_ x-position of the graph point in system coordinates
|
||||
* \param y_ y-position of the graph point in system coordinates
|
||||
* \param index_ index of the graph point in the internal data columns, or -1
|
||||
* \param datastore datastore for formatHitTestDefaultLabel()
|
||||
*
|
||||
* \see hitTest(), clearHitTestData(), m_hitTestData, HitTestLocation, reserveHitTestData()
|
||||
*/
|
||||
inline void addHitTestData(double x_, double y_, int index_=-1, JKQTPDatastore* datastore=nullptr) { addHitTestData(HitTestLocation(x_,y_,formatHitTestDefaultLabel(x_,y_, index_, datastore))); }
|
||||
/** \brief clear the internal datastore for hitTest(),
|
||||
* this variant uses formatHitTestDefaultLabel() to auto-generate the label
|
||||
*
|
||||
* \param pos_ position of the graph point in system coordinates
|
||||
* \param index_ index of the graph point in the internal data columns, or -1
|
||||
* \param datastore datastore for formatHitTestDefaultLabel()
|
||||
*
|
||||
* \see hitTest(), clearHitTestData(), m_hitTestData, HitTestLocation, reserveHitTestData()
|
||||
*/
|
||||
inline void addHitTestData(const QPointF& pos_, int index_=-1, JKQTPDatastore* datastore=nullptr) { addHitTestData(HitTestLocation(pos_,formatHitTestDefaultLabel(pos_.x(), pos_.y(), index_, datastore))); }
|
||||
/** \brief clear the internal datastore for hitTest()
|
||||
*
|
||||
* \param x_ x-position of the graph point in system coordinates
|
||||
* \param y_ y-position of the graph point in system coordinates
|
||||
* \param index_ index of the graph point in the internal data columns
|
||||
* \param label_ a label for this datapoint, that can e.g. be displayed in a tooltip for this point
|
||||
*
|
||||
* \see hitTest(), clearHitTestData(), m_hitTestData, HitTestLocation, reserveHitTestData()
|
||||
*/
|
||||
inline void addHitTestData(double x_, double y_, int index_, const QString& label_) { addHitTestData(HitTestLocation(x_,y_,index_,label_)); }
|
||||
/** \brief clear the internal datastore for hitTest()
|
||||
*
|
||||
* \param pos_ position of the graph point in system coordinates
|
||||
* \param index_ index of the graph point in the internal data columns
|
||||
* \param label_ a label for this datapoint, that can e.g. be displayed in a tooltip for this point
|
||||
*
|
||||
* \see hitTest(), clearHitTestData(), m_hitTestData, HitTestLocation, reserveHitTestData()
|
||||
*/
|
||||
inline void addHitTestData(const QPointF& pos_, int index_, const QString& label_) { addHitTestData(HitTestLocation(pos_,index_,label_)); }
|
||||
|
||||
/** \brief tool-function for hitTest(), which formats a default label, taking into account the x- and y-position (both provided)
|
||||
* and optionally the errors of these positions.
|
||||
*
|
||||
* \param x x-position of the datapoint in system coordinates
|
||||
* \param y y-position of the datapoint in system coordinates
|
||||
* \param index the index of the data point in the associated data column(s), or -1 (optional!)
|
||||
* \param datastore The datastore to read error data from (optional!)
|
||||
* \returns a LaTeX formatted label
|
||||
*/
|
||||
virtual QString formatHitTestDefaultLabel(double x, double y, int index=-1, JKQTPDatastore *datastore=nullptr) const;
|
||||
|
||||
/** \brief the plotter object this object belongs to */
|
||||
JKQTBasePlotter* parent;
|
||||
|
||||
@ -187,6 +344,14 @@ class JKQTP_LIB_EXPORT JKQTPPlotElement: public QObject {
|
||||
bool highlighted;
|
||||
/** \brief internal storage for the used parent plot style */
|
||||
int parentPlotStyle;
|
||||
|
||||
|
||||
/** \brief dataset with graph-points and associated data fro the function hitTest()
|
||||
* \see hitTest(), HitTestLocation
|
||||
*/
|
||||
QVector<HitTestLocation> m_hitTestData;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/** \brief this virtual base class of the (data-column based) graphs,
|
||||
@ -252,7 +417,7 @@ class JKQTP_LIB_EXPORT JKQTPGraph: public JKQTPPlotElement {
|
||||
protected:
|
||||
|
||||
|
||||
friend class JKQTPGraphErrors;
|
||||
friend class JKQTPGraphErrorStyleMixin;
|
||||
|
||||
};
|
||||
|
||||
@ -339,51 +504,45 @@ class JKQTP_LIB_EXPORT JKQTPXYGraph: public JKQTPGraph {
|
||||
|
||||
/*! \copydoc xColumn
|
||||
\see see xColumn for details */
|
||||
inline virtual void setXColumn(int __value)
|
||||
{
|
||||
this->xColumn = __value;
|
||||
}
|
||||
void setXColumn(int __value);
|
||||
/*! \copydoc xColumn
|
||||
\see see xColumn for details */
|
||||
inline virtual int getXColumn() const
|
||||
{
|
||||
return this->xColumn;
|
||||
}
|
||||
int getXColumn() const;
|
||||
/*! \brief sets the property xColumn ( \copybrief xColumn ) to the specified \a __value, where __value is static_cast'ed from size_t to int.
|
||||
\details Description of the parameter xColumn is: <BLOCKQUOTE>\copydoc xColumn </BLOCKQUOTE>
|
||||
\see xColumn for more information */
|
||||
inline virtual void setXColumn (size_t __value) { this->xColumn = static_cast<int>(__value); }
|
||||
void setXColumn (size_t __value);
|
||||
/*! \copydoc yColumn
|
||||
\see see yColumn for details */
|
||||
inline virtual void setYColumn(int __value)
|
||||
{
|
||||
this->yColumn = __value;
|
||||
}
|
||||
void setYColumn(int __value);
|
||||
/*! \copydoc yColumn
|
||||
\see see yColumn for details */
|
||||
inline virtual int getYColumn() const
|
||||
{
|
||||
return this->yColumn;
|
||||
}
|
||||
int getYColumn() const;
|
||||
/*! \brief sets the property yColumn ( \copybrief yColumn ) to the specified \a __value, where __value is static_cast'ed from size_t to int.
|
||||
\details Description of the parameter yColumn is: <BLOCKQUOTE>\copydoc yColumn </BLOCKQUOTE>
|
||||
\see yColumn for more information */
|
||||
inline virtual void setYColumn (size_t __value) { this->yColumn = static_cast<int>(__value); }
|
||||
void setYColumn (size_t __value);
|
||||
/*! \copydoc sortData
|
||||
\see see sortData for details */
|
||||
inline virtual void setDataSortOrder(DataSortOrder __value)
|
||||
{
|
||||
this->sortData = __value;
|
||||
}
|
||||
void setDataSortOrder(DataSortOrder __value);
|
||||
/*! \copydoc sortData
|
||||
\see see sortData for details */
|
||||
inline virtual DataSortOrder getDataSortOrder() const
|
||||
{
|
||||
return this->sortData;
|
||||
}
|
||||
DataSortOrder getDataSortOrder() const;
|
||||
/*! \brief sets the property sortData ( \copybrief sortData ) to the specified \a __value. \details Description of the parameter sortData is: <BLOCKQUOTE>\copydoc sortData </BLOCKQUOTE> \see sortData for more information */
|
||||
void setDataSortOrder(int __value);
|
||||
|
||||
|
||||
/** \brief Implmentation of JKQTPPlotElement::hitTest(), which searches through all graph points defined by xColumn and yColumn
|
||||
* and returns a general x/y-label, also taking into account possibly known errors to the graphs (if it is derived
|
||||
* from JKQTPXGraphErrorData and/or JKQTPYGraphErrorData
|
||||
*
|
||||
* \note This function first checks whether JKQTPPlotElement::hitTest() returns any result, so you can use the basic implementation
|
||||
* in JKQTPPlotElement to override the behaviour here, by simply calling addHitTestData() during your draw() implementation
|
||||
*
|
||||
* \see See JKQTPPlotElement::hitTest() for details on the function definition!
|
||||
*/
|
||||
virtual double hitTest(const QPointF &posSystem, QPointF* closestSpotSystem=nullptr, QString* label=nullptr, HitTestMode mode=HitTestXY) const override;
|
||||
|
||||
protected:
|
||||
|
||||
/** \brief the column that contains the x-component of the datapoints */
|
||||
@ -407,6 +566,14 @@ class JKQTP_LIB_EXPORT JKQTPXYGraph: public JKQTPGraph {
|
||||
if (sortData==Unsorted) return i;
|
||||
return sortedIndices.value(i,i);
|
||||
}
|
||||
|
||||
/** \brief determines the range of row indexes available in the data columns of this graph
|
||||
*
|
||||
* \param[out] imin first usable row-index
|
||||
* \param[out] imax last usable row-index
|
||||
* \return \c true on success and \c false if the information is not available
|
||||
*/
|
||||
virtual bool getIndexRange(int &imin, int &imax) const;
|
||||
};
|
||||
|
||||
|
||||
@ -495,6 +662,13 @@ class JKQTP_LIB_EXPORT JKQTPSingleColumnGraph: public JKQTPGraph {
|
||||
return sortedIndices.value(i,i);
|
||||
}
|
||||
|
||||
/** \brief determines the range of row indexes available in the data columns of this graph
|
||||
*
|
||||
* \param[out] imin first usable row-index
|
||||
* \param[out] imax last usable row-index
|
||||
* \return \c true on success and \c false if the information is not available
|
||||
*/
|
||||
virtual bool getIndexRange(int &imin, int &imax) const;
|
||||
|
||||
};
|
||||
|
||||
|
@ -38,94 +38,233 @@
|
||||
|
||||
|
||||
|
||||
JKQTPGraphErrors::JKQTPGraphErrors(QColor graphColor, JKQTBasePlotter *basePlotter) {
|
||||
errorColor=graphColor.darker();
|
||||
errorStyle=Qt::SolidLine;
|
||||
errorWidth=2;
|
||||
errorFillColor=graphColor.lighter();
|
||||
errorColor.setAlphaF(0.5);
|
||||
errorFillStyle=Qt::SolidPattern;
|
||||
errorbarSize=7;
|
||||
JKQTPGraphErrorStyleMixin::JKQTPGraphErrorStyleMixin() {
|
||||
m_errorLinePen=QPen(QColor("red"), Qt::SolidLine);
|
||||
m_errorLinePen.setJoinStyle(Qt::RoundJoin);
|
||||
m_errorLinePen.setCapStyle(Qt::RoundCap);
|
||||
m_errorLineWidth=1;
|
||||
m_errorBarCapSize=7;
|
||||
}
|
||||
|
||||
if (basePlotter) {
|
||||
errorWidth=basePlotter->getCurrentPlotterStyle().defaultGraphSymbolLineWidth;
|
||||
errorbarSize=basePlotter->getCurrentPlotterStyle().defaultGraphSymbolSize*0.75;
|
||||
void JKQTPGraphErrorStyleMixin::initErrorStyle(JKQTBasePlotter *parent, int &parentPlotStyle)
|
||||
{
|
||||
if (parent) { // get style settings from parent object
|
||||
if (parentPlotStyle<0) parentPlotStyle=parent->getNextStyle();
|
||||
m_errorFillColor=parent->getPlotStyle(parentPlotStyle).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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorStyleFromPen(const JKQTBasePlotter::JKQTPPen &pen)
|
||||
{
|
||||
m_errorLineWidth=pen.errorWidthF();
|
||||
setErrorLineColor(pen.errorColor());
|
||||
setErrorFillColor(pen.errorFillColor());
|
||||
setErrorFillStyle(pen.errorFillStyle());
|
||||
setErrorLineStyle(pen.errorStyle());
|
||||
m_errorBarCapSize=pen.symbolSize()*0.75;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorColorFromGraphColor(QColor graphColor)
|
||||
{
|
||||
setErrorLineColor(graphColor.darker());
|
||||
setErrorFillColor(graphColor.lighter());
|
||||
//errorColor.setAlphaF(0.5);
|
||||
}
|
||||
|
||||
QPen JKQTPGraphErrorStyleMixin::getErrorLinePen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
|
||||
{
|
||||
QPen p=m_errorLinePen;
|
||||
p.setWidthF(qMax(JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH,parent->pt2px(painter, parent->getLineWidthMultiplier()*m_errorLineWidth)));
|
||||
return p;
|
||||
}
|
||||
|
||||
QPen JKQTPGraphErrorStyleMixin::getErrorLinePenForRects(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
|
||||
{
|
||||
QPen p=getErrorLinePen(painter, parent);
|
||||
p.setJoinStyle(Qt::MiterJoin);
|
||||
return p;
|
||||
}
|
||||
|
||||
QBrush JKQTPGraphErrorStyleMixin::getErrorFillBrush(JKQTPEnhancedPainter &/*painter*/, JKQTBasePlotter */*parent*/) const
|
||||
{
|
||||
return m_errorFillBrush;
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorLineColor(const QColor &__value)
|
||||
{
|
||||
m_errorLinePen.setColor(__value);
|
||||
}
|
||||
|
||||
QColor JKQTPGraphErrorStyleMixin::getErrorLineColor() const
|
||||
{
|
||||
return this->m_errorLinePen.color();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorLineStyle(Qt::PenStyle __value)
|
||||
{
|
||||
this->m_errorLinePen.setStyle( __value);
|
||||
}
|
||||
|
||||
Qt::PenStyle JKQTPGraphErrorStyleMixin::getErrorLineStyle() const
|
||||
{
|
||||
return this->m_errorLinePen.style();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorLineWidth(double __value)
|
||||
{
|
||||
this->m_errorLineWidth = __value;
|
||||
}
|
||||
|
||||
double JKQTPGraphErrorStyleMixin::getErrorLineWidth() const
|
||||
{
|
||||
return this->m_errorLineWidth;
|
||||
}
|
||||
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorLineDashOffset(qreal offset)
|
||||
{
|
||||
m_errorLinePen.setDashOffset(offset);
|
||||
}
|
||||
|
||||
qreal JKQTPGraphErrorStyleMixin::getErrorLineDashOffset() const
|
||||
{
|
||||
return m_errorLinePen.dashOffset();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorLineDashPattern(const QVector<qreal> &pattern)
|
||||
{
|
||||
m_errorLinePen.setDashPattern(pattern);
|
||||
m_errorLinePen.setStyle(Qt::CustomDashLine);
|
||||
}
|
||||
|
||||
QVector<qreal> JKQTPGraphErrorStyleMixin::getErrorLineDashPattern() const
|
||||
{
|
||||
return m_errorLinePen.dashPattern();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorLineJoinStyle(Qt::PenJoinStyle style)
|
||||
{
|
||||
m_errorLinePen.setJoinStyle(style);
|
||||
}
|
||||
|
||||
Qt::PenJoinStyle JKQTPGraphErrorStyleMixin::getErrorLineJoinStyle() const
|
||||
{
|
||||
return m_errorLinePen.joinStyle();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorLineCapStyle(Qt::PenCapStyle style)
|
||||
{
|
||||
m_errorLinePen.setCapStyle(style);
|
||||
}
|
||||
|
||||
Qt::PenCapStyle JKQTPGraphErrorStyleMixin::getErrorLineCapStyle() const
|
||||
{
|
||||
return m_errorLinePen.capStyle();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorLineBrush(const QBrush &style)
|
||||
{
|
||||
m_errorLinePen.setBrush(style);
|
||||
}
|
||||
|
||||
QBrush JKQTPGraphErrorStyleMixin::getErrorLineBrush() const
|
||||
{
|
||||
return m_errorLinePen.brush();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorFillColor(const QColor &__value)
|
||||
{
|
||||
m_errorFillColor=__value;
|
||||
m_errorFillBrush.setColor(__value);
|
||||
}
|
||||
|
||||
QColor JKQTPGraphErrorStyleMixin::getErrorFillColor() const
|
||||
{
|
||||
return this->m_errorFillBrush.color();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorFillStyle(Qt::BrushStyle __value)
|
||||
{
|
||||
if (m_errorFillBrush.style()==Qt::LinearGradientPattern || m_errorFillBrush.style()==Qt::RadialGradientPattern || m_errorFillBrush.style()==Qt::ConicalGradientPattern || m_errorFillBrush.style()==Qt::TexturePattern) {
|
||||
m_errorFillBrush=QBrush(m_errorFillColor, __value);
|
||||
} else {
|
||||
m_errorFillBrush.setStyle(__value);
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::setErrorStyleFromPen(const JKQTBasePlotter::JKQTPPen &pen)
|
||||
Qt::BrushStyle JKQTPGraphErrorStyleMixin::getErrorFillStyle() const
|
||||
{
|
||||
errorWidth=pen.errorWidthF();
|
||||
errorColor=pen.errorColor();
|
||||
errorFillColor=pen.errorFillColor();
|
||||
errorFillStyle=pen.errorFillStyle();
|
||||
errorStyle=pen.errorStyle();
|
||||
errorbarSize=pen.symbolSize()*0.75;
|
||||
return this->m_errorFillBrush.style();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::setErrorColor(const QColor &__value)
|
||||
void JKQTPGraphErrorStyleMixin::setErrorBarCapSize(double __value)
|
||||
{
|
||||
this->errorColor = __value;
|
||||
this->m_errorBarCapSize = __value;
|
||||
}
|
||||
|
||||
QColor JKQTPGraphErrors::getErrorColor() const
|
||||
double JKQTPGraphErrorStyleMixin::getErrorBarCapSize() const
|
||||
{
|
||||
return this->errorColor;
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::setErrorStyle(const Qt::PenStyle &__value)
|
||||
{
|
||||
this->errorStyle = __value;
|
||||
}
|
||||
|
||||
Qt::PenStyle JKQTPGraphErrors::getErrorStyle() const
|
||||
{
|
||||
return this->errorStyle;
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::setErrorWidth(double __value)
|
||||
{
|
||||
this->errorWidth = __value;
|
||||
}
|
||||
|
||||
double JKQTPGraphErrors::getErrorWidth() const
|
||||
{
|
||||
return this->errorWidth;
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::setErrorFillColor(const QColor &__value)
|
||||
{
|
||||
this->errorFillColor = __value;
|
||||
}
|
||||
|
||||
QColor JKQTPGraphErrors::getErrorFillColor() const
|
||||
{
|
||||
return this->errorFillColor;
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::setErrorFillStyle(const Qt::BrushStyle &__value)
|
||||
{
|
||||
this->errorFillStyle = __value;
|
||||
}
|
||||
|
||||
Qt::BrushStyle JKQTPGraphErrors::getErrorFillStyle() const
|
||||
{
|
||||
return this->errorFillStyle;
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::setErrorbarSize(double __value)
|
||||
{
|
||||
this->errorbarSize = __value;
|
||||
}
|
||||
|
||||
double JKQTPGraphErrors::getErrorbarSize() const
|
||||
{
|
||||
return this->errorbarSize;
|
||||
return this->m_errorBarCapSize;
|
||||
}
|
||||
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorFillTexture(const QPixmap &__value)
|
||||
{
|
||||
m_errorFillBrush.setStyle(Qt::TexturePattern);
|
||||
m_errorFillBrush.setTexture(__value);
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int xErrorColumnLower, int yErrorColumnLower, bool xErrorSymmetric, bool yErrorSymmetric, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
|
||||
void JKQTPGraphErrorStyleMixin::setErrorFillTexture(const QImage &__value)
|
||||
{
|
||||
m_errorFillBrush.setStyle(Qt::TexturePattern);
|
||||
m_errorFillBrush.setTextureImage(__value);
|
||||
}
|
||||
|
||||
QPixmap JKQTPGraphErrorStyleMixin::getErrorFillTexture() const
|
||||
{
|
||||
return m_errorFillBrush.texture();
|
||||
}
|
||||
|
||||
QImage JKQTPGraphErrorStyleMixin::getErrorFillTextureImage() const
|
||||
{
|
||||
return m_errorFillBrush.textureImage();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorFillGradient(const QGradient &__value)
|
||||
{
|
||||
m_errorFillBrush=QBrush(__value);
|
||||
}
|
||||
|
||||
const QGradient *JKQTPGraphErrorStyleMixin::getErrorFillGradient() const
|
||||
{
|
||||
return m_errorFillBrush.gradient();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorFillBrush(const QBrush &b)
|
||||
{
|
||||
m_errorFillBrush=b;
|
||||
m_errorFillColor=b.color();
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorFillTransform(const QMatrix &b)
|
||||
{
|
||||
m_errorFillBrush.setMatrix(b);
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::setErrorFillTransform(const QTransform &b)
|
||||
{
|
||||
m_errorFillBrush.setTransform(b);
|
||||
}
|
||||
|
||||
void JKQTPGraphErrorStyleMixin::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int xErrorColumnLower, int yErrorColumnLower, bool xErrorSymmetric, bool yErrorSymmetric, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
|
||||
//std::cout<<"JKQTPGraphErrors::intPlotXYErrorIndicators(p, "<<parent<<", "<<xColumn<<", "<<yColumn<<", "<<xErrorColumn<<", "<<yErrorColumn<<", "<<xErrorStyle<<", "<<yErrorStyle<<", ...)\n";
|
||||
if (parent==nullptr) return;
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
@ -137,29 +276,21 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
if (!visX&&!visY) return;
|
||||
//std::cout<<" JKQTPGraphErrors::intPlotXYErrorIndicators(p, "<<parent<<", "<<xColumn<<", "<<yColumn<<", "<<xErrorColumn<<", "<<yErrorColumn<<", ...)\n";
|
||||
|
||||
QBrush b=painter.brush();
|
||||
b.setColor(errorFillColor);
|
||||
b.setStyle(errorFillStyle);
|
||||
QPen p=painter.pen();
|
||||
p.setColor(errorColor);
|
||||
p.setWidthF(qMax(JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH, parent->pt2px(painter, errorWidth*parent->getLineWidthMultiplier())));
|
||||
p.setStyle(errorStyle);
|
||||
p.setJoinStyle(Qt::RoundJoin);
|
||||
p.setCapStyle(Qt::RoundCap);
|
||||
QBrush b=getErrorFillBrush(painter, parent);
|
||||
QPen p=getErrorLinePen(painter, parent);
|
||||
QPen pr=getErrorLinePenForRects(painter, parent);
|
||||
painter.setPen(p);
|
||||
|
||||
unsigned int imaxx=0, imaxy=0;
|
||||
size_t imaxx=0, imaxy=0;
|
||||
if (xColumn>=0) imaxx=datastore->getColumn(static_cast<size_t>(xColumn)).getRows();
|
||||
if (yColumn>=0) imaxy=datastore->getColumn(static_cast<size_t>(yColumn)).getRows();
|
||||
int imax=qMin(imaxx, imaxy);
|
||||
int imin=0;
|
||||
size_t imax=qMin(imaxx, imaxy);
|
||||
size_t imin=0;
|
||||
if (imax<imin) {
|
||||
int h=imin;
|
||||
size_t h=imin;
|
||||
imin=imax;
|
||||
imax=h;
|
||||
}
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
|
||||
double xold=-1;
|
||||
double xpold=-1;
|
||||
@ -168,39 +299,19 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
double ypold=-1;
|
||||
double ymold=-1;
|
||||
bool pastFirst=false;
|
||||
double ebs_px=parent->pt2px(painter, errorbarSize);
|
||||
double ebs_px=parent->pt2px(painter, m_errorBarCapSize);
|
||||
QPolygonF polyX, polyY;
|
||||
QList<QPointF> polyXTopPoints, polyXBottomPoints, polyYTopPoints, polyYBottomPoints;
|
||||
QList<QColor> errFC, errC;
|
||||
bool defaultErrorColor=true;
|
||||
|
||||
|
||||
/*
|
||||
* double delta=1;
|
||||
double deltap=0;
|
||||
double deltam=0;
|
||||
for (int i=imin; i<imax; i++) {
|
||||
double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i));
|
||||
double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i));
|
||||
if (imin==imax) { // only one x-value
|
||||
deltam=0.5;
|
||||
deltap=0.5;
|
||||
} else if (i==imax-1) { // the right-most x-value
|
||||
deltap=deltam=fabs(xv-datastore->get(xColumn,i-1))/2.0;
|
||||
} else if (i==imin) { // the left-most x-value
|
||||
deltam=deltap=fabs(datastore->get(xColumn,i+1)-xv)/2.0;
|
||||
} else {
|
||||
deltam=fabs(xv-datastore->get(xColumn,i-1))/2.0;
|
||||
deltap=fabs(datastore->get(xColumn,i+1)-xv)/2.0;
|
||||
}
|
||||
delta=deltap+deltam;
|
||||
**/
|
||||
|
||||
for (int iii=imin; iii<imax; iii++) {
|
||||
int i=iii;
|
||||
if (dataorder) i=dataorder->value(iii, iii);
|
||||
double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i));
|
||||
double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i));
|
||||
for (size_t iii=imin; iii<imax; iii++) {
|
||||
int i=static_cast<int>(iii);
|
||||
if (dataorder) i=dataorder->value(static_cast<int>(iii), static_cast<int>(iii));
|
||||
const double xv=datastore->get(static_cast<size_t>(xColumn),static_cast<size_t>(i));
|
||||
const double yv=datastore->get(static_cast<size_t>(yColumn),static_cast<size_t>(i));
|
||||
|
||||
double deltax=1;
|
||||
double deltapx=0;
|
||||
@ -208,13 +319,13 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
if (imin==imax) { // only one x-value
|
||||
deltamx=0.5;
|
||||
deltapx=0.5;
|
||||
} else if (i==imax-1&& i-1>=0) { // the right-most x-value
|
||||
deltapx=deltamx=fabs(xv-datastore->get(xColumn,i-1))/2.0;
|
||||
} else if (i==imin && i+1<imax) { // the left-most x-value
|
||||
deltamx=deltapx=fabs(datastore->get(xColumn,i+1)-xv)/2.0;
|
||||
} else if (static_cast<int>(i)==static_cast<int>(imax)-1&& static_cast<int>(i)-1>=0) { // the right-most x-value
|
||||
deltapx=deltamx=fabs(xv-datastore->get(xColumn,static_cast<size_t>(i-1)))/2.0;
|
||||
} else if (i==static_cast<int>(imin) && i+1<static_cast<int>(imax)) { // the left-most x-value
|
||||
deltamx=deltapx=fabs(datastore->get(xColumn,static_cast<size_t>(i+1))-xv)/2.0;
|
||||
} else {
|
||||
if (i-1>=0) deltamx=fabs(xv-datastore->get(xColumn,i-1))/2.0;
|
||||
if (i+1<imax) deltapx=fabs(datastore->get(xColumn,i+1)-xv)/2.0;
|
||||
if (static_cast<int>(i)-1>=0) deltamx=fabs(xv-datastore->get(xColumn,static_cast<size_t>(i-1)))/2.0;
|
||||
if (i+1<static_cast<int>(imax)) deltapx=fabs(datastore->get(xColumn,static_cast<size_t>(i+1))-xv)/2.0;
|
||||
}
|
||||
deltax=deltapx+deltamx;
|
||||
|
||||
@ -224,13 +335,13 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
if (imin==imax) { // only one y-value
|
||||
deltamy=0.5;
|
||||
deltapy=0.5;
|
||||
} else if (i==imax-1&& i-1>=0) { // the right-most y-value
|
||||
deltapy=deltamy=fabs(yv-datastore->get(yColumn,i-1))/2.0;
|
||||
} else if (i==imin && i+1<imax) { // the left-most y-value
|
||||
deltamy=deltapy=fabs(datastore->get(yColumn,i+1)-yv)/2.0;
|
||||
} else if (i==static_cast<int>(imax)-1&& static_cast<int>(i)-1>=0) { // the right-most y-value
|
||||
deltapy=deltamy=fabs(yv-datastore->get(yColumn,static_cast<size_t>(i-1)))/2.0;
|
||||
} else if (i==static_cast<int>(imin) && i+1<static_cast<int>(imax)) { // the left-most y-value
|
||||
deltamy=deltapy=fabs(datastore->get(yColumn,static_cast<size_t>(i+1))-yv)/2.0;
|
||||
} else {
|
||||
if (i-1>=0) deltamy=fabs(yv-datastore->get(yColumn,i-1))/2.0;
|
||||
if (i+1<imax) deltapy=fabs(datastore->get(yColumn,i+1)-yv)/2.0;
|
||||
if (static_cast<int>(i)-1>=0) deltamy=fabs(yv-datastore->get(yColumn,static_cast<size_t>(i-1)))/2.0;
|
||||
if (i+1<static_cast<int>(imax)) deltapy=fabs(datastore->get(yColumn,static_cast<size_t>(i+1))-yv)/2.0;
|
||||
}
|
||||
deltay=deltapy+deltamy;
|
||||
|
||||
@ -239,34 +350,25 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
bool plotlowerbary=false;
|
||||
bool plotupperbary=false;
|
||||
|
||||
double xe=0; if (xErrorStyle!=JKQTPNoError && xErrorColumn>=0) { xe=datastore->get(xErrorColumn,i); plotupperbarx=true; }
|
||||
double ye=0; if (yErrorStyle!=JKQTPNoError && yErrorColumn>=0) { ye=datastore->get(yErrorColumn,i); plotupperbary=true; }
|
||||
double xe=0; if (xErrorStyle!=JKQTPNoError && xErrorColumn>=0) { xe=datastore->get(xErrorColumn,static_cast<size_t>(i)); plotupperbarx=true; }
|
||||
double ye=0; if (yErrorStyle!=JKQTPNoError && yErrorColumn>=0) { ye=datastore->get(yErrorColumn,static_cast<size_t>(i)); plotupperbary=true; }
|
||||
double xl=0; if (xErrorSymmetric) { xl=xe; plotlowerbarx=plotupperbarx||(xl>0); }
|
||||
else if (xErrorStyle!=JKQTPNoError && xErrorColumnLower>=0) { xl=datastore->get(xErrorColumnLower,i); plotlowerbarx=true; }
|
||||
else if (xErrorStyle!=JKQTPNoError && xErrorColumnLower>=0) { xl=datastore->get(xErrorColumnLower,static_cast<size_t>(i)); plotlowerbarx=true; }
|
||||
double yl=0; if (yErrorSymmetric) { yl=ye; plotlowerbary=plotupperbary||(yl>0); }
|
||||
else if (yErrorStyle!=JKQTPNoError && yErrorColumnLower>=0) { yl=datastore->get(yErrorColumnLower,i); plotlowerbary=true; }
|
||||
else if (yErrorStyle!=JKQTPNoError && yErrorColumnLower>=0) { yl=datastore->get(yErrorColumnLower,static_cast<size_t>(i)); plotlowerbary=true; }
|
||||
if (JKQTPIsOKFloat(xv) && JKQTPIsOKFloat(yv) && JKQTPIsOKFloat(xe) && JKQTPIsOKFloat(ye) && JKQTPIsOKFloat(xl) && JKQTPIsOKFloat(yl)) {
|
||||
double x=parentGraph->transformX(xv+xrelshift*deltax); bool xok=JKQTPIsOKFloat(x);
|
||||
double y=parentGraph->transformY(yv+yrelshift*deltay); bool yok=JKQTPIsOKFloat(y);
|
||||
QColor terrCol=errorColor;
|
||||
QColor terrFillCol=errorFillColor;
|
||||
QColor terrCol=getErrorLineColor();
|
||||
QColor terrFillCol=getErrorFillColor();
|
||||
defaultErrorColor = defaultErrorColor && !this->intPlotXYErrorIndicatorsGetColor(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, yErrorColumn, xErrorStyle, yErrorStyle, i, terrCol, terrFillCol);
|
||||
|
||||
// x-errorpolygons
|
||||
if (/*pastFirst &&*/ (xErrorStyle==JKQTPErrorPolygons || xErrorStyle==JKQTPErrorBarsPolygons || xErrorStyle==JKQTPErrorSimpleBarsPolygons)) {
|
||||
//double xl1m=xmold;
|
||||
//double xl1p=xpold;
|
||||
//double yl1=yold;
|
||||
double xl2m=parentGraph->transformX(xv+xrelshift*deltax-xl);
|
||||
double xl2p=parentGraph->transformX(xv+xrelshift*deltax+xe);
|
||||
double yl2=y;
|
||||
/*painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setBrush(b);
|
||||
painter.setPen(QPen(Qt::NoPen));
|
||||
QPolygonF poly;
|
||||
poly << QPointF(xl1p, yl1) << QPointF(xl1m, yl1) << QPointF(xl2m, yl2) << QPointF(xl2p, yl2);
|
||||
painter.drawConvexPolygon(poly);
|
||||
*/
|
||||
|
||||
polyXTopPoints<<QPointF(xl2p, yl2);
|
||||
polyXBottomPoints<<QPointF(xl2m, yl2);
|
||||
errFC<<terrFillCol;
|
||||
@ -275,19 +377,11 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
|
||||
// y-errorpolygons
|
||||
if (/*pastFirst &&*/ (yErrorStyle==JKQTPErrorPolygons || yErrorStyle==JKQTPErrorBarsPolygons || yErrorStyle==JKQTPErrorSimpleBarsPolygons)) {
|
||||
//double yl1m=ymold;
|
||||
//double yl1p=ypold;
|
||||
//double xl1=xold;
|
||||
|
||||
double yl2m=parentGraph->transformY(yv+yrelshift*deltay-yl);
|
||||
double yl2p=parentGraph->transformY(yv+yrelshift*deltay+ye);
|
||||
double xl2=x;
|
||||
/*painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setBrush(b);
|
||||
painter.setPen(QPen(Qt::NoPen));
|
||||
QPolygonF poly;
|
||||
poly << QPointF(xl1, yl1m) << QPointF(xl2, yl2m) << QPointF(xl2, yl2p) << QPointF(xl1, yl1p);
|
||||
painter.drawConvexPolygon(poly);
|
||||
*/
|
||||
|
||||
polyYTopPoints<<QPointF(xl2, yl2p);
|
||||
polyYBottomPoints<<QPointF(xl2, yl2m);
|
||||
errFC<<terrFillCol;
|
||||
@ -295,15 +389,14 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
}
|
||||
|
||||
|
||||
//if (xv>=xmin && xv<=xmax && yv>=ymin && yv<=ymax) {
|
||||
//x-errorbars
|
||||
//x-errorbars
|
||||
if ((xErrorColumn>=0 || xErrorColumnLower>=0) && (xErrorStyle==JKQTPErrorBars || xErrorStyle==JKQTPErrorBarsLines|| xErrorStyle==JKQTPErrorBarsPolygons
|
||||
|| xErrorStyle==JKQTPErrorSimpleBars || xErrorStyle==JKQTPErrorSimpleBarsLines|| xErrorStyle==JKQTPErrorSimpleBarsPolygons)) {
|
||||
double x0=parentGraph->transformX(xv+xrelshift*deltax-xl); bool x0ok=JKQTPIsOKFloat(x0);
|
||||
double x1=parentGraph->transformX(xv+xrelshift*deltax+xe); bool x1ok=JKQTPIsOKFloat(x1);
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
QPen pp=p;
|
||||
pp.setColor(terrCol);
|
||||
if (!defaultErrorColor) pp.setColor(terrCol);
|
||||
painter.setPen(pp);
|
||||
if (x0ok&&x1ok&&xok&&yok) {
|
||||
painter.drawLine(QLineF(x0, y, x1, y));
|
||||
@ -335,7 +428,7 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
double y1=parentGraph->transformY(yv+yrelshift*deltay+ye); bool y1ok=JKQTPIsOKFloat(y1);
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
QPen pp=p;
|
||||
pp.setColor(terrCol);
|
||||
if (!defaultErrorColor) pp.setColor(terrCol);
|
||||
painter.setPen(pp);
|
||||
if (y0ok&&y1ok&&xok&&yok) {
|
||||
painter.drawLine(QLineF(x, y0, x, y1));
|
||||
@ -370,10 +463,10 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
double x1=parentGraph->transformX(xv+xrelshift*deltax+xe); bool x1ok=JKQTPIsOKFloat(x1);
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
QPen pp=p;
|
||||
pp.setColor(terrCol);
|
||||
if (!defaultErrorColor) pp.setColor(terrCol);
|
||||
painter.setPen(pp);
|
||||
QBrush bb=b;
|
||||
bb.setColor(terrFillCol);
|
||||
if (!defaultErrorColor) bb.setColor(terrFillCol);
|
||||
painter.setBrush(bb);
|
||||
|
||||
QRectF errRect=QRectF(QPointF(x0,y0), QPointF(x1,y1));
|
||||
@ -395,7 +488,7 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
double yl2=y;
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
QPen pp=p;
|
||||
pp.setColor(terrCol);
|
||||
if (!defaultErrorColor) pp.setColor(terrCol);
|
||||
painter.setPen(pp);
|
||||
if (JKQTPIsOKFloat(xl1m)&&JKQTPIsOKFloat(yl1)&&JKQTPIsOKFloat(xl2m)&&JKQTPIsOKFloat(yl2)) {
|
||||
painter.drawLine(QLineF(xl1m, yl1, xl2m, yl2));
|
||||
@ -417,7 +510,7 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
double xl2=x;
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
QPen pp=p;
|
||||
pp.setColor(terrCol);
|
||||
if (!defaultErrorColor) pp.setColor(terrCol);
|
||||
painter.setPen(pp);
|
||||
if (JKQTPIsOKFloat(xl1)&&JKQTPIsOKFloat(yl1m)&&JKQTPIsOKFloat(xl2)&&JKQTPIsOKFloat(yl2m)) {
|
||||
painter.drawLine(QLineF(xl1, yl1m, xl2, yl2m));
|
||||
@ -473,39 +566,18 @@ void JKQTPGraphErrors::intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, J
|
||||
//std::cout<<"end\n";
|
||||
}
|
||||
|
||||
bool JKQTPGraphErrors::intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter &/*painter*/, JKQTBasePlotter * /*parent*/, JKQTPGraph* /*parentGraph*/, int /*xColumn*/, int /*yColumn*/, int /*xErrorColumn*/, int /*yErrorColumn*/, JKQTPErrorPlotstyle /*xErrorStyle*/, JKQTPErrorPlotstyle /*yErrorStyle*/, int /*index*/, QColor &/*errorColor*/, QColor &/*errorFillColor*/)
|
||||
bool JKQTPGraphErrorStyleMixin::intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter &/*painter*/, JKQTBasePlotter * /*parent*/, JKQTPGraph* /*parentGraph*/, int /*xColumn*/, int /*yColumn*/, int /*xErrorColumn*/, int /*yErrorColumn*/, JKQTPErrorPlotstyle /*xErrorStyle*/, JKQTPErrorPlotstyle /*yErrorStyle*/, int /*index*/, QColor &/*errorColor*/, QColor &/*errorFillColor*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
double JKQTPGraphErrors::getXErrorU(int /*i*/, JKQTPDatastore * /*ds*/) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double JKQTPGraphErrors::getXErrorL(int /*i*/, JKQTPDatastore * /*ds*/) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double JKQTPGraphErrors::getYErrorU(int /*i*/, JKQTPDatastore * /*ds*/) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double JKQTPGraphErrors::getYErrorL(int/* i*/, JKQTPDatastore * /*ds*/) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
JKQTPXGraphErrors::JKQTPXGraphErrors(QColor graphColor, JKQTBasePlotter *basePlotter):
|
||||
JKQTPGraphErrors(graphColor, basePlotter)
|
||||
JKQTPXGraphErrorData::JKQTPXGraphErrorData()
|
||||
{
|
||||
xErrorSymmetric=true;
|
||||
xErrorColumn=-1;
|
||||
@ -513,37 +585,65 @@ JKQTPXGraphErrors::JKQTPXGraphErrors(QColor graphColor, JKQTBasePlotter *basePlo
|
||||
xErrorColumnLower=-1;
|
||||
}
|
||||
|
||||
void JKQTPXGraphErrors::setXErrorColumn(int __value) {
|
||||
void JKQTPXGraphErrorData::setXErrorSymmetric(bool __value)
|
||||
{
|
||||
this->xErrorSymmetric = __value;
|
||||
}
|
||||
|
||||
bool JKQTPXGraphErrorData::getXErrorSymmetric() const
|
||||
{
|
||||
return this->xErrorSymmetric;
|
||||
}
|
||||
|
||||
int JKQTPXGraphErrorData::getXErrorColumnLower() const {
|
||||
return this->xErrorColumnLower;
|
||||
}
|
||||
|
||||
int JKQTPXGraphErrorData::getXErrorColumn() const {
|
||||
return this->xErrorColumn;
|
||||
}
|
||||
|
||||
void JKQTPXGraphErrorData::setXErrorStyle(JKQTPErrorPlotstyle __value)
|
||||
{
|
||||
this->xErrorStyle = __value;
|
||||
}
|
||||
|
||||
JKQTPErrorPlotstyle JKQTPXGraphErrorData::getXErrorStyle() const
|
||||
{
|
||||
return this->xErrorStyle;
|
||||
}
|
||||
|
||||
void JKQTPXGraphErrorData::setXErrorColumn(int __value) {
|
||||
if (this->xErrorColumn != __value) {
|
||||
this->xErrorColumn = __value;
|
||||
if (xErrorColumn>=0 && xErrorStyle==JKQTPNoError) xErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPXGraphErrors::setXErrorColumnLower(int __value) {
|
||||
void JKQTPXGraphErrorData::setXErrorColumnLower(int __value) {
|
||||
if (this->xErrorColumnLower != __value) {
|
||||
this->xErrorColumnLower = __value;
|
||||
if (xErrorColumnLower>=0 && xErrorStyle==JKQTPNoError) xErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPXGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph *parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
|
||||
intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, -1, xErrorStyle, JKQTPNoError, xErrorColumnLower, -1, xErrorSymmetric, true, xrelshift, yrelshift, dataorder);
|
||||
}
|
||||
|
||||
double JKQTPXGraphErrors::getXErrorU(int i, JKQTPDatastore *ds) const
|
||||
double JKQTPXGraphErrorData::getXErrorU(int i, JKQTPDatastore *ds) const
|
||||
{
|
||||
if (ds && xErrorColumn>=0) {
|
||||
return ds->get(xErrorColumn, i);
|
||||
if (ds && xErrorColumn>=0 && i>=0 && i<static_cast<int>(ds->getColumn(xErrorColumn).getRows())) {
|
||||
return ds->get(xErrorColumn, static_cast<size_t>(i));
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double JKQTPXGraphErrors::getXErrorL(int i, JKQTPDatastore *ds) const
|
||||
double JKQTPXGraphErrorData::getXErrorL(int i, JKQTPDatastore *ds) const
|
||||
{
|
||||
if (ds) {
|
||||
if (xErrorSymmetric) { if (xErrorColumn>=0) return ds->get(xErrorColumn, i); }
|
||||
else if (xErrorColumnLower>=0) return ds->get(xErrorColumnLower, i);
|
||||
if (xErrorSymmetric) {
|
||||
if (xErrorColumn>=0 && i>=0 && i<static_cast<int>(ds->getColumn(xErrorColumn).getRows())) return ds->get(xErrorColumn, static_cast<size_t>(i));
|
||||
} else {
|
||||
if (xErrorColumnLower>=0 && i>=0 && i<static_cast<int>(ds->getColumn(xErrorColumnLower).getRows())) return ds->get(xErrorColumnLower, static_cast<size_t>(i));
|
||||
}
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
@ -553,33 +653,73 @@ double JKQTPXGraphErrors::getXErrorL(int i, JKQTPDatastore *ds) const
|
||||
|
||||
|
||||
|
||||
|
||||
JKQTPYGraphErrors::JKQTPYGraphErrors(QColor graphColor, JKQTBasePlotter *basePlotter):
|
||||
JKQTPGraphErrors(graphColor, basePlotter)
|
||||
JKQTPYGraphErrorData::JKQTPYGraphErrorData()
|
||||
{
|
||||
yErrorColumn=-1;
|
||||
yErrorSymmetric=true;
|
||||
yErrorColumn=-1;
|
||||
yErrorStyle=JKQTPNoError;
|
||||
yErrorColumnLower=-1;
|
||||
}
|
||||
|
||||
void JKQTPYGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
|
||||
intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, -1, yErrorColumn, JKQTPNoError, yErrorStyle, -1, yErrorColumnLower, true, yErrorSymmetric, xrelshift, yrelshift, dataorder);
|
||||
void JKQTPYGraphErrorData::setYErrorSymmetric(bool __value)
|
||||
{
|
||||
this->yErrorSymmetric = __value;
|
||||
}
|
||||
|
||||
double JKQTPYGraphErrors::getYErrorU(int i, JKQTPDatastore *ds) const
|
||||
bool JKQTPYGraphErrorData::getYErrorSymmetric() const
|
||||
{
|
||||
if (ds && yErrorColumn>=0) {
|
||||
return ds->get(yErrorColumn, i);
|
||||
return this->yErrorSymmetric;
|
||||
}
|
||||
|
||||
int JKQTPYGraphErrorData::getYErrorColumnLower() const {
|
||||
return this->yErrorColumnLower;
|
||||
}
|
||||
|
||||
int JKQTPYGraphErrorData::getYErrorColumn() const {
|
||||
return this->yErrorColumn;
|
||||
}
|
||||
|
||||
void JKQTPYGraphErrorData::setYErrorStyle(JKQTPErrorPlotstyle __value)
|
||||
{
|
||||
this->yErrorStyle = __value;
|
||||
}
|
||||
|
||||
JKQTPErrorPlotstyle JKQTPYGraphErrorData::getYErrorStyle() const
|
||||
{
|
||||
return this->yErrorStyle;
|
||||
}
|
||||
|
||||
void JKQTPYGraphErrorData::setYErrorColumn(int __value) {
|
||||
if (this->yErrorColumn != __value) {
|
||||
this->yErrorColumn = __value;
|
||||
if (yErrorColumn>=0 && yErrorStyle==JKQTPNoError) yErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPYGraphErrorData::setYErrorColumnLower(int __value) {
|
||||
if (this->yErrorColumnLower != __value) {
|
||||
this->yErrorColumnLower = __value;
|
||||
if (yErrorColumnLower>=0 && yErrorStyle==JKQTPNoError) yErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double JKQTPYGraphErrorData::getYErrorU(int i, JKQTPDatastore *ds) const
|
||||
{
|
||||
if (ds && yErrorColumn>=0 && i>=0 && i<static_cast<int>(ds->getColumn(yErrorColumn).getRows())) {
|
||||
return ds->get(yErrorColumn, static_cast<size_t>(i));
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double JKQTPYGraphErrors::getYErrorL(int i, JKQTPDatastore *ds) const
|
||||
double JKQTPYGraphErrorData::getYErrorL(int i, JKQTPDatastore *ds) const
|
||||
{
|
||||
if (ds) {
|
||||
if (yErrorSymmetric) { if (yErrorColumn>=0) return ds->get(yErrorColumn, i); }
|
||||
else if (yErrorColumnLower>=0) return ds->get(yErrorColumnLower, i);
|
||||
if (yErrorSymmetric) {
|
||||
if (yErrorColumn>=0 && i>=0 && i<static_cast<int>(ds->getColumn(yErrorColumn).getRows())) return ds->get(yErrorColumn, static_cast<size_t>(i));
|
||||
} else {
|
||||
if (yErrorColumnLower>=0 && i>=0 && i<static_cast<int>(ds->getColumn(yErrorColumnLower).getRows())) return ds->get(yErrorColumnLower, static_cast<size_t>(i));
|
||||
}
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
@ -590,80 +730,30 @@ double JKQTPYGraphErrors::getYErrorL(int i, JKQTPDatastore *ds) const
|
||||
|
||||
|
||||
|
||||
JKQTPXYGraphErrors::JKQTPXYGraphErrors(QColor graphColor, JKQTBasePlotter *basePlotter):
|
||||
JKQTPGraphErrors(graphColor, basePlotter)
|
||||
JKQTPXGraphErrors::JKQTPXGraphErrors()
|
||||
{
|
||||
xErrorSymmetric=true;
|
||||
yErrorSymmetric=true;
|
||||
yErrorColumn=-1;
|
||||
yErrorStyle=JKQTPNoError;
|
||||
xErrorColumn=-1;
|
||||
xErrorStyle=JKQTPNoError;
|
||||
xErrorColumnLower=-1;
|
||||
yErrorColumnLower=-1;
|
||||
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
|
||||
this->intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, yErrorColumn, xErrorStyle, yErrorStyle, xErrorColumnLower, yErrorColumnLower, xErrorSymmetric, yErrorSymmetric, xrelshift, yrelshift, dataorder);
|
||||
}
|
||||
|
||||
double JKQTPXYGraphErrors::getXErrorU(int i, JKQTPDatastore *ds) const
|
||||
{
|
||||
if (ds && xErrorColumn>=0) {
|
||||
return ds->get(xErrorColumn, i);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double JKQTPXYGraphErrors::getXErrorL(int i, JKQTPDatastore *ds) const
|
||||
{
|
||||
if (ds && xErrorColumn>=0) {
|
||||
if (xErrorSymmetric) { if (xErrorColumn>=0) return ds->get(xErrorColumn, i); }
|
||||
else if (xErrorColumnLower>=0) return ds->get(xErrorColumnLower, i);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double JKQTPXYGraphErrors::getYErrorU(int i, JKQTPDatastore *ds) const
|
||||
{
|
||||
if (ds && yErrorColumn>=0) {
|
||||
return ds->get(yErrorColumn, i);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double JKQTPXYGraphErrors::getYErrorL(int i, JKQTPDatastore *ds) const
|
||||
{
|
||||
if (ds && yErrorColumn>=0) {
|
||||
if (yErrorSymmetric) { if (yErrorColumn>=0) return ds->get(yErrorColumn, i); }
|
||||
else if (yErrorColumnLower>=0) return ds->get(yErrorColumnLower, i);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool JKQTPXGraphErrors::errorUsesColumn(int c) const
|
||||
{
|
||||
return c==(xErrorColumn) || (c==xErrorColumnLower);
|
||||
}
|
||||
|
||||
bool JKQTPGraphErrors::errorUsesColumn(int /*c*/) const
|
||||
{
|
||||
return false;
|
||||
void JKQTPXGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph *parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
|
||||
intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, -1, xErrorStyle, JKQTPNoError, xErrorColumnLower, -1, xErrorSymmetric, true, xrelshift, yrelshift, dataorder);
|
||||
}
|
||||
|
||||
void JKQTPGraphErrors::setErrorColorFromGraphColor(QColor graphColor)
|
||||
|
||||
|
||||
|
||||
|
||||
JKQTPYGraphErrors::JKQTPYGraphErrors()
|
||||
{
|
||||
errorColor=graphColor.darker();
|
||||
errorFillColor=graphColor.lighter();
|
||||
//errorColor.setAlphaF(0.5);
|
||||
}
|
||||
|
||||
void JKQTPYGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
|
||||
intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, -1, yErrorColumn, JKQTPNoError, yErrorStyle, -1, yErrorColumnLower, true, yErrorSymmetric, xrelshift, yrelshift, dataorder);
|
||||
}
|
||||
|
||||
bool JKQTPYGraphErrors::errorUsesColumn(int c) const
|
||||
@ -671,18 +761,19 @@ bool JKQTPYGraphErrors::errorUsesColumn(int c) const
|
||||
return (c==yErrorColumn) || (c==yErrorColumnLower);
|
||||
}
|
||||
|
||||
void JKQTPYGraphErrors::setYErrorColumn(int __value) {
|
||||
if (this->yErrorColumn != __value) {
|
||||
this->yErrorColumn = __value;
|
||||
if (yErrorColumn>=0 && yErrorStyle==JKQTPNoError) yErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
JKQTPXYGraphErrors::JKQTPXYGraphErrors()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void JKQTPYGraphErrors::setYErrorColumnLower(int __value) {
|
||||
if (this->yErrorColumnLower != __value) {
|
||||
this->yErrorColumnLower = __value;
|
||||
if (yErrorColumnLower>=0 && yErrorStyle==JKQTPNoError) yErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
void JKQTPXYGraphErrors::plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift, double yrelshift, const QVector<int>* dataorder) {
|
||||
this->intPlotXYErrorIndicators(painter, parent, parentGraph, xColumn, yColumn, xErrorColumn, yErrorColumn, xErrorStyle, yErrorStyle, xErrorColumnLower, yErrorColumnLower, xErrorSymmetric, yErrorSymmetric, xrelshift, yrelshift, dataorder);
|
||||
}
|
||||
|
||||
bool JKQTPXYGraphErrors::errorUsesColumn(int c) const
|
||||
@ -690,51 +781,4 @@ bool JKQTPXYGraphErrors::errorUsesColumn(int c) const
|
||||
return (c==xErrorColumn)||(c==yErrorColumn)||(c==xErrorColumnLower)||(c==yErrorColumnLower);
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::setXErrorColumn(int __value) {
|
||||
if (this->xErrorColumn != __value) {
|
||||
this->xErrorColumn = __value;
|
||||
if (xErrorColumn>=0 && xErrorStyle==JKQTPNoError) xErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::setXErrorColumnLower(int __value) {
|
||||
if (this->xErrorColumnLower != __value) {
|
||||
this->xErrorColumnLower = __value;
|
||||
if (xErrorColumnLower>=0 && xErrorStyle==JKQTPNoError) xErrorStyle=JKQTPErrorBars;
|
||||
} \
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::setYErrorColumn(int __value) {
|
||||
if (this->yErrorColumn != __value) {
|
||||
this->yErrorColumn = __value;
|
||||
if (yErrorColumn>=0 && yErrorStyle==JKQTPNoError) yErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::setYErrorColumnLower(int __value) {
|
||||
if (this->yErrorColumnLower != __value) {
|
||||
this->yErrorColumnLower = __value;
|
||||
if (yErrorColumnLower>=0 && yErrorStyle==JKQTPNoError) yErrorStyle=JKQTPErrorBars;
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::setXErrorColumn(size_t __value)
|
||||
{
|
||||
setXErrorColumn(static_cast<int>(__value));
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::setXErrorColumnLower(size_t __value)
|
||||
{
|
||||
setXErrorColumnLower(static_cast<int>(__value));
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::setYErrorColumn(size_t __value)
|
||||
{
|
||||
setYErrorColumn(static_cast<int>(__value));
|
||||
}
|
||||
|
||||
void JKQTPXYGraphErrors::setYErrorColumnLower(size_t __value)
|
||||
{
|
||||
setYErrorColumnLower(static_cast<int>(__value));
|
||||
}
|
||||
|
||||
|
@ -32,350 +32,325 @@
|
||||
#define JKQTPGRAPHSBASEERROR_H
|
||||
|
||||
|
||||
/*! \brief Descendents of this class add data fields for error indicators and methods to plot them to a class.
|
||||
/*! \brief This mix-in class assembles all styling properties applicable to error indicators
|
||||
\ingroup jkqtplotter_basegraphserrors
|
||||
|
||||
This class is meant to be used with multiple inheritance. I.e. if you implemented some kind of plot
|
||||
you may derive an error plot class in which you will have to overwrite the JKQTPGraph::drawErrorsBefor()
|
||||
or drawErrorsAfter() so it calls the plotErrorIndicators() method from this class. In addition this class
|
||||
will add some public datamemebers and methods to your class that allow to specify the properties of the
|
||||
error indicators (plot properties: color, width, ... and columns for the data).
|
||||
\ingroup jkqtplotter_basegraphs_stylemixins
|
||||
|
||||
\image html jkqtplotter_simpletest_errorbarstyles.png "line-graphs with different types of error indicators"
|
||||
|
||||
|
||||
\see \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
|
||||
*/
|
||||
class JKQTP_LIB_EXPORT JKQTPGraphErrors {
|
||||
class JKQTP_LIB_EXPORT JKQTPGraphErrorStyleMixin {
|
||||
Q_GADGET
|
||||
public:
|
||||
/** \brief class contructor */
|
||||
JKQTPGraphErrors(QColor graphColor, JKQTBasePlotter* basePlotter=nullptr);
|
||||
virtual ~JKQTPGraphErrors()=default;
|
||||
JKQTPGraphErrorStyleMixin();
|
||||
virtual ~JKQTPGraphErrorStyleMixin()=default;
|
||||
|
||||
/** \brief initiaize the error indicator style (from the parent plotter) */
|
||||
void initErrorStyle(JKQTBasePlotter* parent, int &parentPlotStyle);
|
||||
|
||||
|
||||
|
||||
/*! \copydoc m_errorBarCapSize */
|
||||
void setErrorBarCapSize(double __value);
|
||||
/*! \copydoc m_errorBarCapSize */
|
||||
double getErrorBarCapSize() const;
|
||||
|
||||
|
||||
|
||||
/** \brief derive the properties of the error indicators from \a pen */
|
||||
void setErrorStyleFromPen(const JKQTBasePlotter::JKQTPPen& pen);
|
||||
|
||||
/*! \copydoc errorColor
|
||||
\see see errorColor for details */
|
||||
void setErrorColor(const QColor & __value);
|
||||
/*! \copydoc errorColor
|
||||
\see see errorColor for details */
|
||||
QColor getErrorColor() const;
|
||||
/*! \copydoc errorStyle
|
||||
\see see errorStyle for details */
|
||||
void setErrorStyle(const Qt::PenStyle & __value);
|
||||
/*! \copydoc errorStyle
|
||||
\see see errorStyle for details */
|
||||
Qt::PenStyle getErrorStyle() const;
|
||||
/*! \copydoc errorWidth
|
||||
\see see errorWidth for details */
|
||||
void setErrorWidth(double __value);
|
||||
/*! \copydoc errorWidth
|
||||
\see see errorWidth for details */
|
||||
double getErrorWidth() const;
|
||||
/*! \copydoc errorFillColor
|
||||
\see see errorFillColor for details */
|
||||
void setErrorFillColor(const QColor & __value);
|
||||
/*! \copydoc errorFillColor
|
||||
\see see errorFillColor for details */
|
||||
QColor getErrorFillColor() const;
|
||||
/*! \copydoc errorFillStyle
|
||||
\see see errorFillStyle for details */
|
||||
void setErrorFillStyle(const Qt::BrushStyle & __value);
|
||||
/*! \copydoc errorFillStyle
|
||||
\see see errorFillStyle for details */
|
||||
Qt::BrushStyle getErrorFillStyle() const;
|
||||
/*! \copydoc errorbarSize
|
||||
\see see errorbarSize for details */
|
||||
void setErrorbarSize(double __value);
|
||||
/*! \copydoc errorbarSize
|
||||
\see see errorbarSize for details */
|
||||
double getErrorbarSize() const;
|
||||
/** \brief returns true, if the error plots use the given column */
|
||||
virtual bool errorUsesColumn(int c) const;
|
||||
|
||||
/** \brief derive the colors of the error indicators from a given \a color */
|
||||
void setErrorColorFromGraphColor(QColor graphColor);
|
||||
|
||||
protected:
|
||||
/** \brief color of the error lines/bars */
|
||||
QColor errorColor;
|
||||
/** \brief linestyle of the error lines/bars */
|
||||
Qt::PenStyle errorStyle;
|
||||
/** \brief width (pixels) of the error lines/bars */
|
||||
double errorWidth;
|
||||
/** \brief fill color for error polygons */
|
||||
QColor errorFillColor;
|
||||
/** \brief fill style for error polygons */
|
||||
Qt::BrushStyle errorFillStyle;
|
||||
/** \brief size of the error bar end markers [pixels] */
|
||||
double errorbarSize;
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. This method is called by
|
||||
* the JKQTPGraph descendents */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int>* dataorder=nullptr)=0;
|
||||
|
||||
/** \brief set the color of the error indicator (out)lines */
|
||||
void setErrorLineColor(const QColor & __value);
|
||||
/** \brief get the color of the error indicator (out)lines */
|
||||
QColor getErrorLineColor() const;
|
||||
/** \brief set the style of the error indicator (out)lines */
|
||||
void setErrorLineStyle(Qt::PenStyle __value);
|
||||
/** \brief get the style of the error indicator (out)lines */
|
||||
Qt::PenStyle getErrorLineStyle() const;
|
||||
/** \brief set the width [pt] of the error indicator (out)lines */
|
||||
void setErrorLineWidth(double __value);
|
||||
/** \brief get the width [pt] of the error indicator (out)lines */
|
||||
double getErrorLineWidth() const;
|
||||
/** \brief sets the dash offset for a custom dash style of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
|
||||
*/
|
||||
void setErrorLineDashOffset(qreal offset);
|
||||
/** \brief returns the dash offset for a custom dash style of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
|
||||
*/
|
||||
qreal getErrorLineDashOffset() const;
|
||||
/** \brief sets the dash pattern for a custom dash style of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
|
||||
*/
|
||||
void setErrorLineDashPattern(const QVector<qreal> &pattern);
|
||||
/** \brief gets the dash pattern for a custom dash style of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
|
||||
*/
|
||||
QVector<qreal> getErrorLineDashPattern() const;
|
||||
/** \brief sets the join style of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
|
||||
*/
|
||||
void setErrorLineJoinStyle(Qt::PenJoinStyle style);
|
||||
/** \brief returns the join style of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
|
||||
*/
|
||||
Qt::PenJoinStyle getErrorLineJoinStyle() const;
|
||||
/** \brief sets the cap style of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
|
||||
*/
|
||||
void setErrorLineCapStyle(Qt::PenCapStyle style);
|
||||
/** \brief gets the cap style of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
|
||||
*/
|
||||
Qt::PenCapStyle getErrorLineCapStyle() const;
|
||||
/** \brief sets the brush used to fill the line area of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setBrush
|
||||
*/
|
||||
void setErrorLineBrush(const QBrush& style);
|
||||
/** \brief gets the brush used to fill the line area of the error indicator (out)lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setBrush
|
||||
*/
|
||||
QBrush getErrorLineBrush() const;
|
||||
|
||||
|
||||
/** \brief set the fill color of the error indicators */
|
||||
void setErrorFillColor(const QColor & __value);
|
||||
/** \brief get the fill color of the error indicators */
|
||||
QColor getErrorFillColor() const;
|
||||
/** \brief set the fill style of the error indicators */
|
||||
void setErrorFillStyle(Qt::BrushStyle __value);
|
||||
/** \brief get the fill style of the error indicators */
|
||||
Qt::BrushStyle getErrorFillStyle() const;
|
||||
/** \brief set the color of the error indicator filling and sets fill style to Qt::TexturePattern */
|
||||
void setErrorFillTexture(const QPixmap & __value);
|
||||
/** \brief set the color of the error indicator filling and sets fill style to Qt::TexturePattern */
|
||||
void setErrorFillTexture(const QImage & __value);
|
||||
/** \brief set the color of the error indicator filling */
|
||||
QPixmap getErrorFillTexture() const;
|
||||
/** \brief set the color of the error indicator filling */
|
||||
QImage getErrorFillTextureImage() const;
|
||||
|
||||
/** \brief set the filling of the error indicators to a gradient and sets fill style to a gradient setting */
|
||||
void setErrorFillGradient(const QGradient & __value);
|
||||
/** \brief get the gradient object of the error indicator filling */
|
||||
const QGradient *getErrorFillGradient() const;
|
||||
|
||||
/** \brief sets an error indicator fill brush (overwrites all internal properties!) */
|
||||
void setErrorFillBrush(const QBrush& b);
|
||||
/** \brief sets an error indicator fill transformation matrix*/
|
||||
void setErrorFillTransform(const QMatrix& b);
|
||||
/** \brief sets an error indicator fill transformation */
|
||||
void setErrorFillTransform(const QTransform& b);
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
/** \brief error indicator line pen */
|
||||
QPen m_errorLinePen;
|
||||
/** \brief width of the error indicators' lines, given in pt */
|
||||
double m_errorLineWidth;
|
||||
|
||||
|
||||
/** \brief fill style of the graph */
|
||||
QBrush m_errorFillBrush;
|
||||
/** \brief last fill color of the graph */
|
||||
QColor m_errorFillColor;
|
||||
|
||||
|
||||
/** \brief size of the error bar end markers [pt] */
|
||||
double m_errorBarCapSize;
|
||||
|
||||
|
||||
/** \brief constructs a QPen from the error indicator line styling properties */
|
||||
QPen getErrorLinePen(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
/** \brief constructs a QPen from the error indicator line styling properties, suitable for drawing rectangles with sharp edges */
|
||||
QPen getErrorLinePenForRects(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
|
||||
/** \brief constructs a QBrush from the error indicator fill styling properties */
|
||||
QBrush getErrorFillBrush(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
|
||||
void intPlotXYErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int xErrorColumnLower=-1, int yErrorColumnLower=-1, bool xErrorSymmetric=true, bool yErrorSymmetric=true, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr);
|
||||
|
||||
/** \brief this function can be used to set the color of the error indicators automatically
|
||||
*
|
||||
* return \c true and the colors to use, if applicable, the default implementation returns false */
|
||||
virtual bool intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int index, QColor& errorColor, QColor& errorFillColor);
|
||||
virtual bool intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int index, QColor& errorLineColor, QColor& errorFillColor);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*! \brief This class adds data fields for error indicators in x direction
|
||||
\ingroup jkqtplotter_basegraphserrors
|
||||
\see JKQTPYGraphErrorData, \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
*/
|
||||
class JKQTP_LIB_EXPORT JKQTPXGraphErrorData {
|
||||
Q_GADGET
|
||||
public:
|
||||
/** \brief class contructor */
|
||||
JKQTPXGraphErrorData();
|
||||
virtual ~JKQTPXGraphErrorData()=default;
|
||||
|
||||
/*! \copydoc xErrorSymmetric*/
|
||||
void setXErrorSymmetric(bool __value);
|
||||
/*! \copydoc xErrorSymmetric */
|
||||
bool getXErrorSymmetric() const;
|
||||
/*! \copydoc xErrorColumnLower */
|
||||
int getXErrorColumnLower() const;
|
||||
/*! \copydoc xErrorColumn */
|
||||
int getXErrorColumn() const;
|
||||
/*! \copydoc xErrorStyle */
|
||||
void setXErrorStyle(JKQTPErrorPlotstyle __value);
|
||||
/*! \copydoc xErrorStyle */
|
||||
JKQTPErrorPlotstyle getXErrorStyle() const;
|
||||
/** \copydoc xErrorColumn */
|
||||
void setXErrorColumn(int __value);
|
||||
/** \copydoc xErrorColumnLower */
|
||||
void setXErrorColumnLower(int __value);
|
||||
|
||||
|
||||
protected:
|
||||
/** \brief the column that contains the error of the x-component of the datapoints */
|
||||
int xErrorColumn;
|
||||
/** \brief the column that contains the error of the x-component of the datapoints. This is used as the lower error length, if xErrorSymmetric \c ==false. */
|
||||
int xErrorColumnLower;
|
||||
/** \brief indicates whether the x-errors are symmetric (from one column only) */
|
||||
bool xErrorSymmetric;
|
||||
/** \brief how to draw the errors (if available) of the x-value */
|
||||
JKQTPErrorPlotstyle xErrorStyle;
|
||||
|
||||
/** \brief returns the upper x-error for the i-th datapoint, read from datastore \a ds */
|
||||
virtual double getXErrorU(int i, JKQTPDatastore* ds) const;
|
||||
/** \brief returns the lower x-error for the i-th datapoint, read from datastore \a ds */
|
||||
virtual double getXErrorL(int i, JKQTPDatastore* ds) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief This class adds data fields for error indicators in y direction
|
||||
\ingroup jkqtplotter_basegraphserrors
|
||||
\see JKQTPXGraphErrorData \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
*/
|
||||
class JKQTP_LIB_EXPORT JKQTPYGraphErrorData {
|
||||
Q_GADGET
|
||||
public:
|
||||
/** \brief class contructor */
|
||||
JKQTPYGraphErrorData();
|
||||
virtual ~JKQTPYGraphErrorData()=default;
|
||||
|
||||
/*! \copydoc yErrorSymmetric */
|
||||
void setYErrorSymmetric(bool __value);
|
||||
/*! \copydoc yErrorSymmetric */
|
||||
bool getYErrorSymmetric() const;
|
||||
/*! \copydoc yErrorColumnLower */
|
||||
int getYErrorColumnLower() const;
|
||||
/*! \copydoc yErrorColumn */
|
||||
int getYErrorColumn() const;
|
||||
/*! \copydoc yErrorStyle */
|
||||
void setYErrorStyle(JKQTPErrorPlotstyle __value);
|
||||
/*! \copydoc yErrorStyle */
|
||||
JKQTPErrorPlotstyle getYErrorStyle() const;
|
||||
/*! \copydoc yErrorColumn */
|
||||
void setYErrorColumn(int __value);
|
||||
/*! \copydoc yErrorColumnLower */
|
||||
void setYErrorColumnLower(int __value);
|
||||
|
||||
|
||||
protected:
|
||||
/** \brief the column that contains the error of the x-component of the datapoints */
|
||||
int yErrorColumn;
|
||||
/** \brief the column that contains the error of the x-component of the datapoints. This is used as the lower error length, if yErrorSymmetric \c ==false. */
|
||||
int yErrorColumnLower;
|
||||
/** \brief indicates whether the x-errors are symmetric (from one column only) */
|
||||
bool yErrorSymmetric;
|
||||
/** \brief how to draw the errors (if available) of the x-value */
|
||||
JKQTPErrorPlotstyle yErrorStyle;
|
||||
|
||||
/** \brief returns the upper y-error for the i-th datapoint, read from datastore \a ds */
|
||||
virtual double getYErrorU(int i, JKQTPDatastore* ds) const;
|
||||
/** \brief returns the lower y-error for the i-th datapoint, read from datastore \a ds */
|
||||
virtual double getYErrorL(int i, JKQTPDatastore* ds) const;
|
||||
|
||||
//** \brief plot a single error indicator */
|
||||
//void intPlotXYErrorIndicator(JKQTPEnhancedPainter& painter, double x, double xperror, double xmerror, double y, double yperror, double ymerror, JKQTPErrorPlotstyle xErrorStyle=JKQTPNoError, JKQTPErrorPlotstyle yErrorStyle=JKQTPNoError, double lastx=0, double lastxperror=0, double lastxmerror=0, double lasty=0, double lastyperror=0, double lastymerror=0);
|
||||
};
|
||||
|
||||
|
||||
/*! \brief This class adds data fields for error indicators in x direction to a JKQTPGraph descendent.
|
||||
|
||||
/*! \brief This class is the base class for graphs that only display error indicators in x-direction
|
||||
\ingroup jkqtplotter_basegraphserrors
|
||||
\see JKQTPGraphErrors, \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
\see JKQTPXGraphErrorData, JKQTPGraphErrorStyleMixin, \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
*/
|
||||
class JKQTP_LIB_EXPORT JKQTPXGraphErrors: public JKQTPGraphErrors {
|
||||
class JKQTP_LIB_EXPORT JKQTPXGraphErrors: public JKQTPXGraphErrorData, public JKQTPGraphErrorStyleMixin {
|
||||
Q_GADGET
|
||||
public:
|
||||
/** \brief class contructor */
|
||||
JKQTPXGraphErrors(QColor graphColor, JKQTBasePlotter* basePlotter=nullptr);
|
||||
|
||||
/*! \copydoc xErrorSymmetric
|
||||
\see see xErrorSymmetric for details */
|
||||
inline virtual void setXErrorSymmetric(bool __value)
|
||||
{
|
||||
this->xErrorSymmetric = __value;
|
||||
}
|
||||
/*! \copydoc xErrorSymmetric
|
||||
\see see xErrorSymmetric for details */
|
||||
inline virtual bool getXErrorSymmetric() const
|
||||
{
|
||||
return this->xErrorSymmetric;
|
||||
}
|
||||
/*! \brief returns the property xErrorColumnLower ( \copybrief xErrorColumnLower ). \details Description of the parameter xErrorColumnLower is: <BLOCKQUOTE>\copydoc xErrorColumnLower </BLOCKQUOTE>. \see xErrorColumnLower for more information */
|
||||
inline int getXErrorColumnLower() const { return this->xErrorColumnLower; }
|
||||
/*! \brief returns the property xErrorColumn ( \copybrief xErrorColumn ). \details Description of the parameter xErrorColumn is: <BLOCKQUOTE>\copydoc xErrorColumn </BLOCKQUOTE>. \see xErrorColumn for more information */
|
||||
inline int getXErrorColumn() const { return this->xErrorColumn; }
|
||||
/*! \copydoc xErrorStyle
|
||||
\see see xErrorStyle for details */
|
||||
inline virtual void setXErrorStyle(const JKQTPErrorPlotstyle & __value)
|
||||
{
|
||||
this->xErrorStyle = __value;
|
||||
}
|
||||
/*! \copydoc xErrorStyle
|
||||
\see see xErrorStyle for details */
|
||||
inline virtual JKQTPErrorPlotstyle getXErrorStyle() const
|
||||
{
|
||||
return this->xErrorStyle;
|
||||
}
|
||||
/** \brief set the column from which to read the error values for x-error indicators */
|
||||
void setXErrorColumn(int __value);
|
||||
/** \brief set the column from which to read the error values for lower x-error indicators (if not set [=-1], the xErrorColumn-values will be used for upper and lower error indicators) */
|
||||
void setXErrorColumnLower(int __value);
|
||||
JKQTPXGraphErrors();
|
||||
virtual ~JKQTPXGraphErrors()=default;
|
||||
|
||||
/** \brief returns true, if the error plots use the given column */
|
||||
virtual bool errorUsesColumn(int c) const override;
|
||||
virtual bool errorUsesColumn(int c) const ;
|
||||
|
||||
protected:
|
||||
/** \brief the column that contains the error of the x-component of the datapoints */
|
||||
int xErrorColumn;
|
||||
/** \brief the column that contains the error of the x-component of the datapoints. This is used as the lower error length, if xErrorSymmetric \c ==false. */
|
||||
int xErrorColumnLower;
|
||||
/** \brief indicates whether the x-errors are symmetric (from one column only) */
|
||||
bool xErrorSymmetric;
|
||||
/** \brief how to draw the errors (if available) of the x-value */
|
||||
JKQTPErrorPlotstyle xErrorStyle;
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override;
|
||||
|
||||
virtual double getXErrorU(int i, JKQTPDatastore* ds) const override;
|
||||
virtual double getXErrorL(int i, JKQTPDatastore* ds) const override;
|
||||
/** \brief draws the error indicators */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) ;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*! \brief This class adds data fields for error indicators in y direction to a class.
|
||||
\ingroup jkqtplotter_basegraphserrors
|
||||
\see JKQTPGraphErrors, \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
|
||||
/*! \brief This class is the base class for graphs that only display error indicators in y-direction
|
||||
\ingroup jkqtplotter_basegraphserrors
|
||||
\see JKQTPYGraphErrorData, JKQTPGraphErrorStyleMixin, \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
*/
|
||||
class JKQTP_LIB_EXPORT JKQTPYGraphErrors: public JKQTPGraphErrors {
|
||||
class JKQTP_LIB_EXPORT JKQTPYGraphErrors: public JKQTPYGraphErrorData, public JKQTPGraphErrorStyleMixin {
|
||||
Q_GADGET
|
||||
public:
|
||||
/** \brief class contructor */
|
||||
JKQTPYGraphErrors(QColor graphColor, JKQTBasePlotter* basePlotter=nullptr);
|
||||
JKQTPYGraphErrors();
|
||||
virtual ~JKQTPYGraphErrors()=default;
|
||||
|
||||
/*! \copydoc yErrorSymmetric
|
||||
\see see yErrorSymmetric for details */
|
||||
inline virtual void setYErrorSymmetric(bool __value)
|
||||
{
|
||||
this->yErrorSymmetric = __value;
|
||||
}
|
||||
/*! \copydoc yErrorSymmetric
|
||||
\see see yErrorSymmetric for details */
|
||||
inline virtual bool getYErrorSymmetric() const
|
||||
{
|
||||
return this->yErrorSymmetric;
|
||||
}
|
||||
/*! \brief returns the property yErrorColumnLower ( \copybrief yErrorColumnLower ). \details Description of the parameter yErrorColumnLower is: <BLOCKQUOTE>\copydoc yErrorColumnLower </BLOCKQUOTE>. \see yErrorColumnLower for more information */
|
||||
inline int getYErrorColumnLower() const { return this->yErrorColumnLower; }
|
||||
/*! \brief returns the property yErrorColumn ( \copybrief yErrorColumn ). \details Description of the parameter yErrorColumn is: <BLOCKQUOTE>\copydoc yErrorColumn </BLOCKQUOTE>. \see yErrorColumn for more information */
|
||||
inline int getYErrorColumn() const { return this->yErrorColumn; }
|
||||
/*! \copydoc yErrorStyle
|
||||
\see see yErrorStyle for details */
|
||||
inline virtual void setYErrorStyle(const JKQTPErrorPlotstyle & __value)
|
||||
{
|
||||
this->yErrorStyle = __value;
|
||||
}
|
||||
/*! \copydoc yErrorStyle
|
||||
\see see yErrorStyle for details */
|
||||
inline virtual JKQTPErrorPlotstyle getYErrorStyle() const
|
||||
{
|
||||
return this->yErrorStyle;
|
||||
}
|
||||
/** \copydoc JKQTPGraphErrors::errorUsesColumn() */
|
||||
virtual bool errorUsesColumn(int c) const override;
|
||||
/** \brief returns true, if the error plots use the given column */
|
||||
virtual bool errorUsesColumn(int c) const ;
|
||||
|
||||
/** \brief set the column from which to read the error values for y-error indicators */
|
||||
void setYErrorColumn(int __value);
|
||||
/** \brief set the column from which to read the error values for lower y-error indicators (if not set [=-1], the xErrorColumn-values will be used for upper and lower error indicators) */
|
||||
void setYErrorColumnLower(int __value);
|
||||
protected:
|
||||
/** \brief the column that contains the error of the x-component of the datapoints */
|
||||
int yErrorColumn;
|
||||
/** \brief how to draw the errors (if available) of the x-value */
|
||||
JKQTPErrorPlotstyle yErrorStyle;
|
||||
/** \brief indicates whether the y-errors are symmetric (from one column only) */
|
||||
bool yErrorSymmetric;
|
||||
/** \brief the column that contains the error of the y-component of the datapoints. This is used as the lower error length, if yErrorSymmetric \c ==false. */
|
||||
int yErrorColumnLower;
|
||||
/** \brief draws the error indicators */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) ;
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override;
|
||||
|
||||
virtual double getYErrorU(int i, JKQTPDatastore* ds) const override;
|
||||
virtual double getYErrorL(int i, JKQTPDatastore* ds) const override;
|
||||
};
|
||||
|
||||
|
||||
/*! \brief This class adds data fields for error indicators in x and y direction to a class.
|
||||
\ingroup jkqtplotter_basegraphserrors
|
||||
\see JKQTPGraphErrors, \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
|
||||
|
||||
|
||||
/*! \brief This class is the base class for graphs that only display error indicators in x- and y-direction
|
||||
\ingroup jkqtplotter_basegraphserrors
|
||||
\see JKQTPXGraphErrorData, JKQTPYGraphErrorData, JKQTPGraphErrorStyleMixin, \ref jkqtplotter_graphsgroup_classstructure_mixins
|
||||
*/
|
||||
class JKQTP_LIB_EXPORT JKQTPXYGraphErrors: public JKQTPGraphErrors {
|
||||
class JKQTP_LIB_EXPORT JKQTPXYGraphErrors: public JKQTPXGraphErrorData, public JKQTPYGraphErrorData, public JKQTPGraphErrorStyleMixin {
|
||||
Q_GADGET
|
||||
public:
|
||||
/** \brief class contructor */
|
||||
JKQTPXYGraphErrors(QColor graphColor, JKQTBasePlotter* basePlotter=nullptr);
|
||||
/*! \copydoc xErrorSymmetric
|
||||
\see see xErrorSymmetric for details */
|
||||
inline virtual void setXErrorSymmetric(bool __value)
|
||||
{
|
||||
this->xErrorSymmetric = __value;
|
||||
}
|
||||
/*! \copydoc xErrorSymmetric
|
||||
\see see xErrorSymmetric for details */
|
||||
inline virtual bool getXErrorSymmetric() const
|
||||
{
|
||||
return this->xErrorSymmetric;
|
||||
}
|
||||
/*! \copydoc yErrorSymmetric
|
||||
\see see yErrorSymmetric for details */
|
||||
inline virtual void setYErrorSymmetric(bool __value)
|
||||
{
|
||||
this->yErrorSymmetric = __value;
|
||||
}
|
||||
/*! \copydoc yErrorSymmetric
|
||||
\see see yErrorSymmetric for details */
|
||||
inline virtual bool getYErrorSymmetric() const
|
||||
{
|
||||
return this->yErrorSymmetric;
|
||||
}
|
||||
/*! \brief returns the property xErrorColumnLower ( \copybrief xErrorColumnLower ). \details Description of the parameter xErrorColumnLower is: <BLOCKQUOTE>\copydoc xErrorColumnLower </BLOCKQUOTE>. \see xErrorColumnLower for more information */
|
||||
inline int getXErrorColumnLower() const { return this->xErrorColumnLower; }
|
||||
/*! \brief returns the property xErrorColumn ( \copybrief xErrorColumn ). \details Description of the parameter xErrorColumn is: <BLOCKQUOTE>\copydoc xErrorColumn </BLOCKQUOTE>. \see xErrorColumn for more information */
|
||||
inline int getXErrorColumn() const { return this->xErrorColumn; }
|
||||
/*! \brief returns the property yErrorColumnLower ( \copybrief yErrorColumnLower ). \details Description of the parameter yErrorColumnLower is: <BLOCKQUOTE>\copydoc yErrorColumnLower </BLOCKQUOTE>. \see yErrorColumnLower for more information */
|
||||
inline int getYErrorColumnLower() const { return this->yErrorColumnLower; }
|
||||
/*! \brief returns the property yErrorColumn ( \copybrief yErrorColumn ). \details Description of the parameter yErrorColumn is: <BLOCKQUOTE>\copydoc yErrorColumn </BLOCKQUOTE>. \see yErrorColumn for more information */
|
||||
inline int getYErrorColumn() const { return this->yErrorColumn; }
|
||||
/*! \copydoc yErrorStyle
|
||||
\see see yErrorStyle for details */
|
||||
inline virtual void setYErrorStyle(const JKQTPErrorPlotstyle & __value)
|
||||
{
|
||||
this->yErrorStyle = __value;
|
||||
}
|
||||
/*! \copydoc yErrorStyle
|
||||
\see see yErrorStyle for details */
|
||||
inline virtual JKQTPErrorPlotstyle getYErrorStyle() const
|
||||
{
|
||||
return this->yErrorStyle;
|
||||
}
|
||||
/*! \copydoc xErrorStyle
|
||||
\see see xErrorStyle for details */
|
||||
inline virtual void setXErrorStyle(const JKQTPErrorPlotstyle & __value)
|
||||
{
|
||||
this->xErrorStyle = __value;
|
||||
}
|
||||
/*! \copydoc xErrorStyle
|
||||
\see see xErrorStyle for details */
|
||||
inline virtual JKQTPErrorPlotstyle getXErrorStyle() const
|
||||
{
|
||||
return this->xErrorStyle;
|
||||
}
|
||||
/** \copydoc JKQTPGraphErrors::errorUsesColumn() */
|
||||
virtual bool errorUsesColumn(int c) const override;
|
||||
JKQTPXYGraphErrors();
|
||||
virtual ~JKQTPXYGraphErrors()=default;
|
||||
|
||||
/** \brief set the column from which to read the error values for x-error indicators */
|
||||
void setXErrorColumn(int __value);
|
||||
/** \brief set the column from which to read the error values for lower x-error indicators (if not set [=-1], the xErrorColumn-values will be used for upper and lower error indicators) */
|
||||
void setXErrorColumnLower(int __value);
|
||||
/** \brief set the column from which to read the error values for x-error indicators */
|
||||
void setYErrorColumn(int __value);
|
||||
/** \brief set the column from which to read the error values for lower x-error indicators (if not set [=-1], the xErrorColumn-values will be used for upper and lower error indicators) */
|
||||
void setYErrorColumnLower(int __value);
|
||||
/** \brief set the column from which to read the error values for y-error indicators */
|
||||
void setXErrorColumn(size_t __value);
|
||||
/** \brief set the column from which to read the error values for lower y-error indicators (if not set [=-1], the xErrorColumn-values will be used for upper and lower error indicators) */
|
||||
void setXErrorColumnLower(size_t __value);
|
||||
/** \brief set the column from which to read the error values for y-error indicators */
|
||||
void setYErrorColumn(size_t __value);
|
||||
/** \brief set the column from which to read the error values for lower y-error indicators (if not set [=-1], the xErrorColumn-values will be used for upper and lower error indicators) */
|
||||
void setYErrorColumnLower(size_t __value);
|
||||
/** \brief returns true, if the error plots use the given column */
|
||||
virtual bool errorUsesColumn(int c) const ;
|
||||
|
||||
protected:
|
||||
/** \brief the column that contains the error of the x-component of the datapoints */
|
||||
int yErrorColumn;
|
||||
/** \brief how to draw the errors (if available) of the x-value */
|
||||
JKQTPErrorPlotstyle yErrorStyle;
|
||||
/** \brief the column that contains the error of the x-component of the datapoints */
|
||||
int xErrorColumn;
|
||||
/** \brief how to draw the errors (if available) of the x-value */
|
||||
JKQTPErrorPlotstyle xErrorStyle;
|
||||
/** \brief indicates whether the x-errors are symmetric (from one column only) */
|
||||
bool xErrorSymmetric;
|
||||
/** \brief indicates whether the y-errors are symmetric (from one column only) */
|
||||
bool yErrorSymmetric;
|
||||
/** \brief the column that contains the error of the x-component of the datapoints. This is used as the lower error length, if xErrorSymmetric \c ==false. */
|
||||
int xErrorColumnLower;
|
||||
/** \brief the column that contains the error of the y-component of the datapoints. This is used as the lower error length, if yErrorSymmetric \c ==false. */
|
||||
int yErrorColumnLower;
|
||||
/** \brief draws the error indicators */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) ;
|
||||
|
||||
/** \brief draw error indicators with the parameters defined in this class. The position of the datapoints is
|
||||
* given by the \a xColumn and \a yColumn. It is also possible to specify a datarange. */
|
||||
virtual void plotErrorIndicators(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, double xrelshift=0, double yrelshift=0.0, const QVector<int> *dataorder=nullptr) override;
|
||||
|
||||
virtual double getXErrorU(int i, JKQTPDatastore* ds) const override;
|
||||
virtual double getXErrorL(int i, JKQTPDatastore* ds) const override;
|
||||
virtual double getYErrorU(int i, JKQTPDatastore* ds) const override;
|
||||
virtual double getYErrorL(int i, JKQTPDatastore* ds) const override;
|
||||
};
|
||||
|
||||
|
||||
@ -384,4 +359,6 @@ class JKQTP_LIB_EXPORT JKQTPXYGraphErrors: public JKQTPGraphErrors {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // JKQTPGRAPHSBASEERROR_H
|
||||
|
@ -123,20 +123,20 @@ class JKQTP_LIB_EXPORT JKQTPGraphLineStyleMixin {
|
||||
Q_PROPERTY(Qt::PenStyle lineStyle MEMBER m_lineStyle READ getLineStyle WRITE setLineStyle)
|
||||
Q_PROPERTY(double lineWidth MEMBER m_lineWidth READ getLineWidth WRITE setLineWidth)
|
||||
private:
|
||||
/** \brief line pen */
|
||||
/** \brief graph line pen */
|
||||
QPen m_linePen;
|
||||
/** \brief width of the graph, given in pt */
|
||||
/** \brief width of the graph lines, given in pt */
|
||||
double m_lineWidth;
|
||||
/** \brief line pen for the highlighted look */
|
||||
QColor m_highlightingLineColor;
|
||||
protected:
|
||||
/** \brief constructs a QPen from the line styleing properties */
|
||||
/** \brief constructs a QPen from the line styling properties */
|
||||
QPen getLinePen(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
/** \brief constructs a QPen from the line styleing properties, suitable for drawing rectangles with sharp edges */
|
||||
/** \brief constructs a QPen from the line styling properties, suitable for drawing rectangles with sharp edges */
|
||||
QPen getLinePenForRects(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
/** \brief constructs a QPen from the line styleing properties */
|
||||
/** \brief constructs a QPen from the line styling properties */
|
||||
QPen getHighlightingLinePen(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
/** \brief constructs a QPen from the line styleing properties, suitable for drawing rectangle with sharp corners */
|
||||
/** \brief constructs a QPen from the line styling properties, suitable for drawing rectangle with sharp corners */
|
||||
QPen getHighlightingLinePenForRects(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
};
|
||||
|
||||
@ -215,9 +215,9 @@ class JKQTP_LIB_EXPORT JKQTPGraphSymbolStyleMixin {
|
||||
/** \brief width (in pt) of the lines used to plot the symbol for the data points, given in pt */
|
||||
double m_symbolLineWidth;
|
||||
protected:
|
||||
/** \brief constructs a QPen from the line styleing properties */
|
||||
/** \brief constructs a QPen from the line styling properties */
|
||||
QPen getSymbolPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
/** \brief constructs a QPen from the line styleing properties */
|
||||
/** \brief constructs a QPen from the line styling properties */
|
||||
QBrush getSymbolBrush(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
/*! \brief plot a symbol at location x,y (in painter coordinates), using the current style
|
||||
|
||||
@ -323,7 +323,7 @@ class JKQTP_LIB_EXPORT JKQTPGraphFillStyleMixin {
|
||||
/** \brief last fill color of the graph */
|
||||
QColor m_fillColor;
|
||||
protected:
|
||||
/** \brief constructs a QPen from the line styleing properties */
|
||||
/** \brief constructs a QBrush from the graph fill styling properties */
|
||||
QBrush getFillBrush(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
|
||||
};
|
||||
|
||||
|
@ -37,8 +37,7 @@ JKQTPGraphBoxplotStyleMixin::JKQTPGraphBoxplotStyleMixin()
|
||||
|
||||
boxWidth=0.4;
|
||||
|
||||
whiskerLineColor=getLineColor();
|
||||
whiskerLineStyle=getLineStyle();
|
||||
m_whiskerLinePen=QPen(getLineColor(), getLineWidth());
|
||||
whiskerLineWidth=getLineWidth();
|
||||
|
||||
}
|
||||
@ -51,12 +50,12 @@ void JKQTPGraphBoxplotStyleMixin::initBoxplotStyle(JKQTBasePlotter *parent, int
|
||||
initSymbolStyle(parent, parentPlotStyle);
|
||||
if (parent && parentPlotStyle>=0) { // get style settings from parent object
|
||||
parentPlotStyle=parent->getNextStyle();
|
||||
whiskerLineStyle=parent->getPlotStyle(parentPlotStyle).style();
|
||||
m_whiskerLinePen.setColor(parent->getPlotStyle(parentPlotStyle).color());
|
||||
m_whiskerLinePen.setStyle(parent->getPlotStyle(parentPlotStyle).style());
|
||||
whiskerLineWidth=parent->getPlotStyle(parentPlotStyle).widthF();
|
||||
}
|
||||
|
||||
whiskerLineColor=getLineColor();
|
||||
|
||||
setWhiskerLineColor(getLineColor());
|
||||
}
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setBoxplotColor(QColor c, JKQTBasePlotter *parent)
|
||||
@ -67,17 +66,17 @@ void JKQTPGraphBoxplotStyleMixin::setBoxplotColor(QColor c, JKQTBasePlotter *par
|
||||
setHighlightingLineColor(c);
|
||||
setSymbolColor(c);
|
||||
setSymbolFillColor(JKQTPGetDerivedColor(parent->getCurrentPlotterStyle().graphFillColorDerivationMode, c));
|
||||
whiskerLineColor=getLineColor();
|
||||
setWhiskerLineColor(getLineColor());
|
||||
}
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setWhiskerLineStyle(const Qt::PenStyle &__value)
|
||||
void JKQTPGraphBoxplotStyleMixin::setWhiskerLineStyle(Qt::PenStyle __value)
|
||||
{
|
||||
this->whiskerLineStyle = __value;
|
||||
this->m_whiskerLinePen.setStyle(__value);
|
||||
}
|
||||
|
||||
Qt::PenStyle JKQTPGraphBoxplotStyleMixin::getWhiskerLineStyle() const
|
||||
{
|
||||
return this->whiskerLineStyle;
|
||||
return this->m_whiskerLinePen.style();
|
||||
}
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setBoxWidth(double __value)
|
||||
@ -102,20 +101,70 @@ double JKQTPGraphBoxplotStyleMixin::getWhiskerLineWidth() const
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setWhiskerLineColor(QColor __value)
|
||||
{
|
||||
whiskerLineColor=__value;
|
||||
m_whiskerLinePen.setColor(__value);
|
||||
}
|
||||
|
||||
QColor JKQTPGraphBoxplotStyleMixin::getWhiskerLineColor() const
|
||||
{
|
||||
return whiskerLineColor;
|
||||
return m_whiskerLinePen.color();
|
||||
}
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setWhiskerLineDashOffset(qreal offset)
|
||||
{
|
||||
m_whiskerLinePen.setDashOffset(offset);
|
||||
}
|
||||
|
||||
qreal JKQTPGraphBoxplotStyleMixin::getWhiskerLineDashOffset() const
|
||||
{
|
||||
return m_whiskerLinePen.dashOffset();
|
||||
}
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setWhiskerLineDashPattern(const QVector<qreal> &pattern)
|
||||
{
|
||||
m_whiskerLinePen.setDashPattern(pattern);
|
||||
m_whiskerLinePen.setStyle(Qt::CustomDashLine);
|
||||
}
|
||||
|
||||
QVector<qreal> JKQTPGraphBoxplotStyleMixin::getWhiskerLineDashPattern() const
|
||||
{
|
||||
return m_whiskerLinePen.dashPattern();
|
||||
}
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setWhiskerLineJoinStyle(Qt::PenJoinStyle style)
|
||||
{
|
||||
m_whiskerLinePen.setJoinStyle(style);
|
||||
}
|
||||
|
||||
Qt::PenJoinStyle JKQTPGraphBoxplotStyleMixin::getWhiskerLineJoinStyle() const
|
||||
{
|
||||
return m_whiskerLinePen.joinStyle();
|
||||
}
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setWhiskerLineCapStyle(Qt::PenCapStyle style)
|
||||
{
|
||||
m_whiskerLinePen.setCapStyle(style);
|
||||
}
|
||||
|
||||
Qt::PenCapStyle JKQTPGraphBoxplotStyleMixin::getWhiskerLineCapStyle() const
|
||||
{
|
||||
return m_whiskerLinePen.capStyle();
|
||||
}
|
||||
|
||||
void JKQTPGraphBoxplotStyleMixin::setWhiskerLineBrush(const QBrush &style)
|
||||
{
|
||||
m_whiskerLinePen.setBrush(style);
|
||||
}
|
||||
|
||||
QBrush JKQTPGraphBoxplotStyleMixin::getWhiskerLineBrush() const
|
||||
{
|
||||
return m_whiskerLinePen.brush();
|
||||
}
|
||||
|
||||
QPen JKQTPGraphBoxplotStyleMixin::getWhiskerPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
|
||||
{
|
||||
QPen pw=getLinePenForRects(painter, parent);
|
||||
pw.setStyle(whiskerLineStyle);
|
||||
pw.setWidthF(whiskerLineWidth);
|
||||
pw.setColor(whiskerLineColor);
|
||||
QPen pw=m_whiskerLinePen;
|
||||
pw.setWidthF(qMax(JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH,parent->pt2px(painter, parent->getLineWidthMultiplier()*whiskerLineWidth)));
|
||||
pw.setJoinStyle(Qt::MiterJoin);
|
||||
return pw;
|
||||
}
|
||||
|
||||
@ -161,9 +210,10 @@ void JKQTPBoxplotVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
#ifdef JKQTBP_AUTOTIMER
|
||||
JKQTPAutoOutputTimer jkaaot("JKQTPBoxplotVerticalGraph::draw");
|
||||
#endif
|
||||
clearHitTestData();
|
||||
if (parent==nullptr) return;
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
if (datastore==nullptr) return;
|
||||
if (datastore==nullptr) return;
|
||||
|
||||
drawErrorsBefore(painter);
|
||||
|
||||
@ -183,6 +233,7 @@ void JKQTPBoxplotVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
|
||||
reserveHitTestData(imax-imin);
|
||||
|
||||
|
||||
//bool first=false;
|
||||
@ -208,35 +259,46 @@ void JKQTPBoxplotVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
{
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
for (int i=imin; i<imax; i++) {
|
||||
double xv=datastore->get(posColumn,i);
|
||||
double p25v=datastore->get(percentile25Column,i);
|
||||
double p75v=datastore->get(percentile75Column,i);
|
||||
double minv=datastore->get(minColumn,i);
|
||||
double maxv=datastore->get(maxColumn,i);
|
||||
double medianv=datastore->get(medianColumn,i);
|
||||
double mean=transformY(datastore->get(meanColumn,i));
|
||||
const double xv=datastore->get(posColumn,static_cast<size_t>(i));
|
||||
const double p25v=datastore->get(percentile25Column,static_cast<size_t>(i));
|
||||
const double p75v=datastore->get(percentile75Column,static_cast<size_t>(i));
|
||||
const double minv=datastore->get(minColumn,static_cast<size_t>(i));
|
||||
const double maxv=datastore->get(maxColumn,static_cast<size_t>(i));
|
||||
const double medianv=datastore->get(medianColumn,static_cast<size_t>(i));
|
||||
const double meanv=datastore->get(meanColumn,static_cast<size_t>(i));
|
||||
|
||||
QVector<QLineF> lines_p, lines_pw;
|
||||
|
||||
//std::cout<<"(xv, yv) = ( "<<xv<<", "<<yv<<" )\n";
|
||||
if (posColumn>=0 && JKQTPIsOKFloat(xv) && JKQTPIsOKFloat(p25v) &&
|
||||
JKQTPIsOKFloat(p75v) && JKQTPIsOKFloat(minv) &&
|
||||
JKQTPIsOKFloat(maxv) && JKQTPIsOKFloat(medianv) ) {
|
||||
if (posColumn>=0 && JKQTPIsOKFloat(xv) ) {
|
||||
|
||||
// collect single-value labels for hitTest()-data at the bottom of this loop!
|
||||
QStringList labelValues, labelNames;
|
||||
int labMedian=-1, labMean=-1, labMin=-1, labMax=-1, labQ25=-1, labQ75=-1;
|
||||
labelNames<<"pos";
|
||||
labelValues<<QString::fromStdString(jkqtp_floattolatexstr(xv, 3));
|
||||
if (minColumn>=0 && JKQTPIsOKFloat(minv)) { labelNames<<"\\min"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(minv, 3)); labMin=labelValues.size()-1; }
|
||||
if (percentile25Column>=0 && JKQTPIsOKFloat(p25v)) { labelNames<<"q_{25}"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(p25v, 3)); labQ25=labelValues.size()-1; }
|
||||
if (medianColumn>=0 && JKQTPIsOKFloat(medianv)) { labelNames<<"\\median"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(medianv, 3)); labMedian=labelValues.size()-1; }
|
||||
if (meanColumn>=0 && JKQTPIsOKFloat(meanv)) { labelNames<<"\\mu"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(meanv, 3)); labMean=labelValues.size()-1; }
|
||||
if (percentile75Column>=0 && JKQTPIsOKFloat(p75v)) { labelNames<<"q_{75}"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(p75v, 3)); labQ75=labelValues.size()-1; }
|
||||
if (maxColumn>=0 && JKQTPIsOKFloat(maxv)) { labelNames<<"\\max"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(maxv, 3)); labMax=labelValues.size()-1; }
|
||||
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(p);
|
||||
painter.setBrush(b);
|
||||
//std::cout<<"boxplot(med="<<medianv<<", min="<<minv<<", max="<<maxv<<", p25="<<p25v<<", p75="<<p75v<<")\n";
|
||||
double x=transformX(xv);
|
||||
double p25=transformY(p25v);
|
||||
double p75=transformY(p75v);
|
||||
double min=transformY(minv);
|
||||
double max=transformY(maxv);
|
||||
double median=transformY(medianv);
|
||||
const double x=transformX(xv);
|
||||
const double p25=transformY(p25v);
|
||||
const double p75=transformY(p75v);
|
||||
const double min=transformY(minv);
|
||||
const double max=transformY(maxv);
|
||||
const double median=transformY(medianv);
|
||||
const double mean=transformY(meanv);
|
||||
|
||||
double xn=x+1;
|
||||
if (i+1<imax) xn=transformX(datastore->get(posColumn,i+1));
|
||||
else if (i-1>=0) xn=transformX(datastore->get(posColumn,i-1));
|
||||
if (i+1<imax) xn=transformX(datastore->get(posColumn,static_cast<size_t>(i+1)));
|
||||
else if (i-1>=0) xn=transformX(datastore->get(posColumn,static_cast<size_t>(i-1)));
|
||||
else xn=x+1;
|
||||
|
||||
|
||||
@ -272,7 +334,7 @@ void JKQTPBoxplotVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
|
||||
if (percentile25Column>=0 && percentile75Column>=0) painter.drawRect(QRectF(xmi, p75, fabs(xma-xmi), fabs(p75-p25)));
|
||||
if (medianColumn>=0) lines_p.append(QLineF(xmi+p.widthF()/2.0, median, xma-p.widthF()/2.0, median));
|
||||
if (meanColumn>=0 && JKQTPIsOKFloat(mean)) {
|
||||
if (meanColumn>=0 && JKQTPIsOKFloat(meanv)) {
|
||||
plotStyledSymbol(parent, painter,x,mean);
|
||||
}
|
||||
|
||||
@ -283,6 +345,43 @@ void JKQTPBoxplotVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
if (lines_pw.size()>0) painter.drawLines(lines_pw);
|
||||
|
||||
|
||||
// add hit-test graph points
|
||||
if (meanColumn>=0 && JKQTPIsOKFloat(meanv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMean]="\\ul{"+sl[labMean]+"}";
|
||||
sll[labMean]="\\ul{"+sll[labMean]+"}";
|
||||
addHitTestData(xv, meanv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (medianColumn>=0 && JKQTPIsOKFloat(medianv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMedian]="\\ul{"+sl[labMedian]+"}";
|
||||
sll[labMedian]="\\ul{"+sll[labMedian]+"}";
|
||||
addHitTestData(xv, medianv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (minColumn>=0 && JKQTPIsOKFloat(minv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMin]="\\ul{"+sl[labMin]+"}";
|
||||
sll[labMin]="\\ul{"+sll[labMin]+"}";
|
||||
addHitTestData(xv, minv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (maxColumn>=0 && JKQTPIsOKFloat(maxv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMax]="\\ul{"+sl[labMax]+"}";
|
||||
sll[labMax]="\\ul{"+sll[labMax]+"}";
|
||||
addHitTestData(xv, maxv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (percentile25Column>=0 && JKQTPIsOKFloat(p25v)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labQ25]="\\ul{"+sl[labQ25]+"}";
|
||||
sll[labQ25]="\\ul{"+sll[labQ25]+"}";
|
||||
addHitTestData(xv, p25v, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (percentile75Column>=0 && JKQTPIsOKFloat(p75v)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labQ75]="\\ul{"+sl[labQ75]+"}";
|
||||
sll[labQ75]="\\ul{"+sll[labQ75]+"}";
|
||||
addHitTestData(xv, p75v, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
//first=true;
|
||||
}
|
||||
}
|
||||
@ -740,37 +839,47 @@ void JKQTPBoxplotHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
|
||||
//bool first=false;
|
||||
for (int i=imin; i<imax; i++) {
|
||||
double yv=datastore->get(posColumn,i);
|
||||
double p25v=datastore->get(percentile25Column,i);
|
||||
double p75v=datastore->get(percentile75Column,i);
|
||||
double minv=datastore->get(minColumn,i);
|
||||
double maxv=datastore->get(maxColumn,i);
|
||||
double medianv=datastore->get(medianColumn,i);
|
||||
double mean=transformX(datastore->get(meanColumn,i));
|
||||
const double yv=datastore->get(posColumn,static_cast<size_t>(i));
|
||||
const double p25v=datastore->get(percentile25Column,static_cast<size_t>(i));
|
||||
const double p75v=datastore->get(percentile75Column,static_cast<size_t>(i));
|
||||
const double minv=datastore->get(minColumn,static_cast<size_t>(i));
|
||||
const double maxv=datastore->get(maxColumn,static_cast<size_t>(i));
|
||||
const double medianv=datastore->get(medianColumn,static_cast<size_t>(i));
|
||||
const double meanv=datastore->get(meanColumn,static_cast<size_t>(i));
|
||||
|
||||
QVector<QLineF> lines_p, lines_pw;
|
||||
//std::cout<<"(xv, yv) = ( "<<xv<<", "<<yv<<" )\n";
|
||||
if (posColumn>=0 && JKQTPIsOKFloat(yv) &&
|
||||
JKQTPIsOKFloat(p25v) &&
|
||||
JKQTPIsOKFloat(p75v) &&
|
||||
JKQTPIsOKFloat(minv) &&
|
||||
JKQTPIsOKFloat(maxv) &&
|
||||
JKQTPIsOKFloat(medianv)) {
|
||||
if (posColumn>=0 && JKQTPIsOKFloat(yv) ) {
|
||||
|
||||
|
||||
// collect single-value labels for hitTest()-data at the bottom of this loop!
|
||||
QStringList labelValues, labelNames;
|
||||
int labMedian=-1, labMean=-1, labMin=-1, labMax=-1, labQ25=-1, labQ75=-1;
|
||||
labelNames<<"pos";
|
||||
labelValues<<QString::fromStdString(jkqtp_floattolatexstr(yv, 3));
|
||||
if (minColumn>=0 && JKQTPIsOKFloat(minv)) { labelNames<<"\\min"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(minv, 3)); labMin=labelValues.size()-1; }
|
||||
if (percentile25Column>=0 && JKQTPIsOKFloat(p25v)) { labelNames<<"q_{25}"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(p25v, 3)); labQ25=labelValues.size()-1; }
|
||||
if (medianColumn>=0 && JKQTPIsOKFloat(medianv)) { labelNames<<"\\median"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(medianv, 3)); labMedian=labelValues.size()-1; }
|
||||
if (meanColumn>=0 && JKQTPIsOKFloat(meanv)) { labelNames<<"\\mu"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(meanv, 3)); labMean=labelValues.size()-1; }
|
||||
if (percentile75Column>=0 && JKQTPIsOKFloat(p75v)) { labelNames<<"q_{75}"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(p75v, 3)); labQ75=labelValues.size()-1; }
|
||||
if (maxColumn>=0 && JKQTPIsOKFloat(maxv)) { labelNames<<"\\max"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(maxv, 3)); labMax=labelValues.size()-1; }
|
||||
|
||||
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(p);
|
||||
painter.setBrush(b);
|
||||
|
||||
|
||||
double p25=transformX(p25v);
|
||||
double p75=transformX(p75v);
|
||||
double min=transformX(minv);
|
||||
double max=transformX(maxv);
|
||||
double median=transformX(medianv);
|
||||
const double y=transformY(yv);
|
||||
const double p25=transformX(p25v);
|
||||
const double p75=transformX(p75v);
|
||||
const double min=transformX(minv);
|
||||
const double max=transformX(maxv);
|
||||
const double median=transformX(medianv);
|
||||
const double mean=transformX(meanv);
|
||||
|
||||
|
||||
//std::cout<<"boxplot(med="<<medianv<<", min="<<minv<<", max="<<maxv<<", p25="<<p25v<<", p75="<<p75v<<")\n";
|
||||
double y=transformY(yv);
|
||||
double minstop=p25;
|
||||
double maxstop=p75;
|
||||
if (percentile25Column<0 && medianColumn>=0) minstop=median;
|
||||
@ -781,8 +890,8 @@ void JKQTPBoxplotHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
else if (percentile75Column<0 && meanColumn>=0) maxstop=mean;
|
||||
|
||||
double yn=y+1;
|
||||
if (i+1<imax) yn=transformY(datastore->get(posColumn,i+1));
|
||||
else if (i-1>=0) yn=transformY(datastore->get(posColumn,i-1));
|
||||
if (i+1<imax) yn=transformY(datastore->get(posColumn,static_cast<size_t>(i+1)));
|
||||
else if (i-1>=0) yn=transformY(datastore->get(posColumn,static_cast<size_t>(i-1)));
|
||||
else yn=y+1;
|
||||
double delta=fabs(yn-y);
|
||||
double w=((boxwidth_real>0)?boxwidth_real:(delta))*getBoxWidth();
|
||||
@ -808,7 +917,7 @@ void JKQTPBoxplotHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
if (percentile25Column>=0 && percentile75Column>=0) painter.drawRect(QRectF(p25, qMin(yma,ymi), fabs(p75-p25), fabs(yma-ymi)));
|
||||
if (medianColumn>=0) lines_p.append(QLineF(median, ymi-p.widthF()/2.0, median, yma+p.widthF()/2.0));
|
||||
|
||||
if (meanColumn>=0 && JKQTPIsOKFloat(mean)) {
|
||||
if (meanColumn>=0 && JKQTPIsOKFloat(meanv)) {
|
||||
plotStyledSymbol(parent, painter, mean, y);
|
||||
}
|
||||
|
||||
@ -817,7 +926,45 @@ void JKQTPBoxplotHorizontalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
if (lines_p.size()>0) painter.drawLines(lines_p);
|
||||
painter.setPen(pw);
|
||||
if (lines_pw.size()>0) painter.drawLines(lines_pw);
|
||||
|
||||
|
||||
|
||||
// add hit-test graph points
|
||||
if (meanColumn>=0 && JKQTPIsOKFloat(meanv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMean]="\\ul{"+sl[labMean]+"}";
|
||||
sll[labMean]="\\ul{"+sll[labMean]+"}";
|
||||
addHitTestData(meanv, yv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (medianColumn>=0 && JKQTPIsOKFloat(medianv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMedian]="\\ul{"+sl[labMedian]+"}";
|
||||
sll[labMedian]="\\ul{"+sll[labMedian]+"}";
|
||||
addHitTestData(medianv, yv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (minColumn>=0 && JKQTPIsOKFloat(minv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMin]="\\ul{"+sl[labMin]+"}";
|
||||
sll[labMin]="\\ul{"+sll[labMin]+"}";
|
||||
addHitTestData(minv, yv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (maxColumn>=0 && JKQTPIsOKFloat(maxv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMax]="\\ul{"+sl[labMax]+"}";
|
||||
sll[labMax]="\\ul{"+sll[labMax]+"}";
|
||||
addHitTestData(maxv, yv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (percentile25Column>=0 && JKQTPIsOKFloat(p25v)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labQ25]="\\ul{"+sl[labQ25]+"}";
|
||||
sll[labQ25]="\\ul{"+sll[labQ25]+"}";
|
||||
addHitTestData(p25v, yv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (percentile75Column>=0 && JKQTPIsOKFloat(p75v)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labQ75]="\\ul{"+sl[labQ75]+"}";
|
||||
sll[labQ75]="\\ul{"+sll[labQ75]+"}";
|
||||
addHitTestData(p75v, yv, i, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -886,53 +1033,100 @@ void JKQTPBoxplotVerticalElement::draw(JKQTPEnhancedPainter& painter) {
|
||||
|
||||
|
||||
|
||||
double xv=pos;
|
||||
double p25v=percentile25;
|
||||
double p75v=percentile75;
|
||||
double minv=min;
|
||||
double maxv=max;
|
||||
double medianv=median;
|
||||
const double xv=pos;
|
||||
const double p25v=percentile25;
|
||||
const double p75v=percentile75;
|
||||
const double minv=min;
|
||||
const double maxv=max;
|
||||
const double medianv=median;
|
||||
const double meanv=mean;
|
||||
|
||||
//std::cout<<"(xv, yv) = ( "<<xv<<", "<<yv<<" )\n";
|
||||
if (JKQTPIsOKFloat(xv) && JKQTPIsOKFloat(p25v) &&
|
||||
JKQTPIsOKFloat(p75v) && JKQTPIsOKFloat(minv) &&
|
||||
JKQTPIsOKFloat(maxv) && JKQTPIsOKFloat(medianv) ) {
|
||||
if (JKQTPIsOKFloat(xv) ) {
|
||||
|
||||
//std::cout<<"boxplot(med="<<medianv<<", min="<<minv<<", max="<<maxv<<", p25="<<p25v<<", p75="<<p75v<<")\n";
|
||||
double x=transformX(xv);
|
||||
double p25=transformY(p25v);
|
||||
double p75=transformY(p75v);
|
||||
double min=transformY(minv);
|
||||
double max=transformY(maxv);
|
||||
double median=transformY(medianv);
|
||||
const double x=transformX(xv);
|
||||
const double p25=transformY(p25v);
|
||||
const double p75=transformY(p75v);
|
||||
const double min=transformY(minv);
|
||||
const double max=transformY(maxv);
|
||||
const double median=transformY(medianv);
|
||||
|
||||
double w=getBoxWidth();
|
||||
// collect single-value labels for hitTest()-data at the bottom of this loop!
|
||||
QStringList labelValues, labelNames;
|
||||
int labMedian=-1, labMean=-1, labMin=-1, labMax=-1, labQ25=-1, labQ75=-1;
|
||||
labelNames<<"pos";
|
||||
labelValues<<QString::fromStdString(jkqtp_floattolatexstr(xv, 3));
|
||||
if (JKQTPIsOKFloat(minv)) { labelNames<<"\\min"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(minv, 3)); labMin=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(p25v)) { labelNames<<"q_{25}"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(p25v, 3)); labQ25=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(medianv)) { labelNames<<"\\median"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(medianv, 3)); labMedian=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(meanv)) { labelNames<<"\\mu"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(meanv, 3)); labMean=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(p75v)) { labelNames<<"q_{75}"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(p75v, 3)); labQ75=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(maxv)) { labelNames<<"\\max"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(maxv, 3)); labMax=labelValues.size()-1; }
|
||||
|
||||
double w=parent->pt2px(painter, getBoxWidth());
|
||||
double xma=x+w/2.0;
|
||||
double xmi=x-w/2.0;
|
||||
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(p);
|
||||
{
|
||||
if (JKQTPIsOKFloat(p25v) && JKQTPIsOKFloat(p75v)) {
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setBrush(b);
|
||||
painter.drawRect(QRectF(xmi, p75, fabs(xma-xmi), fabs(p75-p25)));
|
||||
if (JKQTPIsOKFloat(p25v)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labQ25]="\\ul{"+sl[labQ25]+"}";
|
||||
sll[labQ25]="\\ul{"+sll[labQ25]+"}";
|
||||
addHitTestData(xv, p25v, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (JKQTPIsOKFloat(p75v)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labQ75]="\\ul{"+sl[labQ75]+"}";
|
||||
sll[labQ75]="\\ul{"+sll[labQ75]+"}";
|
||||
addHitTestData(xv, p75v, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
}
|
||||
|
||||
if (drawMedian) {
|
||||
if (drawMedian && JKQTPIsOKFloat(medianv)) {
|
||||
painter.drawLine(QLineF(xmi, median, xma, median));
|
||||
if (JKQTPIsOKFloat(medianv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMedian]="\\ul{"+sl[labMedian]+"}";
|
||||
sll[labMedian]="\\ul{"+sll[labMedian]+"}";
|
||||
addHitTestData(xv, medianv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
}
|
||||
if (drawMinMax) {
|
||||
painter.drawLine(QLineF(x-w/4.0, max, x+w/4.0, max));
|
||||
painter.drawLine(QLineF(x-w/4.0, min, x+w/4.0, min));
|
||||
if (JKQTPIsOKFloat(maxv)) painter.drawLine(QLineF(x-w/4.0, max, x+w/4.0, max));
|
||||
if (JKQTPIsOKFloat(minv)) painter.drawLine(QLineF(x-w/4.0, min, x+w/4.0, min));
|
||||
painter.setPen(pw);
|
||||
painter.drawLine(QLineF(x, max, x, p75));
|
||||
painter.drawLine(QLineF(x, min, x, p25));
|
||||
if (JKQTPIsOKFloat(maxv)) painter.drawLine(QLineF(x, max, x, p75));
|
||||
if (JKQTPIsOKFloat(minv)) painter.drawLine(QLineF(x, min, x, p25));
|
||||
if (JKQTPIsOKFloat(minv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMin]="\\ul{"+sl[labMin]+"}";
|
||||
sll[labMin]="\\ul{"+sll[labMin]+"}";
|
||||
addHitTestData(xv, minv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (JKQTPIsOKFloat(maxv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMax]="\\ul{"+sl[labMax]+"}";
|
||||
sll[labMax]="\\ul{"+sll[labMax]+"}";
|
||||
addHitTestData(xv, maxv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (drawMean) {
|
||||
double mean=transformY(this->mean);
|
||||
if (drawMean && JKQTPIsOKFloat(meanv)) {
|
||||
double mean=transformY(meanv);
|
||||
plotStyledSymbol(parent, painter, x, mean);
|
||||
if (JKQTPIsOKFloat(meanv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMean]="\\ul{"+sl[labMean]+"}";
|
||||
sll[labMean]="\\ul{"+sll[labMean]+"}";
|
||||
addHitTestData(xv, meanv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1267,28 +1461,36 @@ void JKQTPBoxplotHorizontalElement::draw(JKQTPEnhancedPainter& painter) {
|
||||
QPen pw=getWhiskerPen(painter, parent);
|
||||
QPen np(Qt::NoPen);
|
||||
QBrush b=getFillBrush(painter, parent);
|
||||
double yv=pos;
|
||||
double p25v=percentile25;
|
||||
double p75v=percentile75;
|
||||
double minv=min;
|
||||
double maxv=max;
|
||||
double medianv=median;
|
||||
const double yv=pos;
|
||||
const double p25v=percentile25;
|
||||
const double p75v=percentile75;
|
||||
const double minv=min;
|
||||
const double maxv=max;
|
||||
const double medianv=median;
|
||||
const double meanv=mean;
|
||||
|
||||
//std::cout<<"(xv, yv) = ( "<<xv<<", "<<yv<<" )\n";
|
||||
if (JKQTPIsOKFloat(yv) &&
|
||||
JKQTPIsOKFloat(p25v) &&
|
||||
JKQTPIsOKFloat(p75v) &&
|
||||
JKQTPIsOKFloat(minv) &&
|
||||
JKQTPIsOKFloat(maxv) &&
|
||||
JKQTPIsOKFloat(medianv)) {
|
||||
if (JKQTPIsOKFloat(yv) ) {
|
||||
|
||||
//std::cout<<"boxplot(med="<<medianv<<", min="<<minv<<", max="<<maxv<<", p25="<<p25v<<", p75="<<p75v<<")\n";
|
||||
double y=transformY(yv);
|
||||
double p25=transformX(p25v);
|
||||
double p75=transformX(p75v);
|
||||
double min=transformX(minv);
|
||||
double max=transformX(maxv);
|
||||
double median=transformX(medianv);
|
||||
const double y=transformY(yv);
|
||||
const double p25=transformX(p25v);
|
||||
const double p75=transformX(p75v);
|
||||
const double min=transformX(minv);
|
||||
const double max=transformX(maxv);
|
||||
const double median=transformX(medianv);
|
||||
|
||||
// collect single-value labels for hitTest()-data at the bottom of this loop!
|
||||
QStringList labelValues, labelNames;
|
||||
int labMedian=-1, labMean=-1, labMin=-1, labMax=-1, labQ25=-1, labQ75=-1;
|
||||
labelNames<<"pos";
|
||||
labelValues<<QString::fromStdString(jkqtp_floattolatexstr(yv, 3));
|
||||
if (JKQTPIsOKFloat(minv)) { labelNames<<"\\min"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(minv, 3)); labMin=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(p25v)) { labelNames<<"q_{25}"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(p25v, 3)); labQ25=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(medianv)) { labelNames<<"\\median"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(medianv, 3)); labMedian=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(meanv)) { labelNames<<"\\mu"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(meanv, 3)); labMean=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(p75v)) { labelNames<<"q_{75}"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(p75v, 3)); labQ75=labelValues.size()-1; }
|
||||
if (JKQTPIsOKFloat(maxv)) { labelNames<<"\\max"; labelValues<<QString::fromStdString(jkqtp_floattolatexstr(maxv, 3)); labMax=labelValues.size()-1; }
|
||||
|
||||
double w= parent->pt2px(painter, getBoxWidth());
|
||||
double yma=y+w/2.0;
|
||||
@ -1296,27 +1498,62 @@ void JKQTPBoxplotHorizontalElement::draw(JKQTPEnhancedPainter& painter) {
|
||||
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(p);
|
||||
{
|
||||
if (JKQTPIsOKFloat(p25v) && JKQTPIsOKFloat(p75v)) {
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setBrush(b);
|
||||
painter.drawRect(QRectF(p25, ymi, fabs(p75-p25), fabs(yma-ymi)));
|
||||
if (JKQTPIsOKFloat(p25v)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labQ25]="\\ul{"+sl[labQ25]+"}";
|
||||
sll[labQ25]="\\ul{"+sll[labQ25]+"}";
|
||||
addHitTestData(p25v, yv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (JKQTPIsOKFloat(p75v)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labQ75]="\\ul{"+sl[labQ75]+"}";
|
||||
sll[labQ75]="\\ul{"+sll[labQ75]+"}";
|
||||
addHitTestData(p75v, yv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
}
|
||||
|
||||
if (drawMedian) {
|
||||
if (drawMedian && JKQTPIsOKFloat(medianv)) {
|
||||
painter.drawLine(QLineF(median, ymi, median, yma));
|
||||
}
|
||||
if (JKQTPIsOKFloat(medianv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMedian]="\\ul{"+sl[labMedian]+"}";
|
||||
sll[labMedian]="\\ul{"+sll[labMedian]+"}";
|
||||
addHitTestData(medianv, yv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
} }
|
||||
if (drawMinMax) {
|
||||
painter.drawLine(QLineF(max, y-w/4.0, max, y+w/4.0));
|
||||
painter.drawLine(QLineF(min, y-w/4.0, min, y+w/4.0));
|
||||
if (JKQTPIsOKFloat(maxv)) painter.drawLine(QLineF(max, y-w/4.0, max, y+w/4.0));
|
||||
if (JKQTPIsOKFloat(minv)) painter.drawLine(QLineF(min, y-w/4.0, min, y+w/4.0));
|
||||
painter.setPen(pw);
|
||||
painter.drawLine(QLineF(max, y, p75, y));
|
||||
painter.drawLine(QLineF(min, y, p25, y));
|
||||
if (JKQTPIsOKFloat(maxv)) painter.drawLine(QLineF(max, y, p75, y));
|
||||
if (JKQTPIsOKFloat(minv)) painter.drawLine(QLineF(min, y, p25, y));
|
||||
if (JKQTPIsOKFloat(minv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMin]="\\ul{"+sl[labMin]+"}";
|
||||
sll[labMin]="\\ul{"+sll[labMin]+"}";
|
||||
addHitTestData(minv, yv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
if (JKQTPIsOKFloat(maxv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMax]="\\ul{"+sl[labMax]+"}";
|
||||
sll[labMax]="\\ul{"+sll[labMax]+"}";
|
||||
addHitTestData(maxv, yv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (drawMean) {
|
||||
double mean=transformY(this->mean);
|
||||
if (drawMean && JKQTPIsOKFloat(meanv)) {
|
||||
double mean=transformY(meanv);
|
||||
plotStyledSymbol(parent, painter, mean, y);
|
||||
if (JKQTPIsOKFloat(meanv)) {
|
||||
QStringList sl=labelValues, sll=labelNames;
|
||||
sl[labMean]="\\ul{"+sl[labMean]+"}";
|
||||
sll[labMean]="\\ul{"+sll[labMean]+"}";
|
||||
addHitTestData(meanv, yv, "\\ensuremath{\\begin{bmatrix}"+sll.join("\\\\")+"\\end{bmatrix}\\;=\\;\\begin{bmatrix}"+sl.join("\\\\")+"\\end{bmatrix}}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -49,11 +49,9 @@ class JKQTP_LIB_EXPORT JKQTPGraphBoxplotStyleMixin: public JKQTPGraphLineStyleMi
|
||||
|
||||
|
||||
|
||||
/*! \copydoc whiskerStyle
|
||||
\see see whiskerStyle for details */
|
||||
void setWhiskerLineStyle(const Qt::PenStyle & __value);
|
||||
/*! \copydoc whiskerStyle
|
||||
\see see whiskerStyle for details */
|
||||
/*! \brief set the line style of whisker lines */
|
||||
void setWhiskerLineStyle(Qt::PenStyle __value);
|
||||
/*! \brief get the line style of whisker lines */
|
||||
Qt::PenStyle getWhiskerLineStyle() const;
|
||||
|
||||
/*! \copydoc boxWidth
|
||||
@ -63,20 +61,58 @@ class JKQTP_LIB_EXPORT JKQTPGraphBoxplotStyleMixin: public JKQTPGraphLineStyleMi
|
||||
\see see boxWidth for details */
|
||||
double getBoxWidth() const;
|
||||
|
||||
/*! \copydoc whiskerLineWidth
|
||||
\see see whiskerLineWidth for details */
|
||||
/*! \brief set the width [pt] of whisker lines */
|
||||
void setWhiskerLineWidth(double __value);
|
||||
/*! \copydoc whiskerLineWidth
|
||||
\see see whiskerLineWidth for details */
|
||||
/*! \brief get the width [pt] of whisker lines */
|
||||
double getWhiskerLineWidth() const;
|
||||
|
||||
/*! \copydoc whiskerLineColor
|
||||
\see see whiskerLineColor for details */
|
||||
/*! \brief set the color of whisker lines */
|
||||
void setWhiskerLineColor(QColor __value);
|
||||
/*! \copydoc whiskerLineColor
|
||||
\see see whiskerLineColor for details */
|
||||
/*! \brief get the color of whisker lines */
|
||||
QColor getWhiskerLineColor() const;
|
||||
|
||||
|
||||
/** \brief sets the dash offset for a custom dash style of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
|
||||
*/
|
||||
void setWhiskerLineDashOffset(qreal offset);
|
||||
/** \brief returns the dash offset for a custom dash style of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
|
||||
*/
|
||||
qreal getWhiskerLineDashOffset() const;
|
||||
/** \brief sets the dash pattern for a custom dash style of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
|
||||
*/
|
||||
void setWhiskerLineDashPattern(const QVector<qreal> &pattern);
|
||||
/** \brief gets the dash pattern for a custom dash style of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
|
||||
*/
|
||||
QVector<qreal> getWhiskerLineDashPattern() const;
|
||||
/** \brief sets the join style of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
|
||||
*/
|
||||
void setWhiskerLineJoinStyle(Qt::PenJoinStyle style);
|
||||
/** \brief returns the join style of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
|
||||
*/
|
||||
Qt::PenJoinStyle getWhiskerLineJoinStyle() const;
|
||||
/** \brief sets the cap style of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
|
||||
*/
|
||||
void setWhiskerLineCapStyle(Qt::PenCapStyle style);
|
||||
/** \brief gets the cap style of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
|
||||
*/
|
||||
Qt::PenCapStyle getWhiskerLineCapStyle() const;
|
||||
/** \brief sets the brush used to fill the line area of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setBrush
|
||||
*/
|
||||
void setWhiskerLineBrush(const QBrush& style);
|
||||
/** \brief gets the brush used to fill the line area of whisker lines
|
||||
* \see https://doc.qt.io/qt-5/qpen.html#setBrush
|
||||
*/
|
||||
QBrush getWhiskerLineBrush() const;
|
||||
|
||||
/** \brief build a pen to be used for drawing whiskers */
|
||||
QPen getWhiskerPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const;
|
||||
|
||||
@ -85,13 +121,11 @@ class JKQTP_LIB_EXPORT JKQTPGraphBoxplotStyleMixin: public JKQTPGraphLineStyleMi
|
||||
void setBoxplotColor(QColor c, JKQTBasePlotter *parent);
|
||||
private:
|
||||
/** \brief line style of the whisker lines */
|
||||
Qt::PenStyle whiskerLineStyle;
|
||||
QPen m_whiskerLinePen;
|
||||
/** \brief line width (in pt) of the whisker lines */
|
||||
double whiskerLineWidth;
|
||||
/** \brief color of the whisker lines */
|
||||
QColor whiskerLineColor;
|
||||
/** \brief width of box in percent of distance between the current two posColumn values
|
||||
* if we only plot one box&whiskers then this is the width in plot coordinates */
|
||||
* if we only plot one box&whiskers then this is the width in pt */
|
||||
double boxWidth;
|
||||
|
||||
};
|
||||
@ -113,6 +147,10 @@ class JKQTP_LIB_EXPORT JKQTPGraphBoxplotStyleMixin: public JKQTPGraphLineStyleMi
|
||||
|
||||
\image html boxplots.png
|
||||
|
||||
This class also implements hitTest() in a way that displays all data of the boxplot in the tooltips:
|
||||
|
||||
\image html tooltip_boxplot.png
|
||||
|
||||
\note There are additional classes to draw a single boxplot element: JKQTPBoxplotHorizontalElement and JKQTPBoxplotVerticalElement.
|
||||
In these you can set the data values, as they are NOT drawn from a data column. This can be useful, if you e.g. want to
|
||||
draw the statistical properties of a distribution.
|
||||
|
@ -272,13 +272,13 @@ class JKQTP_LIB_EXPORT JKQTPXFunctionLineGraph: public JKQTPGraph, public JKQTPG
|
||||
|
||||
/*! \copydoc errorColor
|
||||
\see see errorColor for details */
|
||||
inline virtual void setErrorColor(const QColor & __value)
|
||||
inline virtual void setErrorLineColor(const QColor & __value)
|
||||
{
|
||||
this->errorColor = __value;
|
||||
}
|
||||
/*! \copydoc errorColor
|
||||
\see see errorColor for details */
|
||||
inline virtual QColor getErrorColor() const
|
||||
inline virtual QColor getErrorLineColor() const
|
||||
{
|
||||
return this->errorColor;
|
||||
}
|
||||
@ -296,7 +296,7 @@ class JKQTP_LIB_EXPORT JKQTPXFunctionLineGraph: public JKQTPGraph, public JKQTPG
|
||||
}
|
||||
/*! \copydoc errorFillStyle
|
||||
\see see errorFillStyle for details */
|
||||
inline virtual void setErrorFillStyle(const Qt::BrushStyle & __value)
|
||||
inline virtual void setErrorFillStyle(Qt::BrushStyle __value)
|
||||
{
|
||||
this->errorFillStyle = __value;
|
||||
}
|
||||
@ -308,13 +308,13 @@ class JKQTP_LIB_EXPORT JKQTPXFunctionLineGraph: public JKQTPGraph, public JKQTPG
|
||||
}
|
||||
/*! \copydoc errorStyle
|
||||
\see see errorStyle for details */
|
||||
inline virtual void setErrorStyle(const Qt::PenStyle & __value)
|
||||
inline virtual void setErrorLineStyle(Qt::PenStyle __value)
|
||||
{
|
||||
this->errorStyle = __value;
|
||||
}
|
||||
/*! \copydoc errorStyle
|
||||
\see see errorStyle for details */
|
||||
inline virtual Qt::PenStyle getErrorStyle() const
|
||||
inline virtual Qt::PenStyle getErrorLineStyle() const
|
||||
{
|
||||
return this->errorStyle;
|
||||
}
|
||||
|
@ -71,11 +71,10 @@ JKQTPFilledCurveYGraph::JKQTPFilledCurveYGraph(JKQTPlotter *parent):
|
||||
|
||||
|
||||
JKQTPFilledCurveXErrorGraph::JKQTPFilledCurveXErrorGraph(JKQTBasePlotter *parent):
|
||||
JKQTPFilledCurveXGraph(parent), JKQTPYGraphErrors(getLineColor(), parent)
|
||||
JKQTPFilledCurveXGraph(parent)
|
||||
{
|
||||
setErrorColorFromGraphColor(getLineColor());
|
||||
if (parentPlotStyle>=0) setErrorStyleFromPen(parent->getPlotStyle(parentPlotStyle));
|
||||
|
||||
initErrorStyle(parent, parentPlotStyle);
|
||||
}
|
||||
|
||||
JKQTPFilledCurveXErrorGraph::JKQTPFilledCurveXErrorGraph(JKQTPlotter *parent):
|
||||
@ -97,10 +96,10 @@ void JKQTPFilledCurveXErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &painter)
|
||||
}
|
||||
|
||||
JKQTPFilledCurveYErrorGraph::JKQTPFilledCurveYErrorGraph(JKQTBasePlotter *parent):
|
||||
JKQTPFilledCurveYGraph(parent), JKQTPXGraphErrors(getLineColor(), parent)
|
||||
JKQTPFilledCurveYGraph(parent)
|
||||
{
|
||||
setErrorColorFromGraphColor(getLineColor());
|
||||
if (parentPlotStyle>=0) setErrorStyleFromPen(parent->getPlotStyle(parentPlotStyle));
|
||||
initErrorStyle(parent, parentPlotStyle);
|
||||
|
||||
}
|
||||
|
||||
|
@ -225,6 +225,7 @@ bool JKQTPGeoText::getYMinMax(double& miny, double& maxy, double& smallestGreate
|
||||
}
|
||||
|
||||
void JKQTPGeoText::draw(JKQTPEnhancedPainter& painter) {
|
||||
clearHitTestData();
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
parent->getMathText()->setFontRomanOrSpecial(getTextFontName());
|
||||
parent->getMathText()->setFontSize(getTextFontSize()*parent->getFontSizeMultiplier());
|
||||
@ -300,10 +301,16 @@ bool JKQTPGeoLine::getYMinMax(double& miny, double& maxy, double& smallestGreate
|
||||
}
|
||||
|
||||
void JKQTPGeoLine::draw(JKQTPEnhancedPainter& painter) {
|
||||
clearHitTestData();
|
||||
reserveHitTestData(2);
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(getLinePen(painter, parent));
|
||||
QLineF l(QPointF(transformX(x1), transformY(y1)), QPointF(transformX(x2), transformY(y2)));
|
||||
if (l.length()>0) painter.drawLine(l);
|
||||
if (l.length()>0) {
|
||||
painter.drawLine(l);
|
||||
addHitTestData(x1, y1);
|
||||
addHitTestData(x2, y2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -384,6 +391,8 @@ bool JKQTPGeoInfiniteLine::getYMinMax(double& miny, double& maxy, double& smalle
|
||||
}
|
||||
|
||||
void JKQTPGeoInfiniteLine::draw(JKQTPEnhancedPainter& painter) {
|
||||
clearHitTestData();
|
||||
reserveHitTestData(2);
|
||||
|
||||
double xmin=parent->getXAxis()->getMin();
|
||||
double xmax=parent->getXAxis()->getMax();
|
||||
@ -503,7 +512,14 @@ void JKQTPGeoInfiniteLine::draw(JKQTPEnhancedPainter& painter) {
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(getLinePen(painter, parent));
|
||||
QLineF l(QPointF(transformX(x1), transformY(y1)), QPointF(transformX(x2), transformY(y2)));
|
||||
if (l.length()>0) painter.drawLine(l);
|
||||
if (l.length()>0) {
|
||||
painter.drawLine(l);
|
||||
addHitTestData(x, y, formatHitTestDefaultLabel(x,y)+
|
||||
QString(", \\ensuremath{\\mathrm{\\mathbf{d}}y/\\mathrm{\\mathbf{d}}x\\;=\\;%1/%2\\;=\\;%3\\;=\\;%4\\degree}").arg(QString::fromStdString(jkqtp_floattolatexstr(dy, 3))).arg(QString::fromStdString(jkqtp_floattolatexstr(dx, 3))).arg(QString::fromStdString(jkqtp_floattolatexstr(dy/dx, 3))).arg(QString::fromStdString(jkqtp_floattolatexstr(atan2(dy,dx), 1))));
|
||||
addHitTestData(x1, y1);
|
||||
addHitTestData(x2, y2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -625,10 +641,16 @@ bool JKQTPGeoPolyLines::getYMinMax(double& miny, double& maxy, double& smallestG
|
||||
}
|
||||
|
||||
void JKQTPGeoPolyLines::draw(JKQTPEnhancedPainter& painter) {
|
||||
clearHitTestData();
|
||||
reserveHitTestData(points.size());
|
||||
|
||||
QPainterPath path=transformToLinePath(points);
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(getLinePen(painter, parent));
|
||||
painter.drawPath(path);
|
||||
for (const auto& p:points) {
|
||||
addHitTestData(p.x(), p.y());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -754,11 +776,16 @@ QPolygonF JKQTPGeoRectangle::getPolygon() {
|
||||
}
|
||||
|
||||
void JKQTPGeoRectangle::draw(JKQTPEnhancedPainter& painter) {
|
||||
clearHitTestData();
|
||||
QPolygonF poly=getPolygon();
|
||||
reserveHitTestData(poly.size());
|
||||
QPolygonF rect;
|
||||
for (int i=0; i<poly.size(); i++) {
|
||||
rect.append(QPointF(transformX(poly[i].x()), transformY(poly[i].y())));
|
||||
}
|
||||
for (const auto& p:poly) {
|
||||
addHitTestData(p.x(), p.y());
|
||||
}
|
||||
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(getLinePenForRects(painter, parent));
|
||||
@ -886,11 +913,16 @@ bool JKQTPGeoPolygon::getYMinMax(double& miny, double& maxy, double& smallestGre
|
||||
}
|
||||
|
||||
void JKQTPGeoPolygon::draw(JKQTPEnhancedPainter& painter) {
|
||||
clearHitTestData();
|
||||
reserveHitTestData(points.size());
|
||||
QPolygonF path=transformToPolygon(points);
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(getLinePen(painter, parent));
|
||||
painter.setBrush(getFillBrush(painter, parent));
|
||||
painter.drawPolygon(path);
|
||||
for (const auto& p:points) {
|
||||
addHitTestData(p.x(), p.y());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -956,7 +988,6 @@ void JKQTPGeoEllipse::draw(JKQTPEnhancedPainter& painter) {
|
||||
rect=transformToLinePath(JKQTPDrawEllipse(x,y,width/2.0, height/2.0,0,360,angle, controlPoints));
|
||||
rect.closeSubpath();
|
||||
|
||||
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
painter.setPen(getLinePen(painter, parent));
|
||||
painter.setBrush(getFillBrush(painter, parent));
|
||||
@ -1320,9 +1351,10 @@ bool JKQTPGeoSymbol::getYMinMax(double &miny, double &maxy, double &smallestGrea
|
||||
|
||||
void JKQTPGeoSymbol::draw(JKQTPEnhancedPainter &painter)
|
||||
{
|
||||
clearHitTestData();
|
||||
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
|
||||
plotStyledSymbol(parent, painter, transformX(x), transformY(y));
|
||||
|
||||
addHitTestData(x,y);
|
||||
}
|
||||
|
||||
void JKQTPGeoSymbol::drawKeyMarker(JKQTPEnhancedPainter &painter, QRectF &rect)
|
||||
|
@ -263,11 +263,10 @@ void JKQTPImpulsesVerticalGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
|
||||
|
||||
JKQTPImpulsesHorizontalErrorGraph::JKQTPImpulsesHorizontalErrorGraph(JKQTBasePlotter *parent):
|
||||
JKQTPImpulsesHorizontalGraph(parent), JKQTPXGraphErrors(getLineColor(), parent)
|
||||
JKQTPImpulsesHorizontalGraph(parent)
|
||||
{
|
||||
setErrorColorFromGraphColor(getLineColor());
|
||||
if (parentPlotStyle>=0) setErrorStyleFromPen(parent->getPlotStyle(parentPlotStyle));
|
||||
|
||||
initErrorStyle(parent, parentPlotStyle);
|
||||
}
|
||||
|
||||
JKQTPImpulsesHorizontalErrorGraph::JKQTPImpulsesHorizontalErrorGraph(JKQTPlotter *parent):
|
||||
@ -288,10 +287,10 @@ void JKQTPImpulsesHorizontalErrorGraph::drawErrorsAfter(JKQTPEnhancedPainter &pa
|
||||
}
|
||||
|
||||
JKQTPImpulsesVerticalErrorGraph::JKQTPImpulsesVerticalErrorGraph(JKQTBasePlotter *parent):
|
||||
JKQTPImpulsesVerticalGraph(parent), JKQTPYGraphErrors(getLineColor(), parent)
|
||||
JKQTPImpulsesVerticalGraph(parent)
|
||||
{
|
||||
setErrorColorFromGraphColor(getLineColor());
|
||||
if (parentPlotStyle>=0) setErrorStyleFromPen(parent->getPlotStyle(parentPlotStyle));
|
||||
initErrorStyle(parent, parentPlotStyle);
|
||||
}
|
||||
|
||||
JKQTPImpulsesVerticalErrorGraph::JKQTPImpulsesVerticalErrorGraph(JKQTPlotter *parent):
|
||||
|
@ -114,6 +114,7 @@ void JKQTPPeakStreamGraph::draw(JKQTPEnhancedPainter &painter)
|
||||
const double xv=datastore->get(dataColumn,static_cast<size_t>(i));
|
||||
if (JKQTPIsOKFloat(xv)) {
|
||||
lines<<QLineF(transform(xv, baseline), transform(xv, baseline+peakHeight));
|
||||
addHitTestData(xv, (baseline+peakHeight)/2.0,iii, datastore);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -126,6 +127,7 @@ void JKQTPPeakStreamGraph::draw(JKQTPEnhancedPainter &painter)
|
||||
const double yv=datastore->get(dataColumn,static_cast<size_t>(i));
|
||||
if (JKQTPIsOKFloat(yv)) {
|
||||
lines<<QLineF(transform(baseline, yv), transform(baseline+peakHeight, yv));
|
||||
addHitTestData((baseline+peakHeight)/2.0, yv,iii, datastore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ QColor JKQTPHorizontalRange::getCenterColor() const
|
||||
return this->centerColor;
|
||||
}
|
||||
|
||||
void JKQTPHorizontalRange::setCenterStyle(const Qt::PenStyle &__value)
|
||||
void JKQTPHorizontalRange::setCenterStyle(Qt::PenStyle __value)
|
||||
{
|
||||
this->centerStyle = __value;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ class JKQTP_LIB_EXPORT JKQTPHorizontalRange: public JKQTPGraph, public JKQTPGrap
|
||||
QColor getCenterColor() const;
|
||||
/*! \copydoc centerStyle
|
||||
\see see centerStyle for details */
|
||||
void setCenterStyle(const Qt::PenStyle & __value);
|
||||
void setCenterStyle(Qt::PenStyle __value);
|
||||
/*! \copydoc centerStyle
|
||||
\see see centerStyle for details */
|
||||
Qt::PenStyle getCenterStyle() const;
|
||||
|
@ -108,21 +108,13 @@ void JKQTPXYLineGraph::draw(JKQTPEnhancedPainter& painter) {
|
||||
if (isHighlighted() && getSymbolType()!=JKQTPNoSymbol) {
|
||||
//JKQTPPlotSymbol(painter, x, y, JKQTPFilledCircle, parent->pt2px(painter, symbolSize*1.5), parent->pt2px(painter, symbolWidth*parent->getLineWidthMultiplier()), penSelection.color(), penSelection.color());
|
||||
}
|
||||
plotStyledSymbol(parent, painter, x, y);
|
||||
/*if (drawLine && first) {
|
||||
double xl1=xold;
|
||||
double yl1=yold;
|
||||
double xl2=x;
|
||||
double yl2=y;
|
||||
lines.append(QLineF(xl1, yl1, xl2, yl2));
|
||||
}*/
|
||||
if ((!parent->getXAxis()->isLogAxis() || xv>0.0) && (!parent->getYAxis()->isLogAxis() || yv>0.0) ) {
|
||||
plotStyledSymbol(parent, painter, x, y);
|
||||
}
|
||||
if (drawLine) {
|
||||
linesP<<QPointF(x,y);
|
||||
|
||||
}
|
||||
// xold=x;
|
||||
// yold=y;
|
||||
// first=true;
|
||||
}
|
||||
}
|
||||
//qDebug()<<"JKQTPXYLineGraph::draw(): "<<4<<" lines="<<lines.size();
|
||||
@ -191,10 +183,10 @@ void JKQTPXYLineGraph::setColor(QColor c)
|
||||
|
||||
|
||||
JKQTPXYLineErrorGraph::JKQTPXYLineErrorGraph(JKQTBasePlotter *parent):
|
||||
JKQTPXYLineGraph(parent), JKQTPXYGraphErrors(getSymbolColor(), parent)
|
||||
JKQTPXYLineGraph(parent)
|
||||
{
|
||||
setErrorColorFromGraphColor(getSymbolColor());
|
||||
if (parentPlotStyle>=0) setErrorStyleFromPen(parent->getPlotStyle(parentPlotStyle));
|
||||
initErrorStyle(parent, parentPlotStyle);
|
||||
}
|
||||
|
||||
JKQTPXYLineErrorGraph::JKQTPXYLineErrorGraph(JKQTPlotter *parent):
|
||||
@ -436,10 +428,12 @@ void JKQTPXYParametrizedScatterGraph::draw(JKQTPEnhancedPainter &painter)
|
||||
linewidths<<lineW;
|
||||
}
|
||||
|
||||
if (isHighlighted() && getSymbolType()!=JKQTPNoSymbol && symbolColumn<0) {
|
||||
JKQTPPlotSymbol(painter, x, y, JKQTPFilledCircle,symbSize, parent->pt2px(painter, getSymbolLineWidth()*parent->getLineWidthMultiplier()), penSelection.color(), penSelection.color());
|
||||
} else {
|
||||
JKQTPPlotSymbol(painter, x, y, getLocalSymbolType(i), symbSize, parent->pt2px(painter, getSymbolLineWidth()*parent->getLineWidthMultiplier()), symbColor, symbFillColor);
|
||||
if ((!parent->getXAxis()->isLogAxis() || xv>0.0) && (!parent->getYAxis()->isLogAxis() || yv>0.0) ) {
|
||||
if (isHighlighted() && getSymbolType()!=JKQTPNoSymbol && symbolColumn<0) {
|
||||
JKQTPPlotSymbol(painter, x, y, JKQTPFilledCircle,symbSize, parent->pt2px(painter, getSymbolLineWidth()*parent->getLineWidthMultiplier()), penSelection.color(), penSelection.color());
|
||||
} else {
|
||||
JKQTPPlotSymbol(painter, x, y, getLocalSymbolType(i), symbSize, parent->pt2px(painter, getSymbolLineWidth()*parent->getLineWidthMultiplier()), symbColor, symbFillColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -886,10 +880,10 @@ JKQTPGraphSymbols JKQTPXYParametrizedScatterGraph::getLocalSymbolType(int i)
|
||||
|
||||
|
||||
JKQTPXYParametrizedErrorScatterGraph::JKQTPXYParametrizedErrorScatterGraph(JKQTBasePlotter *parent):
|
||||
JKQTPXYParametrizedScatterGraph(parent), JKQTPXYGraphErrors(getSymbolColor(), parent)
|
||||
JKQTPXYParametrizedScatterGraph(parent)
|
||||
{
|
||||
setErrorColorFromGraphColor(getSymbolColor());
|
||||
if (parentPlotStyle>=0) setErrorStyleFromPen(parent->getPlotStyle(parentPlotStyle));
|
||||
initErrorStyle(parent, parentPlotStyle);
|
||||
}
|
||||
|
||||
JKQTPXYParametrizedErrorScatterGraph::JKQTPXYParametrizedErrorScatterGraph(JKQTPlotter *parent):
|
||||
@ -997,10 +991,10 @@ void JKQTPXYParametrizedErrorScatterGraph::drawErrorsBefore(JKQTPEnhancedPainter
|
||||
else plotErrorIndicators(painter, parent, this, xColumn, yColumn, 0, 0, &sortedIndices);
|
||||
}
|
||||
|
||||
bool JKQTPXYParametrizedErrorScatterGraph::intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter &/*painter*/, JKQTBasePlotter * /*parent*/, JKQTPGraph* /*parentGraph*/, int /*xColumn*/, int /*yColumn*/, int /*xErrorColumn*/, int /*yErrorColumn*/, JKQTPErrorPlotstyle /*xErrorStyle*/, JKQTPErrorPlotstyle /*yErrorStyle*/, int index, QColor &/*errorColor*/, QColor &/*errorFillColor*/)
|
||||
bool JKQTPXYParametrizedErrorScatterGraph::intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter &/*painter*/, JKQTBasePlotter * /*parent*/, JKQTPGraph* /*parentGraph*/, int /*xColumn*/, int /*yColumn*/, int /*xErrorColumn*/, int /*yErrorColumn*/, JKQTPErrorPlotstyle /*xErrorStyle*/, JKQTPErrorPlotstyle /*yErrorStyle*/, int index, QColor &errorLineColor, QColor &errorFillColor)
|
||||
{
|
||||
QColor c=getLocalColor(index);
|
||||
errorColor=c.darker();
|
||||
errorLineColor=c.darker();
|
||||
errorFillColor=c.lighter();
|
||||
//qDebug()<<"intPlotXYErrorIndicatorsGetColor("<<index<<"): "<<errorColor;
|
||||
return true;
|
||||
|
@ -461,7 +461,7 @@ class JKQTP_LIB_EXPORT JKQTPXYParametrizedErrorScatterGraph: public JKQTPXYParam
|
||||
/** \brief this function can be used to set the color of the error indicators automatically
|
||||
*
|
||||
* return \c true and the colors to use, if applicable, the default implementation returns false */
|
||||
virtual bool intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int index, QColor& errorColor, QColor& errorFillColor) override;
|
||||
virtual bool intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter& painter, JKQTBasePlotter* parent, JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int index, QColor& errorLineColor, QColor& errorFillColor) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -91,6 +91,8 @@ void JKQTPSingleColumnSymbolsGraph::draw(JKQTPEnhancedPainter &painter)
|
||||
#ifdef JKQTBP_AUTOTIMER
|
||||
JKQTPAutoOutputTimer jkaaot("JKQTPSingleColumnSymbolsGraph::draw");
|
||||
#endif
|
||||
clearHitTestData();
|
||||
|
||||
if (parent==nullptr) return;
|
||||
JKQTPDatastore* datastore=parent->getDatastore();
|
||||
if (datastore==nullptr) return;
|
||||
@ -109,6 +111,7 @@ void JKQTPSingleColumnSymbolsGraph::draw(JKQTPEnhancedPainter &painter)
|
||||
}
|
||||
if (imin<0) imin=0;
|
||||
if (imax<0) imax=0;
|
||||
reserveHitTestData(imax-imin);
|
||||
|
||||
std::random_device rd; // random number generators:
|
||||
std::minstd_rand gen{rd()};
|
||||
@ -152,6 +155,7 @@ void JKQTPSingleColumnSymbolsGraph::draw(JKQTPEnhancedPainter &painter)
|
||||
plotSymbols.append(QPointF(x,y));
|
||||
if (JKQTPIsOKFloat(xv) && JKQTPIsOKFloat(yv)) {
|
||||
plotStyledSymbol(parent, painter, x, y);
|
||||
addHitTestData(xv, yv,iii, datastore);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -178,6 +182,7 @@ void JKQTPSingleColumnSymbolsGraph::draw(JKQTPEnhancedPainter &painter)
|
||||
if (JKQTPIsOKFloat(xv) && JKQTPIsOKFloat(yv)) {
|
||||
plotSymbols.append(QPointF(x,y));
|
||||
plotStyledSymbol(parent, painter, x, y);
|
||||
addHitTestData(xv, yv,iii, datastore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,6 +80,32 @@ JKQTPlotter::JKQTPlotter(bool datastore_internal, QWidget* parent, JKQTPDatastor
|
||||
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
|
||||
actgrpMouseLeft=new QActionGroup(this);
|
||||
actMouseLeftAsDefault=actgrpMouseLeft->addAction(QIcon(":/JKQTPlotter/jkqtp_mouseact_default.png"), tr("Default Tool"));
|
||||
actMouseLeftAsDefault->setToolTip(tr("switch back to the default mouse action/tool (left button, no modifiers)"));
|
||||
actMouseLeftAsDefault->setCheckable(true);
|
||||
actMouseLeftAsPanView=actgrpMouseLeft->addAction(QIcon(":/JKQTPlotter/jkqtp_mouseact_drag.png"), tr("Pan View Tool"));
|
||||
actMouseLeftAsPanView->setToolTip(tr("switch on the pan view tool (left button, no modifiers)"));
|
||||
actMouseLeftAsPanView->setCheckable(true);
|
||||
actMouseLeftAsZoomRect=actgrpMouseLeft->addAction(QIcon(":/JKQTPlotter/jkqtp_mouseact_zoomrect.png"), tr("Zoom Rectangle Tool"));
|
||||
actMouseLeftAsZoomRect->setToolTip(tr("switch on the zoom rectangle tool (left button, no modifiers)"));
|
||||
actMouseLeftAsZoomRect->setCheckable(true);
|
||||
actMouseLeftAsRuler=actgrpMouseLeft->addAction(QIcon(":/JKQTPlotter/jkqtp_mouseact_ruler.png"), tr("Ruler Tool"));
|
||||
actMouseLeftAsRuler->setToolTip(tr("switch on the ruler tool (left button, no modifiers)"));
|
||||
actMouseLeftAsRuler->setCheckable(true);
|
||||
actMouseLeftAsToolTip=actgrpMouseLeft->addAction(QIcon(":/JKQTPlotter/jkqtp_mouseact_tooltip.png"), tr("Data Tooltip Tool"));
|
||||
actMouseLeftAsToolTip->setToolTip(tr("switch on the data tooltip tool (left button, no modifiers)"));
|
||||
actMouseLeftAsToolTip->setCheckable(true);
|
||||
actgrpMouseLeft->setExclusive(true);
|
||||
actMouseLeftAsDefault->setChecked(true);
|
||||
|
||||
connect(actMouseLeftAsDefault, SIGNAL(triggered()), this, SLOT(resetMouseLeftAction()));
|
||||
connect(actMouseLeftAsRuler, SIGNAL(triggered()), this, SLOT(setMouseLeftActionAsRuler()));
|
||||
connect(actMouseLeftAsToolTip, SIGNAL(triggered()), this, SLOT(setMouseLeftActionAsToolTip()));
|
||||
connect(actMouseLeftAsPanView, SIGNAL(triggered()), this, SLOT(setMouseLeftActionAsPanView()));
|
||||
connect(actMouseLeftAsZoomRect, SIGNAL(triggered()), this, SLOT(setMouseLeftActionAsZoomRect()));
|
||||
|
||||
|
||||
toolbar=new JKVanishQToolBar(this);
|
||||
toolbar->clear();
|
||||
toolbar->move(1,1);
|
||||
@ -88,12 +114,11 @@ JKQTPlotter::JKQTPlotter(bool datastore_internal, QWidget* parent, JKQTPDatastor
|
||||
toolbar->addSeparator();
|
||||
toolbar->addSeparator();
|
||||
populateToolbar(toolbar);
|
||||
|
||||
contextMenu=nullptr;//new QMenu(this);
|
||||
|
||||
QSize s=QSize(plotterStyle.toolbarIconSize, plotterStyle.toolbarIconSize);
|
||||
toolbar->setIconSize(s);
|
||||
|
||||
contextMenu=nullptr;//new QMenu(this);
|
||||
|
||||
//move(32,32);
|
||||
resize(400,300);
|
||||
doDrawing=true;
|
||||
@ -186,27 +211,125 @@ bool JKQTPlotter::isMousePositionShown() const
|
||||
}
|
||||
|
||||
|
||||
void JKQTPlotter::setUserActionColor(const QColor &__value)
|
||||
void JKQTPlotter::setUserActionOverlayPen(const QPen &__value)
|
||||
{
|
||||
if (plotterStyle.userActionColor != __value) {
|
||||
plotterStyle.userActionColor = __value;
|
||||
if (plotterStyle.userActionOverlayPen != __value) {
|
||||
plotterStyle.userActionOverlayPen = __value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
QColor JKQTPlotter::getUserActionColor() const
|
||||
QPen JKQTPlotter::getUserActionOverlayPen() const
|
||||
{
|
||||
return plotterStyle.userActionColor;
|
||||
return plotterStyle.userActionOverlayPen;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setUserActionCompositionMode(const QPainter::CompositionMode &__value)
|
||||
void JKQTPlotter::setUserActionOverlayBrush(const QBrush &__value)
|
||||
{
|
||||
if (plotterStyle.userActionCompositionMode != __value) {
|
||||
plotterStyle.userActionCompositionMode = __value;
|
||||
if (plotterStyle.userActionOverlayBrush != __value) {
|
||||
plotterStyle.userActionOverlayBrush = __value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
QBrush JKQTPlotter::getUserActionOverlayBrush() const
|
||||
{
|
||||
return plotterStyle.userActionOverlayBrush;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setUserActionOpaquePen(const QPen &__value)
|
||||
{
|
||||
if (plotterStyle.userActionOpaquePen != __value) {
|
||||
plotterStyle.userActionOpaquePen = __value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
QPen JKQTPlotter::getUserActionOpaquePen() const
|
||||
{
|
||||
return plotterStyle.userActionOpaquePen;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setUserActionOpaqueBrush(const QBrush &__value)
|
||||
{
|
||||
if (plotterStyle.userActionOpaqueBrush != __value) {
|
||||
plotterStyle.userActionOpaqueBrush = __value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
QBrush JKQTPlotter::getUserActionOpaqueBrush() const
|
||||
{
|
||||
return plotterStyle.userActionOpaqueBrush;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setUserActionMarkerPen(const QPen &__value)
|
||||
{
|
||||
if (plotterStyle.userActionMarkerPen != __value) {
|
||||
plotterStyle.userActionMarkerPen = __value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
QPen JKQTPlotter::getUserActionMarkerPen() const
|
||||
{
|
||||
return plotterStyle.userActionMarkerPen;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setUserActionMarkerBrush(const QBrush &__value)
|
||||
{
|
||||
if (plotterStyle.userActionMarkerBrush != __value) {
|
||||
plotterStyle.userActionMarkerBrush = __value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
QBrush JKQTPlotter::getUserActionMarkerBrush() const
|
||||
{
|
||||
return plotterStyle.userActionMarkerBrush;
|
||||
}
|
||||
|
||||
|
||||
void JKQTPlotter::setMaxTooltipDistance(int v)
|
||||
{
|
||||
plotterStyle.maxTooltipDistance=v;
|
||||
}
|
||||
|
||||
int JKQTPlotter::getMaxTooltipDistance() const
|
||||
{
|
||||
return plotterStyle.maxTooltipDistance;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setUserActionCatchSensitivity(int v)
|
||||
{
|
||||
plotterStyle.userActionCatchSensitivity=v;
|
||||
}
|
||||
|
||||
int JKQTPlotter::getUserActionCatchSensitivity() const
|
||||
{
|
||||
return plotterStyle.userActionCatchSensitivity;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setUserActionMarkerDiameter(int v)
|
||||
{
|
||||
plotterStyle.userActionMarkerDiameter=v;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setUserActionMarkerType(JKQTPUserActionMarkerType v)
|
||||
{
|
||||
plotterStyle.userActionMarkerType=v;
|
||||
}
|
||||
|
||||
int JKQTPlotter::getUserActionMarkerDiameter() const
|
||||
{
|
||||
return plotterStyle.userActionMarkerDiameter;
|
||||
}
|
||||
|
||||
JKQTPUserActionMarkerType JKQTPlotter::getUserActionMarkerType() const
|
||||
{
|
||||
return plotterStyle.userActionMarkerType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void JKQTPlotter::registerMouseWheelAction(Qt::KeyboardModifiers modifier, JKQTPMouseWheelActions action)
|
||||
@ -225,10 +348,6 @@ void JKQTPlotter::clearAllMouseWheelActions()
|
||||
}
|
||||
|
||||
|
||||
QPainter::CompositionMode JKQTPlotter::getUserActionCompositionMode() const
|
||||
{
|
||||
return plotterStyle.userActionCompositionMode;
|
||||
}
|
||||
|
||||
|
||||
void JKQTPlotter::loadSettings(const QSettings& settings, const QString& group) {
|
||||
@ -246,18 +365,113 @@ void JKQTPlotter::saveSettings(QSettings& settings, const QString& group) const
|
||||
}
|
||||
|
||||
|
||||
void JKQTPlotter::fillInternalStructForToolTipOfClosestDataPoint(double x0, double y0, bool emitEvent) {
|
||||
bool foundAll=false;
|
||||
QList<QString> labels, titles;
|
||||
QList<QColor> colors;
|
||||
QList<QPointF> posSyss;
|
||||
QList<QImage> keymarkers;
|
||||
QList<JKQTPPlotElement*> graphs;
|
||||
QList<double> ds;
|
||||
double dbest=0;
|
||||
for (size_t i=0; i<getPlotter()->getGraphCount(); i++) {
|
||||
JKQTPPlotElement* g=getPlotter()->getGraph(i);
|
||||
bool found=false;
|
||||
QString label;
|
||||
QPointF posSys;
|
||||
double d=0;
|
||||
if (g && g->isVisible()) {
|
||||
QPointF pp;
|
||||
QString ll;
|
||||
double dist=g->hitTest(QPointF(x0, y0), &pp, &ll, JKQTPPlotElement::HitTestXY);
|
||||
if (JKQTPIsOKFloat(dist)) {
|
||||
if (!found || dist<d) {
|
||||
d=dist;
|
||||
posSys=pp;
|
||||
label=ll;
|
||||
found=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found && g) {
|
||||
if (!foundAll) {
|
||||
dbest=d;
|
||||
labels.clear();
|
||||
labels<<label;
|
||||
titles.clear();
|
||||
titles<<g->getTitle();
|
||||
colors.clear();
|
||||
colors<<g->getKeyLabelColor();
|
||||
posSyss.clear();
|
||||
posSyss<<posSys;
|
||||
ds.clear();
|
||||
ds<<d;
|
||||
keymarkers.clear();
|
||||
keymarkers<<g->generateKeyMarker();
|
||||
graphs.clear();
|
||||
graphs<<g;
|
||||
} else {
|
||||
if (fabs(dbest-d)<=plotterStyle.userActionCatchSensitivity) {
|
||||
labels<<label;
|
||||
titles<<g->getTitle();
|
||||
colors<<g->getKeyLabelColor();
|
||||
posSyss<<posSys;
|
||||
ds<<d;
|
||||
keymarkers<<g->generateKeyMarker();
|
||||
graphs<<g;
|
||||
} else {
|
||||
if (d<dbest) {
|
||||
labels.clear();
|
||||
labels<<label;
|
||||
titles.clear();
|
||||
titles<<g->getTitle();
|
||||
colors.clear();
|
||||
colors<<g->getKeyLabelColor();
|
||||
posSyss.clear();
|
||||
posSyss<<posSys;
|
||||
ds.clear();
|
||||
ds<<d;
|
||||
keymarkers.clear();
|
||||
keymarkers<<g->generateKeyMarker();
|
||||
graphs.clear();
|
||||
graphs<<g;
|
||||
}
|
||||
}
|
||||
if (d<dbest) dbest=d;
|
||||
}
|
||||
foundAll=true;
|
||||
}
|
||||
}
|
||||
if (foundAll && dbest<getCurrentPlotterStyle().maxTooltipDistance) {
|
||||
mouseDragMarkers.clear();
|
||||
QStringList entries;
|
||||
for (int i=0; i<posSyss.size(); i++) {
|
||||
const QPoint posPix=QPointF(getXAxis()->x2p(posSyss[i].x())*magnification, getYAxis()->x2p(posSyss[i].y())*magnification).toPoint();
|
||||
entries<<(titles[i]+": "+labels[i]);
|
||||
mouseDragMarkers<<MouseDragMarker(posPix, labels[i], titles[i], colors[i], keymarkers[i], graphs[i]);
|
||||
}
|
||||
//const QPoint globalPosPix=mapToGlobal(posPix);
|
||||
//const int rectsize=24;
|
||||
//qDebug()<<graph->getTitle()<<" clicked("<<event->pos()<<") ==> posSys="<<posSys<<" / posPix="<<posPix<<" globalPosPix="<<globalPosPix<<", label="<<label<<", distance="<<d;
|
||||
//QToolTip::showText(globalPosPix, graph->getTitle()+":\n"+label, this);//, QRect(posPix.x()-rectsize/2, posPix.y()-rectsize/2, rectsize, rectsize));
|
||||
|
||||
if (emitEvent) {
|
||||
if (mouseDragMarkers.size()>0) {
|
||||
emit tooltipDisplayed(posSyss[0].x(), posSyss[0].y(), entries, graphs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPlotter::paintUserAction() {
|
||||
if (currentMouseDragAction.isValid() && mouseDragingRectangle) {
|
||||
image=oldImage;
|
||||
if (image.width()>0 && image.height()>0 && !image.isNull()) {
|
||||
JKQTPEnhancedPainter painter(&image);
|
||||
QPen p=painter.pen();
|
||||
p.setWidthF(1);
|
||||
p.setColor(plotterStyle.userActionColor.darker());
|
||||
p.setStyle(Qt::DashLine);
|
||||
painter.setPen(p);
|
||||
QPainter::CompositionMode oldCMode=painter.compositionMode();
|
||||
painter.setCompositionMode(plotterStyle.userActionCompositionMode);
|
||||
painter.setRenderHint(JKQTPEnhancedPainter::NonCosmeticDefaultPen, true);
|
||||
painter.setRenderHint(JKQTPEnhancedPainter::Antialiasing, true);
|
||||
painter.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing, true);
|
||||
painter.setPen(plotterStyle.userActionOverlayPen);
|
||||
if ((mouseDragRectXEnd!=mouseDragRectXStart) && (mouseDragRectYEnd!=mouseDragRectYStart)) {
|
||||
double x1=plotter->x2p(mouseDragRectXStart)*magnification;
|
||||
double y1=plotter->y2p(mouseDragRectYStart)*magnification;
|
||||
@ -266,28 +480,170 @@ void JKQTPlotter::paintUserAction() {
|
||||
double dx=x2-x1;
|
||||
double dy=y2-y1;
|
||||
if ((currentMouseDragAction.mode==jkqtpmdaZoomByRectangle) || (currentMouseDragAction.mode==jkqtpmdaDrawRectangleForEvent)) {
|
||||
painter.setOpacity(0.2);
|
||||
painter.fillRect(QRectF(x1, y1, x2-x1, y2-y1), QBrush(plotterStyle.userActionColor));
|
||||
painter.setOpacity(1.0);
|
||||
painter.fillRect(QRectF(x1, y1, x2-x1, y2-y1), plotterStyle.userActionOverlayBrush);
|
||||
painter.setPen(plotterStyle.userActionOverlayPen);
|
||||
painter.drawRect(QRectF(x1, y1, x2-x1, y2-y1));
|
||||
} else if (currentMouseDragAction.mode==jkqtpmdaDrawCircleForEvent) {
|
||||
QColor zc=plotterStyle.userActionColor;
|
||||
zc.setAlphaF(0.2);
|
||||
painter.setBrush(QBrush(zc));
|
||||
painter.setPen(plotterStyle.userActionOverlayPen);
|
||||
painter.setBrush(plotterStyle.userActionOverlayBrush);
|
||||
painter.drawEllipse(QPointF(x1, y1), qMin(fabs(dx), fabs(dy)), qMin(fabs(dx), fabs(dy)));
|
||||
} else if (currentMouseDragAction.mode==jkqtpmdaDrawEllipseForEvent) {
|
||||
QColor zc=plotterStyle.userActionColor;
|
||||
zc.setAlphaF(0.2);
|
||||
painter.setBrush(QBrush(zc));
|
||||
painter.setPen(plotterStyle.userActionOverlayPen);
|
||||
painter.setBrush(plotterStyle.userActionOverlayBrush);
|
||||
painter.drawEllipse(QPointF(x1, y1), fabs(dx), fabs(dy));
|
||||
} else if (currentMouseDragAction.mode==jkqtpmdaDrawLineForEvent) {
|
||||
QPen pp=p;
|
||||
pp.setColor(plotterStyle.userActionColor);
|
||||
painter.setPen(pp);
|
||||
painter.setPen(plotterStyle.userActionOverlayPen);
|
||||
painter.setBrush(plotterStyle.userActionOverlayBrush);
|
||||
painter.drawLine(QPointF(x1,y1), QPointF(x2,y2));
|
||||
} else if (currentMouseDragAction.mode==jkqtpmdaRuler) {
|
||||
painter.setPen(plotterStyle.userActionOpaquePen);
|
||||
painter.setBrush(plotterStyle.userActionOpaqueBrush);
|
||||
painter.drawLine(QPointF(x1,y1), QPointF(x2,y1));
|
||||
painter.drawLine(QPointF(x2,y1), QPointF(x2,y2));
|
||||
painter.drawLine(QPointF(x1,y1), QPointF(x2,y2));
|
||||
const double dxy=sqrt(jkqtp_sqr(mouseDragRectXEnd-mouseDragRectXStart)+jkqtp_sqr(mouseDragRectYEnd-mouseDragRectYStart));
|
||||
const double alpha=atan2((mouseDragRectYEnd-mouseDragRectYStart), (mouseDragRectXEnd-mouseDragRectXStart))/M_PI*180.0;
|
||||
const double dx=fabs(mouseDragRectXEnd-mouseDragRectXStart);
|
||||
const double dy=fabs(mouseDragRectYEnd-mouseDragRectYStart);
|
||||
|
||||
painter.setBrush(plotterStyle.userActionOpaqueBrush);
|
||||
QString txt;
|
||||
double a=0,d=0,so=0,w=0;
|
||||
getPlotter()->getMathText()->setFontSize(plotterStyle.userActionFontSize);
|
||||
getPlotter()->getMathText()->setFontRomanOrSpecial(plotterStyle.userActionFontName);
|
||||
|
||||
txt=QString::fromStdString("\\delta_{x}="+jkqtp_floattolatexstr(dx, 3));
|
||||
getPlotter()->getMathText()->parse(txt);
|
||||
getPlotter()->getMathText()->getSizeDetail(painter, w, a, d, so);
|
||||
if (y1>y2) {
|
||||
QRectF rec((x1+x2)/2.0-w/2.0, y1+2, w, a+d);
|
||||
painter.fillRect(rec, plotterStyle.userActionOpaqueBrush);
|
||||
getPlotter()->getMathText()->draw(painter, Qt::AlignTop, rec);
|
||||
} else {
|
||||
QRectF rec((x1+x2)/2.0-w/2.0, y1-2-a-d, w, a+d);
|
||||
painter.fillRect(rec, plotterStyle.userActionOpaqueBrush);
|
||||
getPlotter()->getMathText()->draw(painter, Qt::AlignBottom, rec);
|
||||
}
|
||||
|
||||
txt=QString::fromStdString(jkqtp_floattolatexstr(dy, 3));
|
||||
getPlotter()->getMathText()->parse("\\delta_{y}="+txt);
|
||||
getPlotter()->getMathText()->getSizeDetail(painter, w, a, d, so);
|
||||
//double dyh=a+d;
|
||||
if (x2>x1) {
|
||||
QRectF rec(x2+2, (y1+y2)/2.0-(a+d)/2.0, w, a+d);
|
||||
painter.fillRect(rec, plotterStyle.userActionOpaqueBrush);
|
||||
getPlotter()->getMathText()->draw(painter, Qt::AlignVCenter|Qt::AlignLeft, rec);
|
||||
} else {
|
||||
QRectF rec(x2-2-w, (y1+y2)/2.0-(a+d)/2.0, w, a+d);
|
||||
painter.fillRect(rec, plotterStyle.userActionOpaqueBrush);
|
||||
getPlotter()->getMathText()->draw(painter, Qt::AlignVCenter|Qt::AlignRight, rec);
|
||||
}
|
||||
|
||||
|
||||
txt=QString::fromStdString("\\delta_{x,y}="+jkqtp_floattolatexstr(dxy)+", \\alpha="+jkqtp_floattolatexstr(alpha, 1)+"\\degree");
|
||||
getPlotter()->getMathText()->parse(txt);
|
||||
getPlotter()->getMathText()->getSizeDetail(painter, w, a, d, so);
|
||||
if (x2<x1) {
|
||||
QRectF rec((x1+x2)/2.0, (y1+y2)/2.0-(a+d)/2.0, w, a+d);
|
||||
painter.fillRect(rec, plotterStyle.userActionOpaqueBrush);
|
||||
getPlotter()->getMathText()->draw(painter,Qt::AlignTop|Qt::AlignLeft, rec);
|
||||
} else {
|
||||
QRectF rec((x1+x2)/2.0-w, (y1+y2)/2.0-(a+d)/2.0, w, a+d);
|
||||
painter.fillRect(rec, plotterStyle.userActionOpaqueBrush);
|
||||
getPlotter()->getMathText()->draw(painter,Qt::AlignTop|Qt::AlignRight, rec);
|
||||
}
|
||||
|
||||
|
||||
} else if (currentMouseDragAction.mode==jkqtpmdaToolTipForClosestDataPoint) {
|
||||
if (mouseDragMarkers.size()>0) {
|
||||
const int markerD=getCurrentPlotterStyle().userActionMarkerDiameter;
|
||||
if (getCurrentPlotterStyle().userActionMarkerType==jkqtpuamtCircle) {
|
||||
painter.setBrush(plotterStyle.userActionMarkerBrush);
|
||||
painter.setPen(plotterStyle.userActionMarkerPen);
|
||||
painter.drawEllipse(QRectF(mouseDragMarkers[0].pos.x()-markerD/2, mouseDragMarkers[0].pos.y()-markerD/2, markerD, markerD));
|
||||
} else if (getCurrentPlotterStyle().userActionMarkerType==jkqtpuamtCrossHair) {
|
||||
painter.setBrush(plotterStyle.userActionMarkerBrush);
|
||||
painter.setPen(plotterStyle.userActionMarkerPen);
|
||||
painter.drawLine(QLineF(plotter->getInternalPlotBorderLeft(), mouseDragMarkers[0].pos.y(), image.width()-plotter->getInternalPlotBorderRight(), mouseDragMarkers[0].pos.y()));
|
||||
painter.drawLine(QLineF(mouseDragMarkers[0].pos.x(), plotter->getInternalPlotBorderTop(), mouseDragMarkers[0].pos.x(), image.height()-plotter->getInternalPlotBorderBottom()));
|
||||
} else if (getCurrentPlotterStyle().userActionMarkerType==jkqtpuamtCircleAndCrossHair) {
|
||||
painter.setBrush(plotterStyle.userActionMarkerBrush);
|
||||
painter.setPen(plotterStyle.userActionMarkerPen);
|
||||
painter.drawEllipse(QRectF(mouseDragMarkers[0].pos.x()-markerD/2, mouseDragMarkers[0].pos.y()-markerD/2, markerD, markerD));
|
||||
painter.drawLine(QLineF(plotter->getInternalPlotBorderLeft(), mouseDragMarkers[0].pos.y(), mouseDragMarkers[0].pos.x()-markerD/2, mouseDragMarkers[0].pos.y()));
|
||||
painter.drawLine(QLineF(image.width()-plotter->getInternalPlotBorderRight(), mouseDragMarkers[0].pos.y(), mouseDragMarkers[0].pos.x()+markerD/2, mouseDragMarkers[0].pos.y()));
|
||||
painter.drawLine(QLineF(mouseDragMarkers[0].pos.x(), plotter->getInternalPlotBorderTop(), mouseDragMarkers[0].pos.x(), mouseDragMarkers[0].pos.y()-markerD/2));
|
||||
painter.drawLine(QLineF(mouseDragMarkers[0].pos.x(), image.height()-plotter->getInternalPlotBorderBottom(), mouseDragMarkers[0].pos.x(), mouseDragMarkers[0].pos.y()+markerD/2));
|
||||
}
|
||||
const int xoffset=qMax<int>(markerD*3/2,16);
|
||||
const int x0=mouseDragMarkers[0].pos.x()+xoffset;
|
||||
QRectF rall(0,0,0,0);
|
||||
double y=mouseDragMarkers[0].pos.y();
|
||||
QVector<QRectF> rects;
|
||||
QVector<QString> txts;
|
||||
QVector<QColor> colors;
|
||||
const int txtoffset=4;
|
||||
QString txt;
|
||||
double ascent=0,descent=0,strikeout=0,width=0;
|
||||
getPlotter()->getMathText()->setFontSize(plotterStyle.userActionFontSize);
|
||||
getPlotter()->getMathText()->setFontRomanOrSpecial(plotterStyle.userActionFontName);
|
||||
|
||||
|
||||
for (auto& m: mouseDragMarkers) {
|
||||
QString txt="\\textcolor{"+jkqtp_QColor2String(m.color)+"}{"+m.title+": "+m.label+"}";
|
||||
|
||||
getPlotter()->getMathText()->parse(txt);
|
||||
getPlotter()->getMathText()->getSizeDetail(painter, width, ascent, descent, strikeout);
|
||||
|
||||
double txtheight=ascent+descent;
|
||||
QRectF rec(x0+txtoffset, y, width+1, txtheight+1);
|
||||
if (rall.width()*rall.height()<=0) {
|
||||
rall=rec.toRect();
|
||||
} else {
|
||||
rall.setBottom(rall.bottom()+txtheight+ascent/4);
|
||||
rall.setRight(qMax(rall.right(), rec.right()));
|
||||
}
|
||||
rects << rec;
|
||||
txts<<txt;
|
||||
colors<<m.color;
|
||||
//qDebug()<<y<<txt<<rall;
|
||||
y=y+txtheight+ascent/4;
|
||||
}
|
||||
rall.setLeft(rall.left()-txtoffset);
|
||||
rall.setRight(rall.right()+txtoffset);
|
||||
rall.setTop(rall.top()-txtoffset);
|
||||
rall.setBottom(rall.bottom()+txtoffset);
|
||||
|
||||
if (rall.right()>image.width()) {
|
||||
rall.moveLeft(mouseDragMarkers[0].pos.x()-rall.width()-xoffset);
|
||||
for (auto& r: rects) {
|
||||
r.moveLeft(rall.left()+txtoffset);
|
||||
}
|
||||
}
|
||||
if (rall.bottom()>image.height()) {
|
||||
double oldY=rall.y();
|
||||
rall.moveTop(image.height()-rall.height());
|
||||
for (auto& r: rects) {
|
||||
r.moveTop(r.y()-(oldY-rall.y()));
|
||||
}
|
||||
}
|
||||
//qDebug()<<"rall="<<rall;
|
||||
painter.setBrush(plotterStyle.userActionOpaqueBrush);
|
||||
painter.setPen(plotterStyle.userActionOpaquePen);
|
||||
JKQTPDrawTooltip(painter, mouseDragMarkers[0].pos.x(), mouseDragMarkers[0].pos.y(), rall);
|
||||
for (int i=0; i<txts.size(); i++) {
|
||||
getPlotter()->getMathText()->parse(txts[i]);
|
||||
getPlotter()->getMathText()->draw(painter, Qt::AlignTop|Qt::AlignLeft, rects[i]);
|
||||
QStringList el=getPlotter()->getMathText()->getErrorList();
|
||||
if (el.size()>0) {
|
||||
qDebug()<<"error parsing LaTeX string fo tooltip ("<<txts[i]<<"):\n - "<<el.join("\n - ");
|
||||
// } else {
|
||||
// qDebug()<<txts[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
painter.setCompositionMode(oldCMode);
|
||||
}
|
||||
update();
|
||||
}
|
||||
@ -317,6 +673,8 @@ void JKQTPlotter::mouseMoveEvent ( QMouseEvent * event ) {
|
||||
(currentMouseDragAction.mode==jkqtpmdaDrawCircleForEvent) ||
|
||||
(currentMouseDragAction.mode==jkqtpmdaDrawEllipseForEvent) ||
|
||||
(currentMouseDragAction.mode==jkqtpmdaScribbleForEvents) ||
|
||||
(currentMouseDragAction.mode==jkqtpmdaToolTipForClosestDataPoint) ||
|
||||
(currentMouseDragAction.mode==jkqtpmdaRuler) ||
|
||||
(currentMouseDragAction.mode==jkqtpmdaPanPlotOnMove) ||
|
||||
(currentMouseDragAction.mode==jkqtpmdaPanPlotOnRelease) ||
|
||||
(currentMouseDragAction.mode==jkqtpmdaDrawLineForEvent) ) &&
|
||||
@ -333,6 +691,17 @@ void JKQTPlotter::mouseMoveEvent ( QMouseEvent * event ) {
|
||||
mouseDragRectYEnd=plotter->p2y((event->y()-getPlotYOffset())/magnification);
|
||||
mouseDragRectXEndPixel=event->x();
|
||||
mouseDragRectYEndPixel=event->y();
|
||||
|
||||
|
||||
if (currentMouseDragAction.mode==jkqtpmdaToolTipForClosestDataPoint) {
|
||||
fillInternalStructForToolTipOfClosestDataPoint(mouseDragRectXEnd, mouseDragRectYEnd);
|
||||
|
||||
}
|
||||
if (currentMouseDragAction.mode==jkqtpmdaRuler) {
|
||||
emit rulerDisplayed(mouseDragRectXStart, mouseDragRectYStart, mouseDragRectXEnd, mouseDragRectYEnd, event->modifiers());
|
||||
|
||||
}
|
||||
|
||||
paintUserAction();
|
||||
event->accept();
|
||||
//std::cout<<mouseZoomingTStart<<" -- "<<mouseZoomingTEnd<<std::endl;
|
||||
@ -353,13 +722,14 @@ void JKQTPlotter::mouseMoveEvent ( QMouseEvent * event ) {
|
||||
}
|
||||
setXY(plotter->p2x(zoomRect.left()), plotter->p2x(zoomRect.right()), plotter->p2y(zoomRect.bottom()), plotter->p2y(zoomRect.top()));
|
||||
}
|
||||
|
||||
} else {
|
||||
event->accept();
|
||||
/*if (emitSignals)*/ //emit plotMouseMove(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
// emit clicked signal, if event occured inside plot only
|
||||
// emit move signal, if event occured inside plot only
|
||||
if ( (event->x()/magnification>=plotter->getInternalPlotBorderLeft()) && (event->x()/magnification<=plotter->getPlotWidth()+plotter->getInternalPlotBorderLeft()) &&
|
||||
((event->y()-getPlotYOffset())/magnification>=plotter->getInternalPlotBorderTop()) && ((event->y()-getPlotYOffset())/magnification<=plotter->getPlotHeight()+plotter->getInternalPlotBorderTop()) ) {
|
||||
emit plotMouseMove(plotter->p2x(event->x()/magnification), plotter->p2y((event->y()-getPlotYOffset())/magnification));
|
||||
@ -369,20 +739,21 @@ void JKQTPlotter::mouseMoveEvent ( QMouseEvent * event ) {
|
||||
|
||||
|
||||
|
||||
|
||||
void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
|
||||
currentMouseDragAction.clear();
|
||||
mouseDragMarkers.clear();
|
||||
|
||||
auto actionIT=findMatchingMouseDragAction(event->button(), event->modifiers());
|
||||
if (actionIT!=plotterStyle.registeredMouseDragActionModes.end()) {
|
||||
bool foundIT=false;
|
||||
auto actionIT=findMatchingMouseDragAction(event->button(), event->modifiers(), &foundIT);
|
||||
if (foundIT) {
|
||||
// we found a matching action
|
||||
currentMouseDragAction=MouseDragAction(actionIT.key().first, actionIT.key().second, actionIT.value());
|
||||
mouseLastClickX=event->x();
|
||||
mouseLastClickY=event->y();
|
||||
mouseDragRectXStart=plotter->p2x(event->x()/magnification);
|
||||
mouseDragRectYStart=plotter->p2y((event->y()-getPlotYOffset())/magnification);
|
||||
mouseDragRectXEndPixel=mouseDragRectXStartPixel=event->x();
|
||||
mouseDragRectYEndPixel=mouseDragRectYStartPixel=event->y();
|
||||
currentMouseDragAction=MouseDragAction(actionIT.key().first, actionIT.key().second, actionIT.value());
|
||||
mouseDragingRectangle=true;
|
||||
oldImage=image;
|
||||
if (currentMouseDragAction.mode==jkqtpmdaScribbleForEvents) emit userScribbleClick(mouseDragRectXStart, mouseDragRectYStart, event->modifiers(), true, false);
|
||||
@ -401,6 +772,10 @@ void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
|
||||
event->accept();
|
||||
}
|
||||
updateCursor();
|
||||
if ((actionIT!=plotterStyle.registeredMouseDragActionModes.end() || actionIT!=registeredOverrideMouseDragActionModes.end()) && actionIT.value()==jkqtpmdaToolTipForClosestDataPoint) {
|
||||
fillInternalStructForToolTipOfClosestDataPoint(mouseDragRectXStart, mouseDragRectYStart);
|
||||
paintUserAction();
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPlotter::mouseReleaseEvent ( QMouseEvent * event ){
|
||||
@ -452,11 +827,19 @@ void JKQTPlotter::mouseReleaseEvent ( QMouseEvent * event ){
|
||||
emit userLineFinished(x1, y1, x2, y2, event->modifiers());
|
||||
}
|
||||
}
|
||||
if (currentMouseDragAction.mode!=jkqtpmdaZoomByRectangle) update();
|
||||
if (currentMouseDragAction.mode==jkqtpmdaScribbleForEvents) emit userScribbleClick(x1, y1, event->modifiers(), false, true);
|
||||
if (currentMouseDragAction.mode!=jkqtpmdaZoomByRectangle && currentMouseDragAction.mode!=jkqtpmdaRuler && currentMouseDragAction.mode!=jkqtpmdaToolTipForClosestDataPoint) {
|
||||
update();
|
||||
}
|
||||
if (currentMouseDragAction.mode==jkqtpmdaScribbleForEvents) {
|
||||
emit userScribbleClick(x1, y1, event->modifiers(), false, true);
|
||||
}
|
||||
event->accept();
|
||||
}
|
||||
resetCurrentMouseDragAction();
|
||||
}
|
||||
|
||||
void JKQTPlotter::resetCurrentMouseDragAction () {
|
||||
mouseDragingRectangle=false;
|
||||
currentMouseDragAction.clear();
|
||||
updateCursor();
|
||||
}
|
||||
@ -603,10 +986,16 @@ void JKQTPlotter::initContextMenu()
|
||||
contextMenu->addAction(plotter->getActionCopyMatlab());
|
||||
contextMenu->addSeparator();
|
||||
contextMenu->addAction(plotter->getActionShowPlotData());
|
||||
contextMenu->addSeparator();
|
||||
contextMenu->addSection(tr("Zooming"));
|
||||
contextMenu->addAction(plotter->getActionZoomAll());
|
||||
contextMenu->addAction(plotter->getActionZoomIn());
|
||||
contextMenu->addAction(plotter->getActionZoomOut());
|
||||
contextMenu->addSection(tr("left mouse button tool"));
|
||||
contextMenu->addAction(actMouseLeftAsDefault);
|
||||
contextMenu->addAction(actMouseLeftAsPanView);
|
||||
contextMenu->addAction(actMouseLeftAsZoomRect);
|
||||
contextMenu->addAction(actMouseLeftAsRuler);
|
||||
contextMenu->addAction(actMouseLeftAsToolTip);
|
||||
contextMenu->addSeparator();
|
||||
QMenu* menVisibleGroup=new QMenu(tr("Graph Visibility"), contextMenu);
|
||||
for (size_t i=0; i<getPlotter()->getGraphCount(); i++) {
|
||||
@ -688,6 +1077,12 @@ void JKQTPlotter::updateCursor() {
|
||||
static QBitmap cursor(":/JKQTPlotter/jkqtp_cursor_scribble.png");
|
||||
static QBitmap mask(":/JKQTPlotter/jkqtp_cursor_scribble_mask.png");
|
||||
setCursor(QCursor(cursor, mask, 9, 14));
|
||||
} else if (currentMouseDragAction.mode==jkqtpmdaToolTipForClosestDataPoint) {
|
||||
setCursor(QCursor(Qt::CrossCursor));
|
||||
} else if (currentMouseDragAction.mode==jkqtpmdaRuler) {
|
||||
static QBitmap cursor(":/JKQTPlotter/jkqtp_cursor_line.png");
|
||||
static QBitmap mask(":/JKQTPlotter/jkqtp_cursor_line_mask.png");
|
||||
setCursor(QCursor(cursor, mask, 9, 14));
|
||||
} else {
|
||||
setCursor(QCursor(Qt::ArrowCursor));
|
||||
}
|
||||
@ -726,6 +1121,7 @@ void JKQTPlotter::redrawOverlays() {
|
||||
repaint();
|
||||
}
|
||||
|
||||
|
||||
void JKQTPlotter::redrawPlot() {
|
||||
#ifdef JKQTBP_AUTOTIMER
|
||||
JKQTPAutoOutputTimer jkaaot(QString("JKQTPlotter::redrawPlot()"));
|
||||
@ -952,6 +1348,68 @@ void JKQTPlotter::reactGraphVisible(bool visible)
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPlotter::setMouseLeftActionAsPanView()
|
||||
{
|
||||
setOverrideMouseDragAction(Qt::LeftButton, Qt::NoModifier, JKQTPMouseDragActions::jkqtpmdaPanPlotOnMove);
|
||||
}
|
||||
|
||||
void JKQTPlotter::setMouseLeftActionAsZoomRect()
|
||||
{
|
||||
setOverrideMouseDragAction(Qt::LeftButton, Qt::NoModifier, JKQTPMouseDragActions::jkqtpmdaZoomByRectangle);
|
||||
}
|
||||
|
||||
void JKQTPlotter::setMouseLeftActionAsRuler()
|
||||
{
|
||||
setOverrideMouseDragAction(Qt::LeftButton, Qt::NoModifier, JKQTPMouseDragActions::jkqtpmdaRuler);
|
||||
}
|
||||
|
||||
void JKQTPlotter::setMouseLeftActionAsToolTip()
|
||||
{
|
||||
setOverrideMouseDragAction(Qt::LeftButton, Qt::NoModifier, JKQTPMouseDragActions::jkqtpmdaToolTipForClosestDataPoint);
|
||||
}
|
||||
|
||||
void JKQTPlotter::resetMouseLeftAction()
|
||||
{
|
||||
resetOverrideMouseDragAction(Qt::LeftButton, Qt::NoModifier);
|
||||
}
|
||||
|
||||
void JKQTPlotter::setMouseActionToolbarActionsActive(bool __value)
|
||||
{
|
||||
actgrpMouseLeft->setVisible(__value);
|
||||
}
|
||||
|
||||
QAction* JKQTPlotter::getActMouseLeftAsDefault() const {
|
||||
return actMouseLeftAsDefault;
|
||||
}
|
||||
|
||||
QAction *JKQTPlotter::getActMouseLeftAsZoomRect() const
|
||||
{
|
||||
return actMouseLeftAsZoomRect;
|
||||
}
|
||||
|
||||
QAction *JKQTPlotter::getActMouseLeftAsPanView() const
|
||||
{
|
||||
return actMouseLeftAsPanView;
|
||||
}
|
||||
|
||||
QAction* JKQTPlotter::getActMouseLeftAsRuler() const {
|
||||
return actMouseLeftAsRuler;
|
||||
}
|
||||
|
||||
QAction* JKQTPlotter::getActMouseLeftAsToolTip() const {
|
||||
return actMouseLeftAsToolTip;
|
||||
}
|
||||
|
||||
void JKQTPlotter::setOverrideMouseDragAction(Qt::MouseButton button, Qt::KeyboardModifiers modifier, JKQTPMouseDragActions action)
|
||||
{
|
||||
registeredOverrideMouseDragActionModes.insert(qMakePair<Qt::MouseButton, Qt::KeyboardModifiers>(button, modifier), action);
|
||||
}
|
||||
|
||||
void JKQTPlotter::resetOverrideMouseDragAction(Qt::MouseButton button, Qt::KeyboardModifiers modifier)
|
||||
{
|
||||
registeredOverrideMouseDragActionModes.remove(qMakePair<Qt::MouseButton, Qt::KeyboardModifiers>(button, modifier));
|
||||
}
|
||||
|
||||
void JKQTPlotter::setContextMenuMode(JKQTPContextMenuModes mode) {
|
||||
contextMenuMode=mode;
|
||||
}
|
||||
@ -1049,7 +1507,12 @@ void JKQTPlotter::populateToolbar(QToolBar *toolbar) const
|
||||
toolbar->addAction(plotter->getActionZoomAll());
|
||||
toolbar->addAction(plotter->getActionZoomIn());
|
||||
toolbar->addAction(plotter->getActionZoomOut());
|
||||
|
||||
toolbar->addSeparator();
|
||||
toolbar->addAction(actMouseLeftAsDefault);
|
||||
toolbar->addAction(actMouseLeftAsPanView);
|
||||
toolbar->addAction(actMouseLeftAsZoomRect);
|
||||
toolbar->addAction(actMouseLeftAsRuler);
|
||||
toolbar->addAction(actMouseLeftAsToolTip);
|
||||
if (actions().size()>0) {
|
||||
toolbar->addSeparator();
|
||||
toolbar->addActions(actions());
|
||||
@ -1089,11 +1552,11 @@ void JKQTPlotter::resetContextMenu(bool createnew)
|
||||
qDeleteAll(contextSubMenus);
|
||||
contextSubMenus.clear();
|
||||
delete contextMenu;
|
||||
if (createnew) {
|
||||
contextMenu=new QMenu(this);
|
||||
} else {
|
||||
contextMenu=nullptr;
|
||||
}
|
||||
}
|
||||
if (createnew) {
|
||||
contextMenu=new QMenu(this);
|
||||
} else {
|
||||
contextMenu=nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1183,9 +1646,16 @@ void JKQTPlotter::openStandardAndSpecialContextMenu(int x, int y)
|
||||
|
||||
}
|
||||
|
||||
JKQTPMouseDragActionsHashMapIterator JKQTPlotter::findMatchingMouseDragAction(Qt::MouseButton button, Qt::KeyboardModifiers modifiers) const
|
||||
JKQTPMouseDragActionsHashMapIterator JKQTPlotter::findMatchingMouseDragAction(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, bool* found) const
|
||||
{
|
||||
return plotterStyle.registeredMouseDragActionModes.find(qMakePair<Qt::MouseButton, Qt::KeyboardModifiers>(button, modifiers));
|
||||
auto it=registeredOverrideMouseDragActionModes.find(qMakePair<Qt::MouseButton, Qt::KeyboardModifiers>(button, modifiers));
|
||||
if (it!=registeredOverrideMouseDragActionModes.end()) {
|
||||
if (found) *found=true;
|
||||
return it;
|
||||
}
|
||||
auto itt=plotterStyle.registeredMouseDragActionModes.find(qMakePair<Qt::MouseButton, Qt::KeyboardModifiers>(button, modifiers));
|
||||
if (found) *found=(itt!=plotterStyle.registeredMouseDragActionModes.end());
|
||||
return itt;
|
||||
}
|
||||
|
||||
JKQTPMouseDoubleClickActionsHashMapIterator JKQTPlotter::findMatchingMouseDoubleClickAction(Qt::MouseButton button, Qt::KeyboardModifiers modifiers) const
|
||||
@ -1208,6 +1678,10 @@ void JKQTPlotter::setPlotUpdateEnabled(bool enable)
|
||||
void JKQTPlotter::registerMouseDragAction(Qt::MouseButton button, Qt::KeyboardModifiers modifier, JKQTPMouseDragActions action)
|
||||
{
|
||||
plotterStyle.registeredMouseDragActionModes[qMakePair<Qt::MouseButton, Qt::KeyboardModifiers>(button, modifier)]=action;
|
||||
if (button==Qt::LeftButton && modifier==Qt::NoModifier) {
|
||||
actMouseLeftAsDefault->setChecked(true);
|
||||
resetMouseLeftAction();
|
||||
}
|
||||
}
|
||||
|
||||
void JKQTPlotter::deregisterMouseDragAction(Qt::MouseButton button, Qt::KeyboardModifiers modifier)
|
||||
|
@ -319,8 +319,14 @@ JKQTP_LIB_EXPORT void initJKQTPlotterResources();
|
||||
*
|
||||
* If e.g. the mode JKQTPlotter::MouseActionMode::jkqtpmdaZoomByRectangle is selected, while you drag the mouse, the
|
||||
* zoom rectangle is drawn over the plot. You can modify the style of drawing using these functions:
|
||||
* - setUserActionColor() sets the color of the drawn shape
|
||||
* - setUserActionCompositionMode() specifies how to combine the shape with the existing plot
|
||||
* - setUserActionOverlayPen() sets the pen for (semi-transparent) overlay shapes, e.g. zoom rectangles
|
||||
* - setUserActionOverlayBrush() sets the brush for (semi-transparent) overlay shapes, e.g. zoom rectangles
|
||||
* - setUserActionOpaquePen() sets the pen for opaque overlay shapes, e.g. tool-tips
|
||||
* - setUserActionOpaqueBrush() sets the brush for opaque overlay shapes, e.g. tool-tips
|
||||
* - setUserActionMarkerPen() sets the pen for marker overlay shapes, e.g. with tool-tips
|
||||
* - setUserActionMarkerBrush() sets the brush for marker overlay shapes, e.g. with tool-tips
|
||||
* - setUserActionMarkerDiameter() sets the size of user-action markers
|
||||
* - setUserActionMarkerType() sets the type of user-action markers
|
||||
* .
|
||||
*
|
||||
* \image html zoomin_mouse_contextmenu.gif "Zooming with the mouse"
|
||||
@ -329,6 +335,10 @@ JKQTP_LIB_EXPORT void initJKQTPlotterResources();
|
||||
*
|
||||
* \image html drag_viewport.gif "Drag the Plot Viewport"
|
||||
*
|
||||
* \image html rulertool.gif "Measurement Ruler Tool"
|
||||
*
|
||||
* \image html tooltiptool.gif "Data Point Tooltip Tool"
|
||||
*
|
||||
*
|
||||
* \subsubsection JKQTPLOTTER_USERMOUSEINTERACTION_MOUSECLICK Actions After (Double-)Clicks on the Mouse Buttons
|
||||
* The right mouse button has a special role: If it is single-clicked and no JKQTPlotter::MouseActionMode is specified
|
||||
@ -475,11 +485,48 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
*
|
||||
* \see setMousePositionShown(), JKQTPlotterStyle::displayMousePosition, \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEMOVE */
|
||||
bool isMousePositionShown() const;
|
||||
/** \brief returns the fill color of the zoom rectangle \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QColor getUserActionColor() const;
|
||||
|
||||
/** \brief returns the QPainter::CompositionMode used to draw the zoom rectangle etc. \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QPainter::CompositionMode getUserActionCompositionMode() const;
|
||||
/** \copydoc JKQTPlotterStyle::userActionOverlayPen
|
||||
*
|
||||
* \see setUserActionOverlayPen(), getUserActionOverlayPen(), JKQTPlotterStyle::userActionOverlayPen \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QPen getUserActionOverlayPen() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionOverlayBrush
|
||||
*
|
||||
* \see setUserActionOverlayBrush(), getUserActionOverlayBrush(), JKQTPlotterStyle::userActionOverlayBrush \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QBrush getUserActionOverlayBrush() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionOpaquePen
|
||||
*
|
||||
* \see setUserActionOpaquePen(), getUserActionOpaquePen(), JKQTPlotterStyle::userActionOpaquePen \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QPen getUserActionOpaquePen() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionOpaqueBrush
|
||||
*
|
||||
* \see setUserActionOpaqueBrush(), getUserActionOpaqueBrush(), JKQTPlotterStyle::userActionOpaqueBrush \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QBrush getUserActionOpaqueBrush() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionMarkerPen
|
||||
*
|
||||
* \see setUserActionMarkerPen(), getUserActionMarkerPen(), JKQTPlotterStyle::userActionMarkerPen \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QPen getUserActionMarkerPen() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionMarkerBrush
|
||||
*
|
||||
* \see setUserActionMarkerBrush(), getUserActionMarkerBrush(), JKQTPlotterStyle::userActionMarkerBrush \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QBrush getUserActionMarkerBrush() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::maxTooltipDistance */
|
||||
int getMaxTooltipDistance() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionCatchSensitivity */
|
||||
int getUserActionCatchSensitivity() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionMarkerDiameter */
|
||||
int getUserActionMarkerDiameter() const;
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionMarkerType */
|
||||
JKQTPUserActionMarkerType getUserActionMarkerType() const;
|
||||
|
||||
|
||||
/** \brief loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings</a> object */
|
||||
@ -850,6 +897,18 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
*/
|
||||
void saveCurrentPlotterStyle(QSettings& settings, const QString& group="plot/", bool alsoSaveBaseStyle=true) const;
|
||||
|
||||
/** \brief \copydoc actMouseLeftAsToolTip */
|
||||
QAction *getActMouseLeftAsToolTip() const;
|
||||
/** \brief \copydoc actMouseLeftAsRuler */
|
||||
QAction *getActMouseLeftAsRuler() const;
|
||||
/** \brief \copydoc actMouseLeftAsDefault */
|
||||
QAction *getActMouseLeftAsDefault() const;
|
||||
/** \brief \copydoc actMouseLeftAsZoomRect */
|
||||
QAction *getActMouseLeftAsZoomRect() const;
|
||||
/** \brief \copydoc actMouseLeftAsPanView */
|
||||
QAction *getActMouseLeftAsPanView() const;
|
||||
|
||||
|
||||
public slots:
|
||||
/** \brief set the current plot magnification */
|
||||
void setMagnification(double m);
|
||||
@ -931,6 +990,12 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
*/
|
||||
void redrawOverlays();
|
||||
|
||||
/** \brief allows to activate/deactivate toolbar buttons that can activate certain mouse drag actions
|
||||
*
|
||||
* \see getActMouseLeftAsDefault(), getActMouseLeftAsRuler(), getActMouseLeftAsToolTip()
|
||||
*/
|
||||
void setMouseActionToolbarActionsActive(bool __value);
|
||||
|
||||
/** \brief returns whether the toolbar is enabled
|
||||
*
|
||||
* \copydetails JKQTPlotterStyle::toolbarEnabled
|
||||
@ -952,14 +1017,42 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
*
|
||||
* \see isMousePositionShown(), JKQTPlotterStyle::displayMousePosition, \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEMOVE */
|
||||
void setMousePositionShown(bool __value);
|
||||
/** \brief set the fill color of the zoom rectangle
|
||||
/** \copydoc JKQTPlotterStyle::userActionOverlayPen
|
||||
*
|
||||
* \see getUserActionColor(), JKQTPlotterStyle::userActionColor \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
void setUserActionColor(const QColor & __value);
|
||||
/** \brief set the QPainter::CompositionMode used to draw the zoom rectangle etc.
|
||||
* \see setUserActionOverlayPen(), getUserActionOverlayPen(), JKQTPlotterStyle::userActionOverlayPen \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
void setUserActionOverlayPen(const QPen & __value);
|
||||
/** \copydoc JKQTPlotterStyle::userActionOverlayPen
|
||||
*
|
||||
* \see getUserActionCompositionMode(), JKQTPlotterStyle::userActionColor \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
void setUserActionCompositionMode(const QPainter::CompositionMode & __value);
|
||||
* \see setUserActionOverlayBrush(), getUserActionOverlayBrush(), JKQTPlotterStyle::userActionOverlayBrush \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
void setUserActionOverlayBrush(const QBrush & __value);
|
||||
/** \copydoc JKQTPlotterStyle::userActionOpaquePen
|
||||
*
|
||||
* \see setUserActionOpaquePen(), getUserActionOpaquePen(), JKQTPlotterStyle::userActionOpaquePen \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
void setUserActionOpaquePen(const QPen & __value);
|
||||
/** \copydoc JKQTPlotterStyle::userActionOpaquePen
|
||||
*
|
||||
* \see setUserActionOpaqueBrush(), getUserActionOpaqueBrush(), JKQTPlotterStyle::userActionOpaqueBrush \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
void setUserActionOpaqueBrush(const QBrush & __value);
|
||||
/** \copydoc JKQTPlotterStyle::userActionMarkerPen
|
||||
*
|
||||
* \see setUserActionMarkerPen(), getUserActionMarkerPen(), JKQTPlotterStyle::userActionMarkerPen \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
void setUserActionMarkerPen(const QPen & __value);
|
||||
/** \copydoc JKQTPlotterStyle::userActionMarkerPen
|
||||
*
|
||||
* \see setUserActionMarkerBrush(), getUserActionMarkerBrush(), JKQTPlotterStyle::userActionMarkerBrush \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
void setUserActionMarkerBrush(const QBrush & __value);
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::maxTooltipDistance */
|
||||
void setMaxTooltipDistance(int v);
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionCatchSensitivity */
|
||||
void setUserActionCatchSensitivity(int v);
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionMarkerDiameter */
|
||||
void setUserActionMarkerDiameter(int v);
|
||||
|
||||
/** \copydoc JKQTPlotterStyle::userActionMarkerType */
|
||||
void setUserActionMarkerType(JKQTPUserActionMarkerType v);
|
||||
|
||||
/** \brief sets the mode if the standard context menu \see JKQTPContextMenuModes, \ref JKQTPLOTTER_CONTEXTMENU , \ref JKQTPLOTTER_SPECIALCONTEXTMENU , \ref JKQTPLOTTER_USERMOUSEINTERACTION */
|
||||
void setContextMenuMode(JKQTPContextMenuModes mode);
|
||||
@ -1224,6 +1317,23 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
* \param modifiers key-modifiers when the rectangle was finished
|
||||
*/
|
||||
void userEllipseFinished(double x, double y, double radiusX, double radiusY, Qt::KeyboardModifiers modifiers);
|
||||
/** \brief emitted when a tooltip for a datapoint is displayed
|
||||
*
|
||||
* \param x x-coordinate of the center of the marked datapoint (in plot coordinates)
|
||||
* \param y y-coordinate of the center of the marked datapoint (in plot coordinates)
|
||||
* \param entries contents of the tooltip
|
||||
* \param graphs graph objects that created the entries
|
||||
*/
|
||||
void tooltipDisplayed(double x, double y, const QStringList& entries, const QList<JKQTPPlotElement*>& graphs);
|
||||
/** \brief emitted when a new ruler between two points is displayed
|
||||
*
|
||||
* \param x1 x-coordinate of the start of the line (in plot coordinates)
|
||||
* \param y1 y-coordinate of the start of the line (in plot coordinates)
|
||||
* \param x2 x-coordinate of the end of the line (in plot coordinates)
|
||||
* \param y2 y-coordinate of the end of the line (in plot coordinates)
|
||||
* \param modifiers key-modifiers when the rectangle was finished
|
||||
*/
|
||||
void rulerDisplayed(double x1, double y1, double x2, double y2, Qt::KeyboardModifiers modifiers);
|
||||
|
||||
|
||||
protected:
|
||||
@ -1248,8 +1358,8 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
/** \brief the currently executed MouseDragAction */
|
||||
MouseDragAction currentMouseDragAction;
|
||||
|
||||
/** \brief searches JKQTPlotterStyle::registeredMouseActionModes for a matching action */
|
||||
JKQTPMouseDragActionsHashMapIterator findMatchingMouseDragAction(Qt::MouseButton button, Qt::KeyboardModifiers modifiers) const;
|
||||
/** \brief searches JKQTPlotterStyle::registeredMouseActionModes for a matching action, returns in \a found whether an action was found */
|
||||
JKQTPMouseDragActionsHashMapIterator findMatchingMouseDragAction(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, bool *found=nullptr) const;
|
||||
|
||||
/** \brief searches JKQTPlotterStyle::registeredMouseWheelActions for a matching action */
|
||||
JKQTPMouseWheelActionsHashMapIterator findMatchingMouseWheelAction(Qt::KeyboardModifiers modifiers) const;
|
||||
@ -1311,6 +1421,28 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
*/
|
||||
double mouseDragRectYEnd;
|
||||
|
||||
/** \brief describes a marker to be drawn by paintUserAction() */
|
||||
struct MouseDragMarker{
|
||||
inline MouseDragMarker(const QPoint& pos_, const QString& label_, const QString& title_, const QColor& color_, const QImage& keymarker_=QImage(), JKQTPPlotElement* _graph=nullptr):
|
||||
pos(pos_), label(label_), title(title_), color(color_), keyMarker(keymarker_), graph(_graph)
|
||||
{}
|
||||
/** \brief position of the marker in screen pixels */
|
||||
QPoint pos;
|
||||
/** \brief marker label */
|
||||
QString label;
|
||||
/** \brief graph label */
|
||||
QString title;
|
||||
/** \brief color for the marker */
|
||||
QColor color;
|
||||
/** \brief key marker image */
|
||||
QImage keyMarker;
|
||||
/** \brief graph that created that marker */
|
||||
JKQTPPlotElement* graph;
|
||||
};
|
||||
/** \brief internal list of markers to be drawn by paintUserAction() */
|
||||
QList<MouseDragMarker> mouseDragMarkers;
|
||||
|
||||
|
||||
/** \brief this stores the currently displayed plot */
|
||||
QImage image;
|
||||
|
||||
@ -1435,6 +1567,9 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
int mouseLastClickX;
|
||||
/** \brief y-position of the last mouse-click (in screen pixels) */
|
||||
int mouseLastClickY;
|
||||
/** \brief internal storage for sub-menu entries of the internal contextMenu object, based on the actions returned by JKQTBasePlotter::getLstAdditionalPlotterActions()
|
||||
* \internal
|
||||
*/
|
||||
QList<QMenu*> contextSubMenus;
|
||||
/** \brief fills the member contextMenu with all default and additionally registered actions, also calls modifyContextMenu()
|
||||
*
|
||||
@ -1469,6 +1604,36 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
* \see initContextMenu(), contextMenuMode
|
||||
*/
|
||||
void resetContextMenu(bool createnew=true);
|
||||
|
||||
/** \brief fills the inertnal mouseDragMarkers structure with data to display tooltips close to (x0, y0)
|
||||
*
|
||||
* if \a emitEvent is \c true, the signal is emitted before the function returns
|
||||
*/
|
||||
void fillInternalStructForToolTipOfClosestDataPoint(double x0, double y0, bool emitEvent=true);
|
||||
/** \brief resets the currently activated mouse drag action, e.g. called by mouseReleaseEvent() */
|
||||
void resetCurrentMouseDragAction();
|
||||
|
||||
/** \brief list of override mouse drag action modes, that override the settings ing plotterStyle.registeredMouseDragActionModes \see setOverrideMouseDragAction(), resetOverrideMouseDragAction(), JKQTPlotterStyle::registeredMouseDragActionModes */
|
||||
JKQTPMouseDragActionsHashMap registeredOverrideMouseDragActionModes;
|
||||
|
||||
/** \brief sets an override mouse drag action for the given button/modifiers combination \see setOverrideMouseDragAction(), resetOverrideMouseDragAction(), registeredOverrideMouseDragActionModes */
|
||||
void setOverrideMouseDragAction(Qt::MouseButton button,Qt::KeyboardModifiers modifiers, JKQTPMouseDragActions action);
|
||||
/** \brief removes a previously set override mouse drag action for the given button/modifiers combination \see setOverrideMouseDragAction(), resetOverrideMouseDragAction(), registeredOverrideMouseDragActionModes */
|
||||
void resetOverrideMouseDragAction(Qt::MouseButton button,Qt::KeyboardModifiers modifiers);
|
||||
|
||||
/** \brief action group, that groups the actMouseLeft... actions */
|
||||
QActionGroup* actgrpMouseLeft;
|
||||
/** \brief action that activates the default action, set in plotterStyle! */
|
||||
QAction* actMouseLeftAsDefault;
|
||||
/** \brief action that activates the ruler tool (override!) */
|
||||
QAction* actMouseLeftAsRuler;
|
||||
/** \brief action that activates the tooltip tool (override!) */
|
||||
QAction* actMouseLeftAsToolTip;
|
||||
/** \brief action that activates the zoom rectangle tool (override!) */
|
||||
QAction* actMouseLeftAsZoomRect;
|
||||
/** \brief action that activates the pan view tool (override!) */
|
||||
QAction* actMouseLeftAsPanView;
|
||||
|
||||
protected slots:
|
||||
/** \brief while the window is resized, the plot is only redrawn after a restartable delay, implemented by this function and resizeTimer
|
||||
* \internal
|
||||
@ -1489,6 +1654,17 @@ class JKQTP_LIB_EXPORT JKQTPlotter: public QWidget {
|
||||
/** \brief called from a menu entry that encodes the graph ID */
|
||||
void reactGraphVisible(bool visible);
|
||||
|
||||
/** \brief action that activates the pan viewport tool \see resetMouseLeftAction(), setMouseLeftActionAsToolTip() */
|
||||
void setMouseLeftActionAsPanView();
|
||||
/** \brief action that activates the zoom rectangle tool \see resetMouseLeftAction(), setMouseLeftActionAsToolTip() */
|
||||
void setMouseLeftActionAsZoomRect();
|
||||
/** \brief action that activates the ruler tool \see resetMouseLeftAction(), setMouseLeftActionAsToolTip() */
|
||||
void setMouseLeftActionAsRuler();
|
||||
/** \brief action that activates the tooltip tool \see setMouseLeftActionAsRuler(), resetMouseLeftAction() */
|
||||
void setMouseLeftActionAsToolTip();
|
||||
/** \brief resets any previously set override action for the left mouse-button, un-modified \see setMouseLeftActionAsRuler(), setMouseLeftActionAsToolTip() */
|
||||
void resetMouseLeftAction();
|
||||
|
||||
};
|
||||
|
||||
/** \brief qHash-variant used by JKQTPlotter
|
||||
|
@ -1,11 +1,22 @@
|
||||
#include "jkqtplotterstyle.h"
|
||||
#include <QApplication>
|
||||
#include "jkqtplottertools/jkqttools.h"
|
||||
#include "jkqtplottertools/jkqtptools.h"
|
||||
|
||||
JKQTPlotterStyle::JKQTPlotterStyle():
|
||||
maxTooltipDistance(16),
|
||||
userActionCatchSensitivity(1),
|
||||
toolbarIconSize(16),
|
||||
userActionColor("steelblue"),
|
||||
userActionCompositionMode(QPainter::CompositionMode_SourceOver),
|
||||
userActionOverlayPen(QColor("darkblue").darker(), 1.5, Qt::DashLine),
|
||||
userActionOverlayBrush(QColorWithAlphaF(QColor("steelblue"), 0.2)),
|
||||
userActionOpaquePen(QColor("darkblue").darker(), 1.5, Qt::DashLine),
|
||||
userActionOpaqueBrush(QColor("aliceblue")),
|
||||
userActionMarkerPen(QColor("red").darker(), 1, Qt::DotLine),
|
||||
userActionMarkerBrush(QColorWithAlphaF(QColor("red"), 0.2)),
|
||||
userActionMarkerType(jkqtpuamtCircleAndCrossHair),
|
||||
userActionFontName(QApplication::font().family()+"+XITS"),
|
||||
userActionFontSize(QApplication::font().pointSizeF()*1.1),
|
||||
userActionMarkerDiameter(12),
|
||||
mousePositionTemplate("(%1; %2)"),
|
||||
displayMousePosition(true),
|
||||
toolbarEnabled(true),
|
||||
@ -23,7 +34,40 @@ void JKQTPlotterStyle::loadSettings(const QSettings &settings, const QString &gr
|
||||
{
|
||||
toolbarIconSize=settings.value(group+"toolbar_icon_size", defaultStyle.toolbarIconSize).toInt();
|
||||
mousePositionTemplate=settings.value(group+"mouse_position_template", defaultStyle.mousePositionTemplate).toString();
|
||||
userActionColor=jkqtp_String2QColor(settings.value(group+"useraction_color", jkqtp_QColor2String(defaultStyle.userActionColor)).toString());
|
||||
|
||||
|
||||
userActionOverlayPen=defaultStyle.userActionOverlayPen;
|
||||
userActionOverlayPen.setColor(jkqtp_String2QColor(settings.value(group+"useraction_overlay_color", jkqtp_QColor2String(defaultStyle.userActionOverlayPen.color())).toString()));
|
||||
userActionOverlayPen.setStyle(jkqtp_String2QPenStyle(settings.value(group+"useraction_overlay_penstyle", jkqtp_QPenStyle2String(defaultStyle.userActionOverlayPen.style())).toString()));
|
||||
userActionOverlayPen.setWidthF(settings.value(group+"useraction_overlay_linewidth", defaultStyle.userActionOverlayPen.widthF()).toDouble());
|
||||
userActionOverlayBrush=defaultStyle.userActionOverlayBrush;
|
||||
userActionOverlayBrush.setColor(jkqtp_String2QColor(settings.value(group+"useraction_overlay_brushcolor", jkqtp_QColor2String(defaultStyle.userActionOverlayBrush.color())).toString()));
|
||||
userActionOverlayBrush.setStyle(jkqtp_String2QBrushStyle(settings.value(group+"useraction_overlay_brushstyle", jkqtp_QBrushStyle2String(defaultStyle.userActionOverlayBrush.style())).toString()));
|
||||
|
||||
userActionOpaquePen=defaultStyle.userActionOpaquePen;
|
||||
userActionOpaquePen.setColor(jkqtp_String2QColor(settings.value(group+"useraction_opaque_color", jkqtp_QColor2String(defaultStyle.userActionOpaquePen.color())).toString()));
|
||||
userActionOpaquePen.setStyle(jkqtp_String2QPenStyle(settings.value(group+"useraction_opaque_penstyle", jkqtp_QPenStyle2String(defaultStyle.userActionOpaquePen.style())).toString()));
|
||||
userActionOpaquePen.setWidthF(settings.value(group+"useraction_opaque_linewidth", defaultStyle.userActionOpaquePen.widthF()).toDouble());
|
||||
userActionOpaqueBrush=defaultStyle.userActionOpaqueBrush;
|
||||
userActionOpaqueBrush.setColor(jkqtp_String2QColor(settings.value(group+"useraction_opaque_brushcolor", jkqtp_QColor2String(defaultStyle.userActionOpaqueBrush.color())).toString()));
|
||||
userActionOpaqueBrush.setStyle(jkqtp_String2QBrushStyle(settings.value(group+"useraction_opaque_brushstyle", jkqtp_QBrushStyle2String(defaultStyle.userActionOpaqueBrush.style())).toString()));
|
||||
|
||||
userActionMarkerPen=defaultStyle.userActionMarkerPen;
|
||||
userActionMarkerPen.setColor(jkqtp_String2QColor(settings.value(group+"useraction_marker_color", jkqtp_QColor2String(defaultStyle.userActionMarkerPen.color())).toString()));
|
||||
userActionMarkerPen.setStyle(jkqtp_String2QPenStyle(settings.value(group+"useraction_marker_penstyle", jkqtp_QPenStyle2String(defaultStyle.userActionMarkerPen.style())).toString()));
|
||||
userActionMarkerPen.setWidthF(settings.value(group+"useraction_marker_linewidth", defaultStyle.userActionMarkerPen.widthF()).toDouble());
|
||||
userActionMarkerBrush=defaultStyle.userActionMarkerBrush;
|
||||
userActionMarkerBrush.setColor(jkqtp_String2QColor(settings.value(group+"useraction_marker_brushcolor", jkqtp_QColor2String(defaultStyle.userActionMarkerBrush.color())).toString()));
|
||||
userActionMarkerBrush.setStyle(jkqtp_String2QBrushStyle(settings.value(group+"useraction_marker_brushstyle", jkqtp_QBrushStyle2String(defaultStyle.userActionMarkerBrush.style())).toString()));
|
||||
|
||||
userActionMarkerDiameter=settings.value(group+"useraction_marker_diameter", defaultStyle.userActionMarkerDiameter).toInt();
|
||||
userActionMarkerType=String2JKQTPUserActionMarkerType(settings.value(group+"useraction_marker_type",JKQTPUserActionMarkerType2String(defaultStyle.userActionMarkerType)).toString());
|
||||
|
||||
maxTooltipDistance=settings.value(group+"max_tooltip_distance", defaultStyle.maxTooltipDistance).toInt();
|
||||
userActionCatchSensitivity=settings.value(group+"useraction_catch_sensitivity", defaultStyle.userActionCatchSensitivity).toInt();
|
||||
userActionFontName=settings.value(group+"useraction_font_name", defaultStyle.userActionFontName).toString();
|
||||
userActionFontSize=settings.value(group+"useraction_font_size", defaultStyle.userActionFontSize).toDouble();
|
||||
|
||||
toolbarEnabled=settings.value(group+"toolbar_enabled", defaultStyle.toolbarEnabled).toBool();
|
||||
toolbarAlwaysOn=settings.value(group+"toolbar_always_visible", defaultStyle.toolbarAlwaysOn).toBool();
|
||||
displayMousePosition=settings.value(group+"display_mouse_position", defaultStyle.displayMousePosition).toBool();
|
||||
@ -84,7 +128,33 @@ void JKQTPlotterStyle::saveSettings(QSettings &settings, const QString &group) c
|
||||
{
|
||||
int cnt=0;
|
||||
|
||||
settings.setValue(group+"useraction_color", jkqtp_QColor2String(userActionColor));
|
||||
settings.setValue(group+"max_tooltip_distance", maxTooltipDistance);
|
||||
settings.setValue(group+"useraction_catch_sensitivity", userActionCatchSensitivity);
|
||||
|
||||
settings.setValue(group+"useraction_overlay_color", jkqtp_QColor2String(userActionOverlayPen.color()));
|
||||
settings.setValue(group+"useraction_overlay_penstyle", jkqtp_QPenStyle2String(userActionOverlayPen.style()));
|
||||
settings.setValue(group+"useraction_overlay_linewidth", userActionOverlayPen.widthF());
|
||||
settings.setValue(group+"useraction_overlay_brushcolor", jkqtp_QColor2String(userActionOverlayBrush.color()));
|
||||
settings.setValue(group+"useraction_overlay_brushstyle", jkqtp_QBrushStyle2String(userActionOverlayBrush.style()));
|
||||
|
||||
settings.setValue(group+"useraction_opaque_color", jkqtp_QColor2String(userActionOpaquePen.color()));
|
||||
settings.setValue(group+"useraction_opaque_penstyle", jkqtp_QPenStyle2String(userActionOpaquePen.style()));
|
||||
settings.setValue(group+"useraction_opaque_linewidth", userActionOpaquePen.widthF());
|
||||
settings.setValue(group+"useraction_opaque_brushcolor", jkqtp_QColor2String(userActionOpaqueBrush.color()));
|
||||
settings.setValue(group+"useraction_opaque_brushstyle", jkqtp_QBrushStyle2String(userActionOpaqueBrush.style()));
|
||||
|
||||
settings.setValue(group+"useraction_marker_color", jkqtp_QColor2String(userActionMarkerPen.color()));
|
||||
settings.setValue(group+"useraction_marker_penstyle", jkqtp_QPenStyle2String(userActionMarkerPen.style()));
|
||||
settings.setValue(group+"useraction_marker_linewidth", userActionMarkerPen.widthF());
|
||||
settings.setValue(group+"useraction_marker_brushcolor", jkqtp_QColor2String(userActionMarkerBrush.color()));
|
||||
settings.setValue(group+"useraction_marker_brushstyle", jkqtp_QBrushStyle2String(userActionMarkerBrush.style()));
|
||||
settings.setValue(group+"useraction_marker_diameter", userActionMarkerDiameter);
|
||||
settings.setValue(group+"useraction_marker_type", JKQTPUserActionMarkerType2String(userActionMarkerType));
|
||||
|
||||
settings.setValue(group+"useraction_font_name", userActionFontName);
|
||||
settings.setValue(group+"useraction_font_size", userActionFontSize);
|
||||
|
||||
|
||||
settings.setValue(group+"toolbar_enabled", toolbarEnabled);
|
||||
settings.setValue(group+"toolbar_always_visible", toolbarAlwaysOn);
|
||||
settings.setValue(group+"toolbar_icon_size", toolbarIconSize);
|
||||
|
@ -64,12 +64,38 @@ public:
|
||||
|
||||
|
||||
|
||||
/** \brief maximum distance at which a tooltip for a point is still displayed, when the user action jkqtpmdaToolTipForClosestDataPoint is executed */
|
||||
int maxTooltipDistance;
|
||||
/** \brief sensitivity (i.e. max. distance to see as one point) for user actions */
|
||||
int userActionCatchSensitivity;
|
||||
|
||||
/** \brief width/height of the icons in the plotter toolbar in pixel */
|
||||
int toolbarIconSize;
|
||||
/** \brief fill color of the zoom rectangle \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QColor userActionColor;
|
||||
/** \brief the QPainter::CompositionMode used to draw the zoom rectangle etc. \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QPainter::CompositionMode userActionCompositionMode;
|
||||
/** \brief pen for user actions that overlay the plot (typically semi-transparent, like e.g. zoom-rectangles) \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QPen userActionOverlayPen;
|
||||
/** \brief brush for user actions (typically semi-transparent, like e.g. zoom-rectangles) \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QBrush userActionOverlayBrush;
|
||||
|
||||
/** \brief pen for user actions that cover parts of the plot (typically opaque, like e.g. tooltips) \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QPen userActionOpaquePen;
|
||||
/** \brief brush for user actions that cover parts of the plot (typically opaque, like e.g. tooltips) \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QBrush userActionOpaqueBrush;
|
||||
|
||||
/** \brief pen for location markers of user actions on the plot \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QPen userActionMarkerPen;
|
||||
/** \brief brush for location markers of user actions on the plot \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QBrush userActionMarkerBrush;
|
||||
/** \brief type of the location markers of user actions on the plot \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
JKQTPUserActionMarkerType userActionMarkerType;
|
||||
|
||||
/** \brief font name to use for text of user actions \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
QString userActionFontName;
|
||||
/** \brief font size [pt] to use for text of user actions \see \ref JKQTPLOTTER_USERMOUSEINTERACTION_MOUSEDRAG */
|
||||
double userActionFontSize;
|
||||
|
||||
/** \brief size (diameter) of markers drawn by user actions */
|
||||
int userActionMarkerDiameter;
|
||||
|
||||
/** \brief this string is used to generate the position output above the graph (\c %1 is replaced by the x-position, \c %2 by the y-position)
|
||||
*
|
||||
* By default simply <code>"(%1, %2)</code> is used to format this display (e.g. <code>(1.35, -4.56)</code>).
|
||||
@ -124,6 +150,7 @@ public:
|
||||
/** \brief action to perform on a double-click of the mouse buttons (depending on the button and the modifiers) */
|
||||
JKQTPMouseDoubleClickActionsHashMap registeredMouseDoubleClickActions;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -209,7 +209,7 @@ JKQTPErrorPlotstyleComboBox::JKQTPErrorPlotstyleComboBox(QWidget *parent):
|
||||
setCurrentIndex(2);
|
||||
}
|
||||
|
||||
JKQTPErrorPlotstyle JKQTPErrorPlotstyleComboBox::getErrorStyle() const
|
||||
JKQTPErrorPlotstyle JKQTPErrorPlotstyleComboBox::getErrorLineStyle() const
|
||||
{
|
||||
return String2JKQTPErrorPlotstyle(itemData(currentIndex()).toString());
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ class JKQTP_LIB_EXPORT JKQTPErrorPlotstyleComboBox: public QComboBox {
|
||||
public:
|
||||
JKQTPErrorPlotstyleComboBox(QWidget* parent=nullptr);
|
||||
|
||||
JKQTPErrorPlotstyle getErrorStyle() const;
|
||||
JKQTPErrorPlotstyle getErrorLineStyle() const;
|
||||
void setSymbolType(JKQTPErrorPlotstyle symbol);
|
||||
void setCurrentErrorStyle(JKQTPErrorPlotstyle symbol);
|
||||
protected:
|
||||
|
BIN
lib/jkqtplotterressources/images/jkqtp_mouseact_default.png
Normal file
After Width: | Height: | Size: 953 B |
379
lib/jkqtplotterressources/images/jkqtp_mouseact_default.svg
Normal file
@ -0,0 +1,379 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="128"
|
||||
height="128"
|
||||
id="svg1307"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.91 r13725"
|
||||
version="1.0"
|
||||
sodipodi:docname="jkqtp_mouseact_default.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svgz.inkscape"
|
||||
inkscape:export-filename="jkqtp_mouseact_default.png"
|
||||
inkscape:export-xdpi="16.875"
|
||||
inkscape:export-ydpi="16.875">
|
||||
<defs
|
||||
id="defs1309">
|
||||
<linearGradient
|
||||
id="linearGradient2497">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop2499" />
|
||||
<stop
|
||||
id="stop11148"
|
||||
offset="0.5"
|
||||
style="stop-color:#ececec;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#c1c1c1;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop2501" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3251">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3253" />
|
||||
<stop
|
||||
id="stop14161"
|
||||
offset="0.7087912"
|
||||
style="stop-color:#090909;stop-opacity:0.67870039;" />
|
||||
<stop
|
||||
style="stop-color:#131313;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3255" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3149">
|
||||
<stop
|
||||
id="stop3151"
|
||||
offset="0"
|
||||
style="stop-color:#8e8e8e;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3153"
|
||||
offset="1"
|
||||
style="stop-color:#f8f8f8;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient2466"
|
||||
x1="3006.272"
|
||||
y1="11729.52"
|
||||
x2="-1062.9232"
|
||||
y2="1799.6183"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6116"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6118"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6120"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6122"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6124"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6126"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6128"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6130"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6132"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6134"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997" />
|
||||
<linearGradient
|
||||
y2="63.698586"
|
||||
x2="23.997318"
|
||||
y1="63.698586"
|
||||
x1="34.001774"
|
||||
gradientTransform="matrix(1.6,0,0,1,-14.4,0)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3599"
|
||||
xlink:href="#linearGradient3520"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
gradientTransform="matrix(2.1360441,0,0,1.446027,-72.706823,-25.184217)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3417"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
gradientTransform="matrix(2.1360441,0,0,-1.446027,-72.706823,154.18422)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3413"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<clipPath
|
||||
id="clipPath3393"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<path
|
||||
id="path3395"
|
||||
d="M 13.8125,8 C 10.584167,8 8,10.584167 8,13.8125 L 8,114.1875 C 8,117.41583 10.584167,120 13.8125,120 L 114.1875,120 C 117.41583,120 120,117.41583 120,114.1875 L 120,13.8125 C 120,10.584167 117.41583,8 114.1875,8 L 13.8125,8 z M 21.8125,16 L 106.1875,16 C 109.41583,16 112,18.584167 112,21.8125 L 112,106.1875 C 112,109.41583 109.41583,112 106.1875,112 L 21.8125,112 C 18.584166,112 16,109.41583 16,106.1875 L 16,21.8125 C 16,18.584166 18.584167,16 21.8125,16 z "
|
||||
style="opacity:1;fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="11.771669"
|
||||
x2="61.978939"
|
||||
y1="98.41069"
|
||||
x1="112"
|
||||
id="linearGradient3191"
|
||||
xlink:href="#linearGradient3185"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(2.1360441,0,0,1.446027,-72.706823,-26.184217)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
id="radialGradient3139"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient3133"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3135"
|
||||
offset="0"
|
||||
style="stop-color:#646661;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop3137"
|
||||
offset="1"
|
||||
style="stop-color:#111111;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3185"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3187"
|
||||
offset="0"
|
||||
style="stop-color:#eeeeee;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3189"
|
||||
offset="1"
|
||||
style="stop-color:#eeeeee;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3520"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3522"
|
||||
offset="0"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3524"
|
||||
offset="1"
|
||||
style="stop-color:#ffffff;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.6568544"
|
||||
inkscape:cx="31.094592"
|
||||
inkscape:cy="56.473506"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
guidetolerance="0.1px"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1018"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1">
|
||||
<sodipodi:guide
|
||||
orientation="horizontal"
|
||||
position="14.142135,38.890872"
|
||||
id="guide2204" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="-1365.2977"
|
||||
id="guide2288" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="-21.879771"
|
||||
id="guide2290" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="223.17366"
|
||||
id="guide2298" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="22.424242"
|
||||
id="guide11172" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata1312">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Oxygen team</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/LGPL/2.1/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
style="opacity:0.40163933"
|
||||
transform="matrix(-0.782995,0,0,0.650879,-2271.966,689.799)"
|
||||
id="g4640" />
|
||||
<g
|
||||
id="g4646"
|
||||
transform="matrix(-0.782995,0,0,0.650879,-2271.966,689.799)"
|
||||
style="opacity:0.40163933" />
|
||||
<g
|
||||
id="g4730"
|
||||
transform="matrix(1,0,0,0.650879,928.9972,697.1268)"
|
||||
style="opacity:0.40163933" />
|
||||
<g
|
||||
style="opacity:0.40163933"
|
||||
transform="matrix(1,0,0,0.650879,928.9972,697.1268)"
|
||||
id="g4748" />
|
||||
<path
|
||||
style="fill:#b3b3b3;fill-rule:evenodd;stroke:#808080;stroke-width:7.25476599;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 32.925085,83.185038 48.177219,67.831095 95.628119,115.59874 110.37459,100.95293 62.975297,52.978216 78.22743,37.624273 10.100748,14.342826 Z"
|
||||
id="path5408"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
<path
|
||||
style="fill:#f9f9f9;fill-rule:evenodd;stroke:#000000;stroke-width:7.25476599;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 34.912783,76.740986 50.164917,61.387038 97.615817,109.15469 112.36228,94.508876 64.962995,46.534159 80.215128,31.180216 12.088445,7.8987708 Z"
|
||||
id="path5408-9"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 12 KiB |
BIN
lib/jkqtplotterressources/images/jkqtp_mouseact_drag.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
388
lib/jkqtplotterressources/images/jkqtp_mouseact_drag.svg
Normal file
@ -0,0 +1,388 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="128"
|
||||
height="128"
|
||||
id="svg1307"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.91 r13725"
|
||||
version="1.0"
|
||||
sodipodi:docname="jkqtp_mouseact_drag.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svgz.inkscape"
|
||||
inkscape:export-filename="jkqtp_mouseact_drag.png"
|
||||
inkscape:export-xdpi="16.875"
|
||||
inkscape:export-ydpi="16.875">
|
||||
<defs
|
||||
id="defs1309">
|
||||
<linearGradient
|
||||
id="linearGradient2497">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop2499" />
|
||||
<stop
|
||||
id="stop11148"
|
||||
offset="0.5"
|
||||
style="stop-color:#ececec;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#c1c1c1;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop2501" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3251">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3253" />
|
||||
<stop
|
||||
id="stop14161"
|
||||
offset="0.7087912"
|
||||
style="stop-color:#090909;stop-opacity:0.67870039;" />
|
||||
<stop
|
||||
style="stop-color:#131313;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3255" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3149">
|
||||
<stop
|
||||
id="stop3151"
|
||||
offset="0"
|
||||
style="stop-color:#8e8e8e;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3153"
|
||||
offset="1"
|
||||
style="stop-color:#f8f8f8;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient2466"
|
||||
x1="3006.272"
|
||||
y1="11729.52"
|
||||
x2="-1062.9232"
|
||||
y2="1799.6183"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6116"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6118"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6120"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6122"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6124"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6126"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6128"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6130"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6132"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6134"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997" />
|
||||
<linearGradient
|
||||
y2="63.698586"
|
||||
x2="23.997318"
|
||||
y1="63.698586"
|
||||
x1="34.001774"
|
||||
gradientTransform="matrix(1.6,0,0,1,-14.4,0)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3599"
|
||||
xlink:href="#linearGradient3520"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
gradientTransform="matrix(2.1360441,0,0,1.446027,-72.706823,-25.184217)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3417"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
gradientTransform="matrix(2.1360441,0,0,-1.446027,-72.706823,154.18422)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3413"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<clipPath
|
||||
id="clipPath3393"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<path
|
||||
id="path3395"
|
||||
d="M 13.8125,8 C 10.584167,8 8,10.584167 8,13.8125 L 8,114.1875 C 8,117.41583 10.584167,120 13.8125,120 L 114.1875,120 C 117.41583,120 120,117.41583 120,114.1875 L 120,13.8125 C 120,10.584167 117.41583,8 114.1875,8 L 13.8125,8 z M 21.8125,16 L 106.1875,16 C 109.41583,16 112,18.584167 112,21.8125 L 112,106.1875 C 112,109.41583 109.41583,112 106.1875,112 L 21.8125,112 C 18.584166,112 16,109.41583 16,106.1875 L 16,21.8125 C 16,18.584166 18.584167,16 21.8125,16 z "
|
||||
style="opacity:1;fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="11.771669"
|
||||
x2="61.978939"
|
||||
y1="98.41069"
|
||||
x1="112"
|
||||
id="linearGradient3191"
|
||||
xlink:href="#linearGradient3185"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(2.1360441,0,0,1.446027,-72.706823,-26.184217)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
id="radialGradient3139"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient3133"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3135"
|
||||
offset="0"
|
||||
style="stop-color:#646661;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop3137"
|
||||
offset="1"
|
||||
style="stop-color:#111111;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3185"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3187"
|
||||
offset="0"
|
||||
style="stop-color:#eeeeee;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3189"
|
||||
offset="1"
|
||||
style="stop-color:#eeeeee;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3520"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3522"
|
||||
offset="0"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3524"
|
||||
offset="1"
|
||||
style="stop-color:#ffffff;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.8284272"
|
||||
inkscape:cx="-79.515447"
|
||||
inkscape:cy="51.954067"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
guidetolerance="0.1px"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1018"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1">
|
||||
<sodipodi:guide
|
||||
orientation="horizontal"
|
||||
position="14.142135,38.890872"
|
||||
id="guide2204" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="-1365.2977"
|
||||
id="guide2288" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="139.65359,4.9497473"
|
||||
id="guide2290" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="223.17366"
|
||||
id="guide2298" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="22.424242"
|
||||
id="guide11172" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata1312">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Oxygen team</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/LGPL/2.1/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
style="opacity:0.40163933"
|
||||
transform="matrix(-0.782995,0,0,0.650879,-2271.966,689.799)"
|
||||
id="g4640" />
|
||||
<g
|
||||
id="g4646"
|
||||
transform="matrix(-0.782995,0,0,0.650879,-2271.966,689.799)"
|
||||
style="opacity:0.40163933" />
|
||||
<g
|
||||
id="g4730"
|
||||
transform="matrix(1,0,0,0.650879,928.9972,697.1268)"
|
||||
style="opacity:0.40163933" />
|
||||
<g
|
||||
style="opacity:0.40163933"
|
||||
transform="matrix(1,0,0,0.650879,928.9972,697.1268)"
|
||||
id="g4748" />
|
||||
<path
|
||||
style="fill:#f9f9f9;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 89.498831,23.715752 C 84.278291,15.039705 68.82212,1.9565704 73.805375,33.446236 63.083651,-0.37569651 47.394752,0.55006069 57.462405,38.613693 41.019872,0.00717169 24.932956,2.6049039 45.776136,48.759795 18.510681,4.2706688 11.037665,27.443116 36.596324,67.302326 27.665797,54.118743 10.992539,48.564209 20.891338,75.998602 c 2.131742,5.908094 5.966709,16.406725 11.831724,22.096364 2.451067,2.377774 6.746972,4.044924 30.619431,11.405414 l 3.48121,6.41449 c 14.597838,-6.73502 28.036087,-11.70842 44.190797,-19.245415 0,0 -2.9263,-4.532142 -3.47929,-7.127205 -1.46004,-6.851804 4.29928,-3.005656 0.69587,-21.027207 -3.89176,-19.463589 -7.10127,-25.469689 -18.732249,-44.799291 z"
|
||||
id="path4195"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sccccsscccsss" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
d="M 55.507881,75.320546 70.003569,99.71573"
|
||||
id="path4200"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
d="m 68.825268,67.836745 13.67031,24.867098"
|
||||
id="path4200-0"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
d="M 82.870979,61.156101 95.319925,86.656564"
|
||||
id="path4200-2"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 13 KiB |
BIN
lib/jkqtplotterressources/images/jkqtp_mouseact_ruler.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
406
lib/jkqtplotterressources/images/jkqtp_mouseact_ruler.svg
Normal file
@ -0,0 +1,406 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="128"
|
||||
height="128"
|
||||
id="svg1307"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.91 r13725"
|
||||
version="1.0"
|
||||
sodipodi:docname="jkqtp_mouseact_ruler.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svgz.inkscape"
|
||||
inkscape:export-filename="jkqtp_mouseact_ruler.png"
|
||||
inkscape:export-xdpi="16.875"
|
||||
inkscape:export-ydpi="16.875">
|
||||
<defs
|
||||
id="defs1309">
|
||||
<linearGradient
|
||||
id="linearGradient2497">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop2499" />
|
||||
<stop
|
||||
id="stop11148"
|
||||
offset="0.5"
|
||||
style="stop-color:#ececec;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#c1c1c1;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop2501" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3251">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3253" />
|
||||
<stop
|
||||
id="stop14161"
|
||||
offset="0.7087912"
|
||||
style="stop-color:#090909;stop-opacity:0.67870039;" />
|
||||
<stop
|
||||
style="stop-color:#131313;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3255" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3149">
|
||||
<stop
|
||||
id="stop3151"
|
||||
offset="0"
|
||||
style="stop-color:#8e8e8e;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3153"
|
||||
offset="1"
|
||||
style="stop-color:#f8f8f8;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient2466"
|
||||
x1="3006.272"
|
||||
y1="11729.52"
|
||||
x2="-1062.9232"
|
||||
y2="1799.6183"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6116"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6118"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6120"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6122"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6124"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6126"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6128"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6130"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6132"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6134"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997" />
|
||||
<linearGradient
|
||||
y2="63.698586"
|
||||
x2="23.997318"
|
||||
y1="63.698586"
|
||||
x1="34.001774"
|
||||
gradientTransform="matrix(1.6,0,0,1,-14.4,0)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3599"
|
||||
xlink:href="#linearGradient3520"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
gradientTransform="matrix(2.1360441,0,0,1.446027,-72.706823,-25.184217)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3417"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
gradientTransform="matrix(2.1360441,0,0,-1.446027,-72.706823,154.18422)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3413"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<clipPath
|
||||
id="clipPath3393"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<path
|
||||
id="path3395"
|
||||
d="M 13.8125,8 C 10.584167,8 8,10.584167 8,13.8125 L 8,114.1875 C 8,117.41583 10.584167,120 13.8125,120 L 114.1875,120 C 117.41583,120 120,117.41583 120,114.1875 L 120,13.8125 C 120,10.584167 117.41583,8 114.1875,8 L 13.8125,8 z M 21.8125,16 L 106.1875,16 C 109.41583,16 112,18.584167 112,21.8125 L 112,106.1875 C 112,109.41583 109.41583,112 106.1875,112 L 21.8125,112 C 18.584166,112 16,109.41583 16,106.1875 L 16,21.8125 C 16,18.584166 18.584167,16 21.8125,16 z "
|
||||
style="opacity:1;fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="11.771669"
|
||||
x2="61.978939"
|
||||
y1="98.41069"
|
||||
x1="112"
|
||||
id="linearGradient3191"
|
||||
xlink:href="#linearGradient3185"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(2.1360441,0,0,1.446027,-72.706823,-26.184217)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
id="radialGradient3139"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient3133"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3135"
|
||||
offset="0"
|
||||
style="stop-color:#646661;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop3137"
|
||||
offset="1"
|
||||
style="stop-color:#111111;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3185"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3187"
|
||||
offset="0"
|
||||
style="stop-color:#eeeeee;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3189"
|
||||
offset="1"
|
||||
style="stop-color:#eeeeee;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3520"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3522"
|
||||
offset="0"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3524"
|
||||
offset="1"
|
||||
style="stop-color:#ffffff;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.6568544"
|
||||
inkscape:cx="31.094592"
|
||||
inkscape:cy="56.473506"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
guidetolerance="0.1px"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1018"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1">
|
||||
<sodipodi:guide
|
||||
orientation="horizontal"
|
||||
position="14.142135,38.890872"
|
||||
id="guide2204" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="-1365.2977"
|
||||
id="guide2288" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="135.05739,54.800774"
|
||||
id="guide2290" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="223.17366"
|
||||
id="guide2298" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata1312">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Oxygen team</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/LGPL/2.1/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
style="opacity:0.40163933"
|
||||
transform="matrix(-0.782995,0,0,0.650879,-2271.966,689.799)"
|
||||
id="g4640" />
|
||||
<g
|
||||
id="g4646"
|
||||
transform="matrix(-0.782995,0,0,0.650879,-2271.966,689.799)"
|
||||
style="opacity:0.40163933" />
|
||||
<g
|
||||
id="g4730"
|
||||
transform="matrix(1,0,0,0.650879,928.9972,697.1268)"
|
||||
style="opacity:0.40163933" />
|
||||
<g
|
||||
style="opacity:0.40163933"
|
||||
transform="matrix(1,0,0,0.650879,928.9972,697.1268)"
|
||||
id="g4748" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffeeaa;fill-opacity:1;stroke:#000000;stroke-width:4.2449708;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect5443"
|
||||
width="125.69398"
|
||||
height="36.957787"
|
||||
x="25.908358"
|
||||
y="-17.185261"
|
||||
transform="matrix(0.70438445,0.70981867,-0.70438445,0.70981867,0,0)" />
|
||||
<g
|
||||
id="g5558"
|
||||
style="stroke-width:6;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
transform="matrix(0.99709789,0,0,0.97633067,-0.71985981,2.6949177)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5449"
|
||||
d="M 81.664347,107.43458 94.614519,94.384499"
|
||||
style="fill:#ffeeaa;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5451"
|
||||
d="M 69.016218,94.688874 81.966391,81.638793"
|
||||
style="fill:#ffeeaa;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:#ffeeaa;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 56.368088,81.943165 69.318261,68.893084"
|
||||
id="path5453"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffeeaa;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 43.719962,69.197461 56.670135,56.14738"
|
||||
id="path5457"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#ffeeaa;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 31.071834,56.451754 44.022006,43.401673"
|
||||
id="path5459"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5461"
|
||||
d="M 18.423704,43.706047 31.373877,30.655966"
|
||||
style="fill:#ffeeaa;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 13 KiB |
BIN
lib/jkqtplotterressources/images/jkqtp_mouseact_tooltip.png
Normal file
After Width: | Height: | Size: 802 B |
395
lib/jkqtplotterressources/images/jkqtp_mouseact_tooltip.svg
Normal file
@ -0,0 +1,395 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="128"
|
||||
height="128"
|
||||
id="svg1307"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.91 r13725"
|
||||
version="1.0"
|
||||
sodipodi:docname="jkqtp_mouseact_tooltip.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svgz.inkscape"
|
||||
inkscape:export-filename="jkqtp_mouseact_tooltip.png"
|
||||
inkscape:export-xdpi="16.875"
|
||||
inkscape:export-ydpi="16.875">
|
||||
<defs
|
||||
id="defs1309">
|
||||
<linearGradient
|
||||
id="linearGradient2497">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop2499" />
|
||||
<stop
|
||||
id="stop11148"
|
||||
offset="0.5"
|
||||
style="stop-color:#ececec;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#c1c1c1;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop2501" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3251">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3253" />
|
||||
<stop
|
||||
id="stop14161"
|
||||
offset="0.7087912"
|
||||
style="stop-color:#090909;stop-opacity:0.67870039;" />
|
||||
<stop
|
||||
style="stop-color:#131313;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3255" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3149">
|
||||
<stop
|
||||
id="stop3151"
|
||||
offset="0"
|
||||
style="stop-color:#8e8e8e;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3153"
|
||||
offset="1"
|
||||
style="stop-color:#f8f8f8;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient2466"
|
||||
x1="3006.272"
|
||||
y1="11729.52"
|
||||
x2="-1062.9232"
|
||||
y2="1799.6183"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6116"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6118"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6120"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6122"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6124"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6126"
|
||||
x1="74"
|
||||
y1="77"
|
||||
x2="74.5"
|
||||
y2="40.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,2.538)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6128"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6130"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6132"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3149"
|
||||
id="linearGradient6134"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="63.393002"
|
||||
y1="33.037998"
|
||||
x2="63.893002"
|
||||
y2="-3.4619997" />
|
||||
<linearGradient
|
||||
y2="63.698586"
|
||||
x2="23.997318"
|
||||
y1="63.698586"
|
||||
x1="34.001774"
|
||||
gradientTransform="matrix(1.6,0,0,1,-14.4,0)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3599"
|
||||
xlink:href="#linearGradient3520"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
gradientTransform="matrix(2.1360441,0,0,1.446027,-72.706823,-25.184217)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3417"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
gradientTransform="matrix(2.1360441,0,0,-1.446027,-72.706823,154.18422)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3413"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<clipPath
|
||||
id="clipPath3393"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<path
|
||||
id="path3395"
|
||||
d="M 13.8125,8 C 10.584167,8 8,10.584167 8,13.8125 L 8,114.1875 C 8,117.41583 10.584167,120 13.8125,120 L 114.1875,120 C 117.41583,120 120,117.41583 120,114.1875 L 120,13.8125 C 120,10.584167 117.41583,8 114.1875,8 L 13.8125,8 z M 21.8125,16 L 106.1875,16 C 109.41583,16 112,18.584167 112,21.8125 L 112,106.1875 C 112,109.41583 109.41583,112 106.1875,112 L 21.8125,112 C 18.584166,112 16,109.41583 16,106.1875 L 16,21.8125 C 16,18.584166 18.584167,16 21.8125,16 z "
|
||||
style="opacity:1;fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="11.771669"
|
||||
x2="61.978939"
|
||||
y1="98.41069"
|
||||
x1="112"
|
||||
id="linearGradient3191"
|
||||
xlink:href="#linearGradient3185"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(2.1360441,0,0,1.446027,-72.706823,-26.184217)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
r="40"
|
||||
fy="35.686314"
|
||||
fx="64"
|
||||
cy="35.686314"
|
||||
cx="64"
|
||||
id="radialGradient3139"
|
||||
xlink:href="#linearGradient3133"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient3133"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3135"
|
||||
offset="0"
|
||||
style="stop-color:#646661;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop3137"
|
||||
offset="1"
|
||||
style="stop-color:#111111;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3185"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3187"
|
||||
offset="0"
|
||||
style="stop-color:#eeeeee;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3189"
|
||||
offset="1"
|
||||
style="stop-color:#eeeeee;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3520"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3522"
|
||||
offset="0"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3524"
|
||||
offset="1"
|
||||
style="stop-color:#ffffff;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.6568544"
|
||||
inkscape:cx="31.094592"
|
||||
inkscape:cy="56.473506"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
guidetolerance="0.1px"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1018"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1">
|
||||
<sodipodi:guide
|
||||
orientation="horizontal"
|
||||
position="14.142135,38.890872"
|
||||
id="guide2204" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="-1365.2977"
|
||||
id="guide2288" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="135.05739,54.800774"
|
||||
id="guide2290" />
|
||||
<sodipodi:guide
|
||||
orientation="vertical"
|
||||
position="223.17366"
|
||||
id="guide2298" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata1312">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Oxygen team</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/LGPL/2.1/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
style="opacity:0.40163933"
|
||||
transform="matrix(-0.782995,0,0,0.650879,-2271.966,689.799)"
|
||||
id="g4640" />
|
||||
<g
|
||||
id="g4646"
|
||||
transform="matrix(-0.782995,0,0,0.650879,-2271.966,689.799)"
|
||||
style="opacity:0.40163933" />
|
||||
<g
|
||||
id="g4730"
|
||||
transform="matrix(1,0,0,0.650879,928.9972,697.1268)"
|
||||
style="opacity:0.40163933" />
|
||||
<g
|
||||
style="opacity:0.40163933"
|
||||
transform="matrix(1,0,0,0.650879,928.9972,697.1268)"
|
||||
id="g4748" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-width:4.35676241;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 1.9006296,19.23842 25.499757,42.837549"
|
||||
id="path5568"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-width:4.35676241;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 1.9006299,42.837549 25.499757,19.23842"
|
||||
id="path5568-9"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#d7e3f4;fill-rule:evenodd;stroke:#0000aa;stroke-width:4.61373997;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 17.793819,38.57022 13.379302,5.433219 88.710209,-0.753951 0,48.222723 -89.808804,0 0,-22.656368 z"
|
||||
id="path5585"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccc" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16.94131088px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="37.818214"
|
||||
y="59.321354"
|
||||
id="text5587"
|
||||
sodipodi:linespacing="125%"
|
||||
transform="scale(0.9615429,1.0399952)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5589"
|
||||
x="37.818214"
|
||||
y="59.321354">Graph1:</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
x="37.818214"
|
||||
y="80.497993"
|
||||
id="tspan5591">[123,456]</tspan></text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 13 KiB |
BIN
lib/jkqtplotterressources/images/jkqtp_mouseact_zoomrect.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
3227
lib/jkqtplotterressources/images/jkqtp_mouseact_zoomrect.svg
Normal file
After Width: | Height: | Size: 95 KiB |
BIN
lib/jkqtplotterressources/images/kruler.png
Normal file
After Width: | Height: | Size: 771 B |
@ -73,5 +73,12 @@
|
||||
<file alias="jkqtp_plot_mimage.png">images/plot_mimage.png</file>
|
||||
<file alias="jkqtp_plot_image.png">images/plot_image.png</file>
|
||||
<file alias="jkqtp_plot_rgbimage.png">images/plot_rgbimage.png</file>
|
||||
|
||||
|
||||
<file alias="jkqtp_mouseact_ruler.png">images/jkqtp_mouseact_ruler.png</file>
|
||||
<file alias="jkqtp_mouseact_tooltip.png">images/jkqtp_mouseact_tooltip.png</file>
|
||||
<file alias="jkqtp_mouseact_default.png">images/jkqtp_mouseact_default.png</file>
|
||||
<file alias="jkqtp_mouseact_drag.png">images/jkqtp_mouseact_drag.png</file>
|
||||
<file alias="jkqtp_mouseact_zoomrect.png">images/jkqtp_mouseact_zoomrect.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -40,8 +40,8 @@ graph_default_error_color_mode=darker
|
||||
graph_default_error_fill_color_mode=even_lighter
|
||||
text_default_color=black
|
||||
text_default_size=8
|
||||
text_default_font_name=MS Shell Dlg 2+XITS
|
||||
plot_label_font_name=MS Shell Dlg 2+XITS
|
||||
text_default_font_name=Arial+XITS
|
||||
plot_label_font_name=Arial+XITS
|
||||
plot_label_font_size=12
|
||||
plot_frame_visible=false
|
||||
plot_frame_color=black
|
||||
|
@ -37,8 +37,8 @@ graph_default_symbol_linewidtht=1
|
||||
graph_default_palette=Matlab
|
||||
text_default_color=black
|
||||
text_default_size=8
|
||||
text_default_font_name=MS Shell Dlg 2+XITS
|
||||
plot_label_font_name=MS Shell Dlg 2+XITS
|
||||
text_default_font_name=Arial+XITS
|
||||
plot_label_font_name=Arial+XITS
|
||||
plot_label_font_size=12
|
||||
plot_frame_visible=false
|
||||
plot_frame_color=black
|
||||
|
@ -38,8 +38,8 @@ graph_default_symbol_linewidtht=1
|
||||
graph_default_palette=Matlab
|
||||
text_default_color=black
|
||||
text_default_size=8
|
||||
text_default_font_name=MS Shell Dlg 2+XITS
|
||||
plot_label_font_name=MS Shell Dlg 2+XITS
|
||||
text_default_font_name=Arial+XITS
|
||||
plot_label_font_name=Arial+XITS
|
||||
plot_label_font_size=12
|
||||
plot_frame_visible=true
|
||||
plot_frame_color=black
|
||||
|
@ -37,8 +37,8 @@ graph_default_symbol_linewidtht=1
|
||||
graph_default_palette=Matlab
|
||||
text_default_color=black
|
||||
text_default_size=8
|
||||
text_default_font_name=MS Shell Dlg 2+XITS
|
||||
plot_label_font_name=MS Shell Dlg 2+XITS
|
||||
text_default_font_name=Arial+XITS
|
||||
plot_label_font_name=Arial+XITS
|
||||
plot_label_font_size=12
|
||||
plot_frame_visible=false
|
||||
plot_frame_color=black
|
||||
|
@ -254,3 +254,23 @@ QVector<QPointF> JKQTPDrawEllipse(double x, double y, double a, double b, double
|
||||
}
|
||||
|
||||
|
||||
|
||||
void JKQTPDrawTooltip(JKQTPEnhancedPainter &painter, double x, double y, const QRectF &rect)
|
||||
{
|
||||
QPolygonF poly;
|
||||
if (y<rect.top()) {
|
||||
poly<<rect.topLeft()<<QPointF(rect.left()+rect.width()/3, rect.top())<<QPointF(x,y)<<QPointF(rect.right()-rect.width()/3, rect.top())<< rect.topRight()<<rect.bottomRight()<<rect.bottomLeft()<<rect.topLeft();
|
||||
painter.drawPolygon(poly);
|
||||
} else if (y>rect.bottom()) {
|
||||
poly<<rect.topLeft()<<rect.topRight()<<rect.bottomRight()<<QPointF(rect.right()-rect.width()/3, rect.bottom())<<QPointF(x,y)<<QPointF(rect.left()+rect.width()/3, rect.bottom())<< rect.bottomLeft()<<rect.topLeft();
|
||||
painter.drawPolygon(poly);
|
||||
} else if (x<rect.left()) {
|
||||
poly<<QPointF(x,y)<<rect.topLeft()<<rect.topRight()<<rect.bottomRight()<<rect.bottomLeft()<<QPointF(rect.left(), rect.top()+rect.height()/2)<<QPointF(x,y);
|
||||
painter.drawPolygon(poly);
|
||||
} else if (x>rect.left()) {
|
||||
poly<<rect.topLeft()<<rect.topRight()<<QPointF(x,y)<<QPointF(rect.right(), rect.top()+rect.height()/2)<<rect.bottomRight()<<rect.bottomLeft()<<rect.topLeft();
|
||||
painter.drawPolygon(poly);
|
||||
} else {
|
||||
painter.drawRect(rect);
|
||||
}
|
||||
}
|
||||
|
@ -101,5 +101,15 @@ JKQTP_LIB_EXPORT void JKQTPPlotSymbol(QPaintDevice& paintDevice, double x, doubl
|
||||
*/
|
||||
JKQTP_LIB_EXPORT QVector<QPointF> JKQTPDrawEllipse(double x, double y, double a, double b, double angle_start=0, double angle_end=360, double alpha=0, int controlPoints=180, QPointF* x_start=nullptr, QPointF* x_end=nullptr);
|
||||
|
||||
/*! \brief draw a tooltip, using the current brush and pen of the provided painter
|
||||
\ingroup jkqtptools_drawing
|
||||
|
||||
\param painter JKQTPEnhancedPainter to use for painting
|
||||
\param x x-coordinate of position the tooltip points to
|
||||
\param y y-coordinate of position the tooltip points to
|
||||
\param rect rectangle of the main tooltip area
|
||||
*/
|
||||
JKQTP_LIB_EXPORT void JKQTPDrawTooltip(JKQTPEnhancedPainter& painter, double x, double y, const QRectF& rect);
|
||||
|
||||
|
||||
#endif // JKQTPDRAWINGTOOLS_H_INCLUDED
|
||||
|
@ -979,6 +979,9 @@ JKQTPMouseDragActions String2JKQTPMouseDragActions(const QString &act)
|
||||
if (s=="jkqtpmdadrawrectforevent"||s=="drawellipse"||s=="ellipse") return jkqtpmdaDrawEllipseForEvent;
|
||||
if (s=="jkqtpmdadrawrectforevent"||s=="drawline"||s=="line") return jkqtpmdaDrawLineForEvent;
|
||||
if (s=="jkqtpmdascribbleforevents"||s=="scribble") return jkqtpmdaScribbleForEvents;
|
||||
if (s=="jkqtpmdatooltipforclosestdatapoint"||s=="closestdatapointtooltip"||s=="tooltipforclosestdatapoint"||s=="tooltip") return jkqtpmdaToolTipForClosestDataPoint;
|
||||
if (s=="jkqtpmdaruler"||s=="ruler") return jkqtpmdaRuler;
|
||||
|
||||
|
||||
return jkqtpmdaZoomByRectangle;
|
||||
|
||||
@ -994,6 +997,8 @@ QString JKQTPMouseDragActions2String(JKQTPMouseDragActions act)
|
||||
if (act==jkqtpmdaDrawEllipseForEvent) return "DrawEllipse";
|
||||
if (act==jkqtpmdaDrawLineForEvent) return "DrawLine";
|
||||
if (act==jkqtpmdaScribbleForEvents) return "Scribble";
|
||||
if (act==jkqtpmdaToolTipForClosestDataPoint) return "ToolTipForClosestDataPoint";
|
||||
if (act==jkqtpmdaRuler) return "Ruler";
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
@ -1067,3 +1072,22 @@ QColor JKQTPGetDerivedColor(JKQTPColorDerivationMode mode, const QColor &col)
|
||||
}
|
||||
return col;
|
||||
}
|
||||
|
||||
QString JKQTPUserActionMarkerType2String(JKQTPUserActionMarkerType act)
|
||||
{
|
||||
switch(act) {
|
||||
case jkqtpuamtCircle: return "circle";
|
||||
case jkqtpuamtCrossHair: return "crosshair";
|
||||
case jkqtpuamtCircleAndCrossHair: return "circle+crosshair";
|
||||
}
|
||||
return "circle";
|
||||
}
|
||||
|
||||
JKQTPUserActionMarkerType String2JKQTPUserActionMarkerType(const QString &act)
|
||||
{
|
||||
QString m=act.trimmed().toLower();
|
||||
if (m=="circle") return jkqtpuamtCircle;
|
||||
if (m=="crosshair" || m=="cross") return jkqtpuamtCrossHair;
|
||||
if (m=="circle+crosshair" || m=="circle+cross") return jkqtpuamtCircleAndCrossHair;
|
||||
return jkqtpuamtCircle;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <cstdint>
|
||||
#include <stdexcept>
|
||||
#include <cctype>
|
||||
@ -136,6 +137,33 @@ inline bool JKQTPIsOKFloat(T v) {
|
||||
return std::isfinite(v)&&(!std::isinf(v))&&(!std::isnan(v));
|
||||
}
|
||||
|
||||
|
||||
/** \brief Styles in which to mark single positions during user actions in JKQTPlotter
|
||||
* \ingroup jkqtptools
|
||||
|
||||
*/
|
||||
enum JKQTPUserActionMarkerType {
|
||||
jkqtpuamtCircle=0, /*!< \brief a small circle around the position to mark */
|
||||
jkqtpuamtCrossHair=1, /*!< \brief a cross-hair to the position to mark */
|
||||
jkqtpuamtCircleAndCrossHair=2, /*!< \brief a cross-hair to the position to mark, with a circle-marker around the actual target (i.e. combines jkqtpuamtCircle and jkqtpuamtCrossHair) */
|
||||
};
|
||||
|
||||
|
||||
/** \brief convert a JKQTPUserActionMarkerType to a <a href="http://doc.qt.io/qt-5/qstring.html">QString</a>
|
||||
* \ingroup jkqtptools
|
||||
*
|
||||
* \see String2JKQTPUserActionMarkerType(), JKQTPUserActionMarkerType
|
||||
*/
|
||||
JKQTP_LIB_EXPORT QString JKQTPUserActionMarkerType2String(JKQTPUserActionMarkerType act);
|
||||
/** \brief convert a <a href="http://doc.qt.io/qt-5/qstring.html">QString</a> (created by JKQTPUserActionMarkerType2String() ) to JKQTPUserActionMarkerType
|
||||
* \ingroup jkqtptools
|
||||
*
|
||||
* \see JKQTPUserActionMarkerType2String(), JKQTPUserActionMarkerType
|
||||
*/
|
||||
JKQTP_LIB_EXPORT JKQTPUserActionMarkerType String2JKQTPUserActionMarkerType(const QString &act);
|
||||
|
||||
|
||||
|
||||
/** \brief Availble action this JKQtPlotter can perform when mouse events occur.
|
||||
* This allows you to e.g. draw rectangles or lines over the plot and receive a signal, when the drawing finishes
|
||||
* \ingroup jkqtptools
|
||||
@ -150,8 +178,11 @@ enum JKQTPMouseDragActions {
|
||||
jkqtpmdaDrawEllipseForEvent, /*!< \brief draw an ellipse and when finished execute the signal JKQTPlotter::userEllipseFinished() \image html draw_ellipse.gif "Draw Ellipse User-Action" */
|
||||
jkqtpmdaDrawLineForEvent, /*!< \brief draw a line and when finished execute the signal JKQTPlotter::userLineFinished() \image html draw_line.gif "Draw Lines User-Action" */
|
||||
jkqtpmdaScribbleForEvents, /*!< \brief let the user scribble on the plot (left mouse button is kept pressed) and call JKQTPlotter::userScribbleClick() for each new position */
|
||||
jkqtpmdaToolTipForClosestDataPoint, /*!< \brief shows a tooltip with data of the closest data-point in the plot \image html tooltiptool.gif */
|
||||
jkqtpmdaRuler, /*!< \brief shows a ruler over the plot, which measures delta X, delta Y and sqrt(dx^2+dy^2) \image html rulertool.gif */
|
||||
};
|
||||
|
||||
|
||||
/** \brief convert a JKQTPMouseDragActions to a <a href="http://doc.qt.io/qt-5/qstring.html">QString</a>
|
||||
* \ingroup jkqtptools
|
||||
*
|
||||
@ -287,6 +318,26 @@ enum JKQTPColorDerivationMode {
|
||||
*/
|
||||
JKQTP_LIB_EXPORT QColor JKQTPGetDerivedColor(JKQTPColorDerivationMode mode, const QColor& col);
|
||||
|
||||
/** \brief construct a QColor, based on the given \a color, but with alpha set to the specified value \a alphaF
|
||||
* \ingroup jkqtptools
|
||||
* \see QColorWithAlpha()
|
||||
*/
|
||||
inline QColor QColorWithAlphaF(const QColor& color, qreal alphaF) {
|
||||
QColor c=color;
|
||||
c.setAlphaF(alphaF);
|
||||
return c;
|
||||
}
|
||||
|
||||
/** \brief construct a QColor, based on the given \a color, but with alpha set to the specified value \a alpha
|
||||
* \ingroup jkqtptools
|
||||
* \see QColorWithAlphaF()
|
||||
*/
|
||||
inline QColor QColorWithAlpha(const QColor& color, int alpha) {
|
||||
QColor c=color;
|
||||
c.setAlpha(alpha);
|
||||
return c;
|
||||
}
|
||||
|
||||
/** \brief convert a JKQTPColorDerivationMode to a <a href="http://doc.qt.io/qt-5/qstring.html">QString</a>
|
||||
* \ingroup jkqtptools
|
||||
*
|
||||
@ -867,4 +918,26 @@ inline T jkqtp_roundTo(const double& v) {
|
||||
return static_cast<T>(round(v));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** \brief compare two floats \a a and \a b for euqality, where any difference smaller than \a epsilon is seen as equality */
|
||||
inline bool jkqtp_approximatelyEqual(float a, float b, float epsilon=2.0*std::numeric_limits<float>::epsilon())
|
||||
{
|
||||
return fabsf(a - b) <= epsilon;
|
||||
}
|
||||
|
||||
/** \brief compare two doubles \a a and \a b for euqality, where any difference smaller than \a epsilon is seen as equality */
|
||||
inline bool jkqtp_approximatelyEqual(double a, double b, double epsilon=2.0*std::numeric_limits<double>::epsilon())
|
||||
{
|
||||
return fabs(a - b) <= epsilon;
|
||||
}
|
||||
|
||||
/** \brief returns the quare of the value \a v, i.e. \c v*v */
|
||||
template<typename T>
|
||||
inline T jkqtp_sqr(const T& v) {
|
||||
return v*v;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // JKQTPTOOLS_H_INCLUDED
|
||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 86 KiB |