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