added icon for OpenFOAM export
[engrid.git] / iooperation.h
blobfecc77a303bd059fd87d9d7ee9efb53aa3d3d8f9
1 //
2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + +
4 // + This file is part of enGrid. +
5 // + +
6 // + Copyright 2008,2009 Oliver Gloth +
7 // + +
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. +
12 // + +
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. +
17 // + +
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/>. +
20 // + +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #ifndef iooperation_H
24 #define iooperation_H
26 class IOOperation;
28 #include "operation.h"
30 #include <QString>
31 #include <QFile>
32 #include <QTextStream>
34 #include <vtkLongArray.h>
35 #include <vtkIntArray.h>
36 #include <vtkDoubleArray.h>
37 #include <vtkPointData.h>
38 #include <vtkCellData.h>
40 #include <vector>
42 class IOOperation : public Operation
45 private: // attributes
47 /** flag to determine if a valid file has been selected */
48 bool valid;
50 /** the file name to read -- normally set by inputReadFileName() */
51 QString filename;
53 /** the file format string (e.g. *.stl, *.vtu, ...) */
54 QString format_txt;
56 /** the file extension for write operations */
57 QString extension_txt;
59 protected: // methods
61 /**
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);
67 /**
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);
73 /**
74 * Get a standard C string representing the file name.
75 * @return the file name
77 char* getCFileName();
79 /**
80 * Get the file name.
81 * @return the file name (as QString)
83 QString getFileName();
85 /**
86 * Access to the valid flag (true if a valid file name has been selected)
87 * @return the valid flag
89 bool isValid();
91 public: // methods
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();
106 #endif