mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-11-15 10:05:47 +08:00
renamed JKQTPColorPaletteStyleAndToolsMixin::setPalette() -> JKQTPColorPaletteStyleAndToolsMixin::setColorPalette()
This commit is contained in:
parent
e9ca874f3b
commit
ff373236d4
@ -20,6 +20,7 @@ Changes, compared to \ref page_whatsnew_V2019_11 "v2019.11" include:
|
||||
<li> fixed issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/41">#41: Build error when JKQtPlotter_BUILD_INCLUDE_XITS_FONTS set to OFF </a>, thanks to <a href="https://github.com/smistad">user:smistad</a></li>
|
||||
<li> fixed issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/37">#37: CMake installs things into $PREFIX/doc/*.txt </a>, thanks to <a href="https://github.com/certik">user:certik</a></li>
|
||||
<li> fixed issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/45">#45: Build error on mac jkqtfastplotter.cpp:342:28: Variable has incomplete type 'QPainterPath'</a>, thanks to <a href="https://github.com/abdedixit">user:abdedixit</a></li>
|
||||
<li>renamed/breaking change: renamed JKQTPColorPaletteStyleAndToolsMixin::setPalette() -> JKQTPColorPaletteStyleAndToolsMixin::setColorPalette()</li>
|
||||
<li>removed/breaking change: removed the usage of some deprecated functions and objects (e.g. QMatrix)</li>
|
||||
<li>removed/breaking change: removed the overlay elements (derived from JKQTPOverlayElement), which were not very well set up and are more confusing than useful.</li>
|
||||
<li>improved/breaking change: geometric objects now use an adaptive drawing algorithm to represent curves (before e.g. ellipses were always separated into a fixed number of line-segments)</li>
|
||||
|
@ -91,7 +91,7 @@ int main(int argc, char* argv[])
|
||||
graph->setWidth(w);
|
||||
graph->setHeight(h);
|
||||
// color-map is "BlueGreenRed"
|
||||
graph->setPalette(JKQTPMathImageBlueGreenRed);
|
||||
graph->setColorPalette(JKQTPMathImageBlueGreenRed);
|
||||
// get coordinate axis of color-bar and set its label
|
||||
graph->getColorBarRightAxis()->setAxisLabel("electric potential [V]");
|
||||
// add some levels for the contours. These are chosen to be at the actual potential values
|
||||
|
@ -72,7 +72,7 @@ int main(int argc, char* argv[])
|
||||
graph->setWidth(w);
|
||||
graph->setHeight(h);
|
||||
// color-map is "MATLAB"
|
||||
graph->setPalette(JKQTPMathImageMATLAB);
|
||||
graph->setColorPalette(JKQTPMathImageMATLAB);
|
||||
// get coordinate axis of color-bar and set its label
|
||||
graph->getColorBarRightAxis()->setAxisLabel("light intensity [A.U.]");
|
||||
// determine min/max of data automatically and use it to set the range of the color-scale
|
||||
|
@ -70,7 +70,7 @@ int main(int argc, char* argv[])
|
||||
graph->setWidth(NX);
|
||||
graph->setHeight(NY);
|
||||
// color-map is "MATLAB"
|
||||
graph->setPalette(JKQTPMathImageMATLAB);
|
||||
graph->setColorPalette(JKQTPMathImageMATLAB);
|
||||
// determine min/max of data automatically and use it to set the range of the color-scale
|
||||
graph->setAutoImageRange(true);
|
||||
|
||||
|
@ -60,7 +60,7 @@ int main(int argc, char* argv[])
|
||||
graph->setWidth(w);
|
||||
graph->setHeight(h);
|
||||
// color-map is "BLUEYELLOW"
|
||||
graph->setPalette(JKQTPMathImageBLUEYELLOW);
|
||||
graph->setColorPalette(JKQTPMathImageBLUEYELLOW);
|
||||
// get coordinate axis of color-bar and set its label
|
||||
graph->getColorBarRightAxis()->setAxisLabel("light intensity [A.U.]");
|
||||
// determine min/max of data automatically and use it to set the range of the color-scale
|
||||
|
@ -123,9 +123,9 @@ int main(int argc, char* argv[])
|
||||
graph->setWidth(1);
|
||||
graph->setHeight(1);
|
||||
// color-map is taken from cmbPalette
|
||||
plot->connect(cmbPalette, &JKQTPMathImageColorPaletteComboBox::currentPaletteChanged,[&](JKQTPMathImageColorPalette p) { graph->setPalette(p); plot->redrawPlot(); });
|
||||
graph->setPalette(static_cast<JKQTPMathImageColorPalette>(userpalette_id));
|
||||
cmbPalette->setCurrentColorPalette(graph->getPalette());
|
||||
plot->connect(cmbPalette, &JKQTPMathImageColorPaletteComboBox::currentPaletteChanged,[&](JKQTPMathImageColorPalette p) { graph->setColorPalette(p); plot->redrawPlot(); });
|
||||
graph->setColorPalette(static_cast<JKQTPMathImageColorPalette>(userpalette_id));
|
||||
cmbPalette->setCurrentColorPalette(graph->getColorPalette());
|
||||
|
||||
|
||||
// 4. add the graphs to the plot, so it is actually displayed
|
||||
|
@ -69,7 +69,7 @@ TestWidgetContourPlots::TestWidgetContourPlots(QWidget *parent) :
|
||||
densityplot->setHeight(1.1);
|
||||
densityplot->setNx(histAlexNx);
|
||||
densityplot->setNy(histAlexNy);
|
||||
densityplot->setPalette(JKQTPMathImageINVERTED_OCEAN);
|
||||
densityplot->setColorPalette(JKQTPMathImageINVERTED_OCEAN);
|
||||
densityplot->setImageColumn(colHist2D);
|
||||
densityplot->setInfColor(Qt::transparent);
|
||||
densityplot->setNanColor(Qt::transparent);
|
||||
@ -83,7 +83,7 @@ TestWidgetContourPlots::TestWidgetContourPlots(QWidget *parent) :
|
||||
densityplot->setHeight(1.1);
|
||||
densityplot->setNx(histAlexNx);
|
||||
densityplot->setNy(histAlexNy);
|
||||
densityplot->setPalette(JKQTPMathImageINVERTED_OCEAN);
|
||||
densityplot->setColorPalette(JKQTPMathImageINVERTED_OCEAN);
|
||||
densityplot->setImageColumn(colHist2D);
|
||||
densityplot->setTitle("density plot");
|
||||
plotContour->addGraph(densityplot);
|
||||
|
@ -119,13 +119,13 @@ TestWidgetImages::TestWidgetImages(QWidget *parent) :
|
||||
|
||||
void TestWidgetImages::setImgPalette(int index)
|
||||
{
|
||||
pimg3->setPalette(index);
|
||||
pimg3->setColorPalette(index);
|
||||
plotImg->redrawPlot();
|
||||
}
|
||||
|
||||
void TestWidgetImages::setImgPalette1(int index)
|
||||
{
|
||||
pimg2->setPalette(index);
|
||||
pimg2->setColorPalette(index);
|
||||
plotImg->redrawPlot();
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ int main(int argc, char* argv[])
|
||||
graph2->setXColumn(columnX);
|
||||
graph2->setYColumn(columnY);
|
||||
graph2->setColorColumn(columnR);
|
||||
graph2->setPalette(JKQTPMathImageMATLAB);
|
||||
graph2->setColorPalette(JKQTPMathImageMATLAB);
|
||||
graph2->setSymbolType(JKQTPNoSymbol);
|
||||
graph2->setDrawLine(true);
|
||||
graph2->setTitle("colored spiral");
|
||||
|
@ -89,7 +89,7 @@ int main(int argc, char* argv[])
|
||||
graph2->setXColumn(columnX);
|
||||
graph2->setYColumn(columnY2);
|
||||
graph2->setColorColumn(columnC);
|
||||
graph2->setPalette(JKQTPMathImageRYGB);
|
||||
graph2->setColorPalette(JKQTPMathImageRYGB);
|
||||
graph2->setSymbolType(JKQTPFilledRect);
|
||||
graph2->setDrawLine(true);
|
||||
graph2->setTitle("2: color");
|
||||
@ -129,7 +129,7 @@ int main(int argc, char* argv[])
|
||||
graph5->setYColumn(columnY5);
|
||||
graph5->setColorColumn(columnC);
|
||||
graph5->setSizeColumn(columnS);
|
||||
graph5->setPalette(JKQTPMathImageBLUEYELLOW);
|
||||
graph5->setColorPalette(JKQTPMathImageBLUEYELLOW);
|
||||
graph5->setDrawLine(true);
|
||||
graph5->setTitle("5: color+size");
|
||||
graph5->getColorBarRightAxis()->setAxisLabel("color scale for graph5");
|
||||
@ -157,7 +157,7 @@ int main(int argc, char* argv[])
|
||||
graph7->setLinewidthColumn(columnLW);
|
||||
graph7->setDrawLine(true);
|
||||
graph7->setColorColumn(columnC);
|
||||
graph7->setPalette(JKQTPMathImageBLUEYELLOW);
|
||||
graph7->setColorPalette(JKQTPMathImageBLUEYELLOW);
|
||||
graph7->setSymbolType(JKQTPNoSymbol);
|
||||
graph7->setColorBarRightVisible(false);
|
||||
graph7->setColorBarTopVisible(false);
|
||||
|
@ -55,7 +55,7 @@ int main(int argc, char* argv[])
|
||||
graph1->setSymbolColumn(columnS);
|
||||
graph1->setSymbolType(JKQTPFilledTriangle);
|
||||
graph1->setColorColumn(columnG);
|
||||
graph1->setPalette(JKQTPMathImageOCEAN);
|
||||
graph1->setColorPalette(JKQTPMathImageOCEAN);
|
||||
graph1->setDrawLine(false);
|
||||
graph1->setTitle("");
|
||||
plot.addGraph(graph1);
|
||||
|
@ -511,7 +511,7 @@ void JKQTPXYParametrizedScatterGraph::drawKeyMarker(JKQTPEnhancedPainter &painte
|
||||
} else {
|
||||
QImage img;
|
||||
double colorval[]={0,1};
|
||||
JKQTPImageTools::array2image<double>(colorval, 2, 1, img, getPalette(), double(0.0), double(1.0));
|
||||
JKQTPImageTools::array2image<double>(colorval, 2, 1, img, getColorPalette(), double(0.0), double(1.0));
|
||||
color1=img.pixel(0,0);
|
||||
color2=img.pixel(1,0);
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ QImage JKQTPColorPaletteStyleAndToolsMixin::getPaletteKeyImage(JKQTPMathImageCol
|
||||
}
|
||||
|
||||
|
||||
void JKQTPColorPaletteStyleAndToolsMixin::setPalette(int pal) {
|
||||
void JKQTPColorPaletteStyleAndToolsMixin::setColorPalette(int pal) {
|
||||
palette=static_cast<JKQTPMathImageColorPalette>(pal);
|
||||
}
|
||||
|
||||
@ -331,12 +331,12 @@ void JKQTPColorPaletteStyleAndToolsMixin::cbSetParent(JKQTBasePlotter* parent) {
|
||||
|
||||
}
|
||||
|
||||
void JKQTPColorPaletteStyleAndToolsMixin::setPalette(const JKQTPMathImageColorPalette &__value)
|
||||
void JKQTPColorPaletteStyleAndToolsMixin::setColorPalette(const JKQTPMathImageColorPalette &__value)
|
||||
{
|
||||
this->palette = __value;
|
||||
}
|
||||
|
||||
JKQTPMathImageColorPalette JKQTPColorPaletteStyleAndToolsMixin::getPalette() const
|
||||
JKQTPMathImageColorPalette JKQTPColorPaletteStyleAndToolsMixin::getColorPalette() const
|
||||
{
|
||||
return this->palette;
|
||||
}
|
||||
|
@ -98,11 +98,12 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPColorPaletteStyleAndToolsMixin {
|
||||
|
||||
|
||||
/*! \copydoc palette */
|
||||
void setPalette(int pal);
|
||||
void setColorPalette(int pal);
|
||||
/*! \copydoc palette */
|
||||
void setPalette(const JKQTPMathImageColorPalette & __value);
|
||||
void setColorPalette(const JKQTPMathImageColorPalette & __value);
|
||||
/*! \copydoc palette */
|
||||
JKQTPMathImageColorPalette getPalette() const;
|
||||
JKQTPMathImageColorPalette getColorPalette() const;
|
||||
|
||||
/*! \copydoc rangeMinFailAction */
|
||||
void setRangeMinFailAction(const JKQTPMathImageColorRangeFailAction & __value);
|
||||
/*! \copydoc rangeMinFailAction */
|
||||
|
Loading…
Reference in New Issue
Block a user