VTK
vtkX3DExporterWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkX3DExporterWriter.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 =========================================================================*/
23 #ifndef __vtkX3DExporterWriter_h
24 #define __vtkX3DExporterWriter_h
25 
26 #include <vtkObject.h>
27 
28 // Forward declarations
29 class vtkDataArray;
31 class vtkCellArray;
32 
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
41  virtual int OpenFile(const char* file) = 0;
42 
44  virtual int OpenStream() = 0;
45 
47 
48  vtkSetMacro(WriteToOutputString,int);
49  vtkGetMacro(WriteToOutputString,int);
50  vtkBooleanMacro(WriteToOutputString,int);
52 
54 
57  vtkGetMacro(OutputStringLength, int);
58  vtkGetStringMacro(OutputString);
59  unsigned char *GetBinaryOutputString()
60  {
61  return reinterpret_cast<unsigned char *>(this->OutputString);
62  }
64 
68  char *RegisterAndGetOutputString();
69 
70  // Closes the file if open
71  virtual void CloseFile() = 0;
72  // Flush can be called optionally after some operations to
73  // flush the buffer to the filestream. A writer not necessarily
74  // implements this function
75  virtual void Flush() {};
76 
79  virtual void StartDocument() = 0;
80 
83  virtual void EndDocument() = 0;
84 
86 
90  virtual void StartNode(int nodeID) = 0;
91  virtual void EndNode() = 0;
93 
97  virtual void SetField(int attributeID, const char* value, bool mfstring = false) = 0;
98 
101  virtual void SetField(int attributeID, int) = 0;
102 
105  virtual void SetField(int attributeID, float) = 0;
106 
109  virtual void SetField(int attributeID, double) = 0;
110 
113  virtual void SetField(int attributeID, bool) = 0;
114 
118  virtual void SetField(int attributeID, int type, const double* a) = 0;
119 
123  virtual void SetField(int attributeID, int type, vtkDataArray* a) = 0;
124 
128  virtual void SetField(int attributeID, const double* values, size_t size) = 0;
129 
134  virtual void SetField(int attributeID, const int* values, size_t size, bool image = false) = 0;
135 
137 
141 protected:
145 
149 
150 private:
151  vtkX3DExporterWriter(const vtkX3DExporterWriter&); // Not implemented.
152  void operator=(const vtkX3DExporterWriter&); // Not implemented.
153 };
154 #endif
155