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 "vtkIOXMLModule.h" // For export macro
29 #include "vtkXMLWriter.h"
30 #include "vtkStdString.h" // needed for vtkStdString.
31 
32 class vtkCallbackCommand;
34 class vtkXMLDataElement;
35 class vtkXMLCompositeDataWriterInternals;
36 
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent);
42 
44  virtual const char* GetDefaultFileExtension();
45 
50  vtkGetMacro(GhostLevel, int);
51  vtkSetMacro(GhostLevel, int);
53 
55 
56  vtkGetMacro(WriteMetaFile, int);
57  virtual void SetWriteMetaFile(int flag);
59 
61 
66 
67 protected:
70 
72 
75  virtual int GetDataSetMajorVersion() { return 1; }
76  virtual int GetDataSetMinorVersion() { return 0; }
78 
80  vtkStdString CreatePieceFileName(int Piece);
81 
82  // see algorithm for more info
84 
85  int RequestData(
87  int RequestUpdateExtent(
89 
90  virtual int WriteData();
91  virtual const char* GetDataSetName();
92 
93  // Create a default executive.
95 
97 
99  virtual void FillDataTypes(vtkCompositeDataSet*);
100 
102  unsigned int GetNumberOfDataTypes();
103 
105  int* GetDataTypesPointer();
106 
107  // Methods to create the set of writers matching the set of inputs.
108  void CreateWriters(vtkCompositeDataSet*);
109  vtkXMLWriter* GetWriter(int index);
110 
111  // Methods to help construct internal file names.
112  void SplitFileName();
113  const char* GetFilePrefix();
114  const char* GetFilePath();
115 
119  int WriteMetaFileIfRequested();
120 
121  // Make a directory.
122  void MakeDirectory(const char* name);
123 
124  // Remove a directory.
125  void RemoveADirectory(const char* name);
126 
127  // Internal implementation details.
128  vtkXMLCompositeDataWriterInternals* Internal;
129 
130  // The number of ghost levels to write for unstructured data.
132 
137 
138  // Callback registered with the ProgressObserver.
139  static void ProgressCallbackFunction(vtkObject*, unsigned long, void*,
140  void*);
141  // Progress callback from internal writer.
142  virtual void ProgressCallback(vtkAlgorithm* w);
143 
144  // The observer to report progress from the internal writer.
146 
148 
154  virtual int WriteComposite(vtkCompositeDataSet* compositeData,
155  vtkXMLDataElement* element, int &writerIdx)=0;
157 
159 
166  virtual int WriteNonCompositeData(
167  vtkDataObject* dObj, vtkXMLDataElement* element,
168  int& writerIdx, const char* FileName);
170 
173  virtual void RemoveWrittenFiles(const char* SubDirectory);
174 
175 private:
176  vtkXMLCompositeDataWriter(const vtkXMLCompositeDataWriter&); // Not implemented.
177  void operator=(const vtkXMLCompositeDataWriter&); // Not implemented.
178 };
179 
180 #endif
virtual const char * GetDataSetName()=0
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
abstract base class for most VTK objects
Definition: vtkObject.h:61
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:51
virtual int WriteData()
Definition: vtkXMLWriter.h:323
supports function callbacks
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
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:38
#define VTKIOXML_EXPORT
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.
general representation of visualization data
Definition: vtkDataObject.h:64