8 #include <ui_saveAsciiFileDlg.h>
22 : QDialog(parent), m_ui(new Ui_AsciiSaveDialog), m_autoShow(true) {
25 connect(
m_ui->buttonBox, &QDialogButtonBox::accepted,
this,
36 return m_ui->columnsHeaderCheckBox->isChecked();
40 m_ui->columnsHeaderCheckBox->setChecked(state);
44 return m_ui->pointCountHeaderCheckBox->isChecked();
48 m_ui->pointCountHeaderCheckBox->setChecked(state);
52 m_ui->saveFloatColorsCheckBox->setChecked(state);
56 return m_ui->saveFloatColorsCheckBox->isChecked();
60 m_ui->saveAlphaChannelCheckBox->setChecked(state);
64 return m_ui->saveAlphaChannelCheckBox->isChecked();
68 switch (
m_ui->separatorComboBox->currentIndex()) {
85 m_ui->separatorComboBox->setCurrentIndex(index);
89 return m_ui->separatorComboBox->currentIndex();
93 return m_ui->coordsPrecisionSpinBox->value();
97 m_ui->coordsPrecisionSpinBox->setValue(prec);
101 return m_ui->sfPrecisionSpinBox->value();
105 m_ui->sfPrecisionSpinBox->setValue(prec);
109 return m_ui->orderComboBox->currentIndex() == 1;
113 m_ui->orderComboBox->setCurrentIndex(state ? 1 : 0);
118 settings.beginGroup(
"AsciiSaveDialog");
122 settings.value(
"saveHeader",
123 m_ui->columnsHeaderCheckBox->isChecked())
126 settings.value(
"savePtsHeader",
127 m_ui->pointCountHeaderCheckBox->isChecked())
130 m_ui->coordsPrecisionSpinBox->value())
133 settings.value(
"sfPrecision",
m_ui->sfPrecisionSpinBox->value())
136 settings.value(
"separator",
m_ui->separatorComboBox->currentIndex())
139 settings.value(
"saveOrder",
m_ui->orderComboBox->currentIndex())
142 settings.value(
"saveFloatColors",
143 m_ui->saveFloatColorsCheckBox->isChecked())
146 settings.value(
"saveAlphaChannel",
147 m_ui->saveAlphaChannelCheckBox->isChecked())
151 m_ui->columnsHeaderCheckBox->setChecked(saveColHeader);
152 m_ui->pointCountHeaderCheckBox->setChecked(savePtsHeader);
155 m_ui->separatorComboBox->setCurrentIndex(separatorIndex);
156 m_ui->orderComboBox->setCurrentIndex(orderIndex);
165 settings.beginGroup(
"AsciiSaveDialog");
168 settings.setValue(
"saveHeader",
m_ui->columnsHeaderCheckBox->isChecked());
169 settings.setValue(
"savePtsHeader",
170 m_ui->pointCountHeaderCheckBox->isChecked());
171 settings.setValue(
"coordsPrecision",
m_ui->coordsPrecisionSpinBox->value());
172 settings.setValue(
"sfPrecision",
m_ui->sfPrecisionSpinBox->value());
173 settings.setValue(
"separator",
m_ui->separatorComboBox->currentIndex());
174 settings.setValue(
"saveOrder",
m_ui->orderComboBox->currentIndex());
175 settings.setValue(
"saveFloatColors",
176 m_ui->saveFloatColorsCheckBox->isChecked());
177 settings.setValue(
"saveAlphaChannel",
178 m_ui->saveAlphaChannelCheckBox->isChecked());
void enableSaveColumnsNamesHeader(bool state)
Sets whether columns names should be be saved in header.
void acceptAndSaveSettings()
Saves dialog state to persistent settings.
virtual ~AsciiSaveDlg()
Destructor.
void setSaveAlphaChannel(bool state)
Sets whether to save the alpha (transparency) channel.
int sfPrecision() const
Returns SF precision.
bool saveAlphaChannel() const
Returns whether to save the alpha (transparency) channel.
unsigned char getSeparator() const
Returns separator.
void setSeparatorIndex(int index)
Set separator (index)
bool savePointCountHeader() const
Returns whether the number of points should be saved in header.
bool saveColumnsNamesHeader() const
Returns whether columns names should be be saved in header.
void initFromPersistentSettings()
Inits dialog state from persistent settings.
void setCoordsPrecision(int prec)
Sets coordinates precision.
void enableSavePointCountHeader(bool state)
Sets whether the number of points should be saved in header.
int getSeparatorIndex() const
Returns separator index.
int coordsPrecision() const
Returns coordinates precision.
Ui_AsciiSaveDialog * m_ui
Associated UI.
void setSfPrecision(int prec)
Sets SF precision.
bool swapColorAndSF() const
Returns whether SF(s) and color should be swapped.
void setSaveFloatColors(bool state)
Sets whether to save colors as float values (instead of unsigned bytes)
void enableSwapColorAndSF(bool state)
Sets whether SF(s) and color should be swapped.
AsciiSaveDlg(QWidget *parent=nullptr)
Default constructor.
bool saveFloatColors() const