vtkXMLStructuredGridWriter.h 2.51 KB
Newer Older
1 2 3 4 5
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkXMLStructuredGridWriter.h

6
  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 8 9
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

10 11
     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkXMLStructuredGridWriter - Write VTK XML StructuredGrid files.
// .SECTION Description
// vtkXMLStructuredGridWriter writes the VTK XML StructuredGrid file
// format.  One structured grid input can be written into one file in
// any number of streamed pieces.  The standard extension for this
// writer's file format is "vts".  This writer is also used to write a
// single piece of the parallel file format.

// .SECTION See Also
// vtkXMLPStructuredGridWriter

#ifndef __vtkXMLStructuredGridWriter_h
#define __vtkXMLStructuredGridWriter_h

#include "vtkXMLStructuredDataWriter.h"

class vtkStructuredGrid;

class VTK_IO_EXPORT vtkXMLStructuredGridWriter : public vtkXMLStructuredDataWriter
{
public:
  static vtkXMLStructuredGridWriter* New();
  vtkTypeRevisionMacro(vtkXMLStructuredGridWriter,vtkXMLStructuredDataWriter);
  void PrintSelf(ostream& os, vtkIndent indent);
  
40
  //BTX
41 42 43
  // Description:
  // Get/Set the writer's input.
  vtkStructuredGrid* GetInput();
44
  //ETX
45 46 47 48 49 50 51 52 53
  
  // Description:
  // Get the default file extension for files written by this writer.
  const char* GetDefaultFileExtension();
  
protected:
  vtkXMLStructuredGridWriter();
  ~vtkXMLStructuredGridWriter();  
  
54 55 56
  // see algorithm for more info
  virtual int FillInputPortInformation(int port, vtkInformation* info);

57 58
  void WriteAppendedPiece(int index, vtkIndent indent);
  void WriteAppendedPieceData(int index);
59
  void WriteInlinePiece(vtkIndent indent);
60 61
  void GetInputExtent(int* extent);
  const char* GetDataSetName();
62
  void CalculateSuperclassFraction(float* fractions);
63 64 65
  
  // The position of the appended data offset attribute for the points
  // array.
66
  OffsetsManagerGroup *PointsOM;  //one per piece
67 68 69

  virtual void AllocatePositionArrays();
  virtual void DeletePositionArrays();
70 71 72 73 74 75 76
  
private:
  vtkXMLStructuredGridWriter(const vtkXMLStructuredGridWriter&);  // Not implemented.
  void operator=(const vtkXMLStructuredGridWriter&);  // Not implemented.
};

#endif