VTK  9.7.20261008
vtkXMLCompositeDataWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) Kitware, Inc.
3// SPDX-License-Identifier: BSD-3-Clause
14
15#ifndef vtkXMLCompositeDataWriter_h
16#define vtkXMLCompositeDataWriter_h
17
18#include "vtkIOXMLModule.h" // For export macro
19#include "vtkStdString.h" // needed for vtkStdString.
20#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21#include "vtkXMLWriter.h"
22
23VTK_ABI_NAMESPACE_BEGIN
27class vtkXMLCompositeDataWriterInternals;
28
30{
31public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
38 const char* GetDefaultFileExtension() override;
39
43
45
48 vtkGetMacro(GhostLevel, int);
49 vtkSetMacro(GhostLevel, int);
51
53
56 vtkGetMacro(WriteMetaFile, int);
57 virtual void SetWriteMetaFile(int flag);
59
65
66protected:
69
75 int GetDataSetMajorVersion() override { return 1; }
76 int GetDataSetMinorVersion() override { return 0; }
77
82
83 // see algorithm for more info
84 int FillInputPortInformation(int port, vtkInformation* info) override;
85
88
89 int WriteData() override;
90 const char* GetDataSetName() override;
91
92 // Create a default executive.
94
96
101
105 unsigned int GetNumberOfDataTypes();
106
111
112 // Methods to create the set of writers matching the set of inputs.
115
116 // Methods to help construct internal file names.
120
125 const char* GetDefaultFileExtensionForDataSet(int dataset_type);
126
133
134 // Make a directory.
135 virtual void MakeDirectory(const char* name);
136
137 // Remove a directory.
138 void RemoveADirectory(const char* name);
139
140 // Internal implementation details.
141 vtkXMLCompositeDataWriterInternals* Internal;
142
143 // The number of ghost levels to write for unstructured data.
145
152
153 // Callback registered with the InternalProgressObserver.
154 static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
155 // Progress callback from internal writer.
157
158 // The observer to report progress from the internal writer.
160
170 virtual int WriteComposite(
171 vtkCompositeDataSet* compositeData, vtkXMLDataElement* element, int& writerIdx) = 0;
172
184 vtkDataObject* dObj, vtkXMLDataElement* element, int& writerIdx, const char* fileName);
185
190 virtual void RemoveWrittenFiles(const char* SubDirectory);
191
192private:
194 void operator=(const vtkXMLCompositeDataWriter&) = delete;
195};
196
197VTK_ABI_NAMESPACE_END
198#endif
supports function callbacks
abstract superclass for composite (multi-block or AMR) datasets
general representation of visualization data
Superclass for all pipeline executives in VTK.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition vtkObject.h:162
Wrapper around std::string to keep symbols short.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int * GetDataTypesPointer()
Returns the array pointer to the array of leaf nodes.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int WriteData() override
static void ProgressCallbackFunction(vtkObject *, unsigned long, void *, void *)
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
See the vtkAlgorithm for a description of what these do.
vtkStdString CreatePieceFileName(int Piece)
Create a filename for the given index.
~vtkXMLCompositeDataWriter() override
virtual void FillDataTypes(vtkCompositeDataSet *)
Determine the data types for each of the leaf nodes.
virtual void MakeDirectory(const char *name)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
const char * GetDataSetName() override
void RemoveADirectory(const char *name)
const char * GetDefaultFileExtension() override
Get the default file extension for files written by this writer.
unsigned int GetNumberOfDataTypes()
Returns the number of leaf nodes (also includes empty leaf nodes).
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
int WriteMetaFileIfRequested()
Write the collection file if it is requested.
virtual void ProgressCallback(vtkAlgorithm *w)
const char * GetFilePath()
int GetDataSetMajorVersion() override
Methods to define the file's major and minor version numbers.
vtkCallbackCommand * InternalProgressObserver
virtual void SetWriteMetaFile(int flag)
Get/Set whether this instance will write the meta-file.
vtkXMLWriter * GetWriter(int index)
virtual void RemoveWrittenFiles(const char *SubDirectory)
Utility function to remove any already written files in case writer failed.
vtkXMLCompositeDataWriterInternals * Internal
int WriteMetaFile
Whether to write the collection file on this node.
virtual int WriteNonCompositeData(vtkDataObject *dObj, vtkXMLDataElement *element, int &writerIdx, const char *fileName)
Internal method to write a non vtkCompositeDataSet subclass as well as add in the file name to the me...
vtkExecutive * CreateDefaultExecutive() override
Create a default executive.
void CreateWriters(vtkCompositeDataSet *)
const char * GetDefaultFileExtensionForDataSet(int dataset_type)
Returns the default extension to use for the given dataset type.
virtual int WriteComposite(vtkCompositeDataSet *compositeData, vtkXMLDataElement *element, int &writerIdx)=0
Internal method called recursively to create the xml tree for the children of compositeData as well a...
const char * GetFilePrefix()
Represents an XML element and those nested inside.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_FILEPATH
#define VTK_MARSHALAUTO