Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerScriptedFileWriter.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerScriptedFileWriter_h
22 #define __qSlicerScriptedFileWriter_h
23 
24 // SlicerQt includes
25 #include "qSlicerFileWriter.h"
26 #include "qSlicerBaseQTCoreExport.h"
27 
28 // Forward Declare PyObject*
29 #ifndef PyObject_HEAD
30 struct _object;
31 typedef _object PyObject;
32 #endif
33 class qSlicerScriptedFileWriterPrivate;
34 
35 class Q_SLICER_BASE_QTCORE_EXPORT qSlicerScriptedFileWriter
36  : public qSlicerFileWriter
37 {
38  Q_OBJECT
39 
40 public:
42  qSlicerScriptedFileWriter(QObject* parent = 0);
43  virtual ~qSlicerScriptedFileWriter();
44 
45  QString pythonSource()const;
46 
48  bool setPythonSource(const QString& newPythonSource, const QString& className = QLatin1String(""));
49 
51  Q_INVOKABLE PyObject* self() const;
52 
55  virtual QString description()const;
56 
59  virtual IOFileType fileType()const;
60 
63  virtual bool canWriteObject(vtkObject* object)const;
64 
67  virtual QStringList extensions(vtkObject* object)const;
68 
71  virtual bool write(const qSlicerIO::IOProperties& properties);
72 
73 protected:
74  QScopedPointer<qSlicerScriptedFileWriterPrivate> d_ptr;
75 
76 private:
77  Q_DECLARE_PRIVATE(qSlicerScriptedFileWriter);
78  Q_DISABLE_COPY(qSlicerScriptedFileWriter);
79 };
80 
81 #endif
virtual QStringList extensions(vtkObject *object) const =0
virtual QString description() const =0
Unique name of the reader/writer.
virtual bool write(const qSlicerIO::IOProperties &properties)
virtual IOFileType fileType() const =0
Multiple readers can share the same file type.
QScopedPointer< qSlicerScriptedFileWriterPrivate > d_ptr
QString IOFileType
Definition: qSlicerIO.h:50
virtual bool canWriteObject(vtkObject *object) const
Return true if the object is handled by the writer.
_object PyObject