VTK  9.1.0
vtkXMLCompositeDataWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ParaView
4 Module: vtkXMLCompositeDataWriter.h
5
6 Copyright (c) Kitware, Inc.
7 All rights reserved.
8 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
26#ifndef vtkXMLCompositeDataWriter_h
27#define vtkXMLCompositeDataWriter_h
28
29#include "vtkIOXMLModule.h" // For export macro
30#include "vtkStdString.h" // needed for vtkStdString.
31#include "vtkXMLWriter.h"
32
36class vtkXMLCompositeDataWriterInternals;
37
38class VTKIOXML_EXPORT vtkXMLCompositeDataWriter : public vtkXMLWriter
39{
40public:
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
47 const char* GetDefaultFileExtension() override;
48
54
57 vtkGetMacro(GhostLevel, int);
58 vtkSetMacro(GhostLevel, int);
60
62
65 vtkGetMacro(WriteMetaFile, int);
66 virtual void SetWriteMetaFile(int flag);
68
74
75protected:
78
84 int GetDataSetMajorVersion() override { return 1; }
85 int GetDataSetMinorVersion() override { return 0; }
86
91
92 // see algorithm for more info
93 int FillInputPortInformation(int port, vtkInformation* info) override;
94
97
98 int WriteData() override;
99 const char* GetDataSetName() override;
100
101 // Create a default executive.
103
105
110
114 unsigned int GetNumberOfDataTypes();
115
120
121 // Methods to create the set of writers matching the set of inputs.
124
125 // Methods to help construct internal file names.
129
134 const char* GetDefaultFileExtensionForDataSet(int dataset_type);
135
142
143 // Make a directory.
144 void MakeDirectory(const char* name);
145
146 // Remove a directory.
147 void RemoveADirectory(const char* name);
148
149 // Internal implementation details.
150 vtkXMLCompositeDataWriterInternals* Internal;
151
152 // The number of ghost levels to write for unstructured data.
154
161
162 // Callback registered with the InternalProgressObserver.
163 static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
164 // Progress callback from internal writer.
166
167 // The observer to report progress from the internal writer.
169
179 virtual int WriteComposite(
180 vtkCompositeDataSet* compositeData, vtkXMLDataElement* element, int& writerIdx) = 0;
181
193 vtkDataObject* dObj, vtkXMLDataElement* element, int& writerIdx, const char* fileName);
194
199 virtual void RemoveWrittenFiles(const char* SubDirectory);
200
201private:
203 void operator=(const vtkXMLCompositeDataWriter&) = delete;
204};
205
206#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:123
supports function callbacks
abstract superclass for composite (multi-block or AMR) datasets
general representation of visualization data
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:76
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObject.h:82
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
Writer for multi-group datasets.
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
void MakeDirectory(const char *name)
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.
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 *)
VTK_FILEPATH const char * GetFilePath()
int WriteMetaFileIfRequested()
Write the collection file if it is requested.
virtual void ProgressCallback(vtkAlgorithm *w)
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...
VTK_FILEPATH const char * GetFilePrefix()
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...
Represents an XML element and those nested inside.
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:62
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_FILEPATH