Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkXMLStructuredDataWriter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXMLStructuredDataWriter.h,v $
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 =========================================================================*/
00034 #ifndef __vtkXMLStructuredDataWriter_h
00035 #define __vtkXMLStructuredDataWriter_h
00036 
00037 #include "vtkXMLWriter.h"
00038 
00039 class vtkDataSet;
00040 class vtkPointData;
00041 class vtkExtentTranslator;
00042 class vtkDataArray;
00043 class vtkDataSetAttributes;
00044 
00045 class VTK_IO_EXPORT vtkXMLStructuredDataWriter : public vtkXMLWriter
00046 {
00047 public:
00048   vtkTypeRevisionMacro(vtkXMLStructuredDataWriter,vtkXMLWriter);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050   
00052 
00054   vtkSetMacro(NumberOfPieces, int);
00055   vtkGetMacro(NumberOfPieces, int);
00057   
00059 
00062   vtkSetVector6Macro(WriteExtent, int);
00063   vtkGetVector6Macro(WriteExtent, int);
00065   
00067 
00068   virtual void SetExtentTranslator(vtkExtentTranslator*);
00069   vtkGetObjectMacro(ExtentTranslator, vtkExtentTranslator);
00071   
00072 protected:
00073   vtkXMLStructuredDataWriter();
00074   ~vtkXMLStructuredDataWriter();  
00075   
00076   // Writing drivers defined by subclasses.
00077   virtual void WritePrimaryElementAttributes();
00078   virtual void WriteAppendedPiece(int index, vtkIndent indent);
00079   virtual void WriteAppendedPieceData(int index);
00080   virtual void WriteInlinePiece(int index, vtkIndent indent);
00081   virtual void GetInputExtent(int* extent)=0;
00082   
00083   // The actual writing driver required by vtkXMLWriter.
00084   int WriteData();
00085   void SetupExtentTranslator();
00086   virtual int WriteAppendedMode(vtkIndent indent);
00087   vtkDataArray* CreateExactExtent(vtkDataArray* array, int* inExtent,
00088                                   int* outExtent, int isPoint);
00089   virtual int WriteInlineMode(vtkIndent indent);
00090   unsigned int GetStartTuple(int* extent, int* increments,
00091                              int i, int j, int k);
00092   void CalculatePieceFractions(float* fractions);
00093   
00094   // Define utility methods required by vtkXMLWriter.
00095   vtkDataArray* CreateArrayForPoints(vtkDataArray* inArray);
00096   vtkDataArray* CreateArrayForCells(vtkDataArray* inArray);
00097   
00098   // The extent of the input to write.
00099   int WriteExtent[6];
00100   
00101   // Number of pieces used for streaming.
00102   int NumberOfPieces;
00103   
00104   // Translate piece number to extent.
00105   vtkExtentTranslator* ExtentTranslator;
00106   
00107   // Appended data offsets of point and cell data arrays.
00108   unsigned long** PointDataOffsets;
00109   unsigned long** CellDataOffsets;
00110   
00111 private:
00112   vtkXMLStructuredDataWriter(const vtkXMLStructuredDataWriter&);  // Not implemented.
00113   void operator=(const vtkXMLStructuredDataWriter&);  // Not implemented.
00114 };
00115 
00116 #endif