cctw  0.2.1
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CctwqtSetupImportDialog Class Reference

#include <cctwqtsetupimportdialog.h>

Inheritance diagram for CctwqtSetupImportDialog:
Inheritance graph
Collaboration diagram for CctwqtSetupImportDialog:
Collaboration graph

Public Slots

void accept ()
 
void doAppendImages ()
 
void doClearImages ()
 
void doBrowseDirectory ()
 
void doBrowseDirectoryChanged (int n)
 
void doBrowseDark ()
 
void doClearDark ()
 
void doMatchImages ()
 
void doBrowseOutput ()
 

Public Member Functions

 CctwqtSetupImportDialog (CctwqtMainWindow *parent, CctwImporter *data)
 
 ~CctwqtSetupImportDialog ()
 

Private Member Functions

QString currentDirectory ()
 
void setCurrentDirectory (QString dir)
 
void appendDirectoryPaths (QString dir)
 

Private Attributes

Ui::CctwqtSetupImportDialog * ui
 
CctwqtMainWindowm_Window
 
CctwImporterm_Data
 

Detailed Description

Definition at line 13 of file cctwqtsetupimportdialog.h.

Constructor & Destructor Documentation

CctwqtSetupImportDialog::CctwqtSetupImportDialog ( CctwqtMainWindow parent,
CctwImporter data 
)
explicit

Definition at line 7 of file cctwqtsetupimportdialog.cpp.

References doAppendImages(), doBrowseDark(), doBrowseDirectory(), doBrowseOutput(), doClearDark(), doClearImages(), doMatchImages(), m_Data, setCurrentDirectory(), and ui.

7  :
8  QDialog(parent),
9  ui(new Ui::CctwqtSetupImportDialog),
10  m_Window(parent),
11  m_Data(data)
12 {
13  ui->setupUi(this);
14 
15  setAttribute(Qt::WA_DeleteOnClose);
16 
17  connect(ui->m_AppendImages, SIGNAL(clicked()), this, SLOT(doAppendImages()));
18  connect(ui->m_ClearImages, SIGNAL(clicked()), this, SLOT(doClearImages()));
19  connect(ui->m_DataDirectoryBrowse, SIGNAL(clicked()), this, SLOT(doBrowseDirectory()));
20  connect(ui->m_MatchImages, SIGNAL(clicked()), this, SLOT(doMatchImages()));
21  connect(ui->m_DarkImageBrowse, SIGNAL(clicked()), this, SLOT(doBrowseDark()));
22  connect(ui->m_ClearDark, SIGNAL(clicked()), this, SLOT(doClearDark()));
23  connect(ui->m_OutputFileBrowse, SIGNAL(clicked()), this, SLOT(doBrowseOutput()));
24 
25  if (m_Data) {
26  ui->m_DarkImagePath->setText(m_Data->get_DarkImagePath());
27  setCurrentDirectory(m_Data->get_ImageDirectory());
28  ui->m_DataImages->addItems(m_Data->get_ImagePaths());
29  ui->m_DataPattern->setText(m_Data->get_ImagePattern());
30  ui->m_OutputPath->setText(m_Data->get_OutputPath());
31  ui->m_OutputDataset->setText(m_Data->get_OutputDataset());
32 
33  ui->m_InputImageBuffering->setValue(m_Data->get_InputDataBuffering());
34  ui->m_OutputChunkX->setValue(m_Data->get_ChunkSize().x());
35  ui->m_OutputChunkY->setValue(m_Data->get_ChunkSize().y());
36  ui->m_OutputChunkZ->setValue(m_Data->get_ChunkSize().z());
37  ui->m_OutputCompression->setValue(m_Data->get_Compression());
38  }
39 }
Ui::CctwqtSetupImportDialog * ui
CctwqtSetupImportDialog::~CctwqtSetupImportDialog ( )

Definition at line 41 of file cctwqtsetupimportdialog.cpp.

References ui.

42 {
43  delete ui;
44 }
Ui::CctwqtSetupImportDialog * ui

Member Function Documentation

void CctwqtSetupImportDialog::accept ( )
slot

Definition at line 46 of file cctwqtsetupimportdialog.cpp.

References currentDirectory(), m_Data, and ui.

47 {
48  if (m_Data) {
49  m_Data->set_DarkImagePath(ui->m_DarkImagePath->text());
50  m_Data->set_ImageDirectory(currentDirectory());
51 
52  QStringList res;
53 
54  int ct = ui->m_DataImages->count();
55 
56  for (int i=0; i<ct; i++) {
57  QListWidgetItem *item = ui->m_DataImages->item(i);
58 
59  if (item) {
60  res.append(item->text());
61  }
62  }
63 
64  m_Data->set_ImagePaths(res);
65  m_Data->set_ImagePattern(ui->m_DataPattern->text());
66  m_Data->set_OutputPath(ui->m_OutputPath->text());
67  m_Data->set_OutputDataset(ui->m_OutputDataset->text());
68 
69  m_Data->set_InputDataBuffering(ui->m_InputImageBuffering->value());
70  m_Data->set_ChunkSize(CctwIntVector3D(ui->m_OutputChunkX->value(),
71  ui->m_OutputChunkY->value(),
72  ui->m_OutputChunkZ->value()));
73 
74  m_Data->set_Compression(ui->m_OutputCompression->value());
75  }
76 
77  QDialog::accept();
78 }
Ui::CctwqtSetupImportDialog * ui
CctwVector3D< int > CctwIntVector3D
Definition: cctwvector3d.h:70
void CctwqtSetupImportDialog::appendDirectoryPaths ( QString  dir)
private

Definition at line 148 of file cctwqtsetupimportdialog.cpp.

References ui.

Referenced by setCurrentDirectory().

149 {
150 // printf("Append directory path %s\n", qPrintable(dir));
151 
152  if (dir.length() > 0) {
153  QDir d(dir);
154  QString p1 = d.absolutePath();
155 
156  if (d.cd("..")) {
157  QString p = d.absolutePath();
158 
159  if ((p.length() > 0) && (p != p1)) {
161  }
162  }
163 
164  ui->m_DataDirectory->addItem(p1);
165  }
166 }
Ui::CctwqtSetupImportDialog * ui
QString CctwqtSetupImportDialog::currentDirectory ( )
private

Definition at line 143 of file cctwqtsetupimportdialog.cpp.

References ui.

Referenced by accept(), doAppendImages(), doBrowseDirectory(), and doMatchImages().

144 {
145  return ui->m_DataDirectory->currentText();
146 }
Ui::CctwqtSetupImportDialog * ui
void CctwqtSetupImportDialog::doAppendImages ( )
slot

Definition at line 80 of file cctwqtsetupimportdialog.cpp.

References currentDirectory(), and ui.

Referenced by CctwqtSetupImportDialog().

81 {
82  QStringList paths = QFileDialog::getOpenFileNames(this, "Additional images...",
84 
85  ui->m_DataImages->addItems(paths);
86 }
Ui::CctwqtSetupImportDialog * ui
void CctwqtSetupImportDialog::doBrowseDark ( )
slot

Definition at line 103 of file cctwqtsetupimportdialog.cpp.

References ui.

Referenced by CctwqtSetupImportDialog().

104 {
105  QString path = QFileDialog::getOpenFileName(this, "Dark Image",
106  ui->m_DarkImagePath->text());
107 
108  if (path.length() > 0) {
109  ui->m_DarkImagePath->setText(path);
110  }
111 }
Ui::CctwqtSetupImportDialog * ui
void CctwqtSetupImportDialog::doBrowseDirectory ( )
slot

Definition at line 93 of file cctwqtsetupimportdialog.cpp.

References currentDirectory(), and setCurrentDirectory().

Referenced by CctwqtSetupImportDialog().

94 {
95  QString path = QFileDialog::getExistingDirectory(this, "Image Directory",
97 
98  if (path.length() > 0) {
99  setCurrentDirectory(path);
100  }
101 }
void CctwqtSetupImportDialog::doBrowseDirectoryChanged ( int  n)
slot

Definition at line 183 of file cctwqtsetupimportdialog.cpp.

References setCurrentDirectory(), and ui.

184 {
185  setCurrentDirectory(ui->m_DataDirectory->itemText(n));
186 }
Ui::CctwqtSetupImportDialog * ui
void CctwqtSetupImportDialog::doBrowseOutput ( )
slot

Definition at line 118 of file cctwqtsetupimportdialog.cpp.

References ui.

Referenced by CctwqtSetupImportDialog().

119 {
120  QString path = QFileDialog::getSaveFileName(this, "Output File",
121  ui->m_OutputPath->text());
122 
123  if (path.length() > 0) {
124  ui->m_OutputPath->setText(path);
125  }
126 }
Ui::CctwqtSetupImportDialog * ui
void CctwqtSetupImportDialog::doClearDark ( )
slot

Definition at line 113 of file cctwqtsetupimportdialog.cpp.

References ui.

Referenced by CctwqtSetupImportDialog().

114 {
115  ui->m_DarkImagePath->setText("");
116 }
Ui::CctwqtSetupImportDialog * ui
void CctwqtSetupImportDialog::doClearImages ( )
slot

Definition at line 88 of file cctwqtsetupimportdialog.cpp.

References ui.

Referenced by CctwqtSetupImportDialog().

89 {
90  ui->m_DataImages->clear();
91 }
Ui::CctwqtSetupImportDialog * ui
void CctwqtSetupImportDialog::doMatchImages ( )
slot

Definition at line 128 of file cctwqtsetupimportdialog.cpp.

References currentDirectory(), and ui.

Referenced by CctwqtSetupImportDialog().

129 {
130  QString patt = ui->m_DataPattern->text();
131 
132  QDir d(currentDirectory());
133  d.setFilter(QDir::Files);
134 
135  QStringList patts(patt);
136  d.setNameFilters(patts);
137 
138  QStringList newFiles = d.entryList();
139 
140  ui->m_DataImages->addItems(newFiles);
141 }
Ui::CctwqtSetupImportDialog * ui
void CctwqtSetupImportDialog::setCurrentDirectory ( QString  dir)
private

Definition at line 168 of file cctwqtsetupimportdialog.cpp.

References appendDirectoryPaths(), and ui.

Referenced by CctwqtSetupImportDialog(), doBrowseDirectory(), and doBrowseDirectoryChanged().

169 {
170 // disconnect(ui->m_DataDirectory, SIGNAL(currentIndexChanged(int)), this, SLOT(doBrowseDirectoryChanged(int)));
171 // bool t = ui->m_DataDirectory->blockSignals(true);
172 
173  ui->m_DataDirectory->clear();
174 
176 
177 // ui->m_DataDirectory->blockSignals(t);
178 
179 // connect(ui->m_DataDirectory, SIGNAL(currentIndexChanged(int)), this, SLOT(doBrowseDirectoryChanged(int)));
180  ui->m_DataDirectory->setCurrentIndex(ui->m_DataDirectory->count()-1);
181 }
Ui::CctwqtSetupImportDialog * ui

Member Data Documentation

CctwImporter* CctwqtSetupImportDialog::m_Data
private

Definition at line 40 of file cctwqtsetupimportdialog.h.

Referenced by accept(), and CctwqtSetupImportDialog().

CctwqtMainWindow* CctwqtSetupImportDialog::m_Window
private

Definition at line 39 of file cctwqtsetupimportdialog.h.

Ui::CctwqtSetupImportDialog* CctwqtSetupImportDialog::ui
private

The documentation for this class was generated from the following files: