improved problems with adjacent (to prism layer) boundaries
[engrid-github.git] / src / libengrid / iooperation.h
blob7f75b314b5ba7987fa66bf632199213998a1ae3c
1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // + +
3 // + This file is part of enGrid. +
4 // + +
5 // + Copyright 2008-2014 enGits GmbH +
6 // + +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
11 // + +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
16 // + +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
19 // + +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 #ifndef iooperation_H
22 #define iooperation_H
24 class IOOperation;
26 #include "operation.h"
27 // #include "guimainwindow.h"
29 #include <QString>
30 #include <QFile>
31 #include <QTextStream>
32 #include <QFileInfo>
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 bool m_Valid; ///< flag to determine if a valid file has been selected
48 QString m_FileName; ///< file name to read -- normally set by inputReadFileName()
49 char m_FileName_cc[1024]; ///< "const char *" copy version of file name to read -- only used by getCFileName()
50 QString m_FormatTxt; ///< file format string (e.g. *.stl, *.vtu, ...)
51 QString m_ExtensionTxt; ///< file extension for write operations
52 bool m_FileNameSet; ///< has the file name been set already (batch operation)?
54 protected: // methods
56 /**
57 * Set the file format string for this Reader.
58 * @param format the file name extension (e.g. *.stl, *.vtu, ...)
60 void setFormat(QString format);
62 /**
63 * Set the file extension string for write operations.
64 * @param extension the file name extension (e.g. *.stl, *.vtu, ...)
66 void setExtension(QString format);
68 /**
69 * Get a standard C string representing the file name.
70 * @return the file name
72 const char* getCFileName();
74 /**
75 * Get the file name.
76 * @return the file name (as QString)
78 QString getFileName();
80 /**
81 * Access to the valid flag (true if a valid file name has been selected)
82 * @return the valid flag
84 bool isValid();
86 public: // methods
88 IOOperation();
89 virtual ~IOOperation() {}
91 void readInputFileName(QString default_filename, bool reset = true); ///< Open a QFileDialog and make the user input a file name for opening or importing.
92 void readOutputFileName(QString default_filename); ///< Open a QFileDialog and make the user input a file name for saving or exporting.
93 void readOutputDirectory(); ///< Open a QFileDialog and make the user input a directory name for exporting.
94 void readInputDirectory(QString title_txt = "select input directory"); ///< Open a QFileDialog and make the user input a directory name for importing.
95 void setFileName(QString file_name); ///< set the file name for batch operation
99 #endif