improved code (cont...&-parameters, diverse refactoring for C++1//modernC++, diverse corrections ...)

This commit is contained in:
jkriege2 2019-01-26 12:28:44 +01:00
parent df257a6b1a
commit 847fcb7a35
38 changed files with 5374 additions and 5400 deletions

View File

@ -40,11 +40,11 @@ TestMain::TestMain(QWidget *parent) :
pl2->set_yAxisLabelVisible(false); pl2->set_yAxisLabelVisible(false);
pl2->setPlotBorderLeft(10); pl2->setPlotBorderLeft(10);
pl2->setPlotBorderRight(2); pl2->setPlotBorderRight(2);
w->connect(pl1, SIGNAL(replotting()), pl2, SLOT(replotPlot())); w->connect(pl1, SIGNAL(replotting()), pl2, SLOT(redrawPlot()));
gl->addWidget(pl2, 0, 1); gl->addWidget(pl2, 0, 1);
JKQTFastPlotter* pl3=new JKQTFastPlotter(w); JKQTFastPlotter* pl3=new JKQTFastPlotter(w);
pl3->set_synchronizeX(pl1); pl3->set_synchronizeX(pl1);
w->connect(pl1, SIGNAL(replotting()), pl3, SLOT(replotPlot())); w->connect(pl1, SIGNAL(replotting()), pl3, SLOT(redrawPlot()));
gl->addWidget(pl3, 1, 0); gl->addWidget(pl3, 1, 0);

View File

@ -108,7 +108,7 @@ TestWidgetContourPlots::TestWidgetContourPlots(QWidget *parent) :
plotContour->zoom(-0.1,1.1,-0.1,1.1); plotContour->zoom(-0.1,1.1,-0.1,1.1);
plotContour->setPlotUpdateEnabled(true); plotContour->setPlotUpdateEnabled(true);
plotContour->replotPlot(); plotContour->redrawPlot();

View File

@ -24,7 +24,7 @@ TestWidgetFunctionPlots::TestWidgetFunctionPlots(QWidget *parent) :
pfunc->set_drawErrorPolygons(true); pfunc->set_drawErrorPolygons(true);
pfunc->set_style(Qt::DashLine); pfunc->set_style(Qt::DashLine);
plotFuncPlt->addGraph(pfunc); plotFuncPlt->addGraph(pfunc);
plotFuncPlt->replotPlot(); plotFuncPlt->redrawPlot();
pfuncErrorStyle=new JKQTPErrorPlotstyleComboBox(this); pfuncErrorStyle=new JKQTPErrorPlotstyleComboBox(this);
pfuncErrorStyle->setCurrentIndex(3); pfuncErrorStyle->setCurrentIndex(3);
@ -88,29 +88,29 @@ void TestWidgetFunctionPlots::setPFuncStyle()
if (pfuncErrorStyle->getErrorStyle()==JKQTPErrorPolygons) pfunc->set_drawErrorPolygons(true); if (pfuncErrorStyle->getErrorStyle()==JKQTPErrorPolygons) pfunc->set_drawErrorPolygons(true);
pfunc->set_drawLine(chkPFuncDrawLine->isChecked()); pfunc->set_drawLine(chkPFuncDrawLine->isChecked());
pfunc->set_displaySamplePoints(chkPFuncDrawSamples->isChecked()); pfunc->set_displaySamplePoints(chkPFuncDrawSamples->isChecked());
plotFuncPlt->replotPlot(); plotFuncPlt->redrawPlot();
} }
void TestWidgetFunctionPlots::setPFuncMinPoint(int value) void TestWidgetFunctionPlots::setPFuncMinPoint(int value)
{ {
pfunc->set_minSamples(value); pfunc->set_minSamples(value);
plotFuncPlt->replotPlot(); plotFuncPlt->redrawPlot();
} }
void TestWidgetFunctionPlots::setPFuncMaxRefine(int value) void TestWidgetFunctionPlots::setPFuncMaxRefine(int value)
{ {
pfunc->set_maxRefinementDegree(value); pfunc->set_maxRefinementDegree(value);
plotFuncPlt->replotPlot(); plotFuncPlt->redrawPlot();
} }
void TestWidgetFunctionPlots::setPFunc(const QString &expression) void TestWidgetFunctionPlots::setPFunc(const QString &expression)
{ {
pfunc->set_function(expression); pfunc->set_function(expression);
plotFuncPlt->replotPlot(); plotFuncPlt->redrawPlot();
} }
void TestWidgetFunctionPlots::setPFuncE(const QString &expression) void TestWidgetFunctionPlots::setPFuncE(const QString &expression)
{ {
pfunc->set_errorFunction(expression); pfunc->set_errorFunction(expression);
plotFuncPlt->replotPlot(); plotFuncPlt->redrawPlot();
} }

View File

@ -294,7 +294,7 @@ void TestWidgetGraphs::moveovl() {
ovlCnt=0; ovlCnt=0;
ovlTime.start(); ovlTime.start();
} }
plot->update_overlays(); plot->redrawOverlays();
QTimer::singleShot(10, this, SLOT(moveovl())); QTimer::singleShot(10, this, SLOT(moveovl()));
} }
@ -312,7 +312,7 @@ void TestWidgetGraphs::setErrorStyle(int /*index*/)
if (ey) { if (ey) {
ey->set_yErrorStyle(String2JKQTPErrorPlotstyle(cmb->itemData(cmb->currentIndex()).toString())); ey->set_yErrorStyle(String2JKQTPErrorPlotstyle(cmb->itemData(cmb->currentIndex()).toString()));
} }
plot->replotPlot(); plot->redrawPlot();
} }
} }
@ -325,7 +325,7 @@ void TestWidgetGraphs::setESSymbol(int /*index*/)
exy->set_symbol(String2JKQTPGraphSymbols(cmb->itemData(cmb->currentIndex()).toString())); exy->set_symbol(String2JKQTPGraphSymbols(cmb->itemData(cmb->currentIndex()).toString()));
} }
plot->replotPlot(); plot->redrawPlot();
} }
} }
@ -335,7 +335,7 @@ void TestWidgetGraphs::setSortOrder2(int index)
if (index==0) pltePlot2->set_sortData(JKQTPXYGraph::Unsorted); if (index==0) pltePlot2->set_sortData(JKQTPXYGraph::Unsorted);
if (index==1) pltePlot2->set_sortData(JKQTPXYLineGraph::SortedX); if (index==1) pltePlot2->set_sortData(JKQTPXYLineGraph::SortedX);
if (index==2) pltePlot2->set_sortData(JKQTPXYLineGraph::SortedY); if (index==2) pltePlot2->set_sortData(JKQTPXYLineGraph::SortedY);
plotBot->replotPlot(); plotBot->redrawPlot();
} }
void TestWidgetGraphs::setKeyLayout2(JKQTPKeyLayout layout) void TestWidgetGraphs::setKeyLayout2(JKQTPKeyLayout layout)
@ -343,9 +343,9 @@ void TestWidgetGraphs::setKeyLayout2(JKQTPKeyLayout layout)
plot->getPlotter()->setKeyLayout(layout); plot->getPlotter()->setKeyLayout(layout);
plotBot->getPlotter()->setKeyLayout(layout); plotBot->getPlotter()->setKeyLayout(layout);
plotBot2->getPlotter()->setKeyLayout(layout); plotBot2->getPlotter()->setKeyLayout(layout);
plot->replotPlot(); plot->redrawPlot();
plotBot->replotPlot(); plotBot->redrawPlot();
plotBot2->replotPlot(); plotBot2->redrawPlot();
} }
void TestWidgetGraphs::setKeyPos2(JKQTPKeyPosition layout) void TestWidgetGraphs::setKeyPos2(JKQTPKeyPosition layout)
@ -353,7 +353,7 @@ void TestWidgetGraphs::setKeyPos2(JKQTPKeyPosition layout)
plot->getPlotter()->setKeyPosition(layout); plot->getPlotter()->setKeyPosition(layout);
plotBot->getPlotter()->setKeyPosition(layout); plotBot->getPlotter()->setKeyPosition(layout);
plotBot2->getPlotter()->setKeyPosition(layout); plotBot2->getPlotter()->setKeyPosition(layout);
plot->replotPlot(); plot->redrawPlot();
plotBot->replotPlot(); plotBot->redrawPlot();
plotBot2->replotPlot(); plotBot2->redrawPlot();
} }

View File

@ -117,17 +117,17 @@ TestWidgetImages::TestWidgetImages(QWidget *parent) :
void TestWidgetImages::setImgPalette(int index) void TestWidgetImages::setImgPalette(int index)
{ {
pimg3->set_palette(index); pimg3->set_palette(index);
plotImg->replotPlot(); plotImg->redrawPlot();
} }
void TestWidgetImages::setImgPalette1(int index) void TestWidgetImages::setImgPalette1(int index)
{ {
pimg2->set_palette(index); pimg2->set_palette(index);
plotImg->replotPlot(); plotImg->redrawPlot();
} }
void TestWidgetImages::setImgModifier(int index) void TestWidgetImages::setImgModifier(int index)
{ {
pimg3->set_modifierMode(JKQTPMathImage::ModifierMode(index)); pimg3->set_modifierMode(JKQTPMathImage::ModifierMode(index));
plotImg->replotPlot(); plotImg->redrawPlot();
} }

View File

@ -96,5 +96,5 @@ TestWidgetParamScatterPlots::TestWidgetParamScatterPlots(QWidget *parent) :
void TestWidgetParamScatterPlots::setPSPSymmErrors(bool checked) void TestWidgetParamScatterPlots::setPSPSymmErrors(bool checked)
{ {
pltePSPCol->set_yErrorSymmetric(checked); pltePSPCol->set_yErrorSymmetric(checked);
plotPSP->replotPlot(); plotPSP->redrawPlot();
} }

View File

@ -65,12 +65,12 @@ void TestWidgetPeaksPlots::setDrawBaseline(bool checked)
{ {
graphPeakStream1->set_drawBaseline(checked); graphPeakStream1->set_drawBaseline(checked);
graphPeakStream2->set_drawBaseline(checked); graphPeakStream2->set_drawBaseline(checked);
plotPeaks->replotPlot(); plotPeaks->redrawPlot();
} }
void TestWidgetPeaksPlots::setYPeaks(bool checked) void TestWidgetPeaksPlots::setYPeaks(bool checked)
{ {
graphPeakStream1->set_yPeaks(checked); graphPeakStream1->set_yPeaks(checked);
graphPeakStream2->set_yPeaks(checked); graphPeakStream2->set_yPeaks(checked);
plotPeaks->replotPlot(); plotPeaks->redrawPlot();
} }

View File

@ -153,19 +153,19 @@ void TestWidgetRGBImages::setRGBColorBars(bool checked)
{ {
rgbimg->set_colorbarsSideBySide(checked); rgbimg->set_colorbarsSideBySide(checked);
rgbimg2->set_colorbarsSideBySide(checked); rgbimg2->set_colorbarsSideBySide(checked);
plotImgRGB->replotPlot(); plotImgRGB->redrawPlot();
} }
void TestWidgetRGBImages::setRGBMode1(int mode) void TestWidgetRGBImages::setRGBMode1(int mode)
{ {
rgbimg->set_rgbMode((JKQTPRGBMathImageRGBMode)mode); rgbimg->set_rgbMode((JKQTPRGBMathImageRGBMode)mode);
plotImgRGB->replotPlot(); plotImgRGB->redrawPlot();
} }
void TestWidgetRGBImages::setRGBMode2(int mode) void TestWidgetRGBImages::setRGBMode2(int mode)
{ {
rgbimg2->set_rgbMode((JKQTPRGBMathImageRGBMode)mode); rgbimg2->set_rgbMode((JKQTPRGBMathImageRGBMode)mode);
plotImgRGB->replotPlot(); plotImgRGB->redrawPlot();
} }
void TestWidgetRGBImages::updateRGBChannels() void TestWidgetRGBImages::updateRGBChannels()
@ -191,13 +191,13 @@ void TestWidgetRGBImages::updateRGBChannels()
rgbimg->set_dataB(nullptr); rgbimg->set_dataB(nullptr);
rgbimg2->set_imageBColumn(-1); rgbimg2->set_imageBColumn(-1);
} }
plotImgRGB->replotPlot(); plotImgRGB->redrawPlot();
} }
void TestWidgetRGBImages::setRGBModifier(int item) void TestWidgetRGBImages::setRGBModifier(int item)
{ {
rgbimg->set_modifierMode(JKQTPMathImage::ModifierMode(item)); rgbimg->set_modifierMode(JKQTPMathImage::ModifierMode(item));
rgbimg2->set_modifierMode(JKQTPMathImage::ModifierMode(item)); rgbimg2->set_modifierMode(JKQTPMathImage::ModifierMode(item));
plotImgRGB->replotPlot(); plotImgRGB->redrawPlot();
} }

View File

