21#ifndef __qSlicerNodeWriter_h
22#define __qSlicerNodeWriter_h
25#include "qSlicerBaseQTGUIExport.h"
53 vtkNew<vtkMRMLNodeWriter> writer;
55 writer->SetFileType(
fileType.toStdString());
58 this->setFileWriter(writer);
87 vtkNew<vtkMRMLIOProperties> vtkProperties;
92 return writer->
Write(vtkProperties);
95 return writer->
WriteNode(node, vtkProperties);
111 vtkNew<vtkMRMLNodeWriter> writer;
118 std::vector<std::string> classNames;
121 classNames.push_back(className.toStdString());
123 this->
nodeWriter()->SetNodeClassNames(classNames);
127 QStringList classNames;
128 for (
const std::string& className : this->
nodeWriter()->GetNodeClassNames())
130 classNames << QString::fromStdString(className);
static void toVTKProperties(const IOProperties &properties, vtkMRMLIOProperties *vtkProperties)
qSlicerNodeWriter(QObject *parent)
vtkMRMLNodeWriter * nodeWriter() const
VTK-based writer that performs all tasks.
virtual vtkMRMLNode * getNodeByID(const char *id) const
void setSupportUseCompression(bool support)
bool write(const qSlicerIO::IOProperties &properties) override
bool supportUseCompression() const
bool supportUseCompression
Some storage nodes don't support the compression option.
qSlicerVTKFileWriter Superclass
QStringList nodeClassNames() const
qSlicerIOOptions * options() const override
Options widget (for writers that call this method from their options() implementation).
void setNodeClassNames(const QStringList &nodeClassNames)
qSlicerNodeWriter(const QString &description, const qSlicerIO::IOFileType &fileType, const QStringList &nodeClassNames, bool supportUseCompression, QObject *parent)
vtkMRMLScene * mrmlScene() const
Return a pointer on the MRML scene.
QString description() const override
Unique name of the reader/writer.
double canWriteObjectConfidence(vtkObject *object) const override
qSlicerVTKFileWriter(vtkMRMLFileWriter *writer, QObject *parent=nullptr)
Q_INVOKABLE vtkMRMLFileWriter * fileWriter() const
VTK-based writer that performs all the tasks of this class.
IOFileType fileType() const override
Multiple readers can share the same file type.
void setFileWriter(vtkMRMLFileWriter *writer)
virtual void SetScene(vtkMRMLScene *scene)
Where the nodes go, and where messages for the user are collected.
virtual double CanWriteObjectConfidence(vtkObject *object)
void ClearWrittenNodeIDs()
virtual vtkMRMLNode * GetNodeByID(const std::string &id)
Get node from the scene by node ID.
bool Write(vtkMRMLIOProperties *properties) override
bool WriteNode(vtkMRMLStorableNode *node, vtkMRMLIOProperties *properties)
static vtkMRMLNodeWriter * SafeDownCast(vtkObject *o)
Abstract Superclass for all specific types of MRML nodes.
virtual char * GetID()
ID use by other nodes to reference this node in XML.
MRML node to represent a 3D surface model.
static vtkMRMLStorableNode * SafeDownCast(vtkObject *o)