Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerNodeWriter.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 Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerNodeWriter_h
22 #define __qSlicerNodeWriter_h
23 
24 // QtCore includes
25 #include "qSlicerBaseQTGUIExport.h"
26 #include "qSlicerFileWriter.h"
27 class qSlicerNodeWriterPrivate;
28 class vtkMRMLNode;
29 
31 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerNodeWriter
32  : public qSlicerFileWriter
33 {
34  Q_OBJECT
36  Q_PROPERTY(bool supportUseCompression READ supportUseCompression WRITE setSupportUseCompression);
37 public:
39  qSlicerNodeWriter(const QString& description,
40  const qSlicerIO::IOFileType& fileType,
41  const QStringList& nodeTags,
42  bool useCompression,
43  QObject* parent);
44 
45  ~qSlicerNodeWriter() override;
46 
47  void setSupportUseCompression(bool useCompression);
48  bool supportUseCompression()const;
49 
50  QString description()const override;
51  IOFileType fileType()const override;
52 
54  bool canWriteObject(vtkObject* object)const override;
55 
59  QStringList extensions(vtkObject* object)const override;
60 
65  bool write(const qSlicerIO::IOProperties& properties) override;
66 
67  virtual vtkMRMLNode* getNodeByID(const char *id)const;
68 
70  qSlicerIOOptions* options()const override;
71 
72 protected:
73  void setNodeClassNames(const QStringList& nodeClassNames);
74  QStringList nodeClassNames()const;
75 
76 protected:
77  QScopedPointer<qSlicerNodeWriterPrivate> d_ptr;
78 
79 private:
80  Q_DECLARE_PRIVATE(qSlicerNodeWriter);
81  Q_DISABLE_COPY(qSlicerNodeWriter);
82 };
83 
84 #endif
virtual QStringList extensions(vtkObject *object) const =0
virtual QString description() const =0
Unique name of the reader/writer.
Utility class that is ready to use for most of the nodes.
QScopedPointer< qSlicerNodeWriterPrivate > d_ptr
virtual bool write(const qSlicerIO::IOProperties &properties)
virtual IOFileType fileType() const =0
Multiple readers can share the same file type.
virtual qSlicerIOOptions * options() const
QObject Superclass
Definition: qSlicerIO.h:48
QString IOFileType
Definition: qSlicerIO.h:52
virtual bool canWriteObject(vtkObject *object) const
Return true if the object is handled by the writer.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167