00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __vtkX3DExporterXMLWriter_h
00016 #define __vtkX3DExporterXMLWriter_h
00017
00018 #include "vtkX3DExporterWriter.h"
00019
00020 class vtkX3DExporterXMLNodeInfoStack;
00021
00022 class VTK_HYBRID_EXPORT vtkX3DExporterXMLWriter : public vtkX3DExporterWriter
00023 {
00024
00025 public:
00026 static vtkX3DExporterXMLWriter *New();
00027 vtkTypeRevisionMacro(vtkX3DExporterXMLWriter, vtkX3DExporterWriter);
00028 void PrintSelf(ostream& os, vtkIndent indent);
00029
00030 virtual void CloseFile();
00031 virtual int OpenFile(const char* file);
00032 virtual void Flush();
00033
00034
00035 void StartDocument();
00036 void EndDocument();
00037
00038
00039 void StartNode(int elementID);
00040 void EndNode();
00041
00042
00043
00044 void SetField(int attributeID, const char*, bool mfstring = true);
00045
00046 void SetField(int attributeID, int);
00047
00048 void SetField(int attributeID, float);
00049
00050 void SetField(int attributeID, double);
00051
00052 void SetField(int attributeID, bool);
00053
00054
00055 void SetField(int attributeID, int type, const double* a);
00056 void SetField(int attributeID, int type, vtkDataArray* a);
00057 void SetField(int attributeID, const double* values, size_t size);
00058
00059 void SetField(int attributeID, const int* values, size_t size, bool image = false);
00060
00061 protected:
00062 vtkX3DExporterXMLWriter();
00063 ~vtkX3DExporterXMLWriter();
00064
00065 private:
00066
00067 const char* GetNewline() { return "\n"; };
00068 void AddDepth();
00069 void SubDepth();
00070
00071 vtkstd::string ActTab;
00072 int Depth;
00073 ofstream OutputStream;
00074 vtkX3DExporterXMLNodeInfoStack* InfoStack;
00075
00076 vtkX3DExporterXMLWriter(const vtkX3DExporterXMLWriter&);
00077 void operator=(const vtkX3DExporterXMLWriter&);
00078
00079 };
00080
00081 #endif
00082