VTK
vtkX3DExporterFIWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkX3DExporterFIWriter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
19 #ifndef vtkX3DExporterFIWriter_h
20 #define vtkX3DExporterFIWriter_h
21 
22 #include "vtkIOExportModule.h" // For export macro
23 #include "vtkX3DExporterWriter.h"
24 
25 class vtkX3DExporterFIByteWriter;
26 class vtkX3DExporterFINodeInfoStack;
28 
30 {
31 public:
32  static vtkX3DExporterFIWriter *New();
34  void PrintSelf(ostream& os, vtkIndent indent);
35 
36  virtual void CloseFile();
37  virtual int OpenFile(const char* file);
38  virtual int OpenStream();
39 
40  //void Write(const char* str);
41 
42  virtual void Flush();
43 
44  void StartDocument();
45  void EndDocument();
46 
47  // Elements
48  void StartNode(int elementID);
49  void EndNode();
50 
51  // Attributes
52  // SFString / MFString
53  //void SetField(int attributeID, const std::string &value);
54  void SetField(int attributeID, const char*, bool mfstring = false);
55  // SFInt32
56  void SetField(int attributeID, int);
57  // SFFloat
58  void SetField(int attributeID, float);
59  // SFDouble
60  void SetField(int attributeID, double);
61  // SFBool
62  void SetField(int attributeID, bool);
63 
64  // For MFxxx attributes
65  void SetField(int attributeID, int type, const double* a);
66  void SetField(int attributeID, int type, vtkDataArray* a);
67  void SetField(int attributeID, const double* values, size_t size);
68 
69  // MFInt32
70  void SetField(int attributeID, int type, vtkCellArray* a);
71  void SetField(int attributeID, const int* values, size_t size, bool image = false);
72 
73  int GetEncodingMethod();
74 
76 
77  vtkSetClampMacro(Fastest, int, 0, 1);
78  vtkBooleanMacro(Fastest, int);
79  vtkGetMacro(Fastest, int);
80 protected:
84 
85 
86 private:
87  void StartAttribute(int attributeID, bool literal, bool addToTable = false);
88  void EndAttribute();
89 
90  void CheckNode(bool callerIsAttribute = true);
91  bool IsLineFeedEncodingOn;
92 
93  //int Depth;
94  vtkX3DExporterFIByteWriter* Writer;
95  vtkX3DExporterFINodeInfoStack* InfoStack;
96  vtkZLibDataCompressor* Compressor;
97 
98  int Fastest;
99 
100  vtkX3DExporterFIWriter(const vtkX3DExporterFIWriter&); // Not implemented.
101  void operator=(const vtkX3DExporterFIWriter&); // Not implemented.
102 
103 };
104 
105 #endif
106 
X3D Exporter Writer.
virtual void StartNode(int nodeID)=0
virtual void EndNode()=0
#define VTKIOEXPORT_EXPORT
virtual void CloseFile()=0
virtual int OpenStream()=0
void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void SetField(int attributeID, const char *value, bool mfstring=false)=0
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
Data compression using zlib.
virtual void StartDocument()=0
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual void EndDocument()=0
static vtkObject * New()
virtual int OpenFile(const char *file)=0