From a9236429e5691159f1ddc017b28ee0c060e0092d Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Sun, 17 Jan 2016 16:09:51 +0100 Subject: Added a options panel. * Added screenshot action that saves two images: one of the main view (plot + splat) and one of the bottom view (bar chart) * Added methods/signals/slots to Scatterplot for handling glyph sizes * Added methods/signals/slots to VoronoiSplat for handling the alpha/beta parameters, which are now also no longer fixed * Options panel: - glyph sizes of both CPs and RPs - splat opacity - splat parameters (alpha & beta) - color scale combo box currently does nothing --- main.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index b79f6ff..402ecef 100644 --- a/main.cpp +++ b/main.cpp @@ -78,6 +78,8 @@ int main(int argc, char **argv) // cpIndices = relevanceSampling(X, cpSize); cpIndices = arma::randi(cpSize, arma::distr_param(0, n-1)); } + + arma::sort(cpIndices); } if (parser.isSet(cpFileOutputOption)) { const QString &cpFilename = parser.value(cpFileOutputOption); @@ -115,22 +117,22 @@ int main(int argc, char **argv) QQmlApplicationEngine engine(QUrl("qrc:///main_view.qml")); - ColorScale colorScale{ - QColor("#1f77b4"), - QColor("#ff7f0e"), - QColor("#2ca02c"), - QColor("#d62728"), - QColor("#9467bd"), - QColor("#8c564b"), - QColor("#e377c2"), - QColor("#17becf"), - QColor("#7f7f7f"), - }; - colorScale.setExtents(labels.min(), labels.max()); - - //ContinuousColorScale colorScale = ContinuousColorScale::builtin(ContinuousColorScale::RED_GRAY_BLUE); + //ColorScale colorScale{ + // QColor("#1f77b4"), + // QColor("#ff7f0e"), + // QColor("#2ca02c"), + // QColor("#d62728"), + // QColor("#9467bd"), + // QColor("#8c564b"), + // QColor("#e377c2"), + // QColor("#17becf"), + // QColor("#7f7f7f"), + //}; //colorScale.setExtents(labels.min(), labels.max()); + ContinuousColorScale colorScale = ContinuousColorScale::builtin(ContinuousColorScale::RAINBOW); + colorScale.setExtents(labels.min(), labels.max()); + Scatterplot *cpPlot = engine.rootObjects()[0]->findChild("cpPlot"); cpPlot->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton); // cpPlot->setColorData(arma::zeros(cpSize)); @@ -177,13 +179,13 @@ int main(int argc, char **argv) cpPlot, SLOT(setScale(const LinearScale &, const LinearScale &))); BarChart *barChart = engine.rootObjects()[0]->findChild("barChart"); - barChart->setValues(arma::randn(100)); + barChart->setValues(labels); //history->addHistoryItem(Ys); colormap->setColorScale(colorScale); plot->setColorScale(&colorScale); plot->setColorData(labels, false); - //splat->setColormap(colorScale); + splat->setColorScale(colorScale); splat->setValues(labels); cpPlot->setAutoScale(false); -- cgit v1.2.3