@ -31,7 +31,7 @@ In the example in [`test/simpletest_parsedfunctionplot/simpletest_parsedfunction
[=]() { [=]() {
parsedFunc->set_title("user function: \\verb{"+edit->text()+"}"); parsedFunc->set_title("user function: \\verb{"+edit->text()+"}");
parsedFunc->set_function(edit->text()); parsedFunc->set_function(edit->text());
plot->replotPlot(); plot->redrawPlot();
}; };
QObject::connect(edit, &QLineEdit::returnPressed, updateGraphFunctor); QObject::connect(edit, &QLineEdit::returnPressed, updateGraphFunctor);
QObject::connect(edit, &QLineEdit::editingFinished, updateGraphFunctor); QObject::connect(edit, &QLineEdit::editingFinished, updateGraphFunctor);

View File

@ -56,7 +56,7 @@ int main(int argc, char* argv[])
parsedFunc->set_function(edit->text()); parsedFunc->set_function(edit->text());
parsedFunc->set_paramsV(spinP1->value(), spinP2->value()); parsedFunc->set_paramsV(spinP1->value(), spinP2->value());
parsedFunc->set_displaySamplePoints(check->isChecked()); parsedFunc->set_displaySamplePoints(check->isChecked());
plot->replotPlot(); plot->redrawPlot();
}; };
QObject::connect(edit, &QLineEdit::returnPressed, updateGraphFunctor); QObject::connect(edit, &QLineEdit::returnPressed, updateGraphFunctor);
QObject::connect(edit, &QLineEdit::editingFinished, updateGraphFunctor); QObject::connect(edit, &QLineEdit::editingFinished, updateGraphFunctor);

View File

@ -37,7 +37,7 @@ void SpeedTestPlot::plotNewData()
// set new x-range and replot // set new x-range and replot
setX(X[0], X[NDATA-1]); setX(X[0], X[NDATA-1]);
replotPlot(); redrawPlot();
// calculate and update FPS-rate in window title // calculate and update FPS-rate in window title
auto tlastalst=t_lastplot; auto tlastalst=t_lastplot;

View File

@ -92,7 +92,7 @@ void SpeedTestPlot::plotNewData()
// set new x-range and replot // set new x-range and replot
setX(X[0], X[NDATA-1]); setX(X[0], X[NDATA-1]);
replotPlot(); redrawPlot();
// calculate and update FPS-rate in window title // calculate and update FPS-rate in window title
auto tlastalst=t_lastplot; auto tlastalst=t_lastplot;

View File

@ -126,7 +126,7 @@ void FormWithJKQTPlotter::on_btnReplot_clicked()
{ {
graph->set_function(ui->edtEquation->text()); graph->set_function(ui->edtEquation->text());
graph->set_title(ui->edtEquation->text()); graph->set_title(ui->edtEquation->text());
ui->plot->replotPlot(); ui->plot->redrawPlot();
} }
``` ```

View File

@ -48,5 +48,5 @@ void FormWithJKQTPlotter::on_btnReplot_clicked()
{ {
graph->set_function(ui->edtEquation->text()); graph->set_function(ui->edtEquation->text());
graph->set_title(ui->edtEquation->text()); graph->set_title(ui->edtEquation->text());
ui->plot->replotPlot(); ui->plot->redrawPlot();
} }

View File

@ -36,14 +36,14 @@
* \internal * \internal
*/ */
#define JKQTFPPROPERTYsave(settings, group, var, varname) \ #define JKQTFPPROPERTYsave(settings, group, var, varname) \
if (var!=def_##var) settings.setValue(group+varname, var); if ((var)!=def_##var) (settings).setValue((group)+(varname), var);
/** /**
* \brief loads the given property from the given settings object * \brief loads the given property from the given settings object
* \ingroup jkqtfastplotter * \ingroup jkqtfastplotter
* \internal * \internal
*/ */
#define JKQTFPPROPERTYload(settings, group, var, varname, varconvert) \ #define JKQTFPPROPERTYload(settings, group, var, varname, varconvert) \
var=settings.value(group+varname, var).varconvert; var=(settings).value((group)+(varname), var).varconvert;
JKQTFPPlot::JKQTFPPlot(JKQTFastPlotter* parent): JKQTFPPlot::JKQTFPPlot(JKQTFastPlotter* parent):
@ -55,9 +55,7 @@ JKQTFPPlot::JKQTFPPlot(JKQTFastPlotter* parent):
} }
JKQTFPPlot::~JKQTFPPlot() JKQTFPPlot::~JKQTFPPlot()
{ = default;;
};
void JKQTFPPlot::replot() { void JKQTFPPlot::replot() {
if (parent) parent->update_data(); if (parent) parent->update_data();
@ -127,7 +125,7 @@ JKQTFastPlotter::JKQTFastPlotter(QWidget *parent) :
connect(actCopyImage, SIGNAL(triggered()), this, SLOT(copyImage())); connect(actCopyImage, SIGNAL(triggered()), this, SLOT(copyImage()));
addAction(actCopyImage); addAction(actCopyImage);
setContextMenuPolicy(Qt::ActionsContextMenu); setContextMenuPolicy(Qt::ActionsContextMenu);
replotPlot(); redrawPlot();
setMouseTracking(true); setMouseTracking(true);
} }
@ -138,14 +136,14 @@ void JKQTFastPlotter::clearPlots(bool remove) {
} }
} }
plots.clear(); plots.clear();
replotPlot(); redrawPlot();
} }
void JKQTFastPlotter::addPlot(JKQTFPPlot* g) { void JKQTFastPlotter::addPlot(JKQTFPPlot* g) {
g->setParent(this); g->setParent(this);
plots.append(g); plots.append(g);
replotPlot(); redrawPlot();
} }
@ -153,7 +151,7 @@ void JKQTFastPlotter::deletePlot(int i, bool remove) {
if (i>=0 && i<plots.size()) { if (i>=0 && i<plots.size()) {
if (remove) delete plots[i]; if (remove) delete plots[i];
plots.remove(i); plots.remove(i);
replotPlot(); redrawPlot();
} }
} }
@ -163,7 +161,7 @@ void JKQTFastPlotter::deletePlot(JKQTFPPlot* g, bool remove) {
if (i>=0 && i<plots.size()) { if (i>=0 && i<plots.size()) {
if (remove) delete plots[i]; if (remove) delete plots[i];
plots.remove(i); plots.remove(i);
replotPlot(); redrawPlot();
} }
} }
@ -269,7 +267,7 @@ void JKQTFastPlotter::resizeEvent(QResizeEvent *event) {
systemImage=newImage; systemImage=newImage;
} }
//std::cout<<"replotting after resize to ("<<width()<<" x "<<height()<<")...\n"; //std::cout<<"replotting after resize to ("<<width()<<" x "<<height()<<")...\n";
replotPlot(); redrawPlot();
event->accept(); event->accept();
updateGeometry(); updateGeometry();
} }
@ -553,7 +551,7 @@ void JKQTFastPlotter::draw(QPainter* painter, QColor background, QSize* size) {
backgroundColor=oldb; backgroundColor=oldb;
} }
void JKQTFastPlotter::replotPlot() { void JKQTFastPlotter::redrawPlot() {
calcPlotScaling(); calcPlotScaling();
if (!doDrawing) { if (!doDrawing) {
doFullRepaint=true; doFullRepaint=true;
@ -572,7 +570,7 @@ void JKQTFastPlotter::replotPlot() {
update_data(); update_data();
} }
void JKQTFastPlotter::replotPlot_immediate() { void JKQTFastPlotter::redrawPlot_immediate() {
calcPlotScaling(); calcPlotScaling();
if (!doDrawing) { if (!doDrawing) {
doFullRepaint=true; doFullRepaint=true;
@ -593,7 +591,7 @@ void JKQTFastPlotter::replotPlot_immediate() {
void JKQTFastPlotter::update_data() { void JKQTFastPlotter::update_data() {
if (doFullRepaint) { if (doFullRepaint) {
// as doFullRepaint is set false in updtae_plot() this is NO endles loop!!!!!!! // as doFullRepaint is set false in updtae_plot() this is NO endles loop!!!!!!!
replotPlot(); redrawPlot();
return; return;
} }
if (!doDrawing) return; if (!doDrawing) return;
@ -618,7 +616,7 @@ void JKQTFastPlotter::update_data() {
void JKQTFastPlotter::update_data_immediate() { void JKQTFastPlotter::update_data_immediate() {
if (doFullRepaint) { if (doFullRepaint) {
// as doFullRepaint is set false in updtae_plot() this is NO endles loop!!!!!!! // as doFullRepaint is set false in updtae_plot() this is NO endles loop!!!!!!!
replotPlot_immediate(); redrawPlot_immediate();
return; return;
} }
if (!doDrawing) return; if (!doDrawing) return;
@ -782,7 +780,7 @@ void JKQTFastPlotter::setXRange(double min, double max, bool logarithmic) {
xMax=max; xMax=max;
xAxisLog=logarithmic; xAxisLog=logarithmic;
calcPlotScaling(); calcPlotScaling();
replotPlot(); redrawPlot();
} }
void JKQTFastPlotter::setYRange(double min, double max, bool logarithmic) { void JKQTFastPlotter::setYRange(double min, double max, bool logarithmic) {
@ -790,7 +788,7 @@ void JKQTFastPlotter::setYRange(double min, double max, bool logarithmic) {
yMax=max; yMax=max;
yAxisLog=logarithmic; yAxisLog=logarithmic;
calcPlotScaling(); calcPlotScaling();
replotPlot(); redrawPlot();
} }
void JKQTFastPlotter::setXYRange(double xmin, double xmax, double ymin, double ymax, bool xlogarithmic, bool ylogarithmic) { void JKQTFastPlotter::setXYRange(double xmin, double xmax, double ymin, double ymax, bool xlogarithmic, bool ylogarithmic) {
@ -801,7 +799,7 @@ void JKQTFastPlotter::setXYRange(double xmin, double xmax, double ymin, double y
yMax=ymax; yMax=ymax;
yAxisLog=ylogarithmic; yAxisLog=ylogarithmic;
calcPlotScaling(); calcPlotScaling();
replotPlot(); redrawPlot();
} }
/* /*
@ -815,7 +813,7 @@ void JKQTFastPlotter::synchronizeX(JKQTFastPlotter* toWhere) {
plotBorderRight=toWhere->get_internalPlotBorderRight(); plotBorderRight=toWhere->get_internalPlotBorderRight();
std::cout<<"syncX: xMin="<<xMin<<" xMax="<<xMax<<" plotBorderLeft="<<plotBorderLeft<<" plotBorderLeft="<<plotBorderRight<<"\n"; std::cout<<"syncX: xMin="<<xMin<<" xMax="<<xMax<<" plotBorderLeft="<<plotBorderLeft<<" plotBorderLeft="<<plotBorderRight<<"\n";
doDrawing=olddo; doDrawing=olddo;
replotPlot(); redrawPlot();
} }
void JKQTFastPlotter::synchronizeY(JKQTFastPlotter* toWhere) { void JKQTFastPlotter::synchronizeY(JKQTFastPlotter* toWhere) {
@ -828,7 +826,7 @@ void JKQTFastPlotter::synchronizeY(JKQTFastPlotter* toWhere) {
plotBorderBottom=toWhere->get_internalPlotBorderBottom(); plotBorderBottom=toWhere->get_internalPlotBorderBottom();
std::cout<<"syncY: yMin="<<yMin<<" yMax="<<yMax<<" plotBorderTop="<<plotBorderTop<<" plotBorderBottom="<<plotBorderBottom<<"\n"; std::cout<<"syncY: yMin="<<yMin<<" yMax="<<yMax<<" plotBorderTop="<<plotBorderTop<<" plotBorderBottom="<<plotBorderBottom<<"\n";
doDrawing=olddo; doDrawing=olddo;
replotPlot(); redrawPlot();
} }
*/ */
@ -836,7 +834,7 @@ void JKQTFastPlotter::synchronizeY(JKQTFastPlotter* toWhere) {
JKQTFPLinePlot::JKQTFPLinePlot(JKQTFastPlotter* parent, unsigned int N, double* x, double* y, QColor color, Qt::PenStyle style, double width): JKQTFPLinePlot::JKQTFPLinePlot(JKQTFastPlotter* parent, int N, double* x, double* y, QColor color, Qt::PenStyle style, double width):
JKQTFPPlot(parent) JKQTFPPlot(parent)
{ {
this->N=N; this->N=N;
@ -892,7 +890,7 @@ void JKQTFPLinePlot::drawGraph(QPainter& painter) {
path.moveTo(parent->x2p(x[0]), parent->y2p(y[0])); path.moveTo(parent->x2p(x[0]), parent->y2p(y[0]));
//std::cout<<"plotting graph, starting @ ("<<parent->x2p(x[0])<<", "<<parent->y2p(y[0])<<")\n"; //std::cout<<"plotting graph, starting @ ("<<parent->x2p(x[0])<<", "<<parent->y2p(y[0])<<")\n";
} }
for (unsigned int i=1; i<N; i++) { for (int i=1; i<N; i++) {
path.lineTo(parent->x2p(x[i]), parent->y2p(y[i])); path.lineTo(parent->x2p(x[i]), parent->y2p(y[i]));
//std::cout<<"-> ("<<parent->x2p(x[i])<<", "<<parent->y2p(y[i])<<")\n"; //std::cout<<"-> ("<<parent->x2p(x[i])<<", "<<parent->y2p(y[i])<<")\n";
} }
@ -900,13 +898,13 @@ void JKQTFPLinePlot::drawGraph(QPainter& painter) {
if (N>0){ if (N>0){
epath.moveTo(parent->x2p(x[0]), parent->y2p(y[0]+yerr[0])); epath.moveTo(parent->x2p(x[0]), parent->y2p(y[0]+yerr[0]));
} }
for (unsigned int i=1; i<N; i++) { for (int i=1; i<N; i++) {
epath.lineTo(parent->x2p(x[i]), parent->y2p(y[i]+yerr[i])); epath.lineTo(parent->x2p(x[i]), parent->y2p(y[i]+yerr[i]));
} }
if (N>0){ if (N>0){
epath.moveTo(parent->x2p(x[0]), parent->y2p(y[0]-yerr[0])); epath.moveTo(parent->x2p(x[0]), parent->y2p(y[0]-yerr[0]));
} }
for (unsigned int i=1; i<N; i++) { for (int i=1; i<N; i++) {
epath.lineTo(parent->x2p(x[i]), parent->y2p(y[i]-yerr[i])); epath.lineTo(parent->x2p(x[i]), parent->y2p(y[i]-yerr[i]));
} }
} }
@ -946,7 +944,7 @@ void JKQTFPLinePlot::drawGraph(QPainter& painter) {
JKQTFPVCrossPlot::JKQTFPVCrossPlot(JKQTFastPlotter* parent, unsigned int N, double* x, double* y, QColor color, Qt::PenStyle style, double width): JKQTFPVCrossPlot::JKQTFPVCrossPlot(JKQTFastPlotter* parent, int N, double* x, double* y, QColor color, Qt::PenStyle style, double width):
JKQTFPLinePlot(parent, N, x, y, color, style, width) JKQTFPLinePlot(parent, N, x, y, color, style, width)
{ {
crossWidth=5; crossWidth=5;
@ -974,7 +972,7 @@ void JKQTFPVCrossPlot::drawGraph(QPainter& painter) {
pe.setJoinStyle(Qt::RoundJoin); pe.setJoinStyle(Qt::RoundJoin);
QPainterPath path, epath; QPainterPath path, epath;
if (datatype==JKQTFPLPPointer) { if (datatype==JKQTFPLPPointer) {
for (unsigned int i=0; i<N; i++) { for (int i=0; i<N; i++) {
path.moveTo(QPointF(parent->x2p(x[i])-crossWidth/2.0, parent->y2p(y[i]))); path.moveTo(QPointF(parent->x2p(x[i])-crossWidth/2.0, parent->y2p(y[i])));
path.lineTo(QPointF(parent->x2p(x[i])+crossWidth/2.0, parent->y2p(y[i]))); path.lineTo(QPointF(parent->x2p(x[i])+crossWidth/2.0, parent->y2p(y[i])));
path.moveTo(QPointF(parent->x2p(x[i]), parent->y2p(y[i])-crossWidth/2.0)); path.moveTo(QPointF(parent->x2p(x[i]), parent->y2p(y[i])-crossWidth/2.0));
@ -985,13 +983,13 @@ void JKQTFPVCrossPlot::drawGraph(QPainter& painter) {
if (N>0){ if (N>0){
epath.moveTo(parent->x2p(x[0]), parent->y2p(y[0]+yerr[0])); epath.moveTo(parent->x2p(x[0]), parent->y2p(y[0]+yerr[0]));
} }
for (unsigned int i=1; i<N; i++) { for (int i=1; i<N; i++) {
epath.lineTo(parent->x2p(x[i]), parent->y2p(y[i]+yerr[i])); epath.lineTo(parent->x2p(x[i]), parent->y2p(y[i]+yerr[i]));
} }
if (N>0){ if (N>0){
epath.moveTo(parent->x2p(x[0]), parent->y2p(y[0]-yerr[0])); epath.moveTo(parent->x2p(x[0]), parent->y2p(y[0]-yerr[0]));
} }
for (unsigned int i=1; i<N; i++) { for (int i=1; i<N; i++) {
epath.lineTo(parent->x2p(x[i]), parent->y2p(y[i]-yerr[i])); epath.lineTo(parent->x2p(x[i]), parent->y2p(y[i]-yerr[i]));
} }
} }
@ -1035,7 +1033,7 @@ void JKQTFPVCrossPlot::drawGraph(QPainter& painter) {
JKQTFPVBarPlot::JKQTFPVBarPlot(JKQTFastPlotter* parent, unsigned int N, double* x, double* y, QColor color, Qt::PenStyle style, double width): JKQTFPVBarPlot::JKQTFPVBarPlot(JKQTFastPlotter* parent, int N, double* x, double* y, QColor color, Qt::PenStyle style, double width):
JKQTFPLinePlot(parent, N, x, y, color, style, width) JKQTFPLinePlot(parent, N, x, y, color, style, width)
{ {
} }
@ -1058,7 +1056,7 @@ void JKQTFPVBarPlot::drawGraph(QPainter& painter) {
painter.setPen(p); painter.setPen(p);
if (!parent->getYAxisLog()) { if (!parent->getYAxisLog()) {
if (datatype==JKQTFPLPPointer) { if (datatype==JKQTFPLPPointer) {
for (unsigned int i=0; i<N; i++) { for (int i=0; i<N; i++) {
double xval=parent->x2p(x[i]); double xval=parent->x2p(x[i]);
QLineF l(xval, parent->y2p(0), xval, parent->y2p(y[i])); QLineF l(xval, parent->y2p(0), xval, parent->y2p(y[i]));
if (l.length()>0) painter.drawLine(l); if (l.length()>0) painter.drawLine(l);
@ -1073,7 +1071,7 @@ void JKQTFPVBarPlot::drawGraph(QPainter& painter) {
} else { } else {
double starty=parent->get_internalPlotBorderTop()+parent->getPlotHeight(); double starty=parent->get_internalPlotBorderTop()+parent->getPlotHeight();
if (datatype==JKQTFPLPPointer) { if (datatype==JKQTFPLPPointer) {
for (unsigned int i=0; i<N; i++) { for (int i=0; i<N; i++) {
double v=parent->y2p(y[i]); double v=parent->y2p(y[i]);
if (!std::isnan(v) && !std::isinf(v)) { if (!std::isnan(v) && !std::isinf(v)) {
double xval=parent->x2p(x[i]); double xval=parent->x2p(x[i]);
@ -1163,7 +1161,7 @@ void JKQTFPQImagePlot::drawGraph(QPainter& painter) {
JKQTFPimagePlot::JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax, JKQTFPColorPalette palette): JKQTFPimagePlot::JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPImageFormat imageFormat, int width, int height, double xmin, double xmax, double ymin, double ymax, JKQTFPColorPalette palette):
JKQTFPPlot(parent) JKQTFPPlot(parent)
{ {
this->image=image; this->image=image;
@ -1182,7 +1180,7 @@ JKQTFPimagePlot::JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPIma
this->rotation=0; this->rotation=0;
} }
JKQTFPimagePlot::JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height, JKQTFPColorPalette palette): JKQTFPimagePlot::JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPImageFormat imageFormat, int width, int height, JKQTFPColorPalette palette):
JKQTFPPlot(parent) JKQTFPPlot(parent)
{ {
this->image=image; this->image=image;
@ -1253,12 +1251,12 @@ void JKQTFPimagePlot::drawGraph(QPainter& painter) {
painter.setCompositionMode(QPainter::CompositionMode_SourceOver); painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
QImage img(width, height, QImage::Format_ARGB32); QImage img(width, height, QImage::Format_ARGB32);
switch(imageFormat) { switch(imageFormat) {
case JKQTFP_uint8: JKQTFPimagePlot_array2image<uint8_t>((uint8_t*)image, width, height, img, palette, colorMin, colorMax); break; case JKQTFP_uint8: JKQTFPimagePlot_array2image<uint8_t>(static_cast<uint8_t*>(image), width, height, img, palette, colorMin, colorMax); break;
case JKQTFP_uint16: JKQTFPimagePlot_array2image<uint16_t>((uint16_t*)image, width, height, img, palette, colorMin, colorMax); break; case JKQTFP_uint16: JKQTFPimagePlot_array2image<uint16_t>(static_cast<uint16_t*>(image), width, height, img, palette, colorMin, colorMax); break;
case JKQTFP_uint32: JKQTFPimagePlot_array2image<uint32_t>((uint32_t*)image, width, height, img, palette, colorMin, colorMax); break; case JKQTFP_uint32: JKQTFPimagePlot_array2image<uint32_t>(static_cast<uint32_t*>(image), width, height, img, palette, colorMin, colorMax); break;
case JKQTFP_int64: JKQTFPimagePlot_array2image<int64_t>((int64_t*)image, width, height, img, palette, colorMin, colorMax); break; case JKQTFP_int64: JKQTFPimagePlot_array2image<int64_t>(static_cast<int64_t*>(image), width, height, img, palette, colorMin, colorMax); break;
case JKQTFP_float: JKQTFPimagePlot_array2image<float>((float*)image, width, height, img, palette, colorMin, colorMax); break; case JKQTFP_float: JKQTFPimagePlot_array2image<float>(static_cast<float*>(image), width, height, img, palette, colorMin, colorMax); break;
case JKQTFP_double: JKQTFPimagePlot_array2image<double>((double*)image, width, height, img, palette, colorMin, colorMax); break; case JKQTFP_double: JKQTFPimagePlot_array2image<double>(static_cast<double*>(image), width, height, img, palette, colorMin, colorMax); break;
} }
if (img.isNull()) return; if (img.isNull()) return;
double pxmin=parent->x2p(xmin); double pxmin=parent->x2p(xmin);
@ -1296,7 +1294,7 @@ void JKQTFPimagePlot::drawGraph(QPainter& painter) {
JKQTFPimageOverlayPlot::JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* image, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax, QColor color): JKQTFPimageOverlayPlot::JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* image, int width, int height, double xmin, double xmax, double ymin, double ymax, QColor color):
JKQTFPPlot(parent) JKQTFPPlot(parent)
{ {
this->image=image; this->image=image;
@ -1314,7 +1312,7 @@ JKQTFPimageOverlayPlot::JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* im
} }
JKQTFPimageOverlayPlot::JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* image, unsigned int width, unsigned int height, QColor color): JKQTFPimageOverlayPlot::JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* image, int width, int height, QColor color):
JKQTFPPlot(parent) JKQTFPPlot(parent)
{ {
this->image=image; this->image=image;
@ -1353,8 +1351,8 @@ void JKQTFPimageOverlayPlot::drawGraph(QPainter& painter) {
if (showAsSymbols) { if (showAsSymbols) {
QList<double> x,y; QList<double> x,y;
for (unsigned int j=0; j<height; ++j) { for (int j=0; j<height; ++j) {
for (unsigned int i=0; i<width; ++i) { for (int i=0; i<width; ++i) {
if (image[j*width+i]) { if (image[j*width+i]) {
x<<xmin+(double(i)+0.5)/double(width)*(xmax-xmin); x<<xmin+(double(i)+0.5)/double(width)*(xmax-xmin);
y<<ymin+(double(j)+0.5)/double(height)*(ymax-ymin); y<<ymin+(double(j)+0.5)/double(height)*(ymax-ymin);
@ -1378,9 +1376,9 @@ void JKQTFPimageOverlayPlot::drawGraph(QPainter& painter) {
} else { } else {
QImage img(width, height, QImage::Format_ARGB32); QImage img(width, height, QImage::Format_ARGB32);
QColor tc(Qt::transparent); QColor tc(Qt::transparent);
for (unsigned int j=0; j<height; ++j) { for (int j=0; j<height; ++j) {
QRgb* line=(QRgb*)(img.scanLine((int)height-1-(int)j)); QRgb* line=(QRgb*)(img.scanLine((int)height-1-(int)j));
for (unsigned int i=0; i<width; ++i) { for (int i=0; i<width; ++i) {
if (!image[j*width+i]) line[i]=tc.rgba(); if (!image[j*width+i]) line[i]=tc.rgba();
else line[i]=color.rgba(); else line[i]=color.rgba();
} }
@ -1548,7 +1546,7 @@ void JKQTFPQOverlayLinearGridPlot::drawGraph(QPainter& painter) {
JKQTFPRGBImageOverlayPlot::JKQTFPRGBImageOverlayPlot(JKQTFastPlotter *parent, void *imageRed, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax): JKQTFPRGBImageOverlayPlot::JKQTFPRGBImageOverlayPlot(JKQTFastPlotter *parent, void *imageRed, JKQTFPImageFormat imageFormat, int width, int height, double xmin, double xmax, double ymin, double ymax):
JKQTFPPlot(parent) JKQTFPPlot(parent)
{ {
this->width=width; this->width=width;
@ -1572,7 +1570,7 @@ JKQTFPRGBImageOverlayPlot::JKQTFPRGBImageOverlayPlot(JKQTFastPlotter *parent, vo
this->rotation=0; this->rotation=0;
} }
JKQTFPRGBImageOverlayPlot::JKQTFPRGBImageOverlayPlot(JKQTFastPlotter *parent, void *imageRed, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height): JKQTFPRGBImageOverlayPlot::JKQTFPRGBImageOverlayPlot(JKQTFastPlotter *parent, void *imageRed, JKQTFPImageFormat imageFormat, int width, int height):
JKQTFPPlot(parent) JKQTFPPlot(parent)
{ {
this->width=width; this->width=width;
@ -1628,28 +1626,28 @@ void JKQTFPRGBImageOverlayPlot::drawGraph(QPainter &painter) {
QImage img(width, height, QImage::Format_ARGB32); QImage img(width, height, QImage::Format_ARGB32);
img.fill(0); img.fill(0);
switch(imageFormatRed) { switch(imageFormatRed) {
case JKQTFP_uint8: JKQTFPRGBImageOverlayPlot_array2image<uint8_t>((uint8_t*)imageRed, width, height, img, 0, colorMinRed, colorMaxRed); break; case JKQTFP_uint8: JKQTFPRGBImageOverlayPlot_array2image<uint8_t>(static_cast<uint8_t*>(imageRed), width, height, img, 0, colorMinRed, colorMaxRed); break;
case JKQTFP_uint16: JKQTFPRGBImageOverlayPlot_array2image<uint16_t>((uint16_t*)imageRed, width, height, img, 0, colorMinRed, colorMaxRed); break; case JKQTFP_uint16: JKQTFPRGBImageOverlayPlot_array2image<uint16_t>(static_cast<uint16_t*>(imageRed), width, height, img, 0, colorMinRed, colorMaxRed); break;
case JKQTFP_uint32: JKQTFPRGBImageOverlayPlot_array2image<uint32_t>((uint32_t*)imageRed, width, height, img, 0, colorMinRed, colorMaxRed); break; case JKQTFP_uint32: JKQTFPRGBImageOverlayPlot_array2image<uint32_t>(static_cast<uint32_t*>(imageRed), width, height, img, 0, colorMinRed, colorMaxRed); break;
case JKQTFP_int64: JKQTFPRGBImageOverlayPlot_array2image<int64_t>((int64_t*)imageRed, width, height, img, 0, colorMinRed, colorMaxRed); break; case JKQTFP_int64: JKQTFPRGBImageOverlayPlot_array2image<int64_t>(static_cast<int64_t*>(imageRed), width, height, img, 0, colorMinRed, colorMaxRed); break;
case JKQTFP_float: JKQTFPRGBImageOverlayPlot_array2image<float>((float*)imageRed, width, height, img, 0, colorMinRed, colorMaxRed); break; case JKQTFP_float: JKQTFPRGBImageOverlayPlot_array2image<float>(static_cast<float*>(imageRed), width, height, img, 0, colorMinRed, colorMaxRed); break;
case JKQTFP_double: JKQTFPRGBImageOverlayPlot_array2image<double>((double*)imageRed, width, height, img, 0, colorMinRed, colorMaxRed); break; case JKQTFP_double: JKQTFPRGBImageOverlayPlot_array2image<double>(static_cast<double*>(imageRed), width, height, img, 0, colorMinRed, colorMaxRed); break;
} }
switch(imageFormatGreen) { switch(imageFormatGreen) {
case JKQTFP_uint8: JKQTFPRGBImageOverlayPlot_array2image<uint8_t>((uint8_t*)imageGreen, width, height, img, 1, colorMinGreen, colorMaxGreen); break; case JKQTFP_uint8: JKQTFPRGBImageOverlayPlot_array2image<uint8_t>(static_cast<uint8_t*>(imageGreen), width, height, img, 1, colorMinGreen, colorMaxGreen); break;
case JKQTFP_uint16: JKQTFPRGBImageOverlayPlot_array2image<uint16_t>((uint16_t*)imageGreen, width, height, img, 1, colorMinGreen, colorMaxGreen); break; case JKQTFP_uint16: JKQTFPRGBImageOverlayPlot_array2image<uint16_t>(static_cast<uint16_t*>(imageGreen), width, height, img, 1, colorMinGreen, colorMaxGreen); break;
case JKQTFP_uint32: JKQTFPRGBImageOverlayPlot_array2image<uint32_t>((uint32_t*)imageGreen, width, height, img, 1, colorMinGreen, colorMaxGreen); break; case JKQTFP_uint32: JKQTFPRGBImageOverlayPlot_array2image<uint32_t>(static_cast<uint32_t*>(imageGreen), width, height, img, 1, colorMinGreen, colorMaxGreen); break;
case JKQTFP_int64: JKQTFPRGBImageOverlayPlot_array2image<int64_t>((int64_t*)imageGreen, width, height, img, 1, colorMinGreen, colorMaxGreen); break; case JKQTFP_int64: JKQTFPRGBImageOverlayPlot_array2image<int64_t>(static_cast<int64_t*>(imageGreen), width, height, img, 1, colorMinGreen, colorMaxGreen); break;
case JKQTFP_float: JKQTFPRGBImageOverlayPlot_array2image<float>((float*)imageGreen, width, height, img, 1, colorMinGreen, colorMaxGreen); break; case JKQTFP_float: JKQTFPRGBImageOverlayPlot_array2image<float>(static_cast<float*>(imageGreen), width, height, img, 1, colorMinGreen, colorMaxGreen); break;
case JKQTFP_double: JKQTFPRGBImageOverlayPlot_array2image<double>((double*)imageGreen, width, height, img, 1, colorMinGreen, colorMaxGreen); break; case JKQTFP_double: JKQTFPRGBImageOverlayPlot_array2image<double>(static_cast<double*>(imageGreen), width, height, img, 1, colorMinGreen, colorMaxGreen); break;
} }
switch(imageFormatBlue) { switch(imageFormatBlue) {
case JKQTFP_uint8: JKQTFPRGBImageOverlayPlot_array2image<uint8_t>((uint8_t*)imageBlue, width, height, img, 2, colorMinBlue, colorMaxBlue); break; case JKQTFP_uint8: JKQTFPRGBImageOverlayPlot_array2image<uint8_t>(static_cast<uint8_t*>(imageBlue), width, height, img, 2, colorMinBlue, colorMaxBlue); break;
case JKQTFP_uint16: JKQTFPRGBImageOverlayPlot_array2image<uint16_t>((uint16_t*)imageBlue, width, height, img, 2, colorMinBlue, colorMaxBlue); break; case JKQTFP_uint16: JKQTFPRGBImageOverlayPlot_array2image<uint16_t>(static_cast<uint16_t*>(imageBlue), width, height, img, 2, colorMinBlue, colorMaxBlue); break;
case JKQTFP_uint32: JKQTFPRGBImageOverlayPlot_array2image<uint32_t>((uint32_t*)imageBlue, width, height, img, 2, colorMinBlue, colorMaxBlue); break; case JKQTFP_uint32: JKQTFPRGBImageOverlayPlot_array2image<uint32_t>(static_cast<uint32_t*>(imageBlue), width, height, img, 2, colorMinBlue, colorMaxBlue); break;
case JKQTFP_int64: JKQTFPRGBImageOverlayPlot_array2image<int64_t>((int64_t*)imageBlue, width, height, img, 2, colorMinBlue, colorMaxBlue); break; case JKQTFP_int64: JKQTFPRGBImageOverlayPlot_array2image<int64_t>(static_cast<int64_t*>(imageBlue), width, height, img, 2, colorMinBlue, colorMaxBlue); break;
case JKQTFP_float: JKQTFPRGBImageOverlayPlot_array2image<float>((float*)imageBlue, width, height, img, 2, colorMinBlue, colorMaxBlue); break; case JKQTFP_float: JKQTFPRGBImageOverlayPlot_array2image<float>(static_cast<float*>(imageBlue), width, height, img, 2, colorMinBlue, colorMaxBlue); break;
case JKQTFP_double: JKQTFPRGBImageOverlayPlot_array2image<double>((double*)imageBlue, width, height, img, 2, colorMinBlue, colorMaxBlue); break; case JKQTFP_double: JKQTFPRGBImageOverlayPlot_array2image<double>(static_cast<double*>(imageBlue), width, height, img, 2, colorMinBlue, colorMaxBlue); break;
} }
if (img.isNull()) return; if (img.isNull()) return;
double pxmin=parent->x2p(xmin); double pxmin=parent->x2p(xmin);
@ -1669,7 +1667,7 @@ void JKQTFPRGBImageOverlayPlot::drawGraph(QPainter &painter) {
} }
void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, unsigned int width, unsigned int height){ void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, int width, int height){
this->imageRed=imageRed; this->imageRed=imageRed;
this->imageFormatRed=imageFormatRed; this->imageFormatRed=imageFormatRed;
this->imageGreen=nullptr; this->imageGreen=nullptr;
@ -1683,7 +1681,7 @@ void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imag
replot(); replot();
} }
void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, unsigned int width, unsigned int height) { void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, int width, int height) {
this->imageRed=imageRed; this->imageRed=imageRed;
this->imageFormatRed=imageFormatRed; this->imageFormatRed=imageFormatRed;
this->imageGreen=imageGreen; this->imageGreen=imageGreen;
@ -1698,7 +1696,7 @@ void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imag
replot(); replot();
} }
void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, void* imageBlue, JKQTFPImageFormat imageFormatBlue, unsigned int width, unsigned int height) { void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, void* imageBlue, JKQTFPImageFormat imageFormatBlue, int width, int height) {
this->imageRed=imageRed; this->imageRed=imageRed;
this->imageFormatRed=imageFormatRed; this->imageFormatRed=imageFormatRed;
this->imageGreen=imageGreen; this->imageGreen=imageGreen;
@ -1716,7 +1714,7 @@ void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imag
} }
void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax){ void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, int width, int height, double xmin, double xmax, double ymin, double ymax){
this->imageRed=imageRed; this->imageRed=imageRed;
this->imageFormatRed=imageFormatRed; this->imageFormatRed=imageFormatRed;
this->imageRed=nullptr; this->imageRed=nullptr;
@ -1730,7 +1728,7 @@ void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imag
replot(); replot();
} }
void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax) { void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, int width, int height, double xmin, double xmax, double ymin, double ymax) {
this->imageRed=imageRed; this->imageRed=imageRed;
this->imageFormatRed=imageFormatRed; this->imageFormatRed=imageFormatRed;
this->imageGreen=imageGreen; this->imageGreen=imageGreen;
@ -1745,7 +1743,7 @@ void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imag
replot(); replot();
} }
void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, void* imageBlue, JKQTFPImageFormat imageFormatBlue, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax) { void JKQTFPRGBImageOverlayPlot::set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, void* imageBlue, JKQTFPImageFormat imageFormatBlue, int width, int height, double xmin, double xmax, double ymin, double ymax) {
this->imageRed=imageRed; this->imageRed=imageRed;
this->imageFormatRed=imageFormatRed; this->imageFormatRed=imageFormatRed;
this->imageGreen=imageGreen; this->imageGreen=imageGreen;

View File

@ -483,7 +483,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->plotBorderLeft != __value) { if (this->plotBorderLeft != __value) {
this->plotBorderLeft = __value; this->plotBorderLeft = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property plotBorderLeft. /*! \brief returns the property plotBorderLeft.
@ -500,7 +500,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->plotBorderBottom != __value) { if (this->plotBorderBottom != __value) {
this->plotBorderBottom = __value; this->plotBorderBottom = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property plotBorderBottom. /*! \brief returns the property plotBorderBottom.
@ -517,7 +517,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->plotBorderRight != __value) { if (this->plotBorderRight != __value) {
this->plotBorderRight = __value; this->plotBorderRight = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property plotBorderRight. /*! \brief returns the property plotBorderRight.
@ -534,7 +534,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->plotBorderTop != __value) { if (this->plotBorderTop != __value) {
this->plotBorderTop = __value; this->plotBorderTop = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property plotBorderTop. /*! \brief returns the property plotBorderTop.
@ -638,7 +638,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->backgroundColor != __value) { if (this->backgroundColor != __value) {
this->backgroundColor = __value; this->backgroundColor = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property backgroundColor. /*! \brief returns the property backgroundColor.
@ -655,7 +655,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->plotBackgroundColor != __value) { if (this->plotBackgroundColor != __value) {
this->plotBackgroundColor = __value; this->plotBackgroundColor = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property plotBackgroundColor. /*! \brief returns the property plotBackgroundColor.
@ -672,7 +672,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->drawGrid != __value) { if (this->drawGrid != __value) {
this->drawGrid = __value; this->drawGrid = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property drawGrid. /*! \brief returns the property drawGrid.
@ -689,7 +689,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->gridColor != __value) { if (this->gridColor != __value) {
this->gridColor = __value; this->gridColor = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property gridColor. /*! \brief returns the property gridColor.
@ -706,7 +706,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->gridStyle != __value) { if (this->gridStyle != __value) {
this->gridStyle = __value; this->gridStyle = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property gridStyle. /*! \brief returns the property gridStyle.
@ -723,7 +723,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->gridWidth != __value) { if (this->gridWidth != __value) {
this->gridWidth = __value; this->gridWidth = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property gridWidth. /*! \brief returns the property gridWidth.
@ -740,7 +740,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->labelFontSize != __value) { if (this->labelFontSize != __value) {
this->labelFontSize = __value; this->labelFontSize = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property labelFontSize. /*! \brief returns the property labelFontSize.
@ -757,7 +757,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->labelFontName != __value) { if (this->labelFontName != __value) {
this->labelFontName = __value; this->labelFontName = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property labelFontName. /*! \brief returns the property labelFontName.
@ -774,7 +774,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->tickFontSize != __value) { if (this->tickFontSize != __value) {
this->tickFontSize = __value; this->tickFontSize = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property tickFontSize. /*! \brief returns the property tickFontSize.
@ -791,7 +791,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->tickFontName != __value) { if (this->tickFontName != __value) {
this->tickFontName = __value; this->tickFontName = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property tickFontName. /*! \brief returns the property tickFontName.
@ -808,7 +808,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->tickLength != __value) { if (this->tickLength != __value) {
this->tickLength = __value; this->tickLength = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property tickLength. /*! \brief returns the property tickLength.
@ -825,7 +825,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->drawSystemBox != __value) { if (this->drawSystemBox != __value) {
this->drawSystemBox = __value; this->drawSystemBox = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property drawSystemBox. /*! \brief returns the property drawSystemBox.
@ -842,7 +842,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->drawZeroAxes != __value) { if (this->drawZeroAxes != __value) {
this->drawZeroAxes = __value; this->drawZeroAxes = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property drawZeroAxes. /*! \brief returns the property drawZeroAxes.
@ -859,7 +859,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->systemColor != __value) { if (this->systemColor != __value) {
this->systemColor = __value; this->systemColor = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property systemColor. /*! \brief returns the property systemColor.
@ -876,7 +876,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->systemWidth != __value) { if (this->systemWidth != __value) {
this->systemWidth = __value; this->systemWidth = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property systemWidth. /*! \brief returns the property systemWidth.
@ -893,7 +893,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->xZeroTick != __value) { if (this->xZeroTick != __value) {
this->xZeroTick = __value; this->xZeroTick = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property xZeroTick. /*! \brief returns the property xZeroTick.
@ -910,7 +910,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->yZeroTick != __value) { if (this->yZeroTick != __value) {
this->yZeroTick = __value; this->yZeroTick = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property yZeroTick. /*! \brief returns the property yZeroTick.
@ -927,7 +927,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->xTickDistance != __value) { if (this->xTickDistance != __value) {
this->xTickDistance = __value; this->xTickDistance = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property xTickDistance. /*! \brief returns the property xTickDistance.
@ -944,7 +944,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->yTickDistance != __value) { if (this->yTickDistance != __value) {
this->yTickDistance = __value; this->yTickDistance = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property yTickDistance. /*! \brief returns the property yTickDistance.
@ -961,7 +961,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->xAxisLabel != __value) { if (this->xAxisLabel != __value) {
this->xAxisLabel = __value; this->xAxisLabel = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property xAxisLabel. /*! \brief returns the property xAxisLabel.
@ -978,7 +978,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->yAxisLabel != __value) { if (this->yAxisLabel != __value) {
this->yAxisLabel = __value; this->yAxisLabel = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property yAxisLabel. /*! \brief returns the property yAxisLabel.
@ -995,7 +995,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->aspectRatio != __value) { if (this->aspectRatio != __value) {
this->aspectRatio = __value; this->aspectRatio = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property aspectRatio. /*! \brief returns the property aspectRatio.
@ -1012,7 +1012,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->maintainAspectRatio != __value) { if (this->maintainAspectRatio != __value) {
this->maintainAspectRatio = __value; this->maintainAspectRatio = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property maintainAspectRatio. /*! \brief returns the property maintainAspectRatio.
@ -1029,7 +1029,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->xAxisLabelVisible != __value) { if (this->xAxisLabelVisible != __value) {
this->xAxisLabelVisible = __value; this->xAxisLabelVisible = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property xAxisLabelVisible. /*! \brief returns the property xAxisLabelVisible.
@ -1046,7 +1046,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->yAxisLabelVisible != __value) { if (this->yAxisLabelVisible != __value) {
this->yAxisLabelVisible = __value; this->yAxisLabelVisible = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property yAxisLabelVisible. /*! \brief returns the property yAxisLabelVisible.
@ -1063,7 +1063,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->synchronizeX != __value) { if (this->synchronizeX != __value) {
this->synchronizeX = __value; this->synchronizeX = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property synchronizeX. /*! \brief returns the property synchronizeX.
@ -1080,7 +1080,7 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
{ {
if (this->synchronizeY != __value) { if (this->synchronizeY != __value) {
this->synchronizeY = __value; this->synchronizeY = __value;
replotPlot(); redrawPlot();
} }
} }
/*! \brief returns the property synchronizeY. /*! \brief returns the property synchronizeY.
@ -1120,9 +1120,9 @@ class LIB_EXPORT JKQTFastPlotter : public JKQTFASTPLOTTER_BASEWIDGET {
/** \brief copy the current plot image to the clipboard */ /** \brief copy the current plot image to the clipboard */
void copyImage(); void copyImage();
/** \brief replot everything (slowest possible plotting) */ /** \brief replot everything (slowest possible plotting) */
void replotPlot(); void redrawPlot();
/** \brief replot everything (slowest possible plotting) and forces a repaint calling QWidget::repaint() */ /** \brief replot everything (slowest possible plotting) and forces a repaint calling QWidget::repaint() */
void replotPlot_immediate(); void redrawPlot_immediate();
/** \brief replot only the data /** \brief replot only the data
* *
* This internally calls QWidget::update(), so no immediate repaint() is forced! If you want an immediate update, * This internally calls QWidget::update(), so no immediate repaint() is forced! If you want an immediate update,
@ -1217,7 +1217,7 @@ class LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
}; };
protected: protected:
/** \brief number of datapoints in the plot */ /** \brief number of datapoints in the plot */
unsigned int N; int N;
/** \brief pointer to x-coordinate data to display */ /** \brief pointer to x-coordinate data to display */
double* x; double* x;
/** \brief pointer to y-coordinate data to display */ /** \brief pointer to y-coordinate data to display */
@ -1255,7 +1255,7 @@ class LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
\param style style of the graph \param style style of the graph
\param width width of the plot (in pt) \param width width of the plot (in pt)
*/ */
JKQTFPLinePlot(JKQTFastPlotter* parent, unsigned int N, double* x, double* y, QColor color=QColor("red"), Qt::PenStyle style=Qt::SolidLine, double width=1) ; JKQTFPLinePlot(JKQTFastPlotter* parent, int N, double* x, double* y, QColor color=QColor("red"), Qt::PenStyle style=Qt::SolidLine, double width=1) ;
/*! \brief class constructor /*! \brief class constructor
\param parent parent widget \param parent parent widget
@ -1270,7 +1270,7 @@ class LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
/** \brief draw the graph */ /** \brief draw the graph */
virtual void drawGraph(QPainter& painter) override; virtual void drawGraph(QPainter& painter) override;
inline void set_data(double* x, double* y, unsigned int N) { inline void set_data(double* x, double* y, int N) {
this->x=x; this->x=x;
this->y=y; this->y=y;
this->yerr=nullptr; this->yerr=nullptr;
@ -1279,7 +1279,7 @@ class LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
replot(); replot();
}; };
inline void set_data(double* x, double* y, double* yerr, unsigned int N) { inline void set_data(double* x, double* y, double* yerr, int N) {
this->x=x; this->x=x;
this->y=y; this->y=y;
this->yerr=yerr; this->yerr=yerr;
@ -1312,7 +1312,7 @@ class LIB_EXPORT JKQTFPLinePlot: public JKQTFPPlot {
replot(); replot();
}; };
inline unsigned int get_N() { inline int get_N() {
if (datatype==JKQTFPLPPointer) if (datatype==JKQTFPLPPointer)
return N; return N;
if (datatype==JKQTFPLPVector) if (datatype==JKQTFPLPVector)
@ -1487,7 +1487,7 @@ class LIB_EXPORT JKQTFPVCrossPlot: public JKQTFPLinePlot {
\param style style of the graph \param style style of the graph
\param width width of the plot (in pt) \param width width of the plot (in pt)
*/ */
JKQTFPVCrossPlot(JKQTFastPlotter* parent, unsigned int N, double* x, double* y, QColor color=QColor("red"), Qt::PenStyle style=Qt::SolidLine, double width=1) ; JKQTFPVCrossPlot(JKQTFastPlotter* parent, int N, double* x, double* y, QColor color=QColor("red"), Qt::PenStyle style=Qt::SolidLine, double width=1) ;
/*! \brief class constructor /*! \brief class constructor
@ -1546,7 +1546,7 @@ class LIB_EXPORT JKQTFPVBarPlot: public JKQTFPLinePlot {
\param style style of the graph \param style style of the graph
\param width width of the plot (in pt) \param width width of the plot (in pt)
*/ */
JKQTFPVBarPlot(JKQTFastPlotter* parent, unsigned int N, double* x, double* y, QColor color=QColor("red"), Qt::PenStyle style=Qt::SolidLine, double width=1) ; JKQTFPVBarPlot(JKQTFastPlotter* parent, int N, double* x, double* y, QColor color=QColor("red"), Qt::PenStyle style=Qt::SolidLine, double width=1) ;
/*! \brief class constructor /*! \brief class constructor
@ -2100,9 +2100,9 @@ enum JKQTFPColorPalette {
\details Here, the color palettes are illustrated (left is the color for the minimum and right for the maximum). \details Here, the color palettes are illustrated (left is the color for the minimum and right for the maximum).
*/ */
enum JKQTFPImageFormat { enum JKQTFPImageFormat {
JKQTFP_uint8=0, /*!< \image 8 bit unsigned int */ JKQTFP_uint8=0, /*!< \image 8 bit int */
JKQTFP_uint16=1, /*!< \image 16 bit unsigned int */ JKQTFP_uint16=1, /*!< \image 16 bit int */
JKQTFP_uint32=2, /*!< \image 32 bit unsigned int */ JKQTFP_uint32=2, /*!< \image 32 bit int */
JKQTFP_float=3, /*!< \image float */ JKQTFP_float=3, /*!< \image float */
JKQTFP_double=4, /*!< \image double */ JKQTFP_double=4, /*!< \image double */
JKQTFP_int64=5 /*!< \image 64 bit signed int */ JKQTFP_int64=5 /*!< \image 64 bit signed int */
@ -2124,7 +2124,7 @@ enum JKQTFPImageFormat {
the according LUT won't be calculated and stored! the according LUT won't be calculated and stored!
*/ */
template <class T> template <class T>
inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &img, JKQTFPColorPalette palette, T minColor, T maxColor) inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &img, JKQTFPColorPalette palette, double minColor, double maxColor)
{ {
if (!dbl) if (!dbl)
return; return;
@ -2142,7 +2142,7 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
if (minColor == maxColor) { if (minColor == maxColor) {
for (int i=1; i<width*height; ++i) for (int i=1; i<width*height; ++i)
{ {
register T v=dbl[i]; T v=dbl[i];
if (v < min) if (v < min)
min = v; min = v;
else if (v > max) else if (v > max)
@ -2162,26 +2162,26 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
double delta=max-min; double delta=max-min;
unsigned int* lut_used=nullptr; int* lut_used=nullptr;
static unsigned int* lut_red=nullptr; static int* lut_red=nullptr;
static unsigned int* lut_green=nullptr; static int* lut_green=nullptr;
static unsigned int* lut_blue=nullptr; static int* lut_blue=nullptr;
static unsigned int* lut_gray=nullptr; static int* lut_gray=nullptr;
static unsigned int* lut_invred=nullptr; static int* lut_invred=nullptr;
static unsigned int* lut_invgreen=nullptr; static int* lut_invgreen=nullptr;
static unsigned int* lut_invblue=nullptr; static int* lut_invblue=nullptr;
static unsigned int* lut_invgray=nullptr; static int* lut_invgray=nullptr;
static unsigned int* lut_matlab=nullptr; static int* lut_matlab=nullptr;
static unsigned int* lut_rygb=nullptr; static int* lut_rygb=nullptr;
static unsigned int* lut_hsv=nullptr; static int* lut_hsv=nullptr;
static unsigned int* lut_invhsv=nullptr; static int* lut_invhsv=nullptr;
static unsigned int* lut_rainbow=nullptr; static int* lut_rainbow=nullptr;
static unsigned int* lut_hot=nullptr; static int* lut_hot=nullptr;
static unsigned int* lut_ocean=nullptr; static int* lut_ocean=nullptr;
static unsigned int* lut_trafficlight=nullptr; static int* lut_trafficlight=nullptr;
static unsigned int* lut_bluemagentayellow=nullptr; static int* lut_bluemagentayellow=nullptr;
static unsigned int* lut_blueyellow=nullptr; static int* lut_blueyellow=nullptr;
static unsigned int* lut_cyan=nullptr; static int* lut_cyan=nullptr;
img = QImage(width, height, QImage::Format_ARGB32_Premultiplied); img = QImage(width, height, QImage::Format_ARGB32_Premultiplied);
@ -2191,9 +2191,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
{ {
if (palette == JKQTFP_RED) if (palette == JKQTFP_RED)
{ {
unsigned int** plut=&lut_red; int** plut=&lut_red;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2206,9 +2206,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_GREEN) else if (palette == JKQTFP_GREEN)
{ {
unsigned int** plut=&lut_green; int** plut=&lut_green;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2221,9 +2221,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_BLUE) else if (palette == JKQTFP_BLUE)
{ {
unsigned int** plut=&lut_blue; int** plut=&lut_blue;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2238,9 +2238,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
else if (palette == JKQTFP_GRAY) else if (palette == JKQTFP_GRAY)
{ {
unsigned int** plut=&lut_gray; int** plut=&lut_gray;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2255,9 +2255,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
else if (palette == JKQTFP_INVERTEDRED) else if (palette == JKQTFP_INVERTEDRED)
{ {
unsigned int** plut=&lut_invred; int** plut=&lut_invred;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2270,9 +2270,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_INVERTEDGREEN) else if (palette == JKQTFP_INVERTEDGREEN)
{ {
unsigned int** plut=&lut_invgreen; int** plut=&lut_invgreen;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2284,9 +2284,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_INVERTEDBLUE) else if (palette == JKQTFP_INVERTEDBLUE)
{ {
unsigned int** plut=&lut_invblue; int** plut=&lut_invblue;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2298,9 +2298,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_INVERTEDGRAY) else if (palette == JKQTFP_INVERTEDGRAY)
{ {
unsigned int** plut=&lut_invgray; int** plut=&lut_invgray;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=1.0-(l/static_cast<double>(JKQTFPimagePlot_LUTSIZE)); double v=1.0-(l/static_cast<double>(JKQTFPimagePlot_LUTSIZE));
@ -2315,9 +2315,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
else if (palette == JKQTFP_MATLAB) else if (palette == JKQTFP_MATLAB)
{ {
unsigned int** plut=&lut_matlab; int** plut=&lut_matlab;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2348,9 +2348,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_RYGB) //gnuplot: 30,-13,-23 else if (palette == JKQTFP_RYGB) //gnuplot: 30,-13,-23
{ {
unsigned int** plut=&lut_rygb; int** plut=&lut_rygb;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2374,9 +2374,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_HSV) else if (palette == JKQTFP_HSV)
{ {
unsigned int** plut=&lut_hsv; int** plut=&lut_hsv;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2400,9 +2400,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_INVERTED_HSV) else if (palette == JKQTFP_INVERTED_HSV)
{ {
unsigned int** plut=&lut_invhsv; int** plut=&lut_invhsv;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2428,7 +2428,7 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
else if (palette == JKQTFP_RAINBOW) //gnuplot: 33,13,10 else if (palette == JKQTFP_RAINBOW) //gnuplot: 33,13,10
{ {
if (lut_rainbow==nullptr) { if (lut_rainbow==nullptr) {
lut_rainbow=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int)); lut_rainbow=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
//std::cout<<"!!! creating rainbow lut\n"; //std::cout<<"!!! creating rainbow lut\n";
if (lut_rainbow!=nullptr) { if (lut_rainbow!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
@ -2449,9 +2449,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_HOT) //gnuplot: 21,22,23 else if (palette == JKQTFP_HOT) //gnuplot: 21,22,23
{ {
unsigned int** plut=&lut_hot; int** plut=&lut_hot;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2476,9 +2476,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_OCEAN) //gnuplot: 23,28,3 else if (palette == JKQTFP_OCEAN) //gnuplot: 23,28,3
{ {
unsigned int** plut=&lut_ocean; int** plut=&lut_ocean;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2497,9 +2497,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_BLUEMAGENTAYELLOW) //gnuplot: 30,31,32 else if (palette == JKQTFP_BLUEMAGENTAYELLOW) //gnuplot: 30,31,32
{ {
unsigned int** plut=&lut_bluemagentayellow; int** plut=&lut_bluemagentayellow;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2526,9 +2526,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_BLUEYELLOW) //gnuplot: 8,9,10 else if (palette == JKQTFP_BLUEYELLOW) //gnuplot: 8,9,10
{ {
unsigned int** plut=&lut_blueyellow; int** plut=&lut_blueyellow;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2553,9 +2553,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_CYAN) else if (palette == JKQTFP_CYAN)
{ {
unsigned int** plut=&lut_cyan; int** plut=&lut_cyan;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2579,9 +2579,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
} }
else if (palette == JKQTFP_TRAFFICLIGHT) else if (palette == JKQTFP_TRAFFICLIGHT)
{ {
unsigned int** plut=&lut_trafficlight; int** plut=&lut_trafficlight;
if ((*plut)==nullptr) { if ((*plut)==nullptr) {
(*plut)=(unsigned int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(unsigned int)); (*plut)=(int*)malloc((JKQTFPimagePlot_LUTSIZE+2)*sizeof(int));
if ((*plut)!=nullptr) { if ((*plut)!=nullptr) {
for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) { for (int l=0; l<=JKQTFPimagePlot_LUTSIZE; l++) {
double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE); double v=l/static_cast<double>(JKQTFPimagePlot_LUTSIZE);
@ -2608,9 +2608,9 @@ inline void JKQTFPimagePlot_array2image(T* dbl, int width, int height, QImage &i
#endif #endif
if (lut_used!=nullptr) { if (lut_used!=nullptr) {
// LUT found: collor the image accordingly // LUT found: collor the image accordingly
for (register int j=0; j<height; ++j) { for (int j=0; j<height; ++j) {
QRgb* line=(QRgb*)(img.scanLine(height-1-j)); QRgb* line=(QRgb*)(img.scanLine(height-1-j));
for (register int i=0; i<width; ++i) { for (int i=0; i<width; ++i) {
int v = (dbl[j*width+i]-min)/delta*JKQTFPimagePlot_LUTSIZE; int v = (dbl[j*width+i]-min)/delta*JKQTFPimagePlot_LUTSIZE;
v = (v < 0) ? 0 : ( (v > JKQTFPimagePlot_LUTSIZE) ? JKQTFPimagePlot_LUTSIZE : v); v = (v < 0) ? 0 : ( (v > JKQTFPimagePlot_LUTSIZE) ? JKQTFPimagePlot_LUTSIZE : v);
line[i]=lut_used[v]; line[i]=lut_used[v];
@ -2668,9 +2668,9 @@ class LIB_EXPORT JKQTFPimagePlot: public JKQTFPPlot {
/** \brief format of the image */ /** \brief format of the image */
JKQTFPImageFormat imageFormat; JKQTFPImageFormat imageFormat;
/** \brief width of image in pt */ /** \brief width of image in pt */
unsigned int width; int width;
/** \brief height of image in pt */ /** \brief height of image in pt */
unsigned int height; int height;
/** \brief minimum x value of the image */ /** \brief minimum x value of the image */
double xmin; double xmin;
/** \brief maximum x value of the image */ /** \brief maximum x value of the image */
@ -2695,9 +2695,9 @@ class LIB_EXPORT JKQTFPimagePlot: public JKQTFPPlot {
/*! \brief class constructor /*! \brief class constructor
*/ */
JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax, JKQTFPColorPalette palette=JKQTFP_MATLAB) ; JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPImageFormat imageFormat, int width, int height, double xmin, double xmax, double ymin, double ymax, JKQTFPColorPalette palette=JKQTFP_MATLAB) ;
JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height, JKQTFPColorPalette palette=JKQTFP_MATLAB); JKQTFPimagePlot(JKQTFastPlotter* parent, void* image, JKQTFPImageFormat imageFormat, int width, int height, JKQTFPColorPalette palette=JKQTFP_MATLAB);
/** \brief draw the graph */ /** \brief draw the graph */
virtual void drawGraph(QPainter& painter) override; virtual void drawGraph(QPainter& painter) override;
@ -2741,7 +2741,7 @@ class LIB_EXPORT JKQTFPimagePlot: public JKQTFPPlot {
/*! \brief sets the property width to the specified \a __value. /*! \brief sets the property width to the specified \a __value.
\details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPimagePlot::width </BLOCKQUOTE> \details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPimagePlot::width </BLOCKQUOTE>
\see width for more information */ \see width for more information */
inline virtual void set_width(const unsigned int & __value) inline virtual void set_width(int __value)
{ {
if (this->width != __value) { if (this->width != __value) {
this->width = __value; this->width = __value;
@ -2751,14 +2751,14 @@ class LIB_EXPORT JKQTFPimagePlot: public JKQTFPPlot {
/*! \brief returns the property width. /*! \brief returns the property width.
\details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPimagePlot::width </BLOCKQUOTE> \details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPimagePlot::width </BLOCKQUOTE>
\see width for more information */ \see width for more information */
inline virtual unsigned int get_width() const inline virtual int get_width() const
{ {
return this->width; return this->width;
} }
/*! \brief sets the property height to the specified \a __value. /*! \brief sets the property height to the specified \a __value.
\details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPimagePlot::height </BLOCKQUOTE> \details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPimagePlot::height </BLOCKQUOTE>
\see height for more information */ \see height for more information */
inline virtual void set_height(const unsigned int & __value) inline virtual void set_height(int __value)
{ {
if (this->height != __value) { if (this->height != __value) {
this->height = __value; this->height = __value;
@ -2768,7 +2768,7 @@ class LIB_EXPORT JKQTFPimagePlot: public JKQTFPPlot {
/*! \brief returns the property height. /*! \brief returns the property height.
\details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPimagePlot::height </BLOCKQUOTE> \details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPimagePlot::height </BLOCKQUOTE>
\see height for more information */ \see height for more information */
inline virtual unsigned int get_height() const inline virtual int get_height() const
{ {
return this->height; return this->height;
} }
@ -2898,7 +2898,7 @@ class LIB_EXPORT JKQTFPimagePlot: public JKQTFPPlot {
inline double get_colorMax() const { inline double get_colorMax() const {
return this->colorMax; return this->colorMax;
} }
void set_image(void* image, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height) { void set_image(void* image, JKQTFPImageFormat imageFormat, int width, int height) {
this->image=image; this->image=image;
this->imageFormat=imageFormat; this->imageFormat=imageFormat;
this->width=width; this->width=width;
@ -2992,7 +2992,7 @@ inline void JKQTFPRGBImageOverlayPlot_array2image(T* dbl, int width, int height,
if (minColor == maxColor) { if (minColor == maxColor) {
for (int i=1; i<width*height; ++i) for (int i=1; i<width*height; ++i)
{ {
register T v=dbl[i]; T v=dbl[i];
if (v < min) if (v < min)
min = v; min = v;
else if (v > max) else if (v > max)
@ -3016,34 +3016,34 @@ inline void JKQTFPRGBImageOverlayPlot_array2image(T* dbl, int width, int height,
if (min != max) { if (min != max) {
// LUT found: collor the image accordingly // LUT found: collor the image accordingly
if (channel==0) { if (channel==0) {
for (register int j=0; j<height; ++j) { for (int j=0; j<height; ++j) {
QRgb* line=(QRgb*)(img.scanLine(height-1-j)); QRgb* line=(QRgb*)(img.scanLine(height-1-j));
for (register int i=0; i<width; ++i) { for (int i=0; i<width; ++i) {
int v = trunc(double(dbl[j*width+i]-min)*255.0/delta); int v = trunc(double(dbl[j*width+i]-min)*255.0/delta);
v = (v < 0) ? 0 : ( (v > 255) ? 255 : v); v = (v < 0) ? 0 : ( (v > 255) ? 255 : v);
const register QRgb l=line[i]; const QRgb l=line[i];
line[i]=qRgb(v,qGreen(l),qBlue(l)); line[i]=qRgb(v,qGreen(l),qBlue(l));
//if (i==j) qDebug()<<dbl[j*width+i]<<v<<hex<<l<<line[i]<<dec; //if (i==j) qDebug()<<dbl[j*width+i]<<v<<hex<<l<<line[i]<<dec;
} }
} }
} else if (channel==1) { } else if (channel==1) {
for (register int j=0; j<height; ++j) { for (int j=0; j<height; ++j) {
QRgb* line=(QRgb*)(img.scanLine(height-1-j)); QRgb* line=(QRgb*)(img.scanLine(height-1-j));
for (register int i=0; i<width; ++i) { for (int i=0; i<width; ++i) {
int v = (dbl[j*width+i]-min)*255/delta; int v = (dbl[j*width+i]-min)*255/delta;
v = (v < 0) ? 0 : ( (v > 255) ? 255 : v); v = (v < 0) ? 0 : ( (v > 255) ? 255 : v);
const register QRgb l=line[i]; const QRgb l=line[i];
line[i]=qRgb(qRed(l),v,qBlue(l)); line[i]=qRgb(qRed(l),v,qBlue(l));
//if (i==j) qDebug()<<dbl[j*width+i]<<v<<hex<<l<<line[i]<<dec; //if (i==j) qDebug()<<dbl[j*width+i]<<v<<hex<<l<<line[i]<<dec;
} }
} }
} else if (channel==2) { } else if (channel==2) {
for (register int j=0; j<height; ++j) { for (int j=0; j<height; ++j) {
QRgb* line=(QRgb*)(img.scanLine(height-1-j)); QRgb* line=(QRgb*)(img.scanLine(height-1-j));
for (register int i=0; i<width; ++i) { for (int i=0; i<width; ++i) {
int v = (dbl[j*width+i]-min)*255/delta; int v = (dbl[j*width+i]-min)*255/delta;
v = (v < 0) ? 0 : ( (v > 255) ? 255 : v); v = (v < 0) ? 0 : ( (v > 255) ? 255 : v);
const register QRgb l=line[i]; const QRgb l=line[i];
line[i]=qRgb(qRed(l),qGreen(l),v); line[i]=qRgb(qRed(l),qGreen(l),v);
//if (i==j) qDebug()<<dbl[j*width+i]<<v<<hex<<l<<line[i]<<dec; //if (i==j) qDebug()<<dbl[j*width+i]<<v<<hex<<l<<line[i]<<dec;
} }
@ -3091,9 +3091,9 @@ class LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot {
/** \brief format of the image */ /** \brief format of the image */
JKQTFPImageFormat imageFormatBlue; JKQTFPImageFormat imageFormatBlue;
/** \brief width of image in pt */ /** \brief width of image in pt */
unsigned int width; int width;
/** \brief height of image in pt */ /** \brief height of image in pt */
unsigned int height; int height;
/** \brief minimum x value of the image */ /** \brief minimum x value of the image */
double xmin; double xmin;
/** \brief maximum x value of the image */ /** \brief maximum x value of the image */
@ -3120,8 +3120,8 @@ class LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot {
/*! \brief class constructor /*! \brief class constructor
*/ */
JKQTFPRGBImageOverlayPlot(JKQTFastPlotter* parent, void* imageRed, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax) ; JKQTFPRGBImageOverlayPlot(JKQTFastPlotter* parent, void* imageRed, JKQTFPImageFormat imageFormat, int width, int height, double xmin, double xmax, double ymin, double ymax) ;
JKQTFPRGBImageOverlayPlot(JKQTFastPlotter* parent, void* imageRed, JKQTFPImageFormat imageFormat, unsigned int width, unsigned int height); JKQTFPRGBImageOverlayPlot(JKQTFastPlotter* parent, void* imageRed, JKQTFPImageFormat imageFormat, int width, int height);
JKQTFPRGBImageOverlayPlot(JKQTFastPlotter* parent); JKQTFPRGBImageOverlayPlot(JKQTFastPlotter* parent);
/** \brief draw the graph */ /** \brief draw the graph */
@ -3210,7 +3210,7 @@ class LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot {
/*! \brief sets the property width to the specified \a __value. /*! \brief sets the property width to the specified \a __value.
\details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPRGBImageOverlayPlot::width </BLOCKQUOTE> \details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPRGBImageOverlayPlot::width </BLOCKQUOTE>
\see width for more information */ \see width for more information */
inline virtual void set_width(const unsigned int & __value) inline virtual void set_width(int __value)
{ {
if (this->width != __value) { if (this->width != __value) {
this->width = __value; this->width = __value;
@ -3220,14 +3220,14 @@ class LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot {
/*! \brief returns the property width. /*! \brief returns the property width.
\details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPRGBImageOverlayPlot::width </BLOCKQUOTE> \details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPRGBImageOverlayPlot::width </BLOCKQUOTE>
\see width for more information */ \see width for more information */
inline virtual unsigned int get_width() const inline virtual int get_width() const
{ {
return this->width; return this->width;
} }
/*! \brief sets the property height to the specified \a __value. /*! \brief sets the property height to the specified \a __value.
\details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPRGBImageOverlayPlot::height </BLOCKQUOTE> \details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPRGBImageOverlayPlot::height </BLOCKQUOTE>
\see height for more information */ \see height for more information */
inline virtual void set_height(const unsigned int & __value) inline virtual void set_height(int __value)
{ {
if (this->height != __value) { if (this->height != __value) {
this->height = __value; this->height = __value;
@ -3237,7 +3237,7 @@ class LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot {
/*! \brief returns the property height. /*! \brief returns the property height.
\details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPRGBImageOverlayPlot::height </BLOCKQUOTE> \details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPRGBImageOverlayPlot::height </BLOCKQUOTE>
\see height for more information */ \see height for more information */
inline virtual unsigned int get_height() const inline virtual int get_height() const
{ {
return this->height; return this->height;
} }
@ -3351,12 +3351,12 @@ class LIB_EXPORT JKQTFPRGBImageOverlayPlot: public JKQTFPPlot {
inline double get_colorMaxBlue() const { inline double get_colorMaxBlue() const {
return this->colorMaxBlue; return this->colorMaxBlue;
} }
void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, unsigned int width, unsigned int height); void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, int width, int height);
void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, unsigned int width, unsigned int height); void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, int width, int height);
void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, void* imageBlue, JKQTFPImageFormat imageFormatBlue, unsigned int width, unsigned int height); void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, void* imageBlue, JKQTFPImageFormat imageFormatBlue, int width, int height);
void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax); void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, int width, int height, double xmin, double xmax, double ymin, double ymax);
void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax); void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, int width, int height, double xmin, double xmax, double ymin, double ymax);
void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, void* imageBlue, JKQTFPImageFormat imageFormatBlue, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax); void set_image(void* imageRed, JKQTFPImageFormat imageFormatRed, void* imageGreen, JKQTFPImageFormat imageFormatGreen, void* imageBlue, JKQTFPImageFormat imageFormatBlue, int width, int height, double xmin, double xmax, double ymin, double ymax);
public slots: public slots:
inline void set_rotation(int rotation) { inline void set_rotation(int rotation) {
if (this->rotation!=rotation) { if (this->rotation!=rotation) {
@ -3496,9 +3496,9 @@ class LIB_EXPORT JKQTFPimageOverlayPlot: public JKQTFPPlot {
/** \brief image to plot */ /** \brief image to plot */
bool* image; bool* image;
/** \brief width of image in pt */ /** \brief width of image in pt */
unsigned int width; int width;
/** \brief height of image in pt */ /** \brief height of image in pt */
unsigned int height; int height;
/** \brief minimum x value of the image */ /** \brief minimum x value of the image */
double xmin; double xmin;
/** \brief maximum x value of the image */ /** \brief maximum x value of the image */
@ -3519,14 +3519,14 @@ class LIB_EXPORT JKQTFPimageOverlayPlot: public JKQTFPPlot {
/*! \brief class constructor /*! \brief class constructor
*/ */
JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* image, unsigned int width, unsigned int height, double xmin, double xmax, double ymin, double ymax, QColor color=QColor("red")); JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* image, int width, int height, double xmin, double xmax, double ymin, double ymax, QColor color=QColor("red"));
JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* image, unsigned int width, unsigned int height, QColor color=QColor("red")); JKQTFPimageOverlayPlot(JKQTFastPlotter* parent, bool* image, int width, int height, QColor color=QColor("red"));
/** \brief draw the graph */ /** \brief draw the graph */
virtual void drawGraph(QPainter& painter) override; virtual void drawGraph(QPainter& painter) override;
void set_data(bool* image, unsigned int width, unsigned int height) { void set_data(bool* image, int width, int height) {
this->image=image; this->image=image;
this->width=width; this->width=width;
this->height=height; this->height=height;
@ -3548,13 +3548,13 @@ class LIB_EXPORT JKQTFPimageOverlayPlot: public JKQTFPPlot {
/*! \brief returns the property width. /*! \brief returns the property width.
\details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPimageOverlayPlot::width </BLOCKQUOTE>. \details Description of the parameter width is: <BLOCKQUOTE>\copydoc JKQTFPimageOverlayPlot::width </BLOCKQUOTE>.
\see width for more information */ \see width for more information */
inline unsigned int get_width() const { inline int get_width() const {
return this->width; return this->width;
} }
/*! \brief returns the property height. /*! \brief returns the property height.
\details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPimageOverlayPlot::height </BLOCKQUOTE>. \details Description of the parameter height is: <BLOCKQUOTE>\copydoc JKQTFPimageOverlayPlot::height </BLOCKQUOTE>.
\see height for more information */ \see height for more information */
inline unsigned int get_height() const { inline int get_height() const {
return this->height; return this->height;
} }
/*! \brief sets the property xmin to the specified \a __value. /*! \brief sets the property xmin to the specified \a __value.

File diff suppressed because it is too large Load Diff

View File

@ -230,9 +230,9 @@ class LIB_EXPORT JKQTMathText : public QObject {
/** \brief class destructor */ /** \brief class destructor */
~JKQTMathText(); ~JKQTMathText();
/** \brief load the object settings from the given QSettings object with the given name prefix */ /** \brief load the object settings from the given QSettings object with the given name prefix */
void loadSettings(QSettings& settings, QString group=QString("mathtext")); void loadSettings(const QSettings& settings, const QString& group=QString("mathtext"));
/** \brief store the object settings to the given QSettings object with the given name prefix */ /** \brief store the object settings to the given QSettings object with the given name prefix */
void saveSettings(QSettings& settings, QString group=QString("mathtext")); void saveSettings(QSettings& settings, const QString& group=QString("mathtext")) const;
/** \brief parse the given enhanced string. Returns \c true on success. */ /** \brief parse the given enhanced string. Returns \c true on success. */
bool parse(QString text); bool parse(QString text);
/** \brief get the size of the drawn representation. returns an invalid size if no text has been parsed. */ /** \brief get the size of the drawn representation. returns an invalid size if no text has been parsed. */
@ -286,9 +286,9 @@ class LIB_EXPORT JKQTMathText : public QObject {
* <code>setAnyUnicode("Courier New", "Courier New")</code>:<br>\image html jkqtmathparser_couriernew.png * <code>setAnyUnicode("Courier New", "Courier New")</code>:<br>\image html jkqtmathparser_couriernew.png
* <code>setAnyUnicode("Comic Sans MS", "Comic Sans MS")</code>:<br>\image html jkqtmathparser_comicsans.png * <code>setAnyUnicode("Comic Sans MS", "Comic Sans MS")</code>:<br>\image html jkqtmathparser_comicsans.png
*/ */
void useAnyUnicode(QString timesFont=QString(""), QString sansFont=QString("")); void useAnyUnicode(QString timesFont=QString(""), const QString& sansFont=QString(""));
void useLatexFonts(QString prefix=QString(""), QString postfix=QString("")); void useLatexFonts(QString prefix=QString(""), const QString& postfix=QString(""));
/** \brief convert LaTeX to HTML. returns \c ok=true on success and \c ok=false else. */ /** \brief convert LaTeX to HTML. returns \c ok=true on success and \c ok=false else. */
QString toHtml(bool* ok=nullptr, double fontPointSize=10); QString toHtml(bool* ok=nullptr, double fontPointSize=10);
@ -846,7 +846,7 @@ class LIB_EXPORT JKQTMathText : public QObject {
/** \brief subclass representing one text node in the syntax tree */ /** \brief subclass representing one text node in the syntax tree */
class MTtextNode: public MTnode { class MTtextNode: public MTnode {
public: public:
MTtextNode(JKQTMathText* parent, QString text, bool addWhitespace, bool stripInnerWhitepace=false); MTtextNode(JKQTMathText* parent, const QString& text, bool addWhitespace, bool stripInnerWhitepace=false);
virtual ~MTtextNode(); virtual ~MTtextNode();
virtual void getSizeInternal(QPainter& painter, MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos); virtual void getSizeInternal(QPainter& painter, MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos);
virtual double draw(QPainter& painter, double x, double y, MTenvironment currentEv); virtual double draw(QPainter& painter, double x, double y, MTenvironment currentEv);
@ -866,7 +866,7 @@ class LIB_EXPORT JKQTMathText : public QObject {
/** \brief subclass representing one text node in the syntax tree */ /** \brief subclass representing one text node in the syntax tree */
class MTplainTextNode: public MTtextNode { class MTplainTextNode: public MTtextNode {
public: public:
MTplainTextNode(JKQTMathText* parent, QString text, bool addWhitespace, bool stripInnerWhitepace=false); MTplainTextNode(JKQTMathText* parent, const QString& text, bool addWhitespace, bool stripInnerWhitepace=false);
virtual QString getTypeName() const; virtual QString getTypeName() const;
protected: protected:
virtual QString textTransform(const QString& text, JKQTMathText::MTenvironment currentEv, bool forSize=false); virtual QString textTransform(const QString& text, JKQTMathText::MTenvironment currentEv, bool forSize=false);
@ -884,7 +884,7 @@ class LIB_EXPORT JKQTMathText : public QObject {
/** \brief subclass representing one symbol (e.g. \c \\alpha , \c \\cdot ...) node in the syntax tree */ /** \brief subclass representing one symbol (e.g. \c \\alpha , \c \\cdot ...) node in the syntax tree */
class MTsymbolNode: public MTnode { class MTsymbolNode: public MTnode {
public: public:
MTsymbolNode(JKQTMathText* parent, QString name, bool addWhitespace); MTsymbolNode(JKQTMathText* parent, const QString& name, bool addWhitespace);
virtual ~MTsymbolNode(); virtual ~MTsymbolNode();
virtual QString getTypeName() const; virtual QString getTypeName() const;
virtual void getSizeInternal(QPainter& painter, MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos); virtual void getSizeInternal(QPainter& painter, MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos);
@ -947,7 +947,7 @@ class LIB_EXPORT JKQTMathText : public QObject {
/** \brief subclass representing an instruction node with exactly one argument in the syntax tree */ /** \brief subclass representing an instruction node with exactly one argument in the syntax tree */
class MTinstruction1Node: public MTnode { class MTinstruction1Node: public MTnode {
public: public:
MTinstruction1Node(JKQTMathText* parent, QString name, MTnode* child, const QStringList& parameters=QStringList()); MTinstruction1Node(JKQTMathText* parent, const QString& name, MTnode* child, const QStringList& parameters=QStringList());
virtual ~MTinstruction1Node(); virtual ~MTinstruction1Node();
virtual QString getTypeName() const; virtual QString getTypeName() const;
virtual void getSizeInternal(QPainter& painter, MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos); virtual void getSizeInternal(QPainter& painter, MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos);
@ -1030,7 +1030,7 @@ class LIB_EXPORT JKQTMathText : public QObject {
/** \brief subclass representing a brace node */ /** \brief subclass representing a brace node */
class MTbraceNode: public MTnode { class MTbraceNode: public MTnode {
public: public:
MTbraceNode(JKQTMathText* parent, QString openbrace, QString closebrace, MTnode* child, bool showRightBrace=true); MTbraceNode(JKQTMathText* parent, const QString& openbrace, const QString& closebrace, MTnode* child, bool showRightBrace=true);
virtual ~MTbraceNode(); virtual ~MTbraceNode();
virtual void getSizeInternal(QPainter& painter, MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos); virtual void getSizeInternal(QPainter& painter, MTenvironment currentEv, double& width, double& baselineHeight, double& overallHeight, double& strikeoutPos);
virtual double draw(QPainter& painter, double x, double y, MTenvironment currentEv); virtual double draw(QPainter& painter, double x, double y, MTenvironment currentEv);
@ -1436,7 +1436,7 @@ class LIB_EXPORT JKQTMathText : public QObject {
/** \brief tokenizer for the LaTeX parser */ /** \brief tokenizer for the LaTeX parser */
tokenType getToken(); tokenType getToken();
/** \brief parse a LaTeX string */ /** \brief parse a LaTeX string */
MTnode* parseLatexString(bool get, QString quitOnClosingBrace=QString(""), QString quitOnEnvironmentEnd=QString("")); MTnode* parseLatexString(bool get, const QString& quitOnClosingBrace=QString(""), const QString& quitOnEnvironmentEnd=QString(""));
/** \brief parse a LaTeX math environment */ /** \brief parse a LaTeX math environment */
MTnode* parseMath(bool get); MTnode* parseMath(bool get);

View File

@ -1,7 +1,7 @@
/* /*
Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>) Copyright (c) 2008-2019 Jan W. Krieger (<jan@jkrieger.de>)
This software is free software: you can redistribute it and/or modify This software is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License (LGPL) as published by it under the terms of the GNU Lesser General Public License (LGPL) as published by
@ -113,18 +113,17 @@ JKQTPCoordinateAxis::JKQTPCoordinateAxis(JKQTBasePlotter* parent): QObject(paren
paramsChanged=true; paramsChanged=true;
} }
JKQTPCoordinateAxis::~JKQTPCoordinateAxis() { JKQTPCoordinateAxis::~JKQTPCoordinateAxis() = default;
}
void JKQTPCoordinateAxis::set_parent(JKQTBasePlotter* parent) { void JKQTPCoordinateAxis::set_parent(JKQTBasePlotter* parent) {
this->parent=parent; this->parent=parent;
QObject::setParent(parent); QObject::setParent(parent);
} }
void JKQTPCoordinateAxis::replotPlot() { void JKQTPCoordinateAxis::redrawPlot() {
//if (paramsChanged) { //if (paramsChanged) {
calcPlotScaling(); calcPlotScaling();
parent->replotPlot(); parent->redrawPlot();
//} //}
} }
@ -196,43 +195,43 @@ void JKQTPCoordinateAxis::loadSettings(JKQTPCoordinateAxis* settings) {
void JKQTPCoordinateAxis::clearAxisTickLabels() { void JKQTPCoordinateAxis::clearAxisTickLabels() {
tickLabels.clear(); tickLabels.clear();
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::addAxisTickLabel(double x, QString label) { void JKQTPCoordinateAxis::addAxisTickLabel(double x, const QString& label) {
tickLabels.append(qMakePair(x, label)); tickLabels.append(qMakePair(x, label));
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::addAxisTickLabels(const QVector<double> &x, const QStringList &label) { void JKQTPCoordinateAxis::addAxisTickLabels(const QVector<double> &x, const QStringList &label) {
for (int i=0; i<qMin(x.size(), label.size()); i++) { for (int i=0; i<qMin(x.size(), label.size()); i++) {
tickLabels.append(qMakePair(x[i], label[i])); tickLabels.append(qMakePair(x[i], label[i]));
} }
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::addAxisTickLabels(const double *x, const QStringList &label) { void JKQTPCoordinateAxis::addAxisTickLabels(const double *x, const QStringList &label) {
for (int i=0; i<label.size(); i++) { for (int i=0; i<label.size(); i++) {
tickLabels.append(qMakePair(x[i], label[i])); tickLabels.append(qMakePair(x[i], label[i]));
} }
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::addAxisTickLabels(const QVector<double> &x, const QString *label) { void JKQTPCoordinateAxis::addAxisTickLabels(const QVector<double> &x, const QString *label) {
for (int i=0; i<x.size(); i++) { for (int i=0; i<x.size(); i++) {
tickLabels.append(qMakePair(x[i], label[i])); tickLabels.append(qMakePair(x[i], label[i]));
} }
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::addAxisTickLabels(const double *x, const QString *label, int items) { void JKQTPCoordinateAxis::addAxisTickLabels(const double *x, const QString *label, int items) {
for (int i=0; i<items; i++) { for (int i=0; i<items; i++) {
tickLabels.append(qMakePair(x[i], label[i])); tickLabels.append(qMakePair(x[i], label[i]));
} }
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::loadSettings(QSettings& settings, QString group) { void JKQTPCoordinateAxis::loadSettings(const QSettings& settings, const QString& group) {
JKQTPPROPERTYload(settings, group+axisPrefix, showZeroAxis, "show_zero_line", toBool()); JKQTPPROPERTYload(settings, group+axisPrefix, showZeroAxis, "show_zero_line", toBool());
JKQTPPROPERTYload(settings, group+axisPrefix, autoAxisSpacing, "auto_spacing", toBool()); JKQTPPROPERTYload(settings, group+axisPrefix, autoAxisSpacing, "auto_spacing", toBool());
JKQTPPROPERTYload(settings, group+axisPrefix, logAxis, "log", toBool()); JKQTPPROPERTYload(settings, group+axisPrefix, logAxis, "log", toBool());
@ -291,7 +290,7 @@ void JKQTPCoordinateAxis::loadSettings(QSettings& settings, QString group) {
void JKQTPCoordinateAxis::saveSettings(QSettings& settings, QString group) { void JKQTPCoordinateAxis::saveSettings(QSettings& settings, const QString& group) const {
JKQTPPROPERTYsave(settings, group+axisPrefix, showZeroAxis, "show_zero_line"); JKQTPPROPERTYsave(settings, group+axisPrefix, showZeroAxis, "show_zero_line");
JKQTPPROPERTYsave(settings, group+axisPrefix, autoAxisSpacing, "auto_spacing"); JKQTPPROPERTYsave(settings, group+axisPrefix, autoAxisSpacing, "auto_spacing");
JKQTPPROPERTYsave(settings, group+axisPrefix, logAxis, "log"); JKQTPPROPERTYsave(settings, group+axisPrefix, logAxis, "log");
@ -628,13 +627,13 @@ int JKQTPCoordinateAxis::calcLinearUnitDigits() {
double minval=tickStart; double minval=tickStart;
bool equals=true; bool equals=true;
/*for (int i=0; i<20; i++) { /*for (int i=0; i<20; i++) {
equals=equals || (floattolabel((minval+(double)i*tickSpacing), unitdigits)== floattolabel((minval+(double)(i+1)*tickSpacing), unitdigits)); equals=equals || (floattolabel((minval+static_cast<double>(i)*tickSpacing), unitdigits)== floattolabel((minval+(double)(i+1)*tickSpacing), unitdigits));
}*/ }*/
while ((unitdigits<20) && equals) { while ((unitdigits<20) && equals) {
unitdigits++; unitdigits++;
equals=false; equals=false;
for (int i=-10; i<10; i++) { for (int i=-10; i<10; i++) {
QString l1=floattolabel((minval+(double)i*tickSpacing), unitdigits+2); QString l1=floattolabel((minval+static_cast<double>(i)*tickSpacing), unitdigits+2);
QString l2=floattolabel((minval+(double)(i+1.0)*tickSpacing), unitdigits+2); QString l2=floattolabel((minval+(double)(i+1.0)*tickSpacing), unitdigits+2);
//qDebug()<<"unitdigits="<<unitdigits<<" l1="<<l1<<" l2="<<l2; //qDebug()<<"unitdigits="<<unitdigits<<" l1="<<l1<<" l2="<<l2;
equals=equals || (l1==l2); equals=equals || (l1==l2);
@ -804,7 +803,7 @@ void JKQTPCoordinateAxis::setRange(double aamin, double aamax) {
if (oldamin!=axismin || oldamax!=axismax) { if (oldamin!=axismin || oldamax!=axismax) {
paramsChanged=true; paramsChanged=true;
calcPlotScaling(); calcPlotScaling();
replotPlot(); redrawPlot();
} }
} }
@ -817,25 +816,25 @@ void JKQTPCoordinateAxis::setNoAbsoluteRange() {
void JKQTPCoordinateAxis::set_tickSpacing(double __value) { void JKQTPCoordinateAxis::set_tickSpacing(double __value) {
this->tickSpacing = __value; this->tickSpacing = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setAxisMinWidth(double __value) { void JKQTPCoordinateAxis::setAxisMinWidth(double __value) {
this->axisMinWidth = __value; this->axisMinWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_autoAxisSpacing(bool __value) { void JKQTPCoordinateAxis::set_autoAxisSpacing(bool __value) {
this->autoAxisSpacing = __value; this->autoAxisSpacing = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorTickLabelsEnabled(bool __value) { void JKQTPCoordinateAxis::set_minorTickLabelsEnabled(bool __value) {
this->minorTickLabelsEnabled = __value; this->minorTickLabelsEnabled = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_logAxis(bool __value) void JKQTPCoordinateAxis::set_logAxis(bool __value)
@ -849,31 +848,31 @@ void JKQTPCoordinateAxis::set_logAxis(bool __value)
if (this->isLogAxis() && this->minorTicks==def_minorTicks) { if (this->isLogAxis() && this->minorTicks==def_minorTicks) {
this->minorTicks=9; this->minorTicks=9;
} }
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_logAxisBase(double __value) { void JKQTPCoordinateAxis::set_logAxisBase(double __value) {
this->logAxisBase = __value; this->logAxisBase = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setUserTickSpacing(double __value) { void JKQTPCoordinateAxis::setUserTickSpacing(double __value) {
this->userTickSpacing = __value; this->userTickSpacing = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setUserLogTickSpacing(double __value) { void JKQTPCoordinateAxis::setUserLogTickSpacing(double __value) {
this->userLogTickSpacing = __value; this->userLogTickSpacing = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_labelType(JKQTPCALabelType __value) { void JKQTPCoordinateAxis::set_labelType(JKQTPCALabelType __value) {
this->labelType = __value; this->labelType = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickMode(JKQTPLabelTickMode __value) void JKQTPCoordinateAxis::set_tickMode(JKQTPLabelTickMode __value)
@ -887,239 +886,239 @@ void JKQTPCoordinateAxis::set_tickMode(int __value) {
set_tickMode(JKQTPLabelTickMode(__value)); set_tickMode(JKQTPLabelTickMode(__value));
} }
void JKQTPCoordinateAxis::setAxisLabel(QString __value) { void JKQTPCoordinateAxis::setAxisLabel(const QString& __value) {
this->axisLabel = __value; this->axisLabel = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_labelPosition(JKQTPLabelPosition __value) { void JKQTPCoordinateAxis::set_labelPosition(JKQTPLabelPosition __value) {
this->labelPosition = __value; this->labelPosition = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_labelFont(QString __value) { void JKQTPCoordinateAxis::set_labelFont(const QString& __value) {
this->labelFont = __value; this->labelFont = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_labelFontSize(double __value) { void JKQTPCoordinateAxis::set_labelFontSize(double __value) {
this->labelFontSize = __value; this->labelFontSize = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickLabelFont(QString __value) { void JKQTPCoordinateAxis::set_tickLabelFont(const QString& __value) {
this->tickLabelFont = __value; this->tickLabelFont = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickTimeFormat(QString __value) { void JKQTPCoordinateAxis::set_tickTimeFormat(const QString& __value) {
this->tickTimeFormat = __value; this->tickTimeFormat = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickDateFormat(QString __value) { void JKQTPCoordinateAxis::set_tickDateFormat(const QString& __value) {
this->tickDateFormat = __value; this->tickDateFormat = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickDateTimeFormat(QString __value) { void JKQTPCoordinateAxis::set_tickDateTimeFormat(const QString& __value) {
this->tickDateTimeFormat = __value; this->tickDateTimeFormat = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickLabelFontSize(double __value) { void JKQTPCoordinateAxis::set_tickLabelFontSize(double __value) {
this->tickLabelFontSize = __value; this->tickLabelFontSize = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorTickLabelFontSize(double __value) { void JKQTPCoordinateAxis::set_minorTickLabelFontSize(double __value) {
this->minorTickLabelFontSize = __value; this->minorTickLabelFontSize = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorTickLabelFullNumber(bool __value) { void JKQTPCoordinateAxis::set_minorTickLabelFullNumber(bool __value) {
this->minorTickLabelFullNumber = __value; this->minorTickLabelFullNumber = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minTicks(unsigned int __value) { void JKQTPCoordinateAxis::set_minTicks(unsigned int __value) {
this->minTicks = __value; this->minTicks = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorTicks(unsigned int __value) { void JKQTPCoordinateAxis::set_minorTicks(unsigned int __value) {
this->minorTicks = __value; this->minorTicks = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorTicks(int __value) { void JKQTPCoordinateAxis::set_minorTicks(int __value) {
this->minorTicks = qMax(int(0), __value); this->minorTicks = qMax(int(0), __value);
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickOutsideLength(double __value) { void JKQTPCoordinateAxis::set_tickOutsideLength(double __value) {
this->tickOutsideLength = __value; this->tickOutsideLength = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorTickOutsideLength(double __value) { void JKQTPCoordinateAxis::set_minorTickOutsideLength(double __value) {
this->minorTickOutsideLength = __value; this->minorTickOutsideLength = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickInsideLength(double __value) { void JKQTPCoordinateAxis::set_tickInsideLength(double __value) {
this->tickInsideLength = __value; this->tickInsideLength = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorTickInsideLength(double __value) { void JKQTPCoordinateAxis::set_minorTickInsideLength(double __value) {
this->minorTickInsideLength = __value; this->minorTickInsideLength = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setAxisColor(QColor __value) { void JKQTPCoordinateAxis::setAxisColor(const QColor& __value) {
this->axisColor = __value; this->axisColor = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setShowZeroAxis(bool __value) { void JKQTPCoordinateAxis::setShowZeroAxis(bool __value) {
this->showZeroAxis = __value; this->showZeroAxis = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_inverted(bool __value) { void JKQTPCoordinateAxis::set_inverted(bool __value) {
this->inverted = __value; this->inverted = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setGridColor(QColor __value) { void JKQTPCoordinateAxis::setGridColor(const QColor& __value) {
this->gridColor = __value; this->gridColor = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorGridColor(QColor __value) { void JKQTPCoordinateAxis::set_minorGridColor(const QColor& __value) {
this->minorGridColor = __value; this->minorGridColor = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setGridWidth(double __value) { void JKQTPCoordinateAxis::setGridWidth(double __value) {
this->gridWidth = __value; this->gridWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setGridStyle(Qt::PenStyle __value) { void JKQTPCoordinateAxis::setGridStyle(Qt::PenStyle __value) {
this->gridStyle = __value; this->gridStyle = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorGridWidth(double __value) { void JKQTPCoordinateAxis::set_minorGridWidth(double __value) {
this->minorGridWidth = __value; this->minorGridWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorGridStyle(Qt::PenStyle __value) { void JKQTPCoordinateAxis::set_minorGridStyle(Qt::PenStyle __value) {
this->minorGridStyle = __value; this->minorGridStyle = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_drawMode1(JKQTPCADrawMode __value) { void JKQTPCoordinateAxis::set_drawMode1(JKQTPCADrawMode __value) {
this->drawMode1 = __value; this->drawMode1 = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_drawMode2(JKQTPCADrawMode __value) { void JKQTPCoordinateAxis::set_drawMode2(JKQTPCADrawMode __value) {
this->drawMode2 = __value; this->drawMode2 = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_minorTickWidth(double __value) { void JKQTPCoordinateAxis::set_minorTickWidth(double __value) {
this->minorTickWidth = __value; this->minorTickWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickWidth(double __value) { void JKQTPCoordinateAxis::set_tickWidth(double __value) {
this->tickWidth = __value; this->tickWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setLineWidth(double __value) { void JKQTPCoordinateAxis::setLineWidth(double __value) {
this->lineWidth = __value; this->lineWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::setLineWidthZeroAxis(double __value) { void JKQTPCoordinateAxis::setLineWidthZeroAxis(double __value) {
this->lineWidthZeroAxis = __value; this->lineWidthZeroAxis = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickLabelDistance(double __value) { void JKQTPCoordinateAxis::set_tickLabelDistance(double __value) {
this->tickLabelDistance = __value; this->tickLabelDistance = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_labelDistance(double __value) { void JKQTPCoordinateAxis::set_labelDistance(double __value) {
this->labelDistance = __value; this->labelDistance = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_labelDigits(int __value) { void JKQTPCoordinateAxis::set_labelDigits(int __value) {
this->labelDigits = __value; this->labelDigits = __value;
this->paramsChanged=true; this->paramsChanged=true;
this->autoLabelDigits=false; this->autoLabelDigits=false;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_drawGrid(bool __value) { void JKQTPCoordinateAxis::set_drawGrid(bool __value) {
this->drawGrid = __value; this->drawGrid = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_drawMinorGrid(bool __value) { void JKQTPCoordinateAxis::set_drawMinorGrid(bool __value) {
this->drawMinorGrid = __value; this->drawMinorGrid = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPCoordinateAxis::set_tickLabelAngle(double __value) { void JKQTPCoordinateAxis::set_tickLabelAngle(double __value) {
this->tickLabelAngle = __value; this->tickLabelAngle = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
@ -1138,7 +1137,7 @@ void JKQTPCoordinateAxis::setAbsoluteRange(double amin, double amax) {
setRange(axismin, axismax); setRange(axismin, axismax);
/*paramsChanged=true; /*paramsChanged=true;
calcPlotScaling(); calcPlotScaling();
replotPlot();*/ redrawPlot();*/
} }
double JKQTPCoordinateAxis::getNextLabelDistance(double x) { double JKQTPCoordinateAxis::getNextLabelDistance(double x) {
@ -1675,7 +1674,7 @@ void JKQTPVerticalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
get_parent_mathText()->getSizeDetail(painter, width, ascent, descent, strikeoutPos); get_parent_mathText()->getSizeDetail(painter, width, ascent, descent, strikeoutPos);
QRect rect(0,0, get_parent_plotwidth(), ascent+descent);//plotBorderLeft-30); QRectF rect(0,0, get_parent_plotwidth(), ascent+descent);//plotBorderLeft-30);
painter.save(); painter.save();
painter.translate(QPointF(left-parent->pt2px(painter, tickOutsideLength+tickLabelDistance+labelDistance)-descent-labelMax.width()-labelMax.height(), bottom)); painter.translate(QPointF(left-parent->pt2px(painter, tickOutsideLength+tickLabelDistance+labelDistance)-descent-labelMax.width()-labelMax.height(), bottom));
painter.rotate(-90); painter.rotate(-90);
@ -1702,7 +1701,7 @@ void JKQTPVerticalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
get_parent_mathText()->parse(axisLabel); get_parent_mathText()->parse(axisLabel);
QRect rect(0,0, get_parent_plotwidth(), get_parent_mathText()->getSize(painter).height());//plotBorderLeft-30); QRectF rect(0,0, get_parent_plotwidth(), get_parent_mathText()->getSize(painter).height());//plotBorderLeft-30);
painter.save(); painter.save();
painter.translate(QPointF(right+parent->pt2px(painter, tickOutsideLength+tickLabelDistance+labelDistance)+labelMax.width(), bottom)); painter.translate(QPointF(right+parent->pt2px(painter, tickOutsideLength+tickLabelDistance+labelDistance)+labelMax.width(), bottom));
painter.rotate(-90); painter.rotate(-90);
@ -1748,31 +1747,31 @@ JKQTPVerticalIndependentAxis::JKQTPVerticalIndependentAxis(double axisOffset, do
void JKQTPVerticalIndependentAxis::setAxisOffset(double __value) { void JKQTPVerticalIndependentAxis::setAxisOffset(double __value) {
this->axisOffset = __value; this->axisOffset = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPVerticalIndependentAxis::setAxisWidth(double __value) { void JKQTPVerticalIndependentAxis::setAxisWidth(double __value) {
this->axisWidth = __value; this->axisWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPVerticalIndependentAxis::set_otherAxisOffset(double __value) { void JKQTPVerticalIndependentAxis::set_otherAxisOffset(double __value) {
this->otherAxisOffset = __value; this->otherAxisOffset = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPVerticalIndependentAxis::set_otherAxisWidth(double __value) { void JKQTPVerticalIndependentAxis::set_otherAxisWidth(double __value) {
this->otherAxisWidth = __value; this->otherAxisWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPVerticalIndependentAxis::set_otherAxisInverted(bool __value) { void JKQTPVerticalIndependentAxis::set_otherAxisInverted(bool __value) {
this->otherAxisInverted = __value; this->otherAxisInverted = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
double JKQTPVerticalIndependentAxis::get_parent_plotwidth() const { return axisWidth; } double JKQTPVerticalIndependentAxis::get_parent_plotwidth() const { return axisWidth; }
@ -2254,7 +2253,7 @@ void JKQTPHorizontalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
get_parent_mathText()->getSizeDetail(painter, width, ascent, descent, strikeoutPos); get_parent_mathText()->getSizeDetail(painter, width, ascent, descent, strikeoutPos);
QRect rect(0,0, get_parent_plotwidth(), ascent+descent);//plotBorderLeft-30); QRectF rect(0,0, get_parent_plotwidth(), ascent+descent);//plotBorderLeft-30);
painter.save(); painter.save();
painter.translate(QPointF(left, bottom+parent->pt2px(painter, tickOutsideLength+tickLabelDistance+labelDistance)+labelMax.height())); painter.translate(QPointF(left, bottom+parent->pt2px(painter, tickOutsideLength+tickLabelDistance+labelDistance)+labelMax.height()));
//JKQTPEnhancedPainter::RenderHints h=painter.renderHints(); //JKQTPEnhancedPainter::RenderHints h=painter.renderHints();
@ -2280,7 +2279,7 @@ void JKQTPHorizontalAxis::drawAxes(JKQTPEnhancedPainter& painter) {
get_parent_mathText()->parse(axisLabel); get_parent_mathText()->parse(axisLabel);
QRect rect(0,0, get_parent_plotwidth(), get_parent_mathText()->getSize(painter).height());//plotBorderLeft-30); QRectF rect(0,0, get_parent_plotwidth(), get_parent_mathText()->getSize(painter).height());//plotBorderLeft-30);
painter.save(); painter.save();
painter.translate(QPointF(left, top-parent->pt2px(painter, tickOutsideLength+tickLabelDistance+labelDistance)-labelMax.height()-rect.height())); painter.translate(QPointF(left, top-parent->pt2px(painter, tickOutsideLength+tickLabelDistance+labelDistance)-labelMax.height()-rect.height()));
//JKQTPEnhancedPainter::RenderHints h=painter.renderHints(); //JKQTPEnhancedPainter::RenderHints h=painter.renderHints();
@ -2330,31 +2329,31 @@ JKQTPHorizontalIndependentAxis::JKQTPHorizontalIndependentAxis(double axisOffset
void JKQTPHorizontalIndependentAxis::setAxisOffset(double __value) { void JKQTPHorizontalIndependentAxis::setAxisOffset(double __value) {
this->axisOffset = __value; this->axisOffset = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPHorizontalIndependentAxis::setAxisWidth(double __value) { void JKQTPHorizontalIndependentAxis::setAxisWidth(double __value) {
this->axisWidth = __value; this->axisWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPHorizontalIndependentAxis::set_otherAxisOffset(double __value) { void JKQTPHorizontalIndependentAxis::set_otherAxisOffset(double __value) {
this->otherAxisOffset = __value; this->otherAxisOffset = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPHorizontalIndependentAxis::set_otherAxisWidth(double __value) { void JKQTPHorizontalIndependentAxis::set_otherAxisWidth(double __value) {
this->otherAxisWidth = __value; this->otherAxisWidth = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
void JKQTPHorizontalIndependentAxis::set_otherAxisInverted(bool __value) { void JKQTPHorizontalIndependentAxis::set_otherAxisInverted(bool __value) {
this->otherAxisInverted = __value; this->otherAxisInverted = __value;
this->paramsChanged=true; this->paramsChanged=true;
replotPlot(); redrawPlot();
} }
double JKQTPHorizontalIndependentAxis::get_parent_plotwidth() const { return axisWidth; } double JKQTPHorizontalIndependentAxis::get_parent_plotwidth() const { return axisWidth; }

View File

@ -148,13 +148,13 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
virtual ~JKQTPCoordinateAxis(); virtual ~JKQTPCoordinateAxis();
virtual void set_parent(JKQTBasePlotter* parent); virtual void set_parent(JKQTBasePlotter* parent);
/** \brief loads the plot properties from a QSettings object */ /** \brief loads the plot properties from a QSettings object */
virtual void loadSettings(QSettings& settings, QString group=QString("plots")); virtual void loadSettings(const QSettings &settings, const QString& group=QString("plots"));
/** \brief saves the plot properties into a QSettings object. /** \brief saves the plot properties into a QSettings object.
* *
* This method only saves those properties that differ from their default value. * This method only saves those properties that differ from their default value.
*/ */
virtual void saveSettings(QSettings& settings, QString group=QString("plots")); virtual void saveSettings(QSettings& settings, const QString& group=QString("plots")) const;
/** \brief load settings from other axis */ /** \brief load settings from other axis */
virtual void loadSettings(JKQTPCoordinateAxis* settings); virtual void loadSettings(JKQTPCoordinateAxis* settings);
@ -194,7 +194,7 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
void clearAxisTickLabels(); void clearAxisTickLabels();
/** \brief add a new tick label to the axis */ /** \brief add a new tick label to the axis */
void addAxisTickLabel(double x, QString label); void addAxisTickLabel(double x, const QString& label);
/** \brief add a new tick label to the axis */ /** \brief add a new tick label to the axis */
@ -428,7 +428,7 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
/** \brief sets the property axisLabel to the specified \a __value. /** \brief sets the property axisLabel to the specified \a __value.
* \details Description of the parameter axisLabel is: <BLOCKQUOTE>\copydoc axisLabel </BLOCKQUOTE> * \details Description of the parameter axisLabel is: <BLOCKQUOTE>\copydoc axisLabel </BLOCKQUOTE>
* \see axisLabel for more information */ * \see axisLabel for more information */
virtual void setAxisLabel (QString __value); virtual void setAxisLabel (const QString& __value);
/** \brief sets the property labelPosition to the specified \a __value. /** \brief sets the property labelPosition to the specified \a __value.
* \details Description of the parameter labelPosition is: <BLOCKQUOTE>\copydoc labelPosition </BLOCKQUOTE> */ * \details Description of the parameter labelPosition is: <BLOCKQUOTE>\copydoc labelPosition </BLOCKQUOTE> */
@ -436,7 +436,7 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
/** \brief sets the property labelFont to the specified \a __value. /** \brief sets the property labelFont to the specified \a __value.
* \details Description of the parameter labelFont is: <BLOCKQUOTE>\copydoc labelFont </BLOCKQUOTE> */ * \details Description of the parameter labelFont is: <BLOCKQUOTE>\copydoc labelFont </BLOCKQUOTE> */
virtual void set_labelFont (QString __value); virtual void set_labelFont (const QString& __value);
/** \brief sets the property labelFontSize to the specified \a __value. /** \brief sets the property labelFontSize to the specified \a __value.
* \details Description of the parameter labelFontSize is: <BLOCKQUOTE>\copydoc labelFontSize </BLOCKQUOTE> */ * \details Description of the parameter labelFontSize is: <BLOCKQUOTE>\copydoc labelFontSize </BLOCKQUOTE> */
@ -444,22 +444,22 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
/** \brief sets the property tickLabelFont to the specified \a __value. /** \brief sets the property tickLabelFont to the specified \a __value.
* \details Description of the parameter tickLabelFont is: <BLOCKQUOTE>\copydoc tickLabelFont </BLOCKQUOTE> */ * \details Description of the parameter tickLabelFont is: <BLOCKQUOTE>\copydoc tickLabelFont </BLOCKQUOTE> */
virtual void set_tickLabelFont (QString __value); virtual void set_tickLabelFont (const QString& __value);
/** \brief sets the property tickTimeFormat to the specified \a __value. /** \brief sets the property tickTimeFormat to the specified \a __value.
* \details Description of the parameter tickTimeFormat is: <BLOCKQUOTE>\copydoc tickTimeFormat </BLOCKQUOTE> */ * \details Description of the parameter tickTimeFormat is: <BLOCKQUOTE>\copydoc tickTimeFormat </BLOCKQUOTE> */
virtual void set_tickTimeFormat (QString __value); virtual void set_tickTimeFormat (const QString& __value);
/** \brief sets the property tickDateFormat to the specified \a __value. /** \brief sets the property tickDateFormat to the specified \a __value.
* \details Description of the parameter tickDateFormat is: <BLOCKQUOTE>\copydoc tickDateFormat </BLOCKQUOTE> */ * \details Description of the parameter tickDateFormat is: <BLOCKQUOTE>\copydoc tickDateFormat </BLOCKQUOTE> */
virtual void set_tickDateFormat (QString __value); virtual void set_tickDateFormat (const QString& __value);
/** \brief sets the property tickDateTimeFormat to the specified \a __value. /** \brief sets the property tickDateTimeFormat to the specified \a __value.
* \details Description of the parameter tickDateTimeFormat is: <BLOCKQUOTE>\copydoc tickDateTimeFormat </BLOCKQUOTE> */ * \details Description of the parameter tickDateTimeFormat is: <BLOCKQUOTE>\copydoc tickDateTimeFormat </BLOCKQUOTE> */
virtual void set_tickDateTimeFormat (QString __value); virtual void set_tickDateTimeFormat (const QString& __value);
/** \brief sets the property tickLabelFontSize to the specified \a __value. /** \brief sets the property tickLabelFontSize to the specified \a __value.
@ -504,7 +504,7 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
/** \brief sets the property axisColor to the specified \a __value. /** \brief sets the property axisColor to the specified \a __value.
* \details Description of the parameter axisColor is: <BLOCKQUOTE>\copydoc axisColor </BLOCKQUOTE> */ * \details Description of the parameter axisColor is: <BLOCKQUOTE>\copydoc axisColor </BLOCKQUOTE> */
virtual void setAxisColor (QColor __value); virtual void setAxisColor (const QColor& __value);
/** \brief sets the property showZeroAxis to the specified \a __value. /** \brief sets the property showZeroAxis to the specified \a __value.
* \details Description of the parameter showZeroAxis is: <BLOCKQUOTE>\copydoc showZeroAxis </BLOCKQUOTE> */ * \details Description of the parameter showZeroAxis is: <BLOCKQUOTE>\copydoc showZeroAxis </BLOCKQUOTE> */
@ -516,11 +516,11 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
/** \brief sets the property gridColor to the specified \a __value. /** \brief sets the property gridColor to the specified \a __value.
* \details Description of the parameter gridColor is: <BLOCKQUOTE>\copydoc gridColor </BLOCKQUOTE> */ * \details Description of the parameter gridColor is: <BLOCKQUOTE>\copydoc gridColor </BLOCKQUOTE> */
virtual void setGridColor(QColor __value); virtual void setGridColor(const QColor& __value);
/** \brief sets the property minorGridColor to the specified \a __value. /** \brief sets the property minorGridColor to the specified \a __value.
* \details Description of the parameter minorGridColor is: <BLOCKQUOTE>\copydoc minorGridColor </BLOCKQUOTE> */ * \details Description of the parameter minorGridColor is: <BLOCKQUOTE>\copydoc minorGridColor </BLOCKQUOTE> */
virtual void set_minorGridColor(QColor __value); virtual void set_minorGridColor(const QColor& __value);
/** \brief sets the property gridWidth to the specified \a __value. /** \brief sets the property gridWidth to the specified \a __value.
* \details Description of the parameter gridWidth is: <BLOCKQUOTE>\copydoc gridWidth </BLOCKQUOTE> */ * \details Description of the parameter gridWidth is: <BLOCKQUOTE>\copydoc gridWidth </BLOCKQUOTE> */
@ -592,8 +592,8 @@ class LIB_EXPORT JKQTPCoordinateAxis: public QObject {
bool paramsChanged; bool paramsChanged;
bool doUpdateScaling; bool doUpdateScaling;
/** \brief simply calls the replotPlot method of the parent plotter class */ /** \brief simply calls the redrawPlot method of the parent plotter class */
void replotPlot(); void redrawPlot();
/** \brief a list of tick labels. /** \brief a list of tick labels.
* *
* If this list contains items, this class will NOT plot a standard x-axis, * If this list contains items, this class will NOT plot a standard x-axis,

View File

@ -75,7 +75,7 @@ JKQTBasePlotter::JKQTBasePlotter()
initJKQTBasePlotterResources(); initJKQTBasePlotterResources();
} }
void JKQTBasePlotter::setDefaultJKQTBasePrinterUserSettings(QString userSettigsFilename, QString userSettigsPrefix) void JKQTBasePlotter::setDefaultJKQTBasePrinterUserSettings(QString userSettigsFilename, const QString& userSettigsPrefix)
{ {
globalUserSettigsFilename=userSettigsFilename; globalUserSettigsFilename=userSettigsFilename;
globalUserSettigsPrefix=userSettigsPrefix; globalUserSettigsPrefix=userSettigsPrefix;
@ -335,6 +335,10 @@ void JKQTBasePlotter::forceInternalDatastore(){
if (emitPlotSignals) emit plotUpdated(); if (emitPlotSignals) emit plotUpdated();
} }
bool JKQTBasePlotter::isEmittingSignalsEnabled() const {
return this->emitSignals;
}
void JKQTBasePlotter::initSettings() { void JKQTBasePlotter::initSettings() {
useClipping=true; useClipping=true;
//doDrawing=true; //doDrawing=true;
@ -463,6 +467,7 @@ void JKQTBasePlotter::zoom(double nxmin, double nxmax, double nymin, double nyma
if (emitPlotSignals) emit plotUpdated(); if (emitPlotSignals) emit plotUpdated();
if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this); if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this);
} }
void JKQTBasePlotter::resize(int wid, int heigh) { void JKQTBasePlotter::resize(int wid, int heigh) {
widgetWidth=wid; widgetWidth=wid;
widgetHeight=heigh; widgetHeight=heigh;
@ -481,7 +486,7 @@ void JKQTBasePlotter::setHeight(int heigh) {
if (emitPlotSignals) emit plotUpdated(); if (emitPlotSignals) emit plotUpdated();
} }
void JKQTBasePlotter::saveSettings(QSettings& settings, QString group){ void JKQTBasePlotter::saveSettings(QSettings& settings, const QString& group) const{
QString g=group+"/"; QString g=group+"/";
if (group.isEmpty()) g=""; if (group.isEmpty()) g="";
@ -553,7 +558,7 @@ void JKQTBasePlotter::saveSettings(QSettings& settings, QString group){
} }
void JKQTBasePlotter::loadUserSettings(QSettings &settings, QString group) { void JKQTBasePlotter::loadUserSettings(const QSettings &settings, const QString& group) {
currentSaveDirectory=settings.value(group+"currentSaveDirectory", currentSaveDirectory).toString(); currentSaveDirectory=settings.value(group+"currentSaveDirectory", currentSaveDirectory).toString();
currentFileFormat=settings.value(group+"currentFileFormat", currentFileFormat).toString(); currentFileFormat=settings.value(group+"currentFileFormat", currentFileFormat).toString();
currentDataFileFormat=settings.value(group+"currentDataFileFormat", currentFileFormat).toString(); currentDataFileFormat=settings.value(group+"currentDataFileFormat", currentFileFormat).toString();
@ -568,22 +573,19 @@ void JKQTBasePlotter::loadUserSettings(QSettings &settings, QString group) {
printKeepAspect=settings.value(group+"printKeepAspect", printKeepAspect).toBool(); printKeepAspect=settings.value(group+"printKeepAspect", printKeepAspect).toBool();
exportUnitInMM=settings.value(group+"exportUnitInMM", exportUnitInMM).toBool(); exportUnitInMM=settings.value(group+"exportUnitInMM", exportUnitInMM).toBool();
currentPrinter=settings.value(group+"printer", currentPrinter).toString(); currentPrinter=settings.value(group+"printer", currentPrinter).toString();
settings.beginGroup(group+"selections"); int count=settings.value(group+"selections.count", 0).toInt();
int count=settings.value("count", 0).toInt();
getDataColumnsByUserSaved.clear(); getDataColumnsByUserSaved.clear();
for (int i=0; i<count; i++) { for (int i=0; i<count; i++) {
settings.beginGroup(QString("item%1").arg(i)); const QString itg=QString("item%1").arg(i);
QString n=settings.value("name", "").toString(); QString n=settings.value(group+"selections."+itg+".name", "").toString();
QStringList item=settings.value("items", QStringList()).toStringList(); QStringList item=settings.value(group+"selections."+itg+".items", QStringList()).toStringList();
if (!n.isEmpty()) { if (!n.isEmpty()) {
getDataColumnsByUserSaved[n]=item; getDataColumnsByUserSaved[n]=item;
} }
settings.endGroup();
} }
settings.endGroup();
} }
void JKQTBasePlotter::saveUserSettings(QSettings &settings, QString group) { void JKQTBasePlotter::saveUserSettings(QSettings &settings, const QString& group) const {
settings.setValue(group+"printer", currentPrinter); settings.setValue(group+"printer", currentPrinter);
//qDebug()<<settings.fileName()<<group<<currentSaveDirectory<<QDir(currentSaveDirectory).absolutePath(); //qDebug()<<settings.fileName()<<group<<currentSaveDirectory<<QDir(currentSaveDirectory).absolutePath();
settings.setValue(group+"currentSaveDirectory", QDir(currentSaveDirectory).absolutePath()); settings.setValue(group+"currentSaveDirectory", QDir(currentSaveDirectory).absolutePath());
@ -613,7 +615,7 @@ void JKQTBasePlotter::saveUserSettings(QSettings &settings, QString group) {
settings.endGroup(); settings.endGroup();
} }
void JKQTBasePlotter::loadSettings(QSettings& settings, QString group){ void JKQTBasePlotter::loadSettings(const QSettings &settings, const QString& group){
QString g=group+"/"; QString g=group+"/";
if (group.isEmpty()) g=""; if (group.isEmpty()) g="";
@ -1320,8 +1322,8 @@ void JKQTBasePlotter::gridPaint(JKQTPEnhancedPainter& painter, QSizeF pageRect,
int t_y=0; int t_y=0;
//std::cout<<"printing "<<i<<" @g "<<gridPrintingList[i].x<<", "<<gridPrintingList[i].y<<" ...\n"; //std::cout<<"printing "<<i<<" @g "<<gridPrintingList[i].x<<", "<<gridPrintingList[i].y<<" ...\n";
//std::cout<<"colrowlistsizes "<<gridPrintingColumns.size()<<", "<<gridPrintingRows.size()<<" ...\n"; //std::cout<<"colrowlistsizes "<<gridPrintingColumns.size()<<", "<<gridPrintingRows.size()<<" ...\n";
for (size_t j=0; j<gridPrintingList[i].x; j++) { t_x+=gridPrintingColumns[j]; } for (int j=0; j<gridPrintingList[i].x; j++) { t_x+=gridPrintingColumns[j]; }
for (size_t j=0; j<gridPrintingList[i].y; j++) { t_y+=gridPrintingRows[j]; } for (int j=0; j<gridPrintingList[i].y; j++) { t_y+=gridPrintingRows[j]; }
//std::cout<<"printing "<<i<<" @ "<<t_x<<", "<<t_y<<" ...\n"; //std::cout<<"printing "<<i<<" @ "<<t_x<<", "<<t_y<<" ...\n";
painter.translate(t_x, t_y); painter.translate(t_x, t_y);
gridPrintingList[i].plotter->paintPlot(painter, drawOverlays); gridPrintingList[i].plotter->paintPlot(painter, drawOverlays);
@ -1335,7 +1337,7 @@ void JKQTBasePlotter::gridPaint(JKQTPEnhancedPainter& painter, QSizeF pageRect,
gridPrintingList[i].plotter->setLineWidthMultiplier(lwm[i]); gridPrintingList[i].plotter->setLineWidthMultiplier(lwm[i]);
gridPrintingList[i].plotter->set_paintMagnification(pm[i]); gridPrintingList[i].plotter->set_paintMagnification(pm[i]);
gridPrintingList[i].plotter->setBackgroundColor(backg[i]); gridPrintingList[i].plotter->setBackgroundColor(backg[i]);
gridPrintingList[i].plotter->replotPlot(); gridPrintingList[i].plotter->redrawPlot();
} }
} }
@ -1386,8 +1388,8 @@ void JKQTBasePlotter::gridPaintOverlays(JKQTPEnhancedPainter &painter, QSizeF pa
int t_y=0; int t_y=0;
//std::cout<<"printing "<<i<<" @g "<<gridPrintingList[i].x<<", "<<gridPrintingList[i].y<<" ...\n"; //std::cout<<"printing "<<i<<" @g "<<gridPrintingList[i].x<<", "<<gridPrintingList[i].y<<" ...\n";
//std::cout<<"colrowlistsizes "<<gridPrintingColumns.size()<<", "<<gridPrintingRows.size()<<" ...\n"; //std::cout<<"colrowlistsizes "<<gridPrintingColumns.size()<<", "<<gridPrintingRows.size()<<" ...\n";
for (size_t j=0; j<gridPrintingList[i].x; j++) { t_x+=gridPrintingColumns[j]; } for (int j=0; j<gridPrintingList[i].x; j++) { t_x+=gridPrintingColumns[j]; }
for (size_t j=0; j<gridPrintingList[i].y; j++) { t_y+=gridPrintingRows[j]; } for (int j=0; j<gridPrintingList[i].y; j++) { t_y+=gridPrintingRows[j]; }
//std::cout<<"printing "<<i<<" @ "<<t_x<<", "<<t_y<<" ...\n"; //std::cout<<"printing "<<i<<" @ "<<t_x<<", "<<t_y<<" ...\n";
painter.translate(t_x, t_y); painter.translate(t_x, t_y);
gridPrintingList[i].plotter->paintOverlays(painter); gridPrintingList[i].plotter->paintOverlays(painter);
@ -2271,7 +2273,7 @@ void JKQTBasePlotter::printpreviewUpdate()
} }
} }
void JKQTBasePlotter::draw(JKQTPEnhancedPainter& painter, QRect rect, bool drawOverlays) { void JKQTBasePlotter::draw(JKQTPEnhancedPainter& painter, const QRect& rect, bool drawOverlays) {
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::draw(rect, %1)").arg(drawOverlays)); JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::draw(rect, %1)").arg(drawOverlays));
#endif #endif
@ -2299,7 +2301,7 @@ void JKQTBasePlotter::draw(JKQTPEnhancedPainter& painter, QRect rect, bool drawO
emitPlotSignals=oldEmitPlotSignals; emitPlotSignals=oldEmitPlotSignals;
} }
void JKQTBasePlotter::drawOverlays(JKQTPEnhancedPainter &painter, QRect rect) void JKQTBasePlotter::drawOverlays(JKQTPEnhancedPainter &painter, const QRect& rect)
{ {
//resize(rect.width(), rect.height()); //resize(rect.width(), rect.height());
@ -2311,7 +2313,7 @@ void JKQTBasePlotter::drawOverlays(JKQTPEnhancedPainter &painter, QRect rect)
painter.restore(); painter.restore();
} }
void JKQTBasePlotter::draw(JKQTPEnhancedPainter& painter, QPoint pos, bool drawOverlays) { void JKQTBasePlotter::draw(JKQTPEnhancedPainter& painter, const QPoint& pos, bool drawOverlays) {
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::draw(pos, %1)").arg(drawOverlays)); JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::draw(pos, %1)").arg(drawOverlays));
#endif #endif
@ -2339,7 +2341,7 @@ void JKQTBasePlotter::draw(JKQTPEnhancedPainter& painter, QPoint pos, bool drawO
emitPlotSignals=oldEmitPlotSignals; emitPlotSignals=oldEmitPlotSignals;
} }
void JKQTBasePlotter::drawNonGrid(JKQTPEnhancedPainter& painter, QRect rect, bool drawOverlays) { void JKQTBasePlotter::drawNonGrid(JKQTPEnhancedPainter& painter, const QRect& rect, bool drawOverlays) {
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::drawNonGrid(rect, %1)").arg(drawOverlays)); JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::drawNonGrid(rect, %1)").arg(drawOverlays));
#endif #endif
@ -2385,7 +2387,7 @@ void JKQTBasePlotter::drawNonGrid(JKQTPEnhancedPainter& painter, QRect rect, boo
} }
void JKQTBasePlotter::drawNonGrid(JKQTPEnhancedPainter& painter, QPoint pos, bool drawOverlays) { void JKQTBasePlotter::drawNonGrid(JKQTPEnhancedPainter& painter, const QPoint& pos, bool drawOverlays) {
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::drawNonGrid(pos, %1)").arg(drawOverlays)); JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::drawNonGrid(pos, %1)").arg(drawOverlays));
#endif #endif
@ -2431,7 +2433,7 @@ void JKQTBasePlotter::drawNonGrid(JKQTPEnhancedPainter& painter, QPoint pos, boo
emitPlotSignals=oldEmitPlotSignals; emitPlotSignals=oldEmitPlotSignals;
} }
void JKQTBasePlotter::drawNonGridOverlays(JKQTPEnhancedPainter& painter, QPoint pos) { void JKQTBasePlotter::drawNonGridOverlays(JKQTPEnhancedPainter& painter, const QPoint& pos) {
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::drawNonGridOverlays(point)")); JKQTPAutoOutputTimer jkaaot(QString("JKQTBasePlotter::drawNonGridOverlays(point)"));
#endif #endif
@ -2450,6 +2452,16 @@ void JKQTBasePlotter::drawNonGridOverlays(JKQTPEnhancedPainter& painter, QPoint
painter.restore(); painter.restore();
} }
void JKQTBasePlotter::setEmittingPlotSignalsEnabled(bool __value)
{
this->emitPlotSignals = __value;
}
bool JKQTBasePlotter::isEmittingPlotSignalsEnabled() const
{
return this->emitPlotSignals;
}
void JKQTBasePlotter::registerAdditionalAction(const QString &key, QAction *act) void JKQTBasePlotter::registerAdditionalAction(const QString &key, QAction *act)
{ {
if (!lstAdditionalPlotterActions.contains(key)) { if (!lstAdditionalPlotterActions.contains(key)) {
@ -2524,7 +2536,7 @@ void JKQTBasePlotter::copyDataMatlab() {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveData(QString filename, QString format) { void JKQTBasePlotter::saveData(const QString& filename, const QString &format) {
loadUserSettings(); loadUserSettings();
QStringList fileformats; QStringList fileformats;
QStringList fileformatIDs; QStringList fileformatIDs;
@ -2618,7 +2630,7 @@ void JKQTBasePlotter::saveData(QString filename, QString format) {
} }
} }
void JKQTBasePlotter::saveAsCSV(QString filename) { void JKQTBasePlotter::saveAsCSV(const QString& filename) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -2634,7 +2646,7 @@ void JKQTBasePlotter::saveAsCSV(QString filename) {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveAsSYLK(QString filename) { void JKQTBasePlotter::saveAsSYLK(const QString& filename) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -2650,7 +2662,7 @@ void JKQTBasePlotter::saveAsSYLK(QString filename) {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveAsMatlab(QString filename) { void JKQTBasePlotter::saveAsMatlab(const QString& filename) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -2666,7 +2678,7 @@ void JKQTBasePlotter::saveAsMatlab(QString filename) {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveAsDIF(QString filename) { void JKQTBasePlotter::saveAsDIF(const QString& filename) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -2682,7 +2694,7 @@ void JKQTBasePlotter::saveAsDIF(QString filename) {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveAsSemicolonSV(QString filename) { void JKQTBasePlotter::saveAsSemicolonSV(const QString& filename) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -2698,7 +2710,7 @@ void JKQTBasePlotter::saveAsSemicolonSV(QString filename) {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveAsTabSV(QString filename) { void JKQTBasePlotter::saveAsTabSV(const QString& filename) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -2714,7 +2726,7 @@ void JKQTBasePlotter::saveAsTabSV(QString filename) {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveAsGerExcelCSV(QString filename) { void JKQTBasePlotter::saveAsGerExcelCSV(const QString& filename) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -2730,7 +2742,7 @@ void JKQTBasePlotter::saveAsGerExcelCSV(QString filename) {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveAsPDF(QString filename, bool displayPreview) { void JKQTBasePlotter::saveAsPDF(const QString& filename, bool displayPreview) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -2763,7 +2775,7 @@ void JKQTBasePlotter::saveAsPDF(QString filename, bool displayPreview) {
saveUserSettings(); saveUserSettings();
} }
void JKQTBasePlotter::saveAsPS(QString filename, bool displayPreview) { void JKQTBasePlotter::saveAsPS(const QString& filename, bool displayPreview) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
@ -2800,7 +2812,7 @@ void JKQTBasePlotter::saveAsPS(QString filename, bool displayPreview) {
} }
void JKQTBasePlotter::saveImage(QString filename, bool displayPreview) { void JKQTBasePlotter::saveImage(const QString& filename, bool displayPreview) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
QStringList filt; QStringList filt;
@ -2905,7 +2917,7 @@ void JKQTBasePlotter::saveImage(QString filename, bool displayPreview) {
} }
void JKQTBasePlotter::saveAsPixelImage(QString filename, bool displayPreview, const QByteArray& outputFormat) { void JKQTBasePlotter::saveAsPixelImage(const QString& filename, bool displayPreview, const QByteArray& outputFormat) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
QStringList filt; QStringList filt;
@ -3091,7 +3103,7 @@ void JKQTBasePlotter::copyPixelImage() {
} }
void JKQTBasePlotter::saveAsSVG(QString filename, bool displayPreview) { void JKQTBasePlotter::saveAsSVG(const QString& filename, bool displayPreview) {
loadUserSettings(); loadUserSettings();
QString fn=filename; QString fn=filename;
if (fn.isEmpty()) { if (fn.isEmpty()) {
@ -3218,7 +3230,7 @@ void JKQTBasePlotter::synchronizeXYAxis(double newxmin, double newxmax, double n
setXY(newxmin, newxmax, newymin, newymax); setXY(newxmin, newxmax, newymin, newymax);
} }
size_t JKQTBasePlotter::addGraph(size_t xColumn, size_t yColumn, QString title, JKQTPGraphPlotstyle graphStyle) { size_t JKQTBasePlotter::addGraph(size_t xColumn, size_t yColumn, const QString& title, JKQTPGraphPlotstyle graphStyle) {
if (graphStyle==JKQTPImpulsesHorizontal) { if (graphStyle==JKQTPImpulsesHorizontal) {
JKQTPImpulsesHorizontalGraph* gr=new JKQTPImpulsesHorizontalGraph(this); JKQTPImpulsesHorizontalGraph* gr=new JKQTPImpulsesHorizontalGraph(this);
gr->set_title(title); gr->set_title(title);
@ -3267,7 +3279,7 @@ size_t JKQTBasePlotter::addGraph(size_t xColumn, size_t yColumn, QString title,
return -1; return -1;
} }
size_t JKQTBasePlotter::addGraph(size_t xColumn, size_t yColumn, QString title, JKQTPGraphPlotstyle graphStyle, QColor color, JKQTPGraphSymbols symbol, Qt::PenStyle penstyle, double width) { size_t JKQTBasePlotter::addGraph(size_t xColumn, size_t yColumn, const QString& title, JKQTPGraphPlotstyle graphStyle, QColor color, JKQTPGraphSymbols symbol, Qt::PenStyle penstyle, double width) {
if (graphStyle==JKQTPImpulsesHorizontal) { if (graphStyle==JKQTPImpulsesHorizontal) {
JKQTPImpulsesHorizontalGraph* gr=new JKQTPImpulsesHorizontalGraph(this); JKQTPImpulsesHorizontalGraph* gr=new JKQTPImpulsesHorizontalGraph(this);
gr->set_title(title); gr->set_title(title);
@ -3400,7 +3412,7 @@ void JKQTBasePlotter::addVerticalBargraph(QVector<size_t> xColumns, size_t yColu
} }
} }
size_t JKQTBasePlotter::addGraphWithXError(size_t xColumn, size_t yColumn, size_t xErrorColumn, QString title, JKQTPGraphPlotstyle graphStyle, JKQTPErrorPlotstyle errorStyle){ size_t JKQTBasePlotter::addGraphWithXError(size_t xColumn, size_t yColumn, size_t xErrorColumn, const QString& title, JKQTPGraphPlotstyle graphStyle, JKQTPErrorPlotstyle errorStyle){
if (graphStyle==JKQTPImpulsesHorizontal) { if (graphStyle==JKQTPImpulsesHorizontal) {
JKQTPImpulsesHorizontalErrorGraph* gr=new JKQTPImpulsesHorizontalErrorGraph(this); JKQTPImpulsesHorizontalErrorGraph* gr=new JKQTPImpulsesHorizontalErrorGraph(this);
gr->set_title(title); gr->set_title(title);
@ -3444,7 +3456,7 @@ size_t JKQTBasePlotter::addGraphWithXError(size_t xColumn, size_t yColumn, size_
} }
size_t JKQTBasePlotter::addGraphWithYError(size_t xColumn, size_t yColumn, size_t yErrorColumn, QString title, JKQTPGraphPlotstyle graphStyle, JKQTPErrorPlotstyle errorStyle){ size_t JKQTBasePlotter::addGraphWithYError(size_t xColumn, size_t yColumn, size_t yErrorColumn, const QString& title, JKQTPGraphPlotstyle graphStyle, JKQTPErrorPlotstyle errorStyle){
if (graphStyle==JKQTPImpulsesVertical) { if (graphStyle==JKQTPImpulsesVertical) {
JKQTPImpulsesVerticalErrorGraph* gr=new JKQTPImpulsesVerticalErrorGraph(this); JKQTPImpulsesVerticalErrorGraph* gr=new JKQTPImpulsesVerticalErrorGraph(this);
gr->set_title(title); gr->set_title(title);
@ -3488,7 +3500,7 @@ size_t JKQTBasePlotter::addGraphWithYError(size_t xColumn, size_t yColumn, size_
} }
} }
size_t JKQTBasePlotter::addGraphWithXYError(size_t xColumn, size_t yColumn, size_t xErrorColumn, size_t yErrorColumn, QString title, JKQTPGraphPlotstyle graphStyle){ size_t JKQTBasePlotter::addGraphWithXYError(size_t xColumn, size_t yColumn, size_t xErrorColumn, size_t yErrorColumn, const QString& title, JKQTPGraphPlotstyle graphStyle){
JKQTPXYLineErrorGraph* gr=new JKQTPXYLineErrorGraph(this); JKQTPXYLineErrorGraph* gr=new JKQTPXYLineErrorGraph(this);
gr->set_title(title); gr->set_title(title);
gr->set_xColumn(xColumn); gr->set_xColumn(xColumn);
@ -3839,7 +3851,7 @@ void JKQTBasePlotter::loadUserSettings()
} }
} }
void JKQTBasePlotter::saveUserSettings() void JKQTBasePlotter::saveUserSettings() const
{ {
if (!userSettigsFilename.isEmpty()) { if (!userSettigsFilename.isEmpty()) {
QSettings set(userSettigsFilename, QSettings::IniFormat); QSettings set(userSettigsFilename, QSettings::IniFormat);
@ -4529,5 +4541,4 @@ QPaintDevice *JKQTPPaintDeviceAdapter::createPaintdeviceMM(const QString &filena
return createPaintdevice(filename, widthMM/25.4*QApplication::desktop()->logicalDpiX(), heightMM/25.4*QApplication::desktop()->logicalDpiY()); return createPaintdevice(filename, widthMM/25.4*QApplication::desktop()->logicalDpiX(), heightMM/25.4*QApplication::desktop()->logicalDpiY());
} }
JKQTPSaveDataAdapter::~JKQTPSaveDataAdapter() { JKQTPSaveDataAdapter::~JKQTPSaveDataAdapter() = default;
}

File diff suppressed because it is too large Load Diff

View File

@ -55,9 +55,7 @@ JKQTPColumn::JKQTPColumn(JKQTPDatastore *datastore, const QString &name, size_t
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
JKQTPColumn::~JKQTPColumn() JKQTPColumn::~JKQTPColumn()
{ = default;
}
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
size_t JKQTPColumn::getRows() const { size_t JKQTPColumn::getRows() const {
@ -521,7 +519,7 @@ size_t JKQTPDatastore::addLinearColumn(size_t rows, double start, double end, co
double delta=(end-start)/(double)(rows-1); double delta=(end-start)/(double)(rows-1);
JKQTPDatastoreItem* it=new JKQTPDatastoreItem(1, rows); JKQTPDatastoreItem* it=new JKQTPDatastoreItem(1, rows);
for (size_t i=0; i<rows; i++) { for (size_t i=0; i<rows; i++) {
it->set(0, i, start+(double)i * delta); it->set(0, i, start+static_cast<double>(i) * delta);
//std::cout<<"copy@"<<i<<" = "<<data[i]<<std::endl; //std::cout<<"copy@"<<i<<" = "<<data[i]<<std::endl;
} }
/*items.push_back(it); /*items.push_back(it);
@ -632,7 +630,7 @@ size_t JKQTPDatastore::getMaxRows() {
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
void JKQTPDatastore::saveCSV(QString filename, QSet<int> userColumns, QString separator, QString decimal_separator, QString comment, QString aroundStrings, char floatformat) { void JKQTPDatastore::saveCSV(const QString& filename, const QSet<int>& userColumns, const QString& separator, const QString& decimal_separator, const QString& comment, const QString& aroundStrings, char floatformat) {
//std::cout<<filename<<"\n"; //std::cout<<filename<<"\n";
// find out the decimal and the thousand separator // find out the decimal and the thousand separator
@ -647,7 +645,7 @@ void JKQTPDatastore::saveCSV(QString filename, QSet<int> userColumns, QString se
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
void JKQTPDatastore::saveMatlab(QString filename, QSet<int> userColumns) { void JKQTPDatastore::saveMatlab(const QString& filename, const QSet<int>& userColumns) {
//std::cout<<filename<<"\n"; //std::cout<<filename<<"\n";
// find out the decimal and the thousand separator // find out the decimal and the thousand separator
@ -675,7 +673,7 @@ QStringList JKQTPDatastore::getColumnNames() const {
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
void JKQTPDatastore::saveMatlab(QTextStream &txt, QSet<int> userColumns) { void JKQTPDatastore::saveMatlab(QTextStream &txt, const QSet<int>& userColumns) {
//std::cout<<filename<<"\n"; //std::cout<<filename<<"\n";
// find out the decimal and the thousand separator // find out the decimal and the thousand separator
@ -732,7 +730,7 @@ void JKQTPDatastore::saveMatlab(QTextStream &txt, QSet<int> userColumns) {
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
void JKQTPDatastore::saveCSV(QTextStream& txt, QSet<int> userColumns, QString separator, QString decimal_separator, QString comment, QString aroundStrings, char floatformat) { void JKQTPDatastore::saveCSV(QTextStream& txt, const QSet<int>& userColumns, const QString& separator, const QString& decimal_separator, const QString& comment, const QString& aroundStrings, char floatformat) {
//std::cout<<filename<<"\n"; //std::cout<<filename<<"\n";
// find out the decimal and the thousand separator // find out the decimal and the thousand separator
@ -784,7 +782,7 @@ void JKQTPDatastore::saveCSV(QTextStream& txt, QSet<int> userColumns, QString se
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
void JKQTPDatastore::saveSYLK(QString filename, QSet<int> userColumns, QString floatformat) { void JKQTPDatastore::saveSYLK(const QString& filename, const QSet<int>& userColumns, const QString& floatformat) {
Q_UNUSED(floatformat) Q_UNUSED(floatformat)
// find out the decimal and the thousand separator // find out the decimal and the thousand separator
QLocale loc=QLocale::c(); QLocale loc=QLocale::c();
@ -836,7 +834,7 @@ void JKQTPDatastore::saveSYLK(QString filename, QSet<int> userColumns, QString f
} }
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
QList<QVector<double> > JKQTPDatastore::getData(QStringList *columnNames, QSet<int> userColumns) QList<QVector<double> > JKQTPDatastore::getData(QStringList *columnNames, const QSet<int>& userColumns)
{ {
QStringList cl; QStringList cl;
QList<QVector<double> > res; QList<QVector<double> > res;
@ -867,7 +865,7 @@ QList<QVector<double> > JKQTPDatastore::getData(QStringList *columnNames, QSet<i
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
void JKQTPDatastore::saveDIF(QString filename, QSet<int> userColumns, QString floatformat) { void JKQTPDatastore::saveDIF(const QString& filename, const QSet<int>& userColumns, const QString& floatformat) {
Q_UNUSED(floatformat) Q_UNUSED(floatformat)
// find out the decimal and the thousand separator // find out the decimal and the thousand separator
QLocale loc=QLocale::c(); QLocale loc=QLocale::c();
@ -935,8 +933,7 @@ JKQTPDatastoreModel::JKQTPDatastoreModel(JKQTPDatastore *datastore, QObject *par
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
JKQTPDatastoreModel::~JKQTPDatastoreModel() JKQTPDatastoreModel::~JKQTPDatastoreModel()
{ = default;
}
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
QVariant JKQTPDatastoreModel::data(const QModelIndex &index, int role) const { QVariant JKQTPDatastoreModel::data(const QModelIndex &index, int role) const {

View File

@ -525,7 +525,7 @@ class LIB_EXPORT JKQTPDatastore{
* - ... * - ...
* . * .
*/ */
void saveCSV(QString filename, QSet<int> userColumns=QSet<int>(), QString separator=QString(", "), QString decimal_separator=QString("."), QString comment=QString("#"), QString aroundStrings=QString(""), char floatformat='g'); void saveCSV(const QString& filename, const QSet<int>& userColumns=QSet<int>(), const QString& separator=QString(", "), const QString& decimal_separator=QString("."), const QString& comment=QString("#"), const QString& aroundStrings=QString(""), char floatformat='g');
/** \brief save contents of datastore as Comma Separated Values (CSV) file /** \brief save contents of datastore as Comma Separated Values (CSV) file
* *
* \param txt QTextStream to write to * \param txt QTextStream to write to
@ -543,7 +543,7 @@ class LIB_EXPORT JKQTPDatastore{
* - ... * - ...
* . * .
*/ */
void saveCSV(QTextStream& txt, QSet<int> userColumns=QSet<int>(), QString separator=QString(", "), QString decimal_separator=QString("."), QString comment=QString("#"), QString aroundStrings=QString(""), char floatformat='g'); void saveCSV(QTextStream& txt, const QSet<int>& userColumns=QSet<int>(), const QString& separator=QString(", "), const QString& decimal_separator=QString("."), const QString& comment=QString("#"), const QString& aroundStrings=QString(""), char floatformat='g');
/** \brief save contents of datastore as <a href="http://en.wikipedia.org/wiki/SYmbolic_LinK_(SYLK)">SYLK file (SYmbolic LinK)</a> /** \brief save contents of datastore as <a href="http://en.wikipedia.org/wiki/SYmbolic_LinK_(SYLK)">SYLK file (SYmbolic LinK)</a>
* *
@ -551,14 +551,14 @@ class LIB_EXPORT JKQTPDatastore{
* \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() * \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames()
* \param floatformat a \c printf format string that is used to print floating point numbers to the file * \param floatformat a \c printf format string that is used to print floating point numbers to the file
*/ */
void saveSYLK(QString filename, QSet<int> userColumns=QSet<int>(), QString floatformat=QString("%10.10lf")); void saveSYLK(const QString& filename, const QSet<int>& userColumns=QSet<int>(), const QString& floatformat=QString("%10.10lf"));
/** \brief return contents of datastore as QList<QVector<double> >, i.e. a list of column-vectors /** \brief return contents of datastore as QList<QVector<double> >, i.e. a list of column-vectors
* *
* \param columnNames if \c !=nullptr this will afterwards conatin the column titles * \param columnNames if \c !=nullptr this will afterwards conatin the column titles
* \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() * \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames()
*/ */
QList<QVector<double> > getData(QStringList* columnNames=nullptr, QSet<int> userColumns=QSet<int>()); QList<QVector<double> > getData(QStringList* columnNames=nullptr, const QSet<int>& userColumns=QSet<int>());
/** \brief save contents of datastore as <a href="http://www.fileformat.info/format/dif/egff.htm">DIF file (data interchange format)</a> /** \brief save contents of datastore as <a href="http://www.fileformat.info/format/dif/egff.htm">DIF file (data interchange format)</a>
* *
@ -566,20 +566,20 @@ class LIB_EXPORT JKQTPDatastore{
* \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() * \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames()
* \param floatformat a \c printf format string that is used to print floating point numbers to the file * \param floatformat a \c printf format string that is used to print floating point numbers to the file
*/ */
void saveDIF(QString filename, QSet<int> userColumns=QSet<int>(), QString floatformat=QString("%10.10lf")); void saveDIF(const QString& filename, const QSet<int>& userColumns=QSet<int>(), const QString& floatformat=QString("%10.10lf"));
/** \brief save contents of datastore as a Matlab script /** \brief save contents of datastore as a Matlab script
* *
* \param filename the file to create * \param filename the file to create
* \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() * \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames()
*/ */
void saveMatlab(QString filename, QSet<int> userColumns=QSet<int>()); void saveMatlab(const QString& filename, const QSet<int>& userColumns=QSet<int>());
/** \brief save contents of datastore as a Matlab script /** \brief save contents of datastore as a Matlab script
* *
* \param txt the QTextStream to write to * \param txt the QTextStream to write to
* \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames() * \param userColumns a list of all columns to export, an empty list means: export all, the indexes in the list refer to getColumnsNames()
*/ */
void saveMatlab(QTextStream& txt, QSet<int> userColumns=QSet<int>()); void saveMatlab(QTextStream& txt, const QSet<int>& userColumns=QSet<int>());
/** \brief return a list with all columns available in the datastore */ /** \brief return a list with all columns available in the datastore */
QStringList getColumnNames() const; QStringList getColumnNames() const;

View File

@ -122,7 +122,7 @@ JKQTPOverlayVerticalLine::JKQTPOverlayVerticalLine(double pos, JKQTBasePlotter *
} }
JKQTPOverlayVerticalLine::JKQTPOverlayVerticalLine(double pos, QString text, JKQTBasePlotter *parent): JKQTPOverlayVerticalLine::JKQTPOverlayVerticalLine(double pos, const QString& text, JKQTBasePlotter *parent):
JKQTPOverlayOneCoordOverlay(pos, parent) JKQTPOverlayOneCoordOverlay(pos, parent)
{ {
set_text(text); set_text(text);
@ -169,7 +169,7 @@ JKQTPOverlayVerticalRange::JKQTPOverlayVerticalRange(double pos, double pos2, JK
inverted=false; inverted=false;
} }
JKQTPOverlayVerticalRange::JKQTPOverlayVerticalRange(double pos, double pos2, QString text, JKQTBasePlotter *parent): JKQTPOverlayVerticalRange::JKQTPOverlayVerticalRange(double pos, double pos2, const QString& text, JKQTBasePlotter *parent):
JKQTPOverlayTwoCoordOverlay(pos, pos2, parent) JKQTPOverlayTwoCoordOverlay(pos, pos2, parent)
{ {
set_text(text); set_text(text);

View File

@ -374,7 +374,7 @@ class LIB_EXPORT JKQTPOverlayVerticalLine : public JKQTPOverlayOneCoordOverlay {
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayVerticalLine(double pos, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayVerticalLine(double pos, JKQTBasePlotter *parent = 0);
explicit JKQTPOverlayVerticalLine(double pos, QString text, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayVerticalLine(double pos, const QString& text, JKQTBasePlotter *parent = 0);
/** \brief plots the graph to the plotter object specified as parent */ /** \brief plots the graph to the plotter object specified as parent */
virtual void draw(JKQTPEnhancedPainter& painter); virtual void draw(JKQTPEnhancedPainter& painter);
@ -391,7 +391,7 @@ class LIB_EXPORT JKQTPOverlayVerticalRange : public JKQTPOverlayTwoCoordOverlay
Q_OBJECT Q_OBJECT
public: public:
explicit JKQTPOverlayVerticalRange(double pos, double pos2, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayVerticalRange(double pos, double pos2, JKQTBasePlotter *parent = 0);
explicit JKQTPOverlayVerticalRange(double pos, double pos2, QString text, JKQTBasePlotter *parent = 0); explicit JKQTPOverlayVerticalRange(double pos, double pos2, const QString& text, JKQTBasePlotter *parent = 0);
/** \brief plots the graph to the plotter object specified as parent */ /** \brief plots the graph to the plotter object specified as parent */
virtual void draw(JKQTPEnhancedPainter& painter); virtual void draw(JKQTPEnhancedPainter& painter);

View File

@ -48,9 +48,7 @@ JKQTPPlotElement::JKQTPPlotElement(JKQTPlotter *parent):
} }
JKQTPPlotElement::~JKQTPPlotElement() JKQTPPlotElement::~JKQTPPlotElement()
{ = default;
}
JKQTPGraph::JKQTPGraph(JKQTBasePlotter* parent): JKQTPGraph::JKQTPGraph(JKQTBasePlotter* parent):
JKQTPPlotElement(parent) JKQTPPlotElement(parent)
@ -65,9 +63,7 @@ JKQTPGraph::JKQTPGraph(JKQTPlotter *parent):
} }
JKQTPGraph::~JKQTPGraph() JKQTPGraph::~JKQTPGraph()
{ = default;
}
QImage JKQTPPlotElement::generateKeyMarker(QSize size) QImage JKQTPPlotElement::generateKeyMarker(QSize size)
{ {
@ -517,9 +513,7 @@ JKQTPGraphErrors::JKQTPGraphErrors(QColor graphColor) {
} }
JKQTPGraphErrors::~JKQTPGraphErrors() JKQTPGraphErrors::~JKQTPGraphErrors()
{ = default;
}
@ -1210,6 +1204,4 @@ JKQTPPlotObject::JKQTPPlotObject(JKQTPlotter *parent):
} }
JKQTPPlotObject::~JKQTPPlotObject() JKQTPPlotObject::~JKQTPPlotObject()
{ = default;
}

View File

@ -134,7 +134,7 @@ void JKQTPGeoBaseFilled::drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& re
JKQTPGeoText::JKQTPGeoText(JKQTBasePlotter* parent, double x, double y, QString text, double fontSize, QColor color): JKQTPGeoText::JKQTPGeoText(JKQTBasePlotter* parent, double x, double y, const QString& text, double fontSize, QColor color):
JKQTPPlotObject(parent) JKQTPPlotObject(parent)
{ {
this->x=x; this->x=x;
@ -144,7 +144,7 @@ JKQTPGeoText::JKQTPGeoText(JKQTBasePlotter* parent, double x, double y, QString
this->color=color; this->color=color;
} }
JKQTPGeoText::JKQTPGeoText(JKQTPlotter* parent, double x, double y, QString text, double fontSize, QColor color): JKQTPGeoText::JKQTPGeoText(JKQTPlotter* parent, double x, double y, const QString& text, double fontSize, QColor color):
JKQTPPlotObject(parent) JKQTPPlotObject(parent)
{ {
this->x=x; this->x=x;

View File

@ -396,7 +396,7 @@ class LIB_EXPORT JKQTPGeoText: public JKQTPPlotObject {
\param color color of drawing \param color color of drawing
\param fontSize base font size of text \param fontSize base font size of text
*/ */
JKQTPGeoText(JKQTBasePlotter* parent, double x, double y, QString text, double fontSize=10, QColor color=QColor("black")); JKQTPGeoText(JKQTBasePlotter* parent, double x, double y, const QString& text, double fontSize=10, QColor color=QColor("black"));
/*! \brief class contructor /*! \brief class contructor
\param parent parent plotter widget \param parent parent plotter widget
@ -406,7 +406,7 @@ class LIB_EXPORT JKQTPGeoText: public JKQTPPlotObject {
\param color color of drawing \param color color of drawing
\param fontSize base font size of text \param fontSize base font size of text
*/ */
JKQTPGeoText(JKQTPlotter* parent, double x, double y, QString text, double fontSize=10, QColor color=QColor("black")); JKQTPGeoText(JKQTPlotter* parent, double x, double y, const QString& text, double fontSize=10, QColor color=QColor("black"));
/*! \brief sets the property color to the specified \a __value. /*! \brief sets the property color to the specified \a __value.
\details Description of the parameter color is: <BLOCKQUOTE>\copydoc color </BLOCKQUOTE> \details Description of the parameter color is: <BLOCKQUOTE>\copydoc color </BLOCKQUOTE>

View File

@ -119,8 +119,8 @@ void JKQTPImageBase::plotImage(JKQTPEnhancedPainter& painter, QImage& image, dou
painter.drawImage(QPoint(p1.x(), p1.y()), image.scaled(QSize(fabs(p2.x()-p1.x()), fabs(p2.y()-p1.y())), Qt::IgnoreAspectRatio, Qt::FastTransformation)); painter.drawImage(QPoint(p1.x(), p1.y()), image.scaled(QSize(fabs(p2.x()-p1.x()), fabs(p2.y()-p1.y())), Qt::IgnoreAspectRatio, Qt::FastTransformation));
//qDebug()<<"\nimage.size = "<<image.size() <<" SIMPLE!"; //qDebug()<<"\nimage.size = "<<image.size() <<" SIMPLE!";
} else { } else {
double pixwidth=fabs(p2.x()-p1.x())/(double)image.width(); double pixwidth=fabs(p2.x()-p1.x())/static_cast<double>(image.width());
double pixheight=fabs(p2.y()-p1.y())/(double)image.height(); double pixheight=fabs(p2.y()-p1.y())/static_cast<double>(image.height());
//qDebug()<<"\nimage.size = "<<image.size(); //qDebug()<<"\nimage.size = "<<image.size();
//qDebug()<<"size = "<<QSizeF(width, height); //qDebug()<<"size = "<<QSizeF(width, height);
//qDebug()<<"pixsize = "<<QSizeF(pixwidth, pixheight); //qDebug()<<"pixsize = "<<QSizeF(pixwidth, pixheight);
@ -322,7 +322,7 @@ void JKQTPImage::copyImagePlotAsImage()
JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTBasePlotter* parent): JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTBasePlotter* parent):
JKQTPImageBase(x, y, width, height, parent) JKQTPImageBase(x, y, width, height, parent)
{ {
this->data=data; this->data=data;
@ -335,7 +335,7 @@ JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double
} }
JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent): JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTPlotter* parent):
JKQTPImageBase(x, y, width, height, parent) JKQTPImageBase(x, y, width, height, parent)
{ {
this->data=data; this->data=data;
@ -399,14 +399,14 @@ JKQTPMathImageBase::JKQTPMathImageBase(double x, double y, double width, double
modifierMode=ModifyNone; modifierMode=ModifyNone;
} }
void JKQTPMathImageBase::set_data(void* data, uint32_t Nx, uint32_t Ny, DataType datatype) { void JKQTPMathImageBase::set_data(void* data, int Nx, int Ny, DataType datatype) {
this->data=data; this->data=data;
this->datatype=datatype; this->datatype=datatype;
this->Nx=Nx; this->Nx=Nx;
this->Ny=Ny; this->Ny=Ny;
} }
void JKQTPMathImageBase::set_data(void* data, uint32_t Nx, uint32_t Ny) { void JKQTPMathImageBase::set_data(void* data, int Nx, int Ny) {
this->data=data; this->data=data;
this->Nx=Nx; this->Nx=Nx;
this->Ny=Ny; this->Ny=Ny;
@ -425,44 +425,44 @@ void JKQTPMathImageBase::getDataMinMax(double& imin, double& imax) {
if (!data) return; if (!data) return;
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
imin= JKQTPImagePlot_getImageMin<double>((double*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<double>(static_cast<double*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<double>((double*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<double>(static_cast<double*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
imin= JKQTPImagePlot_getImageMin<float>((float*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<float>(static_cast<float*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<float>((float*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<float>(static_cast<float*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
imin= JKQTPImagePlot_getImageMin<uint8_t>((uint8_t*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint8_t>(static_cast<uint8_t*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint8_t>((uint8_t*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint8_t>(static_cast<uint8_t*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
imin= JKQTPImagePlot_getImageMin<uint16_t>((uint16_t*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint16_t>(static_cast<uint16_t*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint16_t>((uint16_t*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint16_t>(static_cast<uint16_t*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
imin= JKQTPImagePlot_getImageMin<uint32_t>((uint32_t*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint32_t>(static_cast<uint32_t*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint32_t>((uint32_t*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint32_t>(static_cast<uint32_t*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
imin= JKQTPImagePlot_getImageMin<uint64_t>((uint64_t*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint64_t>(static_cast<uint64_t*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint64_t>((uint64_t*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint64_t>(static_cast<uint64_t*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
imin= JKQTPImagePlot_getImageMin<int8_t>((int8_t*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int8_t>(static_cast<int8_t*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int8_t>((int8_t*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int8_t>(static_cast<int8_t*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
imin= JKQTPImagePlot_getImageMin<int16_t>((int16_t*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int16_t>(static_cast<int16_t*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int16_t>((int16_t*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int16_t>(static_cast<int16_t*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
imin= JKQTPImagePlot_getImageMin<int32_t>((int32_t*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int32_t>(static_cast<int32_t*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int32_t>((int32_t*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int32_t>(static_cast<int32_t*>(data), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
imin= JKQTPImagePlot_getImageMin<int64_t>((int64_t*)data, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int64_t>(static_cast<int64_t*>(data), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int64_t>((int64_t*)data, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int64_t>(static_cast<int64_t*>(data), Nx, Ny);
break; break;
} }
} }
@ -474,44 +474,44 @@ void JKQTPMathImageBase::getModifierMinMax(double &imin, double &imax)
if (!dataModifier) return; if (!dataModifier) return;
switch(datatypeModifier) { switch(datatypeModifier) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
imin= JKQTPImagePlot_getImageMin<double>((double*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<double>(static_cast<double*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<double>((double*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<double>(static_cast<double*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
imin= JKQTPImagePlot_getImageMin<float>((float*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<float>(static_cast<float*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<float>((float*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<float>(static_cast<float*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
imin= JKQTPImagePlot_getImageMin<uint8_t>((uint8_t*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint8_t>(static_cast<uint8_t*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint8_t>((uint8_t*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint8_t>(static_cast<uint8_t*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
imin= JKQTPImagePlot_getImageMin<uint16_t>((uint16_t*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint16_t>(static_cast<uint16_t*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint16_t>((uint16_t*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint16_t>(static_cast<uint16_t*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
imin= JKQTPImagePlot_getImageMin<uint32_t>((uint32_t*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint32_t>(static_cast<uint32_t*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint32_t>((uint32_t*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint32_t>(static_cast<uint32_t*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
imin= JKQTPImagePlot_getImageMin<uint64_t>((uint64_t*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint64_t>(static_cast<uint64_t*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint64_t>((uint64_t*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint64_t>(static_cast<uint64_t*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
imin= JKQTPImagePlot_getImageMin<int8_t>((int8_t*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int8_t>(static_cast<int8_t*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int8_t>((int8_t*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int8_t>(static_cast<int8_t*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
imin= JKQTPImagePlot_getImageMin<int16_t>((int16_t*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int16_t>(static_cast<int16_t*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int16_t>((int16_t*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int16_t>(static_cast<int16_t*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
imin= JKQTPImagePlot_getImageMin<int32_t>((int32_t*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int32_t>(static_cast<int32_t*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int32_t>((int32_t*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int32_t>(static_cast<int32_t*>(dataModifier), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
imin= JKQTPImagePlot_getImageMin<int64_t>((int64_t*)dataModifier, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int64_t>(static_cast<int64_t*>(dataModifier), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int64_t>((int64_t*)dataModifier, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int64_t>(static_cast<int64_t*>(dataModifier), Nx, Ny);
break; break;
} }
} }
@ -520,34 +520,34 @@ QVector<double> JKQTPMathImageBase::getDataAsDoubleVector() const
{ {
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
return JKQTPImagePlot_arrayToDVector((double*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<double*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
return JKQTPImagePlot_arrayToDVector((float*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<float*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
return JKQTPImagePlot_arrayToDVector((uint8_t*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint8_t*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
return JKQTPImagePlot_arrayToDVector((uint16_t*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint16_t*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
return JKQTPImagePlot_arrayToDVector((uint32_t*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint32_t*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
return JKQTPImagePlot_arrayToDVector((uint64_t*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint64_t*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
return JKQTPImagePlot_arrayToDVector((int8_t*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int8_t*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
return JKQTPImagePlot_arrayToDVector((int16_t*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int16_t*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
return JKQTPImagePlot_arrayToDVector((int32_t*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int32_t*>(data), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
return JKQTPImagePlot_arrayToDVector((int64_t*)data, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int64_t*>(data), Nx*Ny);
break; break;
} }
QVector<double> res; QVector<double> res;
@ -558,34 +558,34 @@ QVector<double> JKQTPMathImageBase::getDataModifierAsDoubleVector() const
{ {
switch(datatypeModifier) { switch(datatypeModifier) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
return JKQTPImagePlot_arrayToDVector((double*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<double*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
return JKQTPImagePlot_arrayToDVector((float*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<float*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
return JKQTPImagePlot_arrayToDVector((uint8_t*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint8_t*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
return JKQTPImagePlot_arrayToDVector((uint16_t*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint16_t*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
return JKQTPImagePlot_arrayToDVector((uint32_t*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint32_t*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
return JKQTPImagePlot_arrayToDVector((uint64_t*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint64_t*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
return JKQTPImagePlot_arrayToDVector((int8_t*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int8_t*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
return JKQTPImagePlot_arrayToDVector((int16_t*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int16_t*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
return JKQTPImagePlot_arrayToDVector((int32_t*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int32_t*>(dataModifier), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
return JKQTPImagePlot_arrayToDVector((int64_t*)dataModifier, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int64_t*>(dataModifier), Nx*Ny);
break; break;
} }
QVector<double> res; QVector<double> res;
@ -602,7 +602,7 @@ void JKQTPMathImageBase::modifyImage(QImage &img)
modifyImage(img, dataModifier, datatypeModifier, Nx, Ny, internalModifierMin, internalModifierMax); modifyImage(img, dataModifier, datatypeModifier, Nx, Ny, internalModifierMin, internalModifierMax);
} }
void JKQTPMathImageBase::modifyImage(QImage &img, void *dataModifier, JKQTPMathImageBase::DataType datatypeModifier, uint32_t Nx, uint32_t Ny, double internalModifierMin, double internalModifierMax) void JKQTPMathImageBase::modifyImage(QImage &img, void *dataModifier, JKQTPMathImageBase::DataType datatypeModifier, int Nx, int Ny, double internalModifierMin, double internalModifierMax)
{ {
if (!dataModifier) return; if (!dataModifier) return;
getModifierMinMax(internalModifierMin, internalModifierMax); getModifierMinMax(internalModifierMin, internalModifierMax);
@ -621,16 +621,16 @@ void JKQTPMathImageBase::modifyImage(QImage &img, void *dataModifier, JKQTPMathI
} }
//qDebug()<<"mod: "<<modifierMode<<" ch:"<<modChannel<<" rgb:"<<rgbModMode; //qDebug()<<"mod: "<<modifierMode<<" ch:"<<modChannel<<" rgb:"<<rgbModMode;
switch(datatypeModifier) { switch(datatypeModifier) {
case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2RGBimage<double>((double*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2RGBimage<double>(static_cast<double*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2RGBimage<float>((float*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2RGBimage<float>(static_cast<float*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2RGBimage<uint8_t>((uint8_t*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2RGBimage<uint8_t>(static_cast<uint8_t*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2RGBimage<uint16_t>((uint16_t*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2RGBimage<uint16_t>(static_cast<uint16_t*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2RGBimage<uint32_t>((uint32_t*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2RGBimage<uint32_t>(static_cast<uint32_t*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2RGBimage<uint64_t>((uint64_t*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2RGBimage<uint64_t>(static_cast<uint64_t*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2RGBimage<int8_t>((int8_t*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2RGBimage<int8_t>(static_cast<int8_t*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2RGBimage<int16_t>((int16_t*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2RGBimage<int16_t>(static_cast<int16_t*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2RGBimage<int32_t>((int32_t*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2RGBimage<int32_t>(static_cast<int32_t*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2RGBimage<int64_t>((int64_t*)dataModifier, Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break; case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2RGBimage<int64_t>(static_cast<int64_t*>(dataModifier), Nx, Ny, img, modChannel, internalModifierMin, internalModifierMax, rgbModMode); break;
} }
} }
} }
@ -716,7 +716,7 @@ void JKQTPMathImage::initJKQTPMathImage() {
this->autoModifierRange=true; this->autoModifierRange=true;
} }
JKQTPMathImage::JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQTBasePlotter* parent): JKQTPMathImage::JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette, JKQTBasePlotter* parent):
JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent) JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent)
{ {
initJKQTPMathImage(); initJKQTPMathImage();
@ -731,7 +731,7 @@ JKQTPMathImage::JKQTPMathImage(JKQTBasePlotter *parent):
JKQTPMathImage::JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQTPlotter* parent): JKQTPMathImage::JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette, JKQTPlotter* parent):
JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent) JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent)
{ {
initJKQTPMathImage(); initJKQTPMathImage();
@ -1102,16 +1102,16 @@ double JKQTPMathImage::getValueAt(double x, double y)
int yy=trunc((y-this->y)/height*double(Ny)); int yy=trunc((y-this->y)/height*double(Ny));
if (xx>=0 && xx<(int64_t)Nx && yy>=0 && yy<(int64_t)Ny) { if (xx>=0 && xx<(int64_t)Nx && yy>=0 && yy<(int64_t)Ny) {
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: return ((double*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::DoubleArray: return (static_cast<double*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::FloatArray: return ((float*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::FloatArray: return (static_cast<float*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::UInt8Array: return ((uint8_t*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::UInt8Array: return (static_cast<uint8_t*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::UInt16Array: return ((uint16_t*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::UInt16Array: return (static_cast<uint16_t*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::UInt32Array: return ((uint32_t*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::UInt32Array: return (static_cast<uint32_t*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::UInt64Array: return ((uint64_t*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::UInt64Array: return (static_cast<uint64_t*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::Int8Array: return ((int8_t*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::Int8Array: return (static_cast<int8_t*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::Int16Array: return ((int16_t*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::Int16Array: return (static_cast<int16_t*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::Int32Array: return ((int32_t*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::Int32Array: return (static_cast<int32_t*>(data))[yy*Nx+xx]; break;
case JKQTPMathImageBase::Int64Array: return ((int64_t*)data)[yy*Nx+xx]; break; case JKQTPMathImageBase::Int64Array: return (static_cast<int64_t*>(data))[yy*Nx+xx]; break;
} } } }
return 0.0; return 0.0;
} }
@ -1220,16 +1220,16 @@ QImage JKQTPMathImage::drawImage() {
QImage img(Nx, Ny, QImage::Format_ARGB32); QImage img(Nx, Ny, QImage::Format_ARGB32);
getDataMinMax(internalDataMin, internalDataMax); getDataMinMax(internalDataMin, internalDataMax);
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2image<double>((double*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2image<double>(static_cast<double*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2image<float>((float*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2image<float>(static_cast<float*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2image<uint8_t>((uint8_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2image<uint8_t>(static_cast<uint8_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2image<uint16_t>((uint16_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2image<uint16_t>(static_cast<uint16_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2image<uint32_t>((uint32_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2image<uint32_t>(static_cast<uint32_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2image<uint64_t>((uint64_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2image<uint64_t>(static_cast<uint64_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2image<int8_t>((int8_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2image<int8_t>(static_cast<int8_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2image<int16_t>((int16_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2image<int16_t>(static_cast<int16_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2image<int32_t>((int32_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2image<int32_t>(static_cast<int32_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2image<int64_t>((int64_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break; case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2image<int64_t>(static_cast<int64_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rangeMinFailAction, rangeMaxFailAction, rangeMinFailColor, rangeMaxFailColor, nanColor, infColor); break;
} }
modifyImage(img); modifyImage(img);
return img; return img;
@ -1261,7 +1261,7 @@ void JKQTPMathImage::set_palette(int pal) {
JKQTPOverlayImage::JKQTPOverlayImage(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQTBasePlotter* parent): JKQTPOverlayImage::JKQTPOverlayImage(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTBasePlotter* parent):
JKQTPImageBase(x, y, width, height, parent) JKQTPImageBase(x, y, width, height, parent)
{ {
actSaveImage=new QAction(tr("Save JKQTPOverlayImage ..."), this); actSaveImage=new QAction(tr("Save JKQTPOverlayImage ..."), this);
@ -1288,7 +1288,7 @@ JKQTPOverlayImage::JKQTPOverlayImage(JKQTBasePlotter *parent):
this->trueColor=QColor("red"); this->trueColor=QColor("red");
} }
JKQTPOverlayImage::JKQTPOverlayImage(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQTPlotter* parent): JKQTPOverlayImage::JKQTPOverlayImage(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTPlotter* parent):
JKQTPImageBase(x, y, width, height, parent) JKQTPImageBase(x, y, width, height, parent)
{ {
actSaveImage=new QAction(tr("Save JKQTPOverlayImage ..."), this); actSaveImage=new QAction(tr("Save JKQTPOverlayImage ..."), this);
@ -1330,9 +1330,9 @@ QImage JKQTPOverlayImage::drawImage() {
QRgb tc=qRgba(round(trueColor.red()*trueColor.alphaF()), round(trueColor.green()*trueColor.alphaF()), round(trueColor.blue()*trueColor.alphaF()), trueColor.alpha()); QRgb tc=qRgba(round(trueColor.red()*trueColor.alphaF()), round(trueColor.green()*trueColor.alphaF()), round(trueColor.blue()*trueColor.alphaF()), trueColor.alpha());
QRgb fc=qRgba(round(falseColor.red()*falseColor.alphaF()), round(falseColor.green()*falseColor.alphaF()), round(falseColor.blue()*falseColor.alphaF()), falseColor.alpha()); QRgb fc=qRgba(round(falseColor.red()*falseColor.alphaF()), round(falseColor.green()*falseColor.alphaF()), round(falseColor.blue()*falseColor.alphaF()), falseColor.alpha());
for (uint32_t y=0; y<Ny; y++) { for (int32_t y=0; y<Ny; y++) {
QRgb* line=(QRgb*)img.scanLine(Ny-1-y); QRgb* line=(QRgb*)img.scanLine(Ny-1-y);
for (uint32_t x=0; x<Nx; x++) { for (int32_t x=0; x<Nx; x++) {
if (data[x+y*Nx]) { if (data[x+y*Nx]) {
line[x]=tc; line[x]=tc;
} else { } else {
@ -1365,14 +1365,14 @@ QColor JKQTPOverlayImage::getKeyLabelColor() {
return c; return c;
} }
void JKQTPOverlayImage::set_data(bool* data, uint32_t Nx, uint32_t Ny) { void JKQTPOverlayImage::set_data(bool* data, int Nx, int Ny) {
this->data=data; this->data=data;
this->Nx=Nx; this->Nx=Nx;
this->Ny=Ny; this->Ny=Ny;
} }
JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQTBasePlotter* parent): JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTBasePlotter* parent):
JKQTPOverlayImage(x, y, width, height, data, Nx, Ny, colTrue, parent) JKQTPOverlayImage(x, y, width, height, data, Nx, Ny, colTrue, parent)
{ {
symbol=JKQTPTarget; symbol=JKQTPTarget;
@ -1392,7 +1392,7 @@ JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(JKQTBasePlotter *parent):
rectanglesAsImageOverlay=false; rectanglesAsImageOverlay=false;
} }
JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQTPlotter* parent): JKQTPOverlayImageEnhanced::JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTPlotter* parent):
JKQTPOverlayImage(x, y, width, height, data, Nx, Ny, colTrue, parent) JKQTPOverlayImage(x, y, width, height, data, Nx, Ny, colTrue, parent)
{ {
symbol=JKQTPTarget; symbol=JKQTPTarget;
@ -1429,7 +1429,7 @@ void JKQTPOverlayImageEnhanced::draw(JKQTPEnhancedPainter& painter) {
double dy=height/(double)Ny; double dy=height/(double)Ny;
for (int ix=0; ix<(int64_t)Nx; ix++) { for (int ix=0; ix<(int64_t)Nx; ix++) {
for (int iy=0; iy<(int64_t)Ny; iy++) { for (int iy=0; iy<(int64_t)Ny; iy++) {
QPointF p1=transform(x+(double)ix*dx, y+(double)iy*dy); QPointF p1=transform(x+static_cast<double>(ix)*dx, y+static_cast<double>(iy)*dy);
QPointF p2=transform(x+(double)(ix+1)*dx, y+(double)(iy+1)*dx); QPointF p2=transform(x+(double)(ix+1)*dx, y+(double)(iy+1)*dx);
if (drawAsRectangles) { if (drawAsRectangles) {
if (data[ix+iy*Nx]) { if (data[ix+iy*Nx]) {
@ -1569,14 +1569,14 @@ void JKQTPRGBMathImage::initObject()
JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTBasePlotter *parent): JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTBasePlotter *parent):
JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent) JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent)
{ {
initObject(); initObject();
} }
JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPlotter *parent): JKQTPRGBMathImage::JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTPlotter *parent):
JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent) JKQTPMathImageBase(x, y, width, height, datatype, data, Nx, Ny, parent)
{ {
initObject(); initObject();
@ -1978,44 +1978,44 @@ void JKQTPRGBMathImage::getDataMinMaxG(double& imin, double& imax) {
if (!dataG) return; if (!dataG) return;
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
imin= JKQTPImagePlot_getImageMin<double>((double*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<double>(static_cast<double*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<double>((double*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<double>(static_cast<double*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
imin= JKQTPImagePlot_getImageMin<float>((float*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<float>(static_cast<float*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<float>((float*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<float>(static_cast<float*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
imin= JKQTPImagePlot_getImageMin<uint8_t>((uint8_t*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint8_t>(static_cast<uint8_t*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint8_t>((uint8_t*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint8_t>(static_cast<uint8_t*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
imin= JKQTPImagePlot_getImageMin<uint16_t>((uint16_t*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint16_t>(static_cast<uint16_t*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint16_t>((uint16_t*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint16_t>(static_cast<uint16_t*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
imin= JKQTPImagePlot_getImageMin<uint32_t>((uint32_t*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint32_t>(static_cast<uint32_t*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint32_t>((uint32_t*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint32_t>(static_cast<uint32_t*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
imin= JKQTPImagePlot_getImageMin<uint64_t>((uint64_t*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint64_t>(static_cast<uint64_t*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint64_t>((uint64_t*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint64_t>(static_cast<uint64_t*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
imin= JKQTPImagePlot_getImageMin<int8_t>((int8_t*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int8_t>(static_cast<int8_t*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int8_t>((int8_t*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int8_t>(static_cast<int8_t*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
imin= JKQTPImagePlot_getImageMin<int16_t>((int16_t*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int16_t>(static_cast<int16_t*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int16_t>((int16_t*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int16_t>(static_cast<int16_t*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
imin= JKQTPImagePlot_getImageMin<int32_t>((int32_t*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int32_t>(static_cast<int32_t*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int32_t>((int32_t*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int32_t>(static_cast<int32_t*>(dataG), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
imin= JKQTPImagePlot_getImageMin<int64_t>((int64_t*)dataG, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int64_t>(static_cast<int64_t*>(dataG), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int64_t>((int64_t*)dataG, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int64_t>(static_cast<int64_t*>(dataG), Nx, Ny);
break; break;
} }
} else { } else {
@ -2031,44 +2031,44 @@ void JKQTPRGBMathImage::getDataMinMaxB(double& imin, double& imax) {
if (!dataG) return; if (!dataG) return;
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
imin= JKQTPImagePlot_getImageMin<double>((double*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<double>(static_cast<double*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<double>((double*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<double>(static_cast<double*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
imin= JKQTPImagePlot_getImageMin<float>((float*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<float>(static_cast<float*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<float>((float*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<float>(static_cast<float*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
imin= JKQTPImagePlot_getImageMin<uint8_t>((uint8_t*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint8_t>(static_cast<uint8_t*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint8_t>((uint8_t*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint8_t>(static_cast<uint8_t*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
imin= JKQTPImagePlot_getImageMin<uint16_t>((uint16_t*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint16_t>(static_cast<uint16_t*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint16_t>((uint16_t*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint16_t>(static_cast<uint16_t*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
imin= JKQTPImagePlot_getImageMin<uint32_t>((uint32_t*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint32_t>(static_cast<uint32_t*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint32_t>((uint32_t*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint32_t>(static_cast<uint32_t*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
imin= JKQTPImagePlot_getImageMin<uint64_t>((uint64_t*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<uint64_t>(static_cast<uint64_t*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<uint64_t>((uint64_t*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<uint64_t>(static_cast<uint64_t*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
imin= JKQTPImagePlot_getImageMin<int8_t>((int8_t*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int8_t>(static_cast<int8_t*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int8_t>((int8_t*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int8_t>(static_cast<int8_t*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
imin= JKQTPImagePlot_getImageMin<int16_t>((int16_t*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int16_t>(static_cast<int16_t*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int16_t>((int16_t*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int16_t>(static_cast<int16_t*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
imin= JKQTPImagePlot_getImageMin<int32_t>((int32_t*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int32_t>(static_cast<int32_t*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int32_t>((int32_t*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int32_t>(static_cast<int32_t*>(dataB), Nx, Ny);
break; break;
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
imin= JKQTPImagePlot_getImageMin<int64_t>((int64_t*)dataB, Nx, Ny); imin= JKQTPImagePlot_getImageMin<int64_t>(static_cast<int64_t*>(dataB), Nx, Ny);
imax= JKQTPImagePlot_getImageMax<int64_t>((int64_t*)dataB, Nx, Ny); imax= JKQTPImagePlot_getImageMax<int64_t>(static_cast<int64_t*>(dataB), Nx, Ny);
break; break;
} }
} else { } else {
@ -2084,20 +2084,20 @@ double JKQTPRGBMathImage::getValueAt(double x, double y, int channel)
if (channel==0) dd=data; if (channel==0) dd=data;
if (channel==1) dd=dataG; if (channel==1) dd=dataG;
if (channel==2) dd=dataB; if (channel==2) dd=dataB;
int xx=trunc((x-this->x)/width*double(Nx)); int xx=static_cast<int>(trunc((x-this->x)/width*Nx));
int yy=trunc((y-this->y)/height*double(Ny)); int yy=static_cast<int>(trunc((y-this->y)/height*Ny));
if (xx>=0 && xx<(int64_t)Nx && yy>=0 && yy<(int64_t)Ny) { if (xx>=0 && xx<Nx && yy>=0 && yy<Ny) {
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: return ((double*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::DoubleArray: return static_cast<double>((static_cast<double*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::FloatArray: return ((float*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::FloatArray: return static_cast<double>((static_cast<float*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::UInt8Array: return ((uint8_t*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::UInt8Array: return static_cast<double>((static_cast<uint8_t*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::UInt16Array: return ((uint16_t*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::UInt16Array: return static_cast<double>((static_cast<uint16_t*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::UInt32Array: return ((uint32_t*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::UInt32Array: return static_cast<double>((static_cast<uint32_t*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::UInt64Array: return ((uint64_t*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::UInt64Array: return static_cast<double>((static_cast<uint64_t*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::Int8Array: return ((int8_t*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::Int8Array: return static_cast<double>((static_cast<int8_t*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::Int16Array: return ((int16_t*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::Int16Array: return static_cast<double>((static_cast<int16_t*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::Int32Array: return ((int32_t*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::Int32Array: return static_cast<double>((static_cast<int32_t*>(dd))[yy*Nx+xx]); break;
case JKQTPMathImageBase::Int64Array: return ((int64_t*)dd)[yy*Nx+xx]; break; case JKQTPMathImageBase::Int64Array: return static_cast<double>((static_cast<int64_t*>(dd))[yy*Nx+xx]); break;
} } } }
return 0.0; return 0.0;
} }
@ -2190,46 +2190,46 @@ QImage JKQTPRGBMathImage::drawImage() {
int palette = 0; int palette = 0;
if (data) { if (data) {
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2RGBimage<double>((double*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2RGBimage<double>(static_cast<double*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2RGBimage<float>((float*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2RGBimage<float>(static_cast<float*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2RGBimage<uint8_t>((uint8_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2RGBimage<uint8_t>(static_cast<uint8_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2RGBimage<uint16_t>((uint16_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2RGBimage<uint16_t>(static_cast<uint16_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2RGBimage<uint32_t>((uint32_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2RGBimage<uint32_t>(static_cast<uint32_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2RGBimage<uint64_t>((uint64_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2RGBimage<uint64_t>(static_cast<uint64_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2RGBimage<int8_t>((int8_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2RGBimage<int8_t>(static_cast<int8_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2RGBimage<int16_t>((int16_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2RGBimage<int16_t>(static_cast<int16_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2RGBimage<int32_t>((int32_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2RGBimage<int32_t>(static_cast<int32_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2RGBimage<int64_t>((int64_t*)data, Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break; case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2RGBimage<int64_t>(static_cast<int64_t*>(data), Nx, Ny, img, palette, internalDataMin, internalDataMax, rgbMode); break;
} }
} }
palette = 1; palette = 1;
if (dataG) { if (dataG) {
switch(datatypeG) { switch(datatypeG) {
case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2RGBimage<double>((double*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2RGBimage<double>(static_cast<double*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2RGBimage<float>((float*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2RGBimage<float>(static_cast<float*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2RGBimage<uint8_t>((uint8_t*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2RGBimage<uint8_t>(static_cast<uint8_t*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2RGBimage<uint16_t>((uint16_t*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2RGBimage<uint16_t>(static_cast<uint16_t*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2RGBimage<uint32_t>((uint32_t*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2RGBimage<uint32_t>(static_cast<uint32_t*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2RGBimage<uint64_t>((uint64_t*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2RGBimage<uint64_t>(static_cast<uint64_t*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2RGBimage<int8_t>((int8_t*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2RGBimage<int8_t>(static_cast<int8_t*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2RGBimage<int16_t>((int16_t*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2RGBimage<int16_t>(static_cast<int16_t*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2RGBimage<int32_t>((int32_t*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2RGBimage<int32_t>(static_cast<int32_t*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2RGBimage<int64_t>((int64_t*)dataG, Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break; case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2RGBimage<int64_t>(static_cast<int64_t*>(dataG), Nx, Ny, img, palette, internalDataMinG, internalDataMaxG, rgbMode); break;
} }
} }
palette = 2; palette = 2;
if (dataB) { if (dataB) {
switch(datatypeB) { switch(datatypeB) {
case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2RGBimage<double>((double*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::DoubleArray: JKQTPImagePlot_array2RGBimage<double>(static_cast<double*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2RGBimage<float>((float*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::FloatArray: JKQTPImagePlot_array2RGBimage<float>(static_cast<float*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2RGBimage<uint8_t>((uint8_t*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::UInt8Array: JKQTPImagePlot_array2RGBimage<uint8_t>(static_cast<uint8_t*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2RGBimage<uint16_t>((uint16_t*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::UInt16Array: JKQTPImagePlot_array2RGBimage<uint16_t>(static_cast<uint16_t*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2RGBimage<uint32_t>((uint32_t*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::UInt32Array: JKQTPImagePlot_array2RGBimage<uint32_t>(static_cast<uint32_t*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2RGBimage<uint64_t>((uint64_t*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::UInt64Array: JKQTPImagePlot_array2RGBimage<uint64_t>(static_cast<uint64_t*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2RGBimage<int8_t>((int8_t*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::Int8Array: JKQTPImagePlot_array2RGBimage<int8_t>(static_cast<int8_t*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2RGBimage<int16_t>((int16_t*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::Int16Array: JKQTPImagePlot_array2RGBimage<int16_t>(static_cast<int16_t*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2RGBimage<int32_t>((int32_t*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::Int32Array: JKQTPImagePlot_array2RGBimage<int32_t>(static_cast<int32_t*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2RGBimage<int64_t>((int64_t*)dataB, Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break; case JKQTPMathImageBase::Int64Array: JKQTPImagePlot_array2RGBimage<int64_t>(static_cast<int64_t*>(dataB), Nx, Ny, img, palette, internalDataMinB, internalDataMaxB, rgbMode); break;
} }
} }
@ -2238,7 +2238,7 @@ QImage JKQTPRGBMathImage::drawImage() {
return img; return img;
} }
void JKQTPRGBMathImage::set_data(void* data, uint32_t Nx, uint32_t Ny, DataType datatype) { void JKQTPRGBMathImage::set_data(void* data, int Nx, int Ny, DataType datatype) {
this->data=data; this->data=data;
this->datatype=datatype; this->datatype=datatype;
this->dataG=nullptr; this->dataG=nullptr;
@ -2247,7 +2247,7 @@ void JKQTPRGBMathImage::set_data(void* data, uint32_t Nx, uint32_t Ny, DataType
this->Ny=Ny; this->Ny=Ny;
} }
void JKQTPRGBMathImage::set_data(void* data, uint32_t Nx, uint32_t Ny) { void JKQTPRGBMathImage::set_data(void* data, int Nx, int Ny) {
this->data=data; this->data=data;
this->Nx=Nx; this->Nx=Nx;
this->Ny=Ny; this->Ny=Ny;
@ -2256,7 +2256,7 @@ void JKQTPRGBMathImage::set_data(void* data, uint32_t Nx, uint32_t Ny) {
} }
void JKQTPRGBMathImage::set_data(void *data, void *dataG, void *dataB, uint32_t Nx, uint32_t Ny, JKQTPMathImageBase::DataType datatype) { void JKQTPRGBMathImage::set_data(void *data, void *dataG, void *dataB, int Nx, int Ny, JKQTPMathImageBase::DataType datatype) {
this->data=data; this->data=data;
this->datatype=datatype; this->datatype=datatype;
this->datatypeG=datatype; this->datatypeG=datatype;
@ -2267,7 +2267,7 @@ void JKQTPRGBMathImage::set_data(void *data, void *dataG, void *dataB, uint32_t
this->Ny=Ny; this->Ny=Ny;
} }
void JKQTPRGBMathImage::set_data(void *data, void *dataG, void *dataB, uint32_t Nx, uint32_t Ny) { void JKQTPRGBMathImage::set_data(void *data, void *dataG, void *dataB, int Nx, int Ny) {
this->data=data; this->data=data;
this->dataG=dataG; this->dataG=dataG;
this->dataB=dataB; this->dataB=dataB;
@ -2285,7 +2285,7 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(JKQTBasePlotter *parent):
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQTBasePlotter *parent): JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int Nx, int Ny, JKQTBasePlotter *parent):
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent) JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2293,7 +2293,7 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, dou
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQTBasePlotter *parent): JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, int Nx, int Ny, JKQTPMathImageColorPalette palette, JKQTBasePlotter *parent):
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,palette,parent) JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,palette,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2309,7 +2309,7 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(JKQTPlotter *parent):
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQTPlotter *parent): JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int Nx, int Ny, JKQTPlotter *parent):
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent) JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2317,14 +2317,14 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, dou
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQTPlotter *parent): JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, int Nx, int Ny, JKQTPMathImageColorPalette palette, JKQTPlotter *parent):
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,palette,parent) JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,palette,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
this->imageColumn=imageColumn; this->imageColumn=imageColumn;
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPlotter *parent): JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, int Nx, int Ny, JKQTPlotter *parent):
JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent) JKQTPMathImage(x,y,width,height,JKQTPMathImageBase::DoubleArray,nullptr,Nx,Ny,JKQTPMathImageGRAY,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2396,7 +2396,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(JKQTBasePlotter *parent):
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQTBasePlotter *parent): JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int Nx, int Ny, JKQTBasePlotter *parent):
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent) JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2406,7 +2406,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, uint32_t Nx, uint32_t Ny, JKQTBasePlotter *parent): JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int Nx, int Ny, JKQTBasePlotter *parent):
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent) JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2416,7 +2416,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, uint32_t Nx, uint32_t Ny, JKQTBasePlotter *parent): JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int Nx, int Ny, JKQTBasePlotter *parent):
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent) JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2426,7 +2426,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, uint32_t Nx, uint32_t Ny, JKQTBasePlotter *parent): JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, int Nx, int Ny, JKQTBasePlotter *parent):
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent) JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2446,7 +2446,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(JKQTPlotter *parent):
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQTPlotter *parent): JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int Nx, int Ny, JKQTPlotter *parent):
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent) JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2456,7 +2456,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, uint32_t Nx, uint32_t Ny, JKQTPlotter *parent): JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int Nx, int Ny, JKQTPlotter *parent):
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent) JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2466,7 +2466,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, uint32_t Nx, uint32_t Ny, JKQTPlotter *parent): JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int Nx, int Ny, JKQTPlotter *parent):
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent) JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2476,7 +2476,7 @@ JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double widt
this->datatype=JKQTPMathImageBase::DoubleArray; this->datatype=JKQTPMathImageBase::DoubleArray;
} }
JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, uint32_t Nx, uint32_t Ny, JKQTPlotter *parent): JKQTPColumnRGBMathImage::JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, int Nx, int Ny, JKQTPlotter *parent):
JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent) JKQTPRGBMathImage(x,y,width,height,DoubleArray,nullptr,Nx,Ny,parent)
{ {
this->modifierColumn=-1; this->modifierColumn=-1;
@ -2509,34 +2509,34 @@ QVector<double> JKQTPRGBMathImage::getDataGAsDoubleVector() const
{ {
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
return JKQTPImagePlot_arrayToDVector((double*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<double*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
return JKQTPImagePlot_arrayToDVector((float*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<float*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
return JKQTPImagePlot_arrayToDVector((uint8_t*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint8_t*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
return JKQTPImagePlot_arrayToDVector((uint16_t*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint16_t*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
return JKQTPImagePlot_arrayToDVector((uint32_t*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint32_t*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
return JKQTPImagePlot_arrayToDVector((uint64_t*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint64_t*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
return JKQTPImagePlot_arrayToDVector((int8_t*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int8_t*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
return JKQTPImagePlot_arrayToDVector((int16_t*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int16_t*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
return JKQTPImagePlot_arrayToDVector((int32_t*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int32_t*>(dataG), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
return JKQTPImagePlot_arrayToDVector((int64_t*)dataG, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int64_t*>(dataG), Nx*Ny);
break; break;
} }
QVector<double> res; QVector<double> res;
@ -2547,34 +2547,34 @@ QVector<double> JKQTPRGBMathImage::getDataBAsDoubleVector() const
{ {
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
return JKQTPImagePlot_arrayToDVector((double*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<double*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
return JKQTPImagePlot_arrayToDVector((float*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<float*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
return JKQTPImagePlot_arrayToDVector((uint8_t*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint8_t*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
return JKQTPImagePlot_arrayToDVector((uint16_t*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint16_t*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
return JKQTPImagePlot_arrayToDVector((uint32_t*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint32_t*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
return JKQTPImagePlot_arrayToDVector((uint64_t*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<uint64_t*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
return JKQTPImagePlot_arrayToDVector((int8_t*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int8_t*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
return JKQTPImagePlot_arrayToDVector((int16_t*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int16_t*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
return JKQTPImagePlot_arrayToDVector((int32_t*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int32_t*>(dataB), Nx*Ny);
break; break;
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
return JKQTPImagePlot_arrayToDVector((int64_t*)dataB, Nx*Ny); return JKQTPImagePlot_arrayToDVector(static_cast<int64_t*>(dataB), Nx*Ny);
break; break;
} }
QVector<double> res; QVector<double> res;
@ -2783,25 +2783,25 @@ double JKQTPContour::value(int xIdx, int yIdx)
if (!data) return 0; if (!data) return 0;
switch(datatype) { switch(datatype) {
case JKQTPMathImageBase::DoubleArray: case JKQTPMathImageBase::DoubleArray:
return ((double*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<double*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::FloatArray: case JKQTPMathImageBase::FloatArray:
return ((float*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<float*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::UInt8Array: case JKQTPMathImageBase::UInt8Array:
return ((uint8_t*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<uint8_t*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::UInt16Array: case JKQTPMathImageBase::UInt16Array:
return ((uint16_t*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<uint16_t*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::UInt32Array: case JKQTPMathImageBase::UInt32Array:
return ((uint32_t*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<uint32_t*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::UInt64Array: case JKQTPMathImageBase::UInt64Array:
return ((uint64_t*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<uint64_t*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::Int8Array: case JKQTPMathImageBase::Int8Array:
return ((int8_t*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<int8_t*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::Int16Array: case JKQTPMathImageBase::Int16Array:
return ((int16_t*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<int16_t*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::Int32Array: case JKQTPMathImageBase::Int32Array:
return ((int32_t*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<int32_t*>(data))[yIdx*get_Nx()+xIdx];
case JKQTPMathImageBase::Int64Array: case JKQTPMathImageBase::Int64Array:
return ((int64_t*)data)[yIdx*get_Nx()+xIdx]; return (static_cast<int64_t*>(data))[yIdx*get_Nx()+xIdx];
default: default:
return 0; return 0;
} }
@ -2925,7 +2925,7 @@ JKQTPContour::JKQTPContour(JKQTBasePlotter *parent) :
} }
} }
JKQTPContour::JKQTPContour(double x, double y, double width, double height, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, DataType datatype, JKQTBasePlotter* parent) : JKQTPContour::JKQTPContour(double x, double y, double width, double height, void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette, DataType datatype, JKQTBasePlotter* parent) :
JKQTPMathImage( x, y, width, height, datatype, data, Nx, Ny, palette, parent) JKQTPMathImage( x, y, width, height, datatype, data, Nx, Ny, palette, parent)
{ {
lineColor=QColor("red"); lineColor=QColor("red");
@ -2957,7 +2957,7 @@ JKQTPContour::JKQTPContour(JKQTPlotter *parent) :
} }
} }
JKQTPContour::JKQTPContour(double x, double y, double width, double height, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, DataType datatype, JKQTPlotter* parent) : JKQTPContour::JKQTPContour(double x, double y, double width, double height, void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette, DataType datatype, JKQTPlotter* parent) :
JKQTPMathImage( x, y, width, height, datatype, data, Nx, Ny, palette, parent) JKQTPMathImage( x, y, width, height, datatype, data, Nx, Ny, palette, parent)
{ {
lineColor=QColor("red"); lineColor=QColor("red");

View File

@ -199,13 +199,13 @@ class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
/** \brief class constructor */ /** \brief class constructor */
JKQTPMathImageBase(JKQTBasePlotter* parent=nullptr); JKQTPMathImageBase(JKQTBasePlotter* parent=nullptr);
JKQTPMathImageBase(double x, double y, double width, double height, JKQTBasePlotter* parent=nullptr); JKQTPMathImageBase(double x, double y, double width, double height, JKQTBasePlotter* parent=nullptr);
JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTBasePlotter* parent=nullptr); JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTBasePlotter* parent=nullptr);
/** \brief class constructor */ /** \brief class constructor */
JKQTPMathImageBase(JKQTPlotter* parent); JKQTPMathImageBase(JKQTPlotter* parent);
JKQTPMathImageBase(double x, double y, double width, double height, JKQTPlotter* parent=nullptr); JKQTPMathImageBase(double x, double y, double width, double height, JKQTPlotter* parent=nullptr);
JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent); JKQTPMathImageBase(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTPlotter* parent);
/** \brief plots a key marker inside the specified rectangle \a rect */ /** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect) override; virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect) override;
@ -213,28 +213,28 @@ class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
/*! \brief sets the property Nx to the specified \a __value. /*! \brief sets the property Nx to the specified \a __value.
\details Description of the parameter Nx is: <BLOCKQUOTE>\copydoc Nx </BLOCKQUOTE> \details Description of the parameter Nx is: <BLOCKQUOTE>\copydoc Nx </BLOCKQUOTE>
\see Nx for more information */ \see Nx for more information */
inline virtual void set_Nx(uint32_t __value) inline virtual void set_Nx(int __value)
{ {
this->Nx = __value; this->Nx = __value;
} }
/*! \brief returns the property Nx. /*! \brief returns the property Nx.
\details Description of the parameter Nx is: <BLOCKQUOTE>\copydoc Nx </BLOCKQUOTE> \details Description of the parameter Nx is: <BLOCKQUOTE>\copydoc Nx </BLOCKQUOTE>
\see Nx for more information */ \see Nx for more information */
inline virtual uint32_t get_Nx() const inline virtual int get_Nx() const
{ {
return this->Nx; return this->Nx;
} }
/*! \brief sets the property Ny to the specified \a __value. /*! \brief sets the property Ny to the specified \a __value.
\details Description of the parameter Ny is: <BLOCKQUOTE>\copydoc Ny </BLOCKQUOTE> \details Description of the parameter Ny is: <BLOCKQUOTE>\copydoc Ny </BLOCKQUOTE>
\see Ny for more information */ \see Ny for more information */
inline virtual void set_Ny(uint32_t __value) inline virtual void set_Ny(int __value)
{ {
this->Ny = __value; this->Ny = __value;
} }
/*! \brief returns the property Ny. /*! \brief returns the property Ny.
\details Description of the parameter Ny is: <BLOCKQUOTE>\copydoc Ny </BLOCKQUOTE> \details Description of the parameter Ny is: <BLOCKQUOTE>\copydoc Ny </BLOCKQUOTE>
\see Ny for more information */ \see Ny for more information */
inline virtual uint32_t get_Ny() const inline virtual int get_Ny() const
{ {
return this->Ny; return this->Ny;
} }
@ -310,8 +310,8 @@ class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
} }
virtual void set_dataModifier(void* data, DataType datatype); virtual void set_dataModifier(void* data, DataType datatype);
virtual void set_data(void* data, uint32_t Nx, uint32_t Ny, DataType datatype); virtual void set_data(void* data, int Nx, int Ny, DataType datatype);
virtual void set_data(void* data, uint32_t Nx, uint32_t Ny); virtual void set_data(void* data, int Nx, int Ny);
/** \brief determine min/max data value of the image */ /** \brief determine min/max data value of the image */
virtual void getDataMinMax(double& imin, double& imax); virtual void getDataMinMax(double& imin, double& imax);
/** \brief determine min/max data value of the image */ /** \brief determine min/max data value of the image */
@ -325,9 +325,9 @@ class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
/** \brief datatype of the data array data */ /** \brief datatype of the data array data */
DataType datatype; DataType datatype;
/** \brief width of the data array data in pt */ /** \brief width of the data array data in pt */
uint32_t Nx; int Nx;
/** \brief height of the data array data in pt */ /** \brief height of the data array data in pt */
uint32_t Ny; int Ny;
/** \brief points to the data array, holding the modifier image */ /** \brief points to the data array, holding the modifier image */
void* dataModifier; void* dataModifier;
@ -344,7 +344,7 @@ class LIB_EXPORT JKQTPMathImageBase: public JKQTPImageBase {
virtual void ensureImageData(); virtual void ensureImageData();
void modifyImage(QImage& img); void modifyImage(QImage& img);
void modifyImage(QImage& img, void* dataModifier, DataType datatypeModifier, uint32_t Nx, uint32_t Ny, double internalModifierMin, double internalModifierMax); void modifyImage(QImage& img, void* dataModifier, DataType datatypeModifier, int Nx, int Ny, double internalModifierMin, double internalModifierMax);
}; };
@ -427,9 +427,9 @@ class LIB_EXPORT JKQTPMathImage: public JKQTPMathImageBase {
public: public:
/** \brief class constructor */ /** \brief class constructor */
JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, JKQTBasePlotter* parent=nullptr); JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, JKQTBasePlotter* parent=nullptr);
JKQTPMathImage(JKQTBasePlotter* parent=nullptr); JKQTPMathImage(JKQTBasePlotter* parent=nullptr);
JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQTPlotter* parent); JKQTPMathImage(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette, JKQTPlotter* parent);
JKQTPMathImage(JKQTPlotter* parent); JKQTPMathImage(JKQTPlotter* parent);
/** \brief plots the graph to the plotter object specified as parent */ /** \brief plots the graph to the plotter object specified as parent */
@ -913,14 +913,14 @@ class LIB_EXPORT JKQTPMathImage: public JKQTPMathImageBase {
class LIB_EXPORT JKQTPRGBMathImage: public JKQTPMathImageBase { class LIB_EXPORT JKQTPRGBMathImage: public JKQTPMathImageBase {
Q_OBJECT Q_OBJECT
public: public:
using JKQTPMathImageBase::set_data;
/** \brief class constructor */ /** \brief class constructor */
JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTBasePlotter* parent=nullptr); JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTBasePlotter* parent=nullptr);
/** \brief class constructor */ /** \brief class constructor */
JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent); JKQTPRGBMathImage(double x, double y, double width, double height, DataType datatype, void* data, int Nx, int Ny, JKQTPlotter* parent);
/** \brief class constructor */ /** \brief class constructor */
JKQTPRGBMathImage(JKQTBasePlotter* parent=nullptr); JKQTPRGBMathImage(JKQTBasePlotter* parent=nullptr);
@ -935,11 +935,11 @@ class LIB_EXPORT JKQTPRGBMathImage: public JKQTPMathImageBase {
virtual void set_data(void* data, void* dataG, void* dataB, uint32_t Nx, uint32_t Ny, DataType datatype); virtual void set_data(void* data, void* dataG, void* dataB, int Nx, int Ny, DataType datatype);
virtual void set_data(void* data, void* dataG, void* dataB, uint32_t Nx, uint32_t Ny); virtual void set_data(void* data, void* dataG, void* dataB, int Nx, int Ny);
virtual void set_data(void* data, uint32_t Nx, uint32_t Ny, DataType datatype); virtual void set_data(void* data, int Nx, int Ny, DataType datatype) override;
virtual void set_data(void* data, uint32_t Nx, uint32_t Ny); virtual void set_data(void* data, int Nx, int Ny) override ;
/** \brief determine min/max data value of the image */ /** \brief determine min/max data value of the image */
@ -1434,13 +1434,13 @@ class LIB_EXPORT JKQTPColumnMathImage: public JKQTPMathImage {
/** \brief class constructor */ /** \brief class constructor */
JKQTPColumnMathImage(JKQTBasePlotter* parent=nullptr); JKQTPColumnMathImage(JKQTBasePlotter* parent=nullptr);
JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQTBasePlotter* parent=nullptr); JKQTPColumnMathImage(double x, double y, double width, double height, int Nx, int Ny, JKQTBasePlotter* parent=nullptr);
JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, JKQTBasePlotter* parent=nullptr); JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, int Nx, int Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, JKQTBasePlotter* parent=nullptr);
/** \brief class constructor */ /** \brief class constructor */
JKQTPColumnMathImage(JKQTPlotter* parent); JKQTPColumnMathImage(JKQTPlotter* parent);
JKQTPColumnMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent); JKQTPColumnMathImage(double x, double y, double width, double height, int Nx, int Ny, JKQTPlotter* parent);
JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, JKQTPlotter* parent); JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, int Nx, int Ny, JKQTPMathImageColorPalette palette, JKQTPlotter* parent);
JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent); JKQTPColumnMathImage(double x, double y, double width, double height, int imageColumn, int Nx, int Ny, JKQTPlotter* parent);
/*! \brief sets the property imageColumn to the specified \a __value. /*! \brief sets the property imageColumn to the specified \a __value.
\details Description of the parameter imageColumn is: <BLOCKQUOTE>\copydoc imageColumn </BLOCKQUOTE> \details Description of the parameter imageColumn is: <BLOCKQUOTE>\copydoc imageColumn </BLOCKQUOTE>
@ -1498,16 +1498,16 @@ class LIB_EXPORT JKQTPColumnRGBMathImage: public JKQTPRGBMathImage {
/** \brief class constructor */ /** \brief class constructor */
JKQTPColumnRGBMathImage(JKQTBasePlotter* parent=nullptr); JKQTPColumnRGBMathImage(JKQTBasePlotter* parent=nullptr);
JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQTBasePlotter* parent=nullptr); JKQTPColumnRGBMathImage(double x, double y, double width, double height, int Nx, int Ny, JKQTBasePlotter* parent=nullptr);
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, uint32_t Nx, uint32_t Ny, JKQTBasePlotter* parent=nullptr); JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int Nx, int Ny, JKQTBasePlotter* parent=nullptr);
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, uint32_t Nx, uint32_t Ny, JKQTBasePlotter* parent=nullptr); JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int Nx, int Ny, JKQTBasePlotter* parent=nullptr);
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, uint32_t Nx, uint32_t Ny, JKQTBasePlotter* parent=nullptr); JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, int Nx, int Ny, JKQTBasePlotter* parent=nullptr);
/** \brief class constructor */ /** \brief class constructor */
JKQTPColumnRGBMathImage(JKQTPlotter* parent); JKQTPColumnRGBMathImage(JKQTPlotter* parent);
JKQTPColumnRGBMathImage(double x, double y, double width, double height, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent); JKQTPColumnRGBMathImage(double x, double y, double width, double height, int Nx, int Ny, JKQTPlotter* parent);
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent); JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int Nx, int Ny, JKQTPlotter* parent);
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent); JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int Nx, int Ny, JKQTPlotter* parent);
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, uint32_t Nx, uint32_t Ny, JKQTPlotter* parent); JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, int Nx, int Ny, JKQTPlotter* parent);
/*! \brief sets the property imageRColumn to the specified \a __value. /*! \brief sets the property imageRColumn to the specified \a __value.
\details Description of the parameter imageRColumn is: <BLOCKQUOTE>\copydoc imageRColumn </BLOCKQUOTE> \details Description of the parameter imageRColumn is: <BLOCKQUOTE>\copydoc imageRColumn </BLOCKQUOTE>
@ -1591,11 +1591,11 @@ class LIB_EXPORT JKQTPOverlayImage: public JKQTPImageBase {
public: public:
/** \brief class constructor */ /** \brief class constructor */
JKQTPOverlayImage(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQTBasePlotter* parent=nullptr); JKQTPOverlayImage(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTBasePlotter* parent=nullptr);
JKQTPOverlayImage(JKQTBasePlotter* parent=nullptr); JKQTPOverlayImage(JKQTBasePlotter* parent=nullptr);
/** \brief class constructor */ /** \brief class constructor */
JKQTPOverlayImage(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQTPlotter* parent); JKQTPOverlayImage(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTPlotter* parent);
JKQTPOverlayImage(JKQTPlotter* parent); JKQTPOverlayImage(JKQTPlotter* parent);
/** \brief plots the graph to the plotter object specified as parent */ /** \brief plots the graph to the plotter object specified as parent */
@ -1640,28 +1640,28 @@ class LIB_EXPORT JKQTPOverlayImage: public JKQTPImageBase {
/*! \brief sets the property Nx to the specified \a __value. /*! \brief sets the property Nx to the specified \a __value.
\details Description of the parameter Nx is: <BLOCKQUOTE>\copydoc Nx </BLOCKQUOTE> \details Description of the parameter Nx is: <BLOCKQUOTE>\copydoc Nx </BLOCKQUOTE>
\see Nx for more information */ \see Nx for more information */
inline virtual void set_Nx(uint32_t __value) inline virtual void set_Nx(int __value)
{ {
this->Nx = __value; this->Nx = __value;
} }
/*! \brief returns the property Nx. /*! \brief returns the property Nx.
\details Description of the parameter Nx is: <BLOCKQUOTE>\copydoc Nx </BLOCKQUOTE> \details Description of the parameter Nx is: <BLOCKQUOTE>\copydoc Nx </BLOCKQUOTE>
\see Nx for more information */ \see Nx for more information */
inline virtual uint32_t get_Nx() const inline virtual int get_Nx() const
{ {
return this->Nx; return this->Nx;
} }
/*! \brief sets the property Ny to the specified \a __value. /*! \brief sets the property Ny to the specified \a __value.
\details Description of the parameter Ny is: <BLOCKQUOTE>\copydoc Ny </BLOCKQUOTE> \details Description of the parameter Ny is: <BLOCKQUOTE>\copydoc Ny </BLOCKQUOTE>
\see Ny for more information */ \see Ny for more information */
inline virtual void set_Ny(uint32_t __value) inline virtual void set_Ny(int __value)
{ {
this->Ny = __value; this->Ny = __value;
} }
/*! \brief returns the property Ny. /*! \brief returns the property Ny.
\details Description of the parameter Ny is: <BLOCKQUOTE>\copydoc Ny </BLOCKQUOTE> \details Description of the parameter Ny is: <BLOCKQUOTE>\copydoc Ny </BLOCKQUOTE>
\see Ny for more information */ \see Ny for more information */
inline virtual uint32_t get_Ny() const inline virtual int get_Ny() const
{ {
return this->Ny; return this->Ny;
} }
@ -1680,7 +1680,7 @@ class LIB_EXPORT JKQTPOverlayImage: public JKQTPImageBase {
return this->data; return this->data;
} }
void set_data(bool* data, uint32_t Nx, uint32_t Ny); void set_data(bool* data, int Nx, int Ny);
QVector<double> getDataAsDoubleVector() const; QVector<double> getDataAsDoubleVector() const;
@ -1688,9 +1688,9 @@ class LIB_EXPORT JKQTPOverlayImage: public JKQTPImageBase {
/** \brief points to the data array, holding the image */ /** \brief points to the data array, holding the image */
bool* data; bool* data;
/** \brief width of the data array data in pt */ /** \brief width of the data array data in pt */
uint32_t Nx; int Nx;
/** \brief height of the data array data in pt */ /** \brief height of the data array data in pt */
uint32_t Ny; int Ny;
/** \brief color for \c true pixels */ /** \brief color for \c true pixels */
QColor trueColor; QColor trueColor;
@ -1722,10 +1722,10 @@ class LIB_EXPORT JKQTPOverlayImageEnhanced: public JKQTPOverlayImage {
Q_OBJECT Q_OBJECT
public: public:
/** \brief class constructor */ /** \brief class constructor */
JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQTBasePlotter* parent=nullptr); JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTBasePlotter* parent=nullptr);
JKQTPOverlayImageEnhanced(JKQTBasePlotter* parent=nullptr); JKQTPOverlayImageEnhanced(JKQTBasePlotter* parent=nullptr);
/** \brief class constructor */ /** \brief class constructor */
JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, uint32_t Nx, uint32_t Ny, QColor colTrue, JKQTPlotter* parent); JKQTPOverlayImageEnhanced(double x, double y, double width, double height, bool* data, int Nx, int Ny, QColor colTrue, JKQTPlotter* parent);
JKQTPOverlayImageEnhanced(JKQTPlotter* parent); JKQTPOverlayImageEnhanced(JKQTPlotter* parent);
/** \brief plots the graph to the plotter object specified as parent */ /** \brief plots the graph to the plotter object specified as parent */
@ -1889,11 +1889,11 @@ class LIB_EXPORT JKQTPContour: public JKQTPMathImage {
/** \brief class constructor */ /** \brief class constructor */
JKQTPContour(JKQTBasePlotter* parent=nullptr); JKQTPContour(JKQTBasePlotter* parent=nullptr);
/** \brief class constructor */ /** \brief class constructor */
JKQTPContour(double x, double y, double width, double height, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, DataType datatype = JKQTPMathImageBase::DoubleArray, JKQTBasePlotter* parent=nullptr); JKQTPContour(double x, double y, double width, double height, void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette=JKQTPMathImageGRAY, DataType datatype = JKQTPMathImageBase::DoubleArray, JKQTBasePlotter* parent=nullptr);
/** \brief class constructor */ /** \brief class constructor */
JKQTPContour(JKQTPlotter* parent); JKQTPContour(JKQTPlotter* parent);
/** \brief class constructor */ /** \brief class constructor */
JKQTPContour(double x, double y, double width, double height, void* data, uint32_t Nx, uint32_t Ny, JKQTPMathImageColorPalette palette, DataType datatype , JKQTPlotter* parent); JKQTPContour(double x, double y, double width, double height, void* data, int Nx, int Ny, JKQTPMathImageColorPalette palette, DataType datatype , JKQTPlotter* parent);
/** \brief plots the graph to the plotter object specified as parent */ /** \brief plots the graph to the plotter object specified as parent */
virtual void draw(JKQTPEnhancedPainter& painter) override; virtual void draw(JKQTPEnhancedPainter& painter) override;

View File

@ -149,7 +149,7 @@ void JKQTPXParsedFunctionLineGraph::createPlotData(bool /*collectParams*/)
double JKQTPXParsedFunctionLineGraph::JKQTPXParsedFunctionLineGraphFunction(double x, void* data) { double JKQTPXParsedFunctionLineGraph::JKQTPXParsedFunctionLineGraphFunction(double x, void* data) {
JKQTPXParsedFunctionLineGraph::JKQTPXParsedFunctionLineGraphFunctionData* d=(JKQTPXParsedFunctionLineGraph::JKQTPXParsedFunctionLineGraphFunctionData*)data; JKQTPXParsedFunctionLineGraph::JKQTPXParsedFunctionLineGraphFunctionData* d=static_cast<JKQTPXParsedFunctionLineGraph::JKQTPXParsedFunctionLineGraphFunctionData*>(data);
if (d && d->parser && d->node) { if (d && d->parser && d->node) {
try { try {
d->parser->addVariableDouble("x", x); d->parser->addVariableDouble("x", x);
@ -312,7 +312,7 @@ void JKQTPYParsedFunctionLineGraph::createPlotData(bool /*collectParams*/)
} }
double JKQTPYParsedFunctionLineGraph::JKQTPYParsedFunctionLineGraphFunction(double x, void* data) { double JKQTPYParsedFunctionLineGraph::JKQTPYParsedFunctionLineGraphFunction(double x, void* data) {
JKQTPYParsedFunctionLineGraph::JKQTPYParsedFunctionLineGraphFunctionData* d=(JKQTPYParsedFunctionLineGraph::JKQTPYParsedFunctionLineGraphFunctionData*)data; JKQTPYParsedFunctionLineGraph::JKQTPYParsedFunctionLineGraphFunctionData* d=static_cast<JKQTPYParsedFunctionLineGraph::JKQTPYParsedFunctionLineGraphFunctionData*>(data);
if (d && d->parser && d->node) { if (d && d->parser && d->node) {
try { try {
d->parser->addVariableDouble("x", x); d->parser->addVariableDouble("x", x);

View File

@ -88,8 +88,8 @@ void JKQTPlotter::init(bool datastore_internal, QWidget* parent, JKQTPDatastore*
mousePosY=0; mousePosY=0;
rightMouseButtonAction=JKQTPlotter::RightMouseButtonContextMenu; rightMouseButtonAction=JKQTPlotter::RightMouseButtonContextMenu;
connect(plotter, SIGNAL(plotUpdated()), this, SLOT(replotPlot())); connect(plotter, SIGNAL(plotUpdated()), this, SLOT(redrawPlot()));
connect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(replotOverlays())); connect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(redrawOverlays()));
connect(plotter, SIGNAL(beforePlotScalingRecalculate()), this, SLOT(intBeforePlotScalingRecalculate())); connect(plotter, SIGNAL(beforePlotScalingRecalculate()), this, SLOT(intBeforePlotScalingRecalculate()));
connect(plotter, SIGNAL(zoomChangedLocally(double, double, double, double, JKQTBasePlotter*)), this, SLOT(pzoomChangedLocally(double, double, double, double, JKQTBasePlotter*))); connect(plotter, SIGNAL(zoomChangedLocally(double, double, double, double, JKQTBasePlotter*)), this, SLOT(pzoomChangedLocally(double, double, double, double, JKQTBasePlotter*)));
@ -136,13 +136,13 @@ void JKQTPlotter::init(bool datastore_internal, QWidget* parent, JKQTPDatastore*
resize(400,300); resize(400,300);
doDrawing=true; doDrawing=true;
plotter->setEmittingSignalsEnabled(true); plotter->setEmittingSignalsEnabled(true);
replotPlot(); redrawPlot();
} }
JKQTPlotter::~JKQTPlotter() { JKQTPlotter::~JKQTPlotter() {
disconnect(plotter, SIGNAL(plotUpdated()), this, SLOT(replotPlot())); disconnect(plotter, SIGNAL(plotUpdated()), this, SLOT(redrawPlot()));
disconnect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(replotOverlays())); disconnect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(redrawOverlays()));
disconnect(plotter, SIGNAL(beforePlotScalingRecalculate()), this, SLOT(intBeforePlotScalingRecalculate())); disconnect(plotter, SIGNAL(beforePlotScalingRecalculate()), this, SLOT(intBeforePlotScalingRecalculate()));
disconnect(plotter, SIGNAL(zoomChangedLocally(double, double, double, double, JKQTBasePlotter*)), this, SLOT(pzoomChangedLocally(double, double, double, double, JKQTBasePlotter*))); disconnect(plotter, SIGNAL(zoomChangedLocally(double, double, double, double, JKQTBasePlotter*)), this, SLOT(pzoomChangedLocally(double, double, double, double, JKQTBasePlotter*)));
delete plotter; delete plotter;
@ -244,7 +244,7 @@ JKQTPlotter::MouseActionModes JKQTPlotter::getMouseActionMode() const
return this->mouseActionMode; return this->mouseActionMode;
} }
void JKQTPlotter::loadSettings(QSettings& settings, QString group) { void JKQTPlotter::loadSettings(const QSettings& settings, const QString& group) {
plotter->loadSettings(settings, group); plotter->loadSettings(settings, group);
@ -252,10 +252,10 @@ void JKQTPlotter::loadSettings(QSettings& settings, QString group) {
mousePositionTemplate=settings.value(group+"mouse_position_template", mousePositionTemplate).toString(); mousePositionTemplate=settings.value(group+"mouse_position_template", mousePositionTemplate).toString();
userActionColor=QColor(settings.value(group+"zoomrect_color", jkqtp_QColor2String(userActionColor)).toString()); userActionColor=QColor(settings.value(group+"zoomrect_color", jkqtp_QColor2String(userActionColor)).toString());
replotPlot(); redrawPlot();
} }
void JKQTPlotter::saveSettings(QSettings& settings, QString group) { void JKQTPlotter::saveSettings(QSettings& settings, const QString& group) const {
plotter->saveSettings(settings, group); plotter->saveSettings(settings, group);
if (userActionColor!=def_userActionColor) settings.setValue(group+"zoomrect_color", jkqtp_QColor2String(userActionColor)); if (userActionColor!=def_userActionColor) settings.setValue(group+"zoomrect_color", jkqtp_QColor2String(userActionColor));
@ -384,10 +384,10 @@ void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
mouseLastClickX=event->x(); mouseLastClickX=event->x();
mouseLastClickY=event->y(); mouseLastClickY=event->y();
if (rightMouseButtonAction==JKQTPlotter::RightMouseButtonZoom) { if (rightMouseButtonAction==JKQTPlotter::RightMouseButtonZoom) {
double xmin=plotter->p2x((long)round((double)plotter->getInternalPlotBorderLeft()-(double)plotter->getPlotWidth()/2.0)); double xmin=plotter->p2x((long)round(static_cast<double>(plotter->getInternalPlotBorderLeft())-static_cast<double>(plotter->getPlotWidth())/2.0));
double xmax=plotter->p2x((long)round((double)plotter->getInternalPlotBorderLeft()+1.5*(double)plotter->getPlotWidth())); double xmax=plotter->p2x((long)round(static_cast<double>(plotter->getInternalPlotBorderLeft())+1.5*static_cast<double>(plotter->getPlotWidth())));
double ymin=plotter->p2y((long)round((double)plotter->getInternalPlotBorderTop()+1.5*(double)plotter->getPlotHeight())); double ymin=plotter->p2y((long)round(static_cast<double>(plotter->getInternalPlotBorderTop())+1.5*static_cast<double>(plotter->getPlotHeight())));
double ymax=plotter->p2y((long)round((double)plotter->getInternalPlotBorderTop()-(double)plotter->getPlotHeight()/2.0)); double ymax=plotter->p2y((long)round(static_cast<double>(plotter->getInternalPlotBorderTop())-static_cast<double>(plotter->getPlotHeight())/2.0));
if (plotter->getXAxis()->isLogAxis()) { if (plotter->getXAxis()->isLogAxis()) {
if (xmin<=0) xmin=1; if (xmin<=0) xmin=1;
if (xmax<=0) xmax=10; if (xmax<=0) xmax=10;
@ -398,7 +398,7 @@ void JKQTPlotter::mousePressEvent ( QMouseEvent * event ){
} }
/*plotter->getXAxis->setRange(xmin, xmax); /*plotter->getXAxis->setRange(xmin, xmax);
plotter->getYAxis->setRange(ymin, ymax);*/ plotter->getYAxis->setRange(ymin, ymax);*/
//replotPlot(); //redrawPlot();
/*if (plotter->isEmittingSignalsEnabled())*/ emit zoomChangedLocally(xmin, xmax, ymin, ymax, this); /*if (plotter->isEmittingSignalsEnabled())*/ emit zoomChangedLocally(xmin, xmax, ymin, ymax, this);
plotter->setXY(xmin, xmax, ymin, ymax); plotter->setXY(xmin, xmax, ymin, ymax);
//update(); //update();
@ -483,15 +483,15 @@ void JKQTPlotter::mouseDoubleClickEvent ( QMouseEvent * event ){
if (rightMouseButtonAction==JKQTPlotter::RightMouseButtonZoom && event->button()==Qt::RightButton) { if (rightMouseButtonAction==JKQTPlotter::RightMouseButtonZoom && event->button()==Qt::RightButton) {
double factor=4.0; double factor=4.0;
if (event->button()==Qt::RightButton) factor=1; if (event->button()==Qt::RightButton) factor=1;
double xmin=plotter->p2x((long)round((double)event->x()/magnification-(double)plotter->getPlotWidth()/factor)); double xmin=plotter->p2x((long)round((double)event->x()/magnification-static_cast<double>(plotter->getPlotWidth())/factor));
double xmax=plotter->p2x((long)round((double)event->x()/magnification+(double)plotter->getPlotWidth()/factor)); double xmax=plotter->p2x((long)round((double)event->x()/magnification+static_cast<double>(plotter->getPlotWidth())/factor));
double ymin=plotter->p2y((long)round((double)event->y()/magnification-(double)getPlotYOffset()+(double)plotter->getPlotHeight()/factor)); double ymin=plotter->p2y((long)round((double)event->y()/magnification-(double)getPlotYOffset()+static_cast<double>(plotter->getPlotHeight())/factor));
double ymax=plotter->p2y((long)round((double)event->y()/magnification-(double)getPlotYOffset()-(double)plotter->getPlotHeight()/factor)); double ymax=plotter->p2y((long)round((double)event->y()/magnification-(double)getPlotYOffset()-static_cast<double>(plotter->getPlotHeight())/factor));
event->accept(); event->accept();
//xAxis->setRange(xmin, xmax); //xAxis->setRange(xmin, xmax);
//yAxis->setRange(ymin, ymax); //yAxis->setRange(ymin, ymax);
//replotPlot(); //redrawPlot();
/*if (plotter->isEmittingSignalsEnabled())*/ emit zoomChangedLocally(xmin, xmax, ymin, ymax, this); /*if (plotter->isEmittingSignalsEnabled())*/ emit zoomChangedLocally(xmin, xmax, ymin, ymax, this);
plotter->setXY(xmin, xmax, ymin, ymax); plotter->setXY(xmin, xmax, ymin, ymax);
update(); update();
@ -518,22 +518,16 @@ void JKQTPlotter::wheelEvent ( QWheelEvent * event ) {
if ( (event->x()/magnification>=plotter->getInternalPlotBorderLeft()) && (event->x()/magnification<=plotter->getPlotWidth()+plotter->getInternalPlotBorderLeft()) && 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()) ) { ((event->y()-getPlotYOffset())/magnification>=plotter->getInternalPlotBorderTop()) && ((event->y()-getPlotYOffset())/magnification<=plotter->getPlotHeight()+plotter->getInternalPlotBorderTop()) ) {
double factor=pow(2.0, 1.0*(double)event->delta()/120.0)*2.0; double factor=pow(2.0, 1.0*(double)event->delta()/120.0)*2.0;
//std::cout<<(double)event->delta()/120.0<<": "<<factor<<std::endl; double xmin=plotter->p2x((long)round((double)event->x()/magnification-static_cast<double>(plotter->getPlotWidth())/factor));
double xmin=plotter->p2x((long)round((double)event->x()/magnification-(double)plotter->getPlotWidth()/factor)); double xmax=plotter->p2x((long)round((double)event->x()/magnification+static_cast<double>(plotter->getPlotWidth())/factor));
double xmax=plotter->p2x((long)round((double)event->x()/magnification+(double)plotter->getPlotWidth()/factor)); double ymin=plotter->p2y((long)round((double)event->y()/magnification-(double)getPlotYOffset()+static_cast<double>(plotter->getPlotHeight())/factor));
double ymin=plotter->p2y((long)round((double)event->y()/magnification-(double)getPlotYOffset()+(double)plotter->getPlotHeight()/factor)); double ymax=plotter->p2y((long)round((double)event->y()/magnification-(double)getPlotYOffset()-static_cast<double>(plotter->getPlotHeight())/factor));
double ymax=plotter->p2y((long)round((double)event->y()/magnification-(double)getPlotYOffset()-(double)plotter->getPlotHeight()/factor));
//std::cout<<"t="<<t<<", w="<<w<<" => "<<tmin<<" -- "<<tmax<<std::endl;
event->accept(); event->accept();
/*if (plotter->isEmittingSignalsEnabled())*/ emit zoomChangedLocally(xmin, xmax, ymin, ymax, this);
plotter->setXY(xmin, xmax, ymin, ymax); plotter->setXY(xmin, xmax, ymin, ymax);
//update(); } else {
/*xAxis->setRange(xmin, xmax); event->ignore();
yAxis->setRange(ymin, ymax); }
//replotPlot();
if (emitSignals) emit zoomChangedLocally(xAxis->getMin(), xAxis->getMax(), yAxis->getMin(), yAxis->getMax(), this);*/
} else { event->ignore(); }
} }
int JKQTPlotter::getPlotYOffset() { int JKQTPlotter::getPlotYOffset() {
@ -662,13 +656,13 @@ void JKQTPlotter::synchronizeXYAxis(double newxmin, double newxmax, double newym
setXY(newxmin, newxmax, newymin, newymax); setXY(newxmin, newxmax, newymin, newymax);
} }
void JKQTPlotter::replotOverlays() { void JKQTPlotter::redrawOverlays() {
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
JKQTPAutoOutputTimer jkaaot(QString("JKQTPlotter::replotOverlays()")); JKQTPAutoOutputTimer jkaaot(QString("JKQTPlotter::redrawOverlays()"));
#endif #endif
if (!doDrawing) return; if (!doDrawing) return;
disconnect(plotter, SIGNAL(plotUpdated()), this, SLOT(replotPlot())); disconnect(plotter, SIGNAL(plotUpdated()), this, SLOT(redrawPlot()));
disconnect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(replotOverlays())); disconnect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(redrawOverlays()));
image=imageNoOverlays; image=imageNoOverlays;
JKQTPEnhancedPainter painter(&image); JKQTPEnhancedPainter painter(&image);
if (painter.isActive()) { if (painter.isActive()) {
@ -676,18 +670,18 @@ void JKQTPlotter::replotOverlays() {
plotter->drawNonGridOverlays(painter); plotter->drawNonGridOverlays(painter);
} }
oldImage=image; oldImage=image;
connect(plotter, SIGNAL(plotUpdated()), this, SLOT(replotPlot())); connect(plotter, SIGNAL(plotUpdated()), this, SLOT(redrawPlot()));
connect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(replotOverlays())); connect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(redrawOverlays()));
repaint(); repaint();
} }
void JKQTPlotter::replotPlot() { void JKQTPlotter::redrawPlot() {
#ifdef JKQTBP_AUTOTIMER #ifdef JKQTBP_AUTOTIMER
JKQTPAutoOutputTimer jkaaot(QString("JKQTPlotter::replotPlot()")); JKQTPAutoOutputTimer jkaaot(QString("JKQTPlotter::redrawPlot()"));
#endif #endif
if (!doDrawing) return; if (!doDrawing) return;
disconnect(plotter, SIGNAL(plotUpdated()), this, SLOT(replotPlot())); disconnect(plotter, SIGNAL(plotUpdated()), this, SLOT(redrawPlot()));
disconnect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(replotOverlays())); disconnect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(redrawOverlays()));
plotter->resize(width()/magnification, height()/magnification-getPlotYOffset()); plotter->resize(width()/magnification, height()/magnification-getPlotYOffset());
JKQTPEnhancedPainter painter(&image); JKQTPEnhancedPainter painter(&image);
if (painter.isActive()) { if (painter.isActive()) {
@ -700,8 +694,8 @@ void JKQTPlotter::replotPlot() {
plotter->drawNonGridOverlays(painter); plotter->drawNonGridOverlays(painter);
} }
oldImage=image; oldImage=image;
connect(plotter, SIGNAL(plotUpdated()), this, SLOT(replotPlot())); connect(plotter, SIGNAL(plotUpdated()), this, SLOT(redrawPlot()));
connect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(replotOverlays())); connect(plotter, SIGNAL(overlaysUpdated()), this, SLOT(redrawOverlays()));
update(); update();
} }
@ -780,7 +774,7 @@ void JKQTPlotter::delayedResizeEvent()
sizeChanged=true; sizeChanged=true;
} }
if (sizeChanged) replotPlot(); if (sizeChanged) redrawPlot();
} }
void JKQTPlotter::leaveEvent(QEvent * /*event*/) { void JKQTPlotter::leaveEvent(QEvent * /*event*/) {
@ -821,7 +815,7 @@ QSize JKQTPlotter::sizeHint() const {
void JKQTPlotter::masterPlotScalingRecalculated() { void JKQTPlotter::masterPlotScalingRecalculated() {
if (masterPlotter) { if (masterPlotter) {
if (plotter->getMasterSynchronizeHeight()||plotter->getMasterSynchronizeWidth()) { if (plotter->getMasterSynchronizeHeight()||plotter->getMasterSynchronizeWidth()) {
replotPlot(); redrawPlot();
} }
} }
} }
@ -833,13 +827,13 @@ void JKQTPlotter::synchronizeToMaster(JKQTPlotter* master, bool synchronizeWidth
plotter->synchronizeToMaster(master->getPlotter(), synchronizeWidth, synchronizeHeight); plotter->synchronizeToMaster(master->getPlotter(), synchronizeWidth, synchronizeHeight);
masterPlotter=master; masterPlotter=master;
if (masterPlotter) connect(masterPlotter->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated())); if (masterPlotter) connect(masterPlotter->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated()));
replotPlot(); redrawPlot();
} }
void JKQTPlotter::resetMasterSynchronization() { void JKQTPlotter::resetMasterSynchronization() {
if (masterPlotter) disconnect(masterPlotter->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated())); if (masterPlotter) disconnect(masterPlotter->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated()));
plotter->resetMasterSynchronization(); plotter->resetMasterSynchronization();
replotPlot(); redrawPlot();
} }
bool JKQTPlotter::isPlotUpdateEnabled() const { bool JKQTPlotter::isPlotUpdateEnabled() const {
@ -930,7 +924,7 @@ int JKQTPlotter::getMouseLastClickY() const {
void JKQTPlotter::setMagnification(double m) void JKQTPlotter::setMagnification(double m)
{ {
magnification=m; magnification=m;
replotPlot(); redrawPlot();
} }
bool JKQTPlotter::getZoomByMouseRectangle() const { bool JKQTPlotter::getZoomByMouseRectangle() const {

View File

@ -235,7 +235,7 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
virtual ~JKQTPlotter(); virtual ~JKQTPlotter();
/** reinitializes the toolbar, i.e. fills in QActions added to the QWidget since its creation/the last call to this function */ /** reinitializes the toolbar, i.e. fills in QActions added to the QWidget since its creation/the last call to this function */
virtual void updateToolbarActions(); void updateToolbarActions();
/** \brief set the width/height of the icons in the toolbar in pt */ /** \brief set the width/height of the icons in the toolbar in pt */
@ -252,39 +252,39 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/*! \brief returns the property displayToolbar. /*! \brief returns the property displayToolbar.
\details Description of the parameter displayToolbar is: <BLOCKQUOTE>\copydoc displayToolbar </BLOCKQUOTE> \details Description of the parameter displayToolbar is: <BLOCKQUOTE>\copydoc displayToolbar </BLOCKQUOTE>
\see displayToolbar for more information */ \see displayToolbar for more information */
virtual bool isToolbarVisible() const; bool isToolbarVisible() const;
/*! \brief returns the property toolbarAlwaysOn. /*! \brief returns the property toolbarAlwaysOn.
\details Description of the parameter toolbarAlwaysOn is: <BLOCKQUOTE>\copydoc toolbarAlwaysOn </BLOCKQUOTE> \details Description of the parameter toolbarAlwaysOn is: <BLOCKQUOTE>\copydoc toolbarAlwaysOn </BLOCKQUOTE>
\see toolbarAlwaysOn for more information */ \see toolbarAlwaysOn for more information */
virtual bool isToolbarAlwaysOn() const; bool isToolbarAlwaysOn() const;
/*! \brief returns the property displayMousePosition. /*! \brief returns the property displayMousePosition.
\details Description of the parameter displayMousePosition is: <BLOCKQUOTE>\copydoc displayMousePosition </BLOCKQUOTE> \details Description of the parameter displayMousePosition is: <BLOCKQUOTE>\copydoc displayMousePosition </BLOCKQUOTE>
\see displayMousePosition for more information */ \see displayMousePosition for more information */
virtual bool isMousePositionShown() const; bool isMousePositionShown() const;
/*! \brief returns the property userActionColor. /*! \brief returns the property userActionColor.
\details Description of the parameter userActionColor is: <BLOCKQUOTE>\copydoc userActionColor </BLOCKQUOTE> \details Description of the parameter userActionColor is: <BLOCKQUOTE>\copydoc userActionColor </BLOCKQUOTE>
\see userActionColor for more information */ \see userActionColor for more information */
virtual QColor getUserActionColor() const; QColor getUserActionColor() const;
/*! \brief returns the property userActionCompositionMode. /*! \brief returns the property userActionCompositionMode.
\details Description of the parameter userActionCompositionMode is: <BLOCKQUOTE>\copydoc userActionCompositionMode </BLOCKQUOTE> \details Description of the parameter userActionCompositionMode is: <BLOCKQUOTE>\copydoc userActionCompositionMode </BLOCKQUOTE>
\see userActionCompositionMode for more information */ \see userActionCompositionMode for more information */
virtual QPainter::CompositionMode getUserActionCompositionMode() const; QPainter::CompositionMode getUserActionCompositionMode() const;
/*! \brief returns the current mouseActionMode. /*! \brief returns the current mouseActionMode.
\details Description of the parameter mouseActionMode is: <BLOCKQUOTE> specifies the user-action mode this JKQtPlotter use when mouse events occur. \details Description of the parameter mouseActionMode is: <BLOCKQUOTE> specifies the user-action mode this JKQtPlotter use 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 </BLOCKQUOTE> * This allows you to e.g. draw rectangles or lines over the plot and receive a signal, when the drawing finishes </BLOCKQUOTE>
\see mouseActionMode for more information */ \see mouseActionMode for more information */
virtual MouseActionModes getMouseActionMode() const; MouseActionModes getMouseActionMode() const;
/** \brief loads the plot properties from a QSettings object */ /** \brief loads the plot properties from a QSettings object */
virtual void loadSettings(QSettings& settings, QString group=QString("plots")); void loadSettings(const QSettings &settings, const QString& group=QString("plots"));
/** \brief saves the plot properties into a QSettings object. /** \brief saves the plot properties into a QSettings object.
* *
* This method only saves those properties that differ from their default value. * This method only saves those properties that differ from their default value.
*/ */
virtual void saveSettings(QSettings& settings, QString group=QString("plots")); void saveSettings(QSettings& settings, const QString& group=QString("plots")) const;
/** \brief returns the minimum size of the widget */ /** \brief returns the minimum size of the widget */
QSize minimumSizeHint() const; QSize minimumSizeHint() const;
@ -323,25 +323,19 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
*/ */
inline void useExternalDatastore(JKQTPDatastore* newStore) { plotter->useExternalDatastore(newStore); } inline void useExternalDatastore(JKQTPDatastore* newStore) { plotter->useExternalDatastore(newStore); }
/** \brief tells the plotter object to use the given external datastore and treat it as an internal one (i.e. free it /** \copydoc JKQTBasePlotter::useAsInternalDatastore() */
* when the plotter object ist destroyed.
*/
inline void useAsInternalDatastore(JKQTPDatastore* newStore) { plotter->useAsInternalDatastore(newStore); } inline void useAsInternalDatastore(JKQTPDatastore* newStore) { plotter->useAsInternalDatastore(newStore); }
/** \brief tells the plotter object to use an internal datastore. A new internal datastore object is generated only if /** \copydoc JKQTBasePlotter::useInternalDatastore() */
* the current datastore is not internal.
*/
inline void useInternalDatastore() { plotter->useInternalDatastore(); } inline void useInternalDatastore() { plotter->useInternalDatastore(); }
/** \brief tells the plotter object to use an internal datastore (just like useInternalDatastore() ), but forces the /** \copydoc JKQTBasePlotter::forceInternalDatastore() */
* generation of a new datastore, even if the current one is already internal (the current one will be freed in
* the lather case */
inline void forceInternalDatastore() { plotter->forceInternalDatastore(); } inline void forceInternalDatastore() { plotter->forceInternalDatastore(); }
/** \brief switch emitting of signals, such as zoomChangedLocally() ..., on (sig=true) or off (sig=false) */ /** \copydoc JKQTBasePlotter::setEmittingSignalsEnabled() */
inline void setEmittingSignalsEnabled(bool sig) { plotter->setEmittingSignalsEnabled(sig); } inline void setEmittingSignalsEnabled(bool sig) { plotter->setEmittingSignalsEnabled(sig); }
/** \brief determine, whether emitting of signals, such as zoomChangedLocally() ..., is switched on or off */ /** \copydoc JKQTBasePlotter::isEmittingSignalsEnabled() */
inline bool isEmittingSignalsEnabled() { return plotter; } inline bool isEmittingSignalsEnabled() { return plotter->isEmittingSignalsEnabled(); }
/** \brief returns, whether updating the plot is currently activated (e.g. you can deactivate this with setPlotUpdateEnabled() while performing major updates on the plot) /** \brief returns, whether updating the plot is currently activated (e.g. you can deactivate this with setPlotUpdateEnabled() while performing major updates on the plot)
* *
@ -361,11 +355,11 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/*! \brief returns the property rightMouseButtonAction. /*! \brief returns the property rightMouseButtonAction.
\details Description of the parameter rightMouseButtonAction is: <BLOCKQUOTE>\copydoc rightMouseButtonAction </BLOCKQUOTE> \details Description of the parameter rightMouseButtonAction is: <BLOCKQUOTE>\copydoc rightMouseButtonAction </BLOCKQUOTE>
\see rightMouseButtonAction for more information */ \see rightMouseButtonAction for more information */
virtual RightMouseButtonAction getActionRightMouseButton() const; RightMouseButtonAction getActionRightMouseButton() const;
/*! \brief returns the property leftDoubleClickAction. /*! \brief returns the property leftDoubleClickAction.
\details Description of the parameter leftDoubleClickAction is: <BLOCKQUOTE>\copydoc leftDoubleClickAction </BLOCKQUOTE> \details Description of the parameter leftDoubleClickAction is: <BLOCKQUOTE>\copydoc leftDoubleClickAction </BLOCKQUOTE>
\see leftDoubleClickAction for more information */ \see leftDoubleClickAction for more information */
virtual LeftDoubleClickAction getActionLeftDoubleClick() const; LeftDoubleClickAction getActionLeftDoubleClick() const;
/*! \brief returns the property menuSpecialContextMenu. \details Description of the parameter menuSpecialContextMenu is: <BLOCKQUOTE>\copydoc menuSpecialContextMenu </BLOCKQUOTE>. \see menuSpecialContextMenu for more information */ /*! \brief returns the property menuSpecialContextMenu. \details Description of the parameter menuSpecialContextMenu is: <BLOCKQUOTE>\copydoc menuSpecialContextMenu </BLOCKQUOTE>. \see menuSpecialContextMenu for more information */
QMenu *getMenuSpecialContextMenu() const; QMenu *getMenuSpecialContextMenu() const;
@ -379,7 +373,7 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/*! \brief returns the property zoomByMouseWheel. /*! \brief returns the property zoomByMouseWheel.
\details Description of the parameter zoomByMouseWheel is: <BLOCKQUOTE>\copydoc zoomByMouseWheel </BLOCKQUOTE> \details Description of the parameter zoomByMouseWheel is: <BLOCKQUOTE>\copydoc zoomByMouseWheel </BLOCKQUOTE>
\see zoomByMouseWheel for more information */ \see zoomByMouseWheel for more information */
virtual bool getZoomByMouseWheel() const; bool getZoomByMouseWheel() const;
/** \brief returns the property mouseContextX. /** \brief returns the property mouseContextX.
\details Description of the parameter mouseContextX is: <BLOCKQUOTE>\copydoc mouseContextX </BLOCKQUOTE>. \details Description of the parameter mouseContextX is: <BLOCKQUOTE>\copydoc mouseContextX </BLOCKQUOTE>.
@ -508,7 +502,7 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/** \brief save the current plot as an image file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed. /** \brief save the current plot as an image file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed.
* The image format is extracted from the file extension (jpeg, tiff, png, pdf, ...) */ * The image format is extracted from the file extension (jpeg, tiff, png, pdf, ...) */
inline void saveImage(QString filename=QString(""), bool displayPreview=true) { inline void saveImage(const QString& filename=QString(""), bool displayPreview=true) {
plotter->saveImage(filename, displayPreview); plotter->saveImage(filename, displayPreview);
} }
@ -520,7 +514,7 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
* If \a format is \c "slk" the output will be in SYLK format, if \a format is \c "csv" or \a "dat" the output will be comma separated values * If \a format is \c "slk" the output will be in SYLK format, if \a format is \c "csv" or \a "dat" the output will be comma separated values
* and if \a format is \c "txt" the output will be tab separated values. * and if \a format is \c "txt" the output will be tab separated values.
*/ */
inline void saveData(QString filename=QString(""), QString format=QString("")) { inline void saveData(const QString& filename=QString(""), const QString& format=QString("")) {
plotter->saveData(filename, format); plotter->saveData(filename, format);
} }
@ -560,10 +554,15 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
inline void zoomOut(double factor=2.0) { plotter->zoomOut(factor); } inline void zoomOut(double factor=2.0) { plotter->zoomOut(factor); }
/** \brief update the plot and the overlays */ /** \brief update the plot and the overlays */
void replotPlot(); void redrawPlot();
/** \brief replot overlays only (use replotPlot() to replot the plot and the overlays) */ /** \brief replot overlays only (use redrawPlot() to replot the plot and the overlays)
void replotOverlays(); *
* You can use this function, if you only changed the overlays but not the graphs in this plotter.
* Then only the overlas are redrawn and the old (saved) image of the graphs and the coordinate syste,
* is used as a base. This is significantly faster than redrawing the whole plot.
*/
void redrawOverlays();
/*! \brief sets the property displayToolbar to the specified \a __value. /*! \brief sets the property displayToolbar to the specified \a __value.
\details Description of the parameter displayToolbar is: <BLOCKQUOTE>\copydoc displayToolbar </BLOCKQUOTE> \details Description of the parameter displayToolbar is: <BLOCKQUOTE>\copydoc displayToolbar </BLOCKQUOTE>
@ -614,7 +613,7 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
/** \brief popuplate the given toolbar with all actions shown in a toolbar from this class ... */ /** \brief popuplate the given toolbar with all actions shown in a toolbar from this class ... */
virtual void populateToolbar(QToolBar* toolbar) const; void populateToolbar(QToolBar* toolbar) const;
/** \brief open the context menu at the mouse position of the last click */ /** \brief open the context menu at the mouse position of the last click */
void openContextMenu(); void openContextMenu();
@ -684,7 +683,7 @@ class LIB_EXPORT JKQTPlotter: public QWidget {
* *
* The plotter will fill the menu with the default items and then call this method. The default implementation does NOTHING. * The plotter will fill the menu with the default items and then call this method. The default implementation does NOTHING.
*/ */
virtual void modifyContextMenu(QMenu* menu); void modifyContextMenu(QMenu* menu);
void init(bool datastore_internal, QWidget* parent, JKQTPDatastore* datast); void init(bool datastore_internal, QWidget* parent, JKQTPDatastore* datast);

View File

@ -52,7 +52,7 @@ class LIB_EXPORT JKQTPEnhancedTableView : public QTableView {
QAction* getActionPrint() const { return printAction; } QAction* getActionPrint() const { return printAction; }
signals: signals:
void keyPressed(int key, Qt::KeyboardModifiers modifiers, QString text); void keyPressed(int key, Qt::KeyboardModifiers modifiers, const QString& text);
public slots: public slots:
void copySelectionToExcel(int copyrole=Qt::EditRole, bool storeHead=true); void copySelectionToExcel(int copyrole=Qt::EditRole, bool storeHead=true);
void copySelectionToExcelNoHead(int copyrole=Qt::EditRole); void copySelectionToExcelNoHead(int copyrole=Qt::EditRole);

View File

@ -59,7 +59,7 @@ void JKQTPPlotSymbol(JKQTPEnhancedPainter& painter, double x, double y, JKQTPGra
star_items=5; star_items=5;
double angle=360.0/double(star_items)/180.0*M_PI; double angle=360.0/double(star_items)/180.0*M_PI;
for (int i=0; i<star_items; i++) { for (int i=0; i<star_items; i++) {
double a=((double)i+0.5)*angle; double a=(static_cast<double>(i)+0.5)*angle;
starcordsx[i*2]=sin(a); starcordsx[i*2]=sin(a);
starcordsx[i*2+1]=0.5*sin(a+angle/2.0); starcordsx[i*2+1]=0.5*sin(a+angle/2.0);
starcordsy[i*2]=cos(a); starcordsy[i*2]=cos(a);

View File

@ -27,12 +27,12 @@
#include <QLocale> #include <QLocale>
#include <QtCore> #include <QtCore>
void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, QString prefix) { void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix) {
settings.setValue(prefix+"pos", widget->pos()); settings.setValue(prefix+"pos", widget->pos());
settings.setValue(prefix+"size", widget->size()); settings.setValue(prefix+"size", widget->size());
} }
void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, QString prefix) { void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, const QString& prefix) {
QPoint pos = settings.value(prefix+"pos", defaultPosition).toPoint(); QPoint pos = settings.value(prefix+"pos", defaultPosition).toPoint();
QSize size = settings.value(prefix+"size", defaultSize).toSize(); QSize size = settings.value(prefix+"size", defaultSize).toSize();
@ -42,11 +42,11 @@ void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPo
widget->move(pos); widget->move(pos);
} }
void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QString prefix) { void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix) {
jkloadWidgetGeometry(settings, widget, QPoint(10, 10), QSize(100, 100), prefix); jkloadWidgetGeometry(settings, widget, QPoint(10, 10), QSize(100, 100), prefix);
} }
void jksaveSplitter(QSettings& settings, QSplitter* splitter, QString prefix) { void jksaveSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix) {
/*QList<int> sizes=splitter->sizes(); /*QList<int> sizes=splitter->sizes();
QString data=""; QString data="";
for (int i=0; i<sizes.size(); i++) { for (int i=0; i<sizes.size(); i++) {
@ -57,7 +57,7 @@ void jksaveSplitter(QSettings& settings, QSplitter* splitter, QString prefix) {
settings.setValue(prefix+"splitter_sizes", splitter->saveState()); settings.setValue(prefix+"splitter_sizes", splitter->saveState());
} }
void jkloadSplitter(QSettings& settings, QSplitter* splitter, QString prefix) { void jkloadSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix) {
/*QString data=settings.value(prefix+"splitter_sizes", "").toString(); /*QString data=settings.value(prefix+"splitter_sizes", "").toString();
QList<int> sizes, s1; QList<int> sizes, s1;
QStringList sl=data.split(","); QStringList sl=data.split(",");
@ -71,7 +71,7 @@ void jkloadSplitter(QSettings& settings, QSplitter* splitter, QString prefix) {
splitter->restoreState(settings.value(prefix+"splitter_sizes").toByteArray()); splitter->restoreState(settings.value(prefix+"splitter_sizes").toByteArray());
} }
QString jkVariantListToString(const QList<QVariant>& data, QString separator) { QString jkVariantListToString(const QList<QVariant>& data, const QString& separator) {
QString r=""; QString r="";
QLocale loc=QLocale::c(); QLocale loc=QLocale::c();
loc.setNumberOptions(QLocale::OmitGroupSeparator); loc.setNumberOptions(QLocale::OmitGroupSeparator);

View File

@ -42,7 +42,7 @@
\param widget the widget to store \param widget the widget to store
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, QString prefix=QString("")); LIB_EXPORT void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix=QString(""));
/*! \brief load the geometry of a given widget to a QSettings /*! \brief load the geometry of a given widget to a QSettings
\ingroup jkqtpjkqtptools_qt \ingroup jkqtpjkqtptools_qt
@ -53,7 +53,7 @@ LIB_EXPORT void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, QStri
\param[out] widget the widget to change \param[out] widget the widget to change
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QString prefix=QString("")); LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix=QString(""));
/*! \brief load the geometry of a given widget to a QSettings /*! \brief load the geometry of a given widget to a QSettings
@ -67,7 +67,7 @@ LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QStri
\param defaultSize default size of the widget \param defaultSize default size of the widget
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, QString prefix=QString("")); LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, const QString& prefix=QString(""));
/*! \brief store the geometry of a given widget to a QSettings /*! \brief store the geometry of a given widget to a QSettings
\ingroup jkqtpjkqtptools_qt \ingroup jkqtpjkqtptools_qt
@ -78,7 +78,7 @@ LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoin
\param widget the widget to store \param widget the widget to store
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jksaveSplitter(QSettings& settings, QSplitter* splitter, QString prefix=QString("")); LIB_EXPORT void jksaveSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix=QString(""));
/*! \brief load the geometry of a given widget to a QSettings /*! \brief load the geometry of a given widget to a QSettings
\ingroup jkqtpjkqtptools_qt \ingroup jkqtpjkqtptools_qt
@ -89,14 +89,14 @@ LIB_EXPORT void jksaveSplitter(QSettings& settings, QSplitter* splitter, QString
\param[out] plitter the plitter to change \param[out] plitter the plitter to change
\param prefix this prefix is prepended to the QSettings keys \param prefix this prefix is prepended to the QSettings keys
*/ */
LIB_EXPORT void jkloadSplitter(QSettings& settings, QSplitter* splitter, QString prefix=QString("")); LIB_EXPORT void jkloadSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix=QString(""));
/*! \brief convert a QList<QVariant> to a string /*! \brief convert a QList<QVariant> to a string
\ingroup jkqtpjkqtptools_qt \ingroup jkqtpjkqtptools_qt
*/ */
LIB_EXPORT QString jkVariantListToString(const QList<QVariant>& data, QString separator=QString(", ")); LIB_EXPORT QString jkVariantListToString(const QList<QVariant>& data, const QString& separator=QString(", "));
/*! \brief filename-ize a string, i.e. replace every non-number and non-character (and also not <code> _ -</code>) character to \c _ /*! \brief filename-ize a string, i.e. replace every non-number and non-character (and also not <code> _ -</code>) character to \c _