2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008,2009 Oliver Gloth +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28 #include "operation.h"
32 #include <QTextStream>
34 #include <vtkLongArray.h>
35 #include <vtkIntArray.h>
36 #include <vtkDoubleArray.h>
37 #include <vtkPointData.h>
38 #include <vtkCellData.h>
42 class IOOperation
: public Operation
45 private: // attributes
47 /** flag to determine if a valid file has been selected */
50 /** the file name to read -- normally set by inputReadFileName() */
53 /** the file format string (e.g. *.stl, *.vtu, ...) */
56 /** the file extension for write operations */
57 QString extension_txt
;
62 * Set the file format string for this Reader.
63 * @param format the file name extension (e.g. *.stl, *.vtu, ...)
65 void setFormat(QString format
);
68 * Set the file extension string for write operations.
69 * @param extension the file name extension (e.g. *.stl, *.vtu, ...)
71 void setExtension(QString format
);
74 * Get a standard C string representing the file name.
75 * @return the file name
81 * @return the file name (as QString)
83 QString
getFileName();
86 * Access to the valid flag (true if a valid file name has been selected)
87 * @return the valid flag
93 virtual ~IOOperation() {};
95 /// Open a QFileDialog and make the user input a file name for opening or importing. */
96 void readInputFileName();
98 /// Open a QFileDialog and make the user input a file name for saving or exporting. */
99 void readOutputFileName();
101 /// Open a QFileDialog and make the user input a directory name for exporting. */
102 void readOutputDirectory();