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 "vtkIOExportModule.h" // For export macro
27 #include "vtkObject.h"
28 
29 // Forward declarations
30 class vtkDataArray;
32 class vtkCellArray;
33 
35 {
36 public:
38  void PrintSelf(ostream& os, vtkIndent indent);
39 
42  virtual int OpenFile(const char* file) = 0;
43 
45  virtual int OpenStream() = 0;
46 
48 
49  vtkSetMacro(WriteToOutputString,int);
50  vtkGetMacro(WriteToOutputString,int);
51  vtkBooleanMacro(WriteToOutputString,int);
53 
55 
58  vtkGetMacro(OutputStringLength, int);
59  vtkGetStringMacro(OutputString);
60  unsigned char *GetBinaryOutputString()
61  {
62  return reinterpret_cast<unsigned char *>(this->OutputString);
63  }
65 
69  char *RegisterAndGetOutputString();
70 
71  // Closes the file if open
72  virtual void CloseFile() = 0;
73  // Flush can be called optionally after some operations to
74  // flush the buffer to the filestream. A writer not necessarily
75  // implements this function
76  virtual void Flush() {}
77 
80  virtual void StartDocument() = 0;
81 
84  virtual void EndDocument() = 0;
85 
87 
91  virtual void StartNode(int nodeID) = 0;
92  virtual void EndNode() = 0;
94 
98  virtual void SetField(int attributeID, const char* value, bool mfstring = false) = 0;
99 
102  virtual void SetField(int attributeID, int) = 0;
103 
106  virtual void SetField(int attributeID, float) = 0;
107 
110  virtual void SetField(int attributeID, double) = 0;
111 
114  virtual void SetField(int attributeID, bool) = 0;
115 
119  virtual void SetField(int attributeID, int type, const double* a) = 0;
120 
124  virtual void SetField(int attributeID, int type, vtkDataArray* a) = 0;
125 
129  virtual void SetField(int attributeID, const double* values, size_t size) = 0;
130 
135  virtual void SetField(int attributeID, const int* values, size_t size, bool image = false) = 0;
136 
138 
142 protected:
146 
150 
151 private:
152  vtkX3DExporterWriter(const vtkX3DExporterWriter&); // Not implemented.
153  void operator=(const vtkX3DExporterWriter&); // Not implemented.
154 };
155 #endif
156 
X3D Exporter Writer.
abstract base class for most VTK objects
Definition: vtkObject.h:61
#define VTKIOEXPORT_EXPORT
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
dynamic, self-adjusting array of unsigned char
unsigned char * GetBinaryOutputString()
object to represent cell connectivity
Definition: vtkCellArray.h:49