VTK
dox/IO/vtkXMLPolyDataWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkXMLPolyDataWriter.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 =========================================================================*/
00035 #ifndef __vtkXMLPolyDataWriter_h
00036 #define __vtkXMLPolyDataWriter_h
00037 
00038 #include "vtkXMLUnstructuredDataWriter.h"
00039 
00040 class vtkPolyData;
00041 
00042 class VTK_IO_EXPORT vtkXMLPolyDataWriter : public vtkXMLUnstructuredDataWriter
00043 {
00044 public:
00045   vtkTypeMacro(vtkXMLPolyDataWriter,vtkXMLUnstructuredDataWriter);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047   static vtkXMLPolyDataWriter* New();
00048 
00049   //BTX
00051 
00052   vtkPolyData* GetInput();
00053   //ETX
00055   
00057   const char* GetDefaultFileExtension();
00058   
00059 protected:
00060   vtkXMLPolyDataWriter();
00061   ~vtkXMLPolyDataWriter();  
00062 
00063   // see algorithm for more info
00064   virtual int FillInputPortInformation(int port, vtkInformation* info);
00065 
00066   const char* GetDataSetName();
00067 
00068   virtual void AllocatePositionArrays();
00069   virtual void DeletePositionArrays();
00070    
00071   void WriteInlinePieceAttributes();
00072   void WriteInlinePiece(vtkIndent indent);
00073   
00074   void WriteAppendedPieceAttributes(int index);
00075   void WriteAppendedPiece(int index, vtkIndent indent);
00076   void WriteAppendedPieceData(int index);
00077 
00078   virtual vtkIdType GetNumberOfInputCells();
00079   void CalculateSuperclassFraction(float* fractions);
00080 
00081   // Positions of attributes for each piece.
00082   unsigned long* NumberOfVertsPositions;
00083   unsigned long* NumberOfLinesPositions;
00084   unsigned long* NumberOfStripsPositions;
00085   unsigned long* NumberOfPolysPositions;
00086 
00087   OffsetsManagerArray *VertsOM;
00088   OffsetsManagerArray *LinesOM;
00089   OffsetsManagerArray *StripsOM;
00090   OffsetsManagerArray *PolysOM;
00091 
00092 private:
00093   vtkXMLPolyDataWriter(const vtkXMLPolyDataWriter&);  // Not implemented.
00094   void operator=(const vtkXMLPolyDataWriter&);  // Not implemented.
00095 };
00096 
00097 #endif