VTK
dox/IO/XML/vtkXMLPDataWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkXMLPDataWriter.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00024 #ifndef __vtkXMLPDataWriter_h
00025 #define __vtkXMLPDataWriter_h
00026 
00027 #include "vtkIOXMLModule.h" // For export macro
00028 #include "vtkXMLWriter.h"
00029 
00030 class vtkCallbackCommand;
00031 
00032 class VTKIOXML_EXPORT vtkXMLPDataWriter : public vtkXMLWriter
00033 {
00034 public:
00035   vtkTypeMacro(vtkXMLPDataWriter,vtkXMLWriter);
00036   void PrintSelf(ostream& os, vtkIndent indent);
00037 
00039 
00040   vtkSetMacro(NumberOfPieces, int);
00041   vtkGetMacro(NumberOfPieces, int);
00043 
00045 
00046   vtkSetMacro(StartPiece, int);
00047   vtkGetMacro(StartPiece, int);
00048   vtkSetMacro(EndPiece, int);
00049   vtkGetMacro(EndPiece, int);
00051 
00053 
00054   vtkSetMacro(GhostLevel, int);
00055   vtkGetMacro(GhostLevel, int);
00057 
00059 
00062   virtual void SetWriteSummaryFile(int flag);
00063   vtkGetMacro(WriteSummaryFile, int);
00064   vtkBooleanMacro(WriteSummaryFile, int);
00066 
00067 protected:
00068   vtkXMLPDataWriter();
00069   ~vtkXMLPDataWriter();
00070 
00071   // Override writing method from superclass.
00072   virtual int WriteInternal();
00073 
00074   virtual vtkXMLWriter* CreatePieceWriter(int index)=0;
00075 
00076   virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent);
00077   int WriteData();
00078   virtual void WritePData(vtkIndent indent);
00079   virtual void WritePPieceAttributes(int index);
00080 
00081   char* CreatePieceFileName(int index, const char* path=0);
00082   void SplitFileName();
00083   int WritePieces();
00084   int WritePiece(int index);
00085 
00086   // Callback registered with the ProgressObserver.
00087   static void ProgressCallbackFunction(vtkObject*, unsigned long, void*,
00088                                        void*);
00089   // Progress callback from internal writer.
00090   virtual void ProgressCallback(vtkAlgorithm* w);
00091 
00092   int StartPiece;
00093   int EndPiece;
00094   int NumberOfPieces;
00095   int GhostLevel;
00096   int WriteSummaryFile;
00097   int WriteSummaryFileInitialized;
00098 
00099   char* PathName;
00100   char* FileNameBase;
00101   char* FileNameExtension;
00102   char* PieceFileNameExtension;
00103 
00104   // The observer to report progress from the internal writer.
00105   vtkCallbackCommand* ProgressObserver;
00106 
00107 private:
00108   vtkXMLPDataWriter(const vtkXMLPDataWriter&);  // Not implemented.
00109   void operator=(const vtkXMLPDataWriter&);  // Not implemented.
00110 };
00111 
00112 #endif