cctw  0.2.1
cctwqtsetupoutputdialog.cpp
Go to the documentation of this file.
2 #include "ui_cctwqtsetupoutputdialog.h"
3 #include "cctwqtmainwindow.h"
4 #include <QFileDialog>
5 #include "cctwapplication.h"
6 
8  QDialog(parent),
10  m_Window(parent),
11  m_Data(data)
12 {
13  ui->setupUi(this);
14 
15  setAttribute(Qt::WA_DeleteOnClose);
16 
17  connect(ui->m_BrowseOutputFileName, SIGNAL(clicked()), this, SLOT(doBrowseOutputFile()));
18 
19  if(m_Data) {
20  ui->m_OutputFileName->setText(m_Data->get_DataFileName());
21  ui->m_OutputDatasetName->setText(m_Data->get_DataSetName());
22  ui->m_OutputCompression->setValue(m_Data->get_Compression());
23 
25 
26  ui->m_OutputDimensionsX->setValue(dims.x());
27  ui->m_OutputDimensionsY->setValue(dims.y());
28  ui->m_OutputDimensionsZ->setValue(dims.z());
29 
31 
32  ui->m_OutputChunkX->setValue(cksz.x());
33  ui->m_OutputChunkY->setValue(cksz.y());
34  ui->m_OutputChunkZ->setValue(cksz.z());
35 
36  CctwIntVector3D hcksz = m_Data->get_HDFChunkSize();
37 
38  ui->m_HDFOutputChunkX->setValue(hcksz.x());
39  ui->m_HDFOutputChunkY->setValue(hcksz.y());
40  ui->m_HDFOutputChunkZ->setValue(hcksz.z());
41 
43 
44  if (xform) {
45  ui->m_OversampleX->setValue(xform->get_OversampleX());
46  ui->m_OversampleY->setValue(xform->get_OversampleY());
47  ui->m_OversampleZ->setValue(xform->get_OversampleZ());
48  }
49  }
50 }
51 
53 {
54  delete ui;
55 }
56 
58 {
59  if (m_Data) {
60  CctwIntVector3D dims(ui->m_OutputDimensionsX->value(),
61  ui->m_OutputDimensionsY->value(),
62  ui->m_OutputDimensionsZ->value());
63 
64  CctwIntVector3D cksz(ui->m_OutputChunkX->value(),
65  ui->m_OutputChunkY->value(),
66  ui->m_OutputChunkZ->value());
67 
68  CctwIntVector3D hcksz(ui->m_HDFOutputChunkX->value(),
69  ui->m_HDFOutputChunkY->value(),
70  ui->m_HDFOutputChunkZ->value());
71 
72  m_Data->setDimensions(dims);
73  m_Data->setChunkSize(cksz);
74  m_Data->set_Compression(ui->m_OutputCompression->value());
75 
76  m_Data->set_DataFileName(ui->m_OutputFileName->text());
77  m_Data->set_DataSetName(ui->m_OutputDatasetName->text());
78 
79  m_Data->set_HDFChunkSize(hcksz);
80 
82 
83  if (xform) {
84  xform->set_OversampleX(ui->m_OversampleX->value());
85  xform->set_OversampleY(ui->m_OversampleY->value());
86  xform->set_OversampleZ(ui->m_OversampleZ->value());
87  }
88  }
89 
90  QDialog::accept();
91 }
92 
94 {
95  if (m_Window) {
96  QString path = QFileDialog::getSaveFileName(this, "Output File",
97  ui->m_OutputFileName->text());
98 
99  if (path.length() > 0) {
100  ui->m_OutputFileName->setText(path);
101  }
102  }
103 }
Ui::CctwqtSetupOutputDialog * ui
void setDimensions(CctwIntVector3D dim)
CctwIntVector3D dimensions
CctwTransformer * m_Transformer
T x() const
Definition: cctwvector3d.h:17
void setChunkSize(CctwIntVector3D cksz)
CctwApplication * cctwApplication()
T z() const
Definition: cctwvector3d.h:19
CctwIntVector3D chunkSize
CctwqtSetupOutputDialog(CctwqtMainWindow *parent, CctwChunkedData *data)
T y() const
Definition: cctwvector3d.h:18