VTK
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 "vtkXMLWriter.h"
31 #include "vtkStdString.h" // needed for vtkStdString.
32 
33 class vtkCallbackCommand;
35 class vtkXMLDataElement;
36 class vtkXMLCompositeDataWriterInternals;
37 
38 class VTKIOXML_EXPORT vtkXMLCompositeDataWriter : public vtkXMLWriter
39 {
40 public:
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
47  virtual const char* GetDefaultFileExtension();
48 
57  vtkGetMacro(GhostLevel, int);
58  vtkSetMacro(GhostLevel, int);
60 
62 
65  vtkGetMacro(WriteMetaFile, int);
66  virtual void SetWriteMetaFile(int flag);
68 
75 
76 protected:
79 
85  virtual int GetDataSetMajorVersion() { return 1; }
86  virtual int GetDataSetMinorVersion() { return 0; }
87 
91  vtkStdString CreatePieceFileName(int Piece);
92 
93  // see algorithm for more info
95 
96  int RequestData(
98  int RequestUpdateExtent(
100 
101  virtual int WriteData();
102  virtual const char* GetDataSetName();
103 
104  // Create a default executive.
106 
108 
112  virtual void FillDataTypes(vtkCompositeDataSet*);
113 
117  unsigned int GetNumberOfDataTypes();
118 
122  int* GetDataTypesPointer();
123 
124  // Methods to create the set of writers matching the set of inputs.
125  void CreateWriters(vtkCompositeDataSet*);
126  vtkXMLWriter* GetWriter(int index);
127 
128  // Methods to help construct internal file names.
129  void SplitFileName();
130  const char* GetFilePrefix();
131  const char* GetFilePath();
132 
137  const char* GetDefaultFileExtensionForDataSet(int dataset_type);
138 
144  int WriteMetaFileIfRequested();
145 
146  // Make a directory.
147  void MakeDirectory(const char* name);
148 
149  // Remove a directory.
150  void RemoveADirectory(const char* name);
151 
152  // Internal implementation details.
153  vtkXMLCompositeDataWriterInternals* Internal;
154 
155  // The number of ghost levels to write for unstructured data.
157 
164 
165  // Callback registered with the ProgressObserver.
166  static void ProgressCallbackFunction(vtkObject*, unsigned long, void*,
167  void*);
168  // Progress callback from internal writer.
169  virtual void ProgressCallback(vtkAlgorithm* w);
170 
171  // The observer to report progress from the internal writer.
173 
183  virtual int WriteComposite(vtkCompositeDataSet* compositeData,
184  vtkXMLDataElement* element, int &writerIdx)=0;
185 
196  virtual int WriteNonCompositeData(
197  vtkDataObject* dObj, vtkXMLDataElement* element,
198  int& writerIdx, const char* FileName);
199 
204  virtual void RemoveWrittenFiles(const char* SubDirectory);
205 
206 private:
207  vtkXMLCompositeDataWriter(const vtkXMLCompositeDataWriter&) VTK_DELETE_FUNCTION;
208  void operator=(const vtkXMLCompositeDataWriter&) VTK_DELETE_FUNCTION;
209 };
210 
211 #endif
virtual const char * GetDataSetName()=0
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
abstract base class for most VTK objects
Definition: vtkObject.h:59
Represents an XML element and those nested inside.
virtual int GetDataSetMajorVersion()
Methods to define the file's major and minor version numbers.
virtual vtkExecutive * CreateDefaultExecutive()
Create a default executive.
Store vtkAlgorithm input/output information.
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:49
virtual int WriteData()
Definition: vtkXMLWriter.h:335
supports function callbacks
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:59
abstract superclass for composite (multi-block or AMR) datasets
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:53
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual const char * GetDefaultFileExtension()=0
Get the default file extension for files written by this writer.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
Writer for multi-group datasets.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkXMLCompositeDataWriterInternals * Internal
Store zero or more vtkInformation instances.
int WriteMetaFile
Whether to write the collection file on this node.
general representation of visualization data
Definition: vtkDataObject.h:64