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 =========================================================================*/
25 #ifndef __vtkXMLCompositeDataWriter_h
26 #define __vtkXMLCompositeDataWriter_h
27 
28 #include "vtkXMLWriter.h"
29 #include "vtkStdString.h" // needed for vtkStdString.
30 
31 class vtkCallbackCommand;
33 class vtkXMLDataElement;
34 class vtkXMLCompositeDataWriterInternals;
35 
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43  virtual const char* GetDefaultFileExtension();
44 
49  vtkGetMacro(GhostLevel, int);
50  vtkSetMacro(GhostLevel, int);
52 
54 
55  vtkGetMacro(WriteMetaFile, int);
56  virtual void SetWriteMetaFile(int flag);
58 
60 
65 
66 protected:
69 
71 
74  virtual int GetDataSetMajorVersion() { return 1; }
75  virtual int GetDataSetMinorVersion() { return 0; }
77 
79  vtkStdString CreatePieceFileName(int Piece);
80 
81  // see algorithm for more info
83 
84  int RequestData(
86  int RequestUpdateExtent(
88 
89  virtual int WriteData();
90  virtual const char* GetDataSetName();
91 
92  // Create a default executive.
94 
96 
98  virtual void FillDataTypes(vtkCompositeDataSet*);
99 
101  unsigned int GetNumberOfDataTypes();
102 
104  int* GetDataTypesPointer();
105 
106  // Methods to create the set of writers matching the set of inputs.
107  void CreateWriters(vtkCompositeDataSet*);
108  vtkXMLWriter* GetWriter(int index);
109 
110  // Methods to help construct internal file names.
111  void SplitFileName();
112  const char* GetFilePrefix();
113  const char* GetFilePath();
114 
118  int WriteMetaFileIfRequested();
119 
120  // Make a directory.
121  void MakeDirectory(const char* name);
122 
123  // Remove a directory.
124  void RemoveADirectory(const char* name);
125 
126  // Internal implementation details.
127  vtkXMLCompositeDataWriterInternals* Internal;
128 
129  // The number of ghost levels to write for unstructured data.
131 
136 
137  // Callback registered with the ProgressObserver.
138  static void ProgressCallbackFunction(vtkObject*, unsigned long, void*,
139  void*);
140  // Progress callback from internal writer.
141  virtual void ProgressCallback(vtkAlgorithm* w);
142 
143  // The observer to report progress from the internal writer.
145 
146  // Garbage collection support.
147  virtual void ReportReferences(vtkGarbageCollector*);
148 
150 
156  virtual int WriteComposite(vtkCompositeDataSet* compositeData,
157  vtkXMLDataElement* element, int &writerIdx)=0;
159 
161 
168  virtual int WriteNonCompositeData(
169  vtkDataObject* dObj, vtkXMLDataElement* element,
170  int& writerIdx, const char* FileName);
172 
175  virtual void RemoveWrittenFiles(const char* SubDirectory);
176 
177 private:
178  vtkXMLCompositeDataWriter(const vtkXMLCompositeDataWriter&); // Not implemented.
179  void operator=(const vtkXMLCompositeDataWriter&); // Not implemented.
180 };
181 
182 #endif
virtual const char * GetDataSetName()=0
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
abstract base class for most VTK objects
Definition: vtkObject.h:60
Represents an XML element and those nested inside.
virtual vtkExecutive * CreateDefaultExecutive()
Store vtkAlgorithm input/output information.
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:47
Detect and break reference loops.
virtual int WriteData()
Definition: vtkXMLWriter.h:313
virtual void ReportReferences(vtkGarbageCollector *)
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:50
a simple class to control print indentation
Definition: vtkIndent.h:37
void PrintSelf(ostream &os, vtkIndent indent)
virtual const char * GetDefaultFileExtension()=0
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int FillInputPortInformation(int port, vtkInformation *info)
Writer for multi-group datasets.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkXMLCompositeDataWriterInternals * Internal
Store zero or more vtkInformation instances.
#define VTK_IO_EXPORT
general representation of visualization data
Definition: vtkDataObject.h:70