VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkX3DExporterFIWriter.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 =========================================================================*/ 00019 #ifndef __vtkX3DExporterFIWriter_h 00020 #define __vtkX3DExporterFIWriter_h 00021 00022 #include "vtkX3DExporterWriter.h" 00023 00024 class vtkX3DExporterFIByteWriter; 00025 class vtkX3DExporterFINodeInfoStack; 00026 class vtkZLibDataCompressor; 00027 00028 class VTK_HYBRID_EXPORT vtkX3DExporterFIWriter : public vtkX3DExporterWriter 00029 { 00030 public: 00031 static vtkX3DExporterFIWriter *New(); 00032 vtkTypeMacro(vtkX3DExporterFIWriter, vtkX3DExporterWriter); 00033 void PrintSelf(ostream& os, vtkIndent indent); 00034 00035 virtual void CloseFile(); 00036 virtual int OpenFile(const char* file); 00037 virtual int OpenStream(); 00038 00039 //void Write(const char* str); 00040 00041 virtual void Flush(); 00042 00043 void StartDocument(); 00044 void EndDocument(); 00045 00046 // Elements 00047 void StartNode(int elementID); 00048 void EndNode(); 00049 00050 // Attributes 00051 // SFString / MFString 00052 //void SetField(int attributeID, const std::string &value); 00053 void SetField(int attributeID, const char*, bool mfstring = false); 00054 // SFInt32 00055 void SetField(int attributeID, int); 00056 // SFFloat 00057 void SetField(int attributeID, float); 00058 // SFDouble 00059 void SetField(int attributeID, double); 00060 // SFBool 00061 void SetField(int attributeID, bool); 00062 00063 // For MFxxx attributes 00064 void SetField(int attributeID, int type, const double* a); 00065 void SetField(int attributeID, int type, vtkDataArray* a); 00066 void SetField(int attributeID, const double* values, size_t size); 00067 00068 // MFInt32 00069 void SetField(int attributeID, int type, vtkCellArray* a); 00070 void SetField(int attributeID, const int* values, size_t size, bool image = false); 00071 00072 int GetEncodingMethod(); 00073 00075 00076 vtkSetClampMacro(Fastest, int, 0, 1); 00077 vtkBooleanMacro(Fastest, int); 00078 vtkGetMacro(Fastest, int); 00079 protected: 00080 vtkX3DExporterFIWriter(); 00081 ~vtkX3DExporterFIWriter(); 00083 00084 00085 private: 00086 void StartAttribute(int attributeID, bool literal, bool addToTable = false); 00087 void EndAttribute(); 00088 00089 void CheckNode(bool callerIsAttribute = true); 00090 bool IsLineFeedEncodingOn; 00091 00092 //int Depth; 00093 vtkX3DExporterFIByteWriter* Writer; 00094 vtkX3DExporterFINodeInfoStack* InfoStack; 00095 vtkZLibDataCompressor* Compressor; 00096 00097 int Fastest; 00098 00099 vtkX3DExporterFIWriter(const vtkX3DExporterFIWriter&); // Not implemented. 00100 void operator=(const vtkX3DExporterFIWriter&); // Not implemented. 00101 00102 }; 00103 00104 #endif 00105