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