00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00025 #ifndef __vtkXMLCompositeDataWriter_h
00026 #define __vtkXMLCompositeDataWriter_h
00027
00028 #include "vtkXMLWriter.h"
00029 #include "vtkStdString.h"
00030
00031 class vtkCallbackCommand;
00032 class vtkCompositeDataSet;
00033 class vtkXMLDataElement;
00034 class vtkXMLCompositeDataWriterInternals;
00035
00036 class VTK_IO_EXPORT vtkXMLCompositeDataWriter : public vtkXMLWriter
00037 {
00038 public:
00039 vtkTypeMacro(vtkXMLCompositeDataWriter,vtkXMLWriter);
00040 void PrintSelf(ostream& os, vtkIndent indent);
00041
00043 virtual const char* GetDefaultFileExtension();
00044
00049 vtkGetMacro(GhostLevel, int);
00050 vtkSetMacro(GhostLevel, int);
00052
00054
00055 vtkGetMacro(WriteMetaFile, int);
00056 virtual void SetWriteMetaFile(int flag);
00058
00060
00061 int ProcessRequest(vtkInformation*,
00062 vtkInformationVector**,
00063 vtkInformationVector*);
00065
00066 protected:
00067 vtkXMLCompositeDataWriter();
00068 ~vtkXMLCompositeDataWriter();
00069
00071
00074 virtual int GetDataSetMajorVersion() { return 1; }
00075 virtual int GetDataSetMinorVersion() { return 0; }
00077
00079 vtkStdString CreatePieceFileName(int Piece);
00080
00081
00082 virtual int FillInputPortInformation(int port, vtkInformation* info);
00083
00084 int RequestData(
00085 vtkInformation* , vtkInformationVector** , vtkInformationVector*);
00086 int RequestUpdateExtent(
00087 vtkInformation* , vtkInformationVector** , vtkInformationVector*);
00088
00089 virtual int WriteData();
00090 virtual const char* GetDataSetName();
00091
00092
00093 virtual vtkExecutive* CreateDefaultExecutive();
00094
00095 vtkInformation* InputInformation;
00096
00098 virtual void FillDataTypes(vtkCompositeDataSet*);
00099
00101 unsigned int GetNumberOfDataTypes();
00102
00104 int* GetDataTypesPointer();
00105
00106
00107 void CreateWriters(vtkCompositeDataSet*);
00108 vtkXMLWriter* GetWriter(int index);
00109
00110
00111 void SplitFileName();
00112 const char* GetFilePrefix();
00113 const char* GetFilePath();
00114
00118 int WriteMetaFileIfRequested();
00119
00120
00121 void MakeDirectory(const char* name);
00122
00123
00124 void RemoveADirectory(const char* name);
00125
00126
00127 vtkXMLCompositeDataWriterInternals* Internal;
00128
00129
00130 int GhostLevel;
00131
00135 int WriteMetaFile;
00136
00137
00138 static void ProgressCallbackFunction(vtkObject*, unsigned long, void*,
00139 void*);
00140
00141 virtual void ProgressCallback(vtkAlgorithm* w);
00142
00143
00144 vtkCallbackCommand* ProgressObserver;
00145
00146
00147 virtual void ReportReferences(vtkGarbageCollector*);
00148
00150
00156 virtual int WriteComposite(vtkCompositeDataSet* compositeData,
00157 vtkXMLDataElement* element, int &writerIdx)=0;
00159
00161
00168 virtual int WriteNonCompositeData(
00169 vtkDataObject* dObj, vtkXMLDataElement* element,
00170 int& writerIdx, const char* FileName);
00172
00175 virtual void RemoveWrittenFiles(const char* SubDirectory);
00176
00177 private:
00178 vtkXMLCompositeDataWriter(const vtkXMLCompositeDataWriter&);
00179 void operator=(const vtkXMLCompositeDataWriter&);
00180 };
00181
00182 #endif