21 #include "ui_mapdialog.h" 29 data_keys_ = data_keys;
30 main_window_ = parent;
32 if (data_keys_.size() > 3 || data_keys_.size() < 2 || !workspace_->Mappable(data_keys)){
33 QMessageBox::warning(
this,
"Cannot map this object",
"Object is not mappable");
41 col_count = workspace_->GetMatrix(data_keys_).n_cols;
48 dataset_ = workspace_->data_model()->GetDataset(data_keys_[0]);
54 ui->columnSpinBox->setRange(1, col_count);
55 ui->nameLineEdit->setText(data_keys_.last());
56 uword unique_ct = vec(unique(workspace_->GetMatrix(data_keys_).col(0))).n_elem;
57 QStringList color_list = workspace_->GradientNames(unique_ct < 10);
58 ui->gradientComboBox->addItems(color_list);
66 void MapDialog::on_buttonBox_accepted()
68 uword unique_ct = vec(unique(workspace_->GetMatrix(data_keys_).col(0))).n_elem;
69 uint column_index = ui->columnSpinBox->value() - 1;
70 QString map_name = ui->nameLineEdit->text();
74 data = workspace_->data_model()->GetMatrix(data_keys_).col(column_index);
81 QCPColorGradient gradient = workspace_->GetGradient(ui->gradientComboBox->currentText(), unique_ct);
84 if (data_keys_.size() == 2)
85 dataset_->CreateMap(map_name,
90 dataset_->CreateMap(map_name,
102 void MapDialog::on_columnSpinBox_valueChanged(
int arg1)
107 data = workspace_->data_model()->GetMatrix(data_keys_).col(arg1-1);
114 vec unique_values = unique(data);
115 QStringList color_list = workspace_->GradientNames(unique_values.n_rows < 10);
116 ui->gradientComboBox->clear();
117 ui->gradientComboBox->addItems(color_list);
MapDialog(MainWindow *parent, QStringList data_keys, QSharedPointer< VespucciWorkspace > ws)
void DisplayExceptionWarning(std::exception e)
MainWindow::DisplayExceptionWarning.
Defines a color gradient for use with e.g. QCPColorMap.
The MainWindow class The main window of the program, this is where the user performs most operations...