VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXMLHyperOctreeWriter.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 =========================================================================*/ 00031 #ifndef __vtkXMLHyperOctreeWriter_h 00032 #define __vtkXMLHyperOctreeWriter_h 00033 00034 #include "vtkIOXMLModule.h" // For export macro 00035 #include "vtkXMLWriter.h" 00036 00037 class vtkHyperOctree; 00038 class vtkHyperOctreeCursor; 00039 class vtkIntArray; 00040 00041 class VTKIOXML_EXPORT vtkXMLHyperOctreeWriter : public vtkXMLWriter 00042 { 00043 public: 00044 vtkTypeMacro(vtkXMLHyperOctreeWriter,vtkXMLWriter); 00045 void PrintSelf(ostream& os, vtkIndent indent); 00046 static vtkXMLHyperOctreeWriter* New(); 00047 00048 //BTX 00050 00051 vtkHyperOctree* GetInput(); 00052 //ETX 00054 00056 const char* GetDefaultFileExtension(); 00057 00058 protected: 00059 vtkXMLHyperOctreeWriter(); 00060 ~vtkXMLHyperOctreeWriter(); 00061 00062 const char* GetDataSetName(); 00063 00064 // specify that we require HyperOctree input 00065 virtual int FillInputPortInformation(int port, vtkInformation* info); 00066 00067 // The most important method, make the XML file for my input. 00068 int WriteData(); 00069 00070 // <HyperOctree ... 00071 int StartPrimElement(vtkIndent); 00072 00073 // ... dim, size, origin> 00074 void WritePrimaryElementAttributes(ostream &, vtkIndent); 00075 00076 // Tree Structure 00077 int WriteTopology(vtkIndent); 00078 00079 // Used by WriteTopology to make and array from the Tree structure recursively 00080 void SerializeTopology(vtkHyperOctreeCursor *, int); 00081 00082 // Writes PointData and CellData attribute data. 00083 int WriteAttributeData(vtkIndent); 00084 00085 // </HyperOctree> 00086 int FinishPrimElement(vtkIndent); 00087 00088 // For appended mode placekeeping 00089 vtkIntArray *TopologyArray; 00090 unsigned long TopoOffset; 00091 OffsetsManagerGroup * TopologyOM; 00092 OffsetsManagerGroup * PointDataOM; 00093 OffsetsManagerGroup * CellDataOM; 00094 00095 private: 00096 vtkXMLHyperOctreeWriter(const vtkXMLHyperOctreeWriter&); // Not implemented. 00097 void operator=(const vtkXMLHyperOctreeWriter&); // Not implemented. 00098 }; 00099 00100 #endif