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