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 =========================================================================*/
24 #ifndef vtkX3DExporterWriter_h
25 #define vtkX3DExporterWriter_h
26 
27 #include "vtkIOExportModule.h" // For export macro
28 #include "vtkObject.h"
29 
30 // Forward declarations
31 class vtkDataArray;
33 class vtkCellArray;
34 
35 class VTKIOEXPORT_EXPORT vtkX3DExporterWriter : public vtkObject
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
45  virtual int OpenFile(const char* file) = 0;
46 
50  virtual int OpenStream() = 0;
51 
53 
56  vtkSetMacro(WriteToOutputString,vtkTypeBool);
57  vtkGetMacro(WriteToOutputString,vtkTypeBool);
58  vtkBooleanMacro(WriteToOutputString,vtkTypeBool);
60 
62 
67  vtkGetMacro(OutputStringLength, int);
68  vtkGetStringMacro(OutputString);
69  unsigned char *GetBinaryOutputString()
70  {
71  return reinterpret_cast<unsigned char *>(this->OutputString);
72  }
74 
80  char *RegisterAndGetOutputString();
81 
82  // Closes the file if open
83  virtual void CloseFile() = 0;
84  // Flush can be called optionally after some operations to
85  // flush the buffer to the filestream. A writer not necessarily
86  // implements this function
87  virtual void Flush() {}
88 
93  virtual void StartDocument() = 0;
94 
99  virtual void EndDocument() = 0;
100 
102 
108  virtual void StartNode(int nodeID) = 0;
109  virtual void EndNode() = 0;
111 
118  virtual void SetField(int attributeID, const char* value, bool mfstring = false) = 0;
119 
125  virtual void SetField(int attributeID, int) = 0;
126 
132  virtual void SetField(int attributeID, float) = 0;
133 
139  virtual void SetField(int attributeID, double) = 0;
140 
146  virtual void SetField(int attributeID, bool) = 0;
147 
154  virtual void SetField(int attributeID, int type, const double* a) = 0;
155 
162  virtual void SetField(int attributeID, int type, vtkDataArray* a) = 0;
163 
170  virtual void SetField(int attributeID, const double* values, size_t size) = 0;
171 
180  virtual void SetField(int attributeID, const int* values, size_t size, bool image = false) = 0;
181 
182  /*
183  * Sets the field specified with attributeID
184  * of the active node to the given value.
185  * The type of the field is specified with type
186  * Supported types: MFString
187  */
188  // virtual void SetField(int attributeID, int type, std::string) = 0;
189 
190 protected:
192  ~vtkX3DExporterWriter() override;
193 
197 
198 private:
200  void operator=(const vtkX3DExporterWriter&) = delete;
201 };
202 #endif
203 
X3D Exporter Writer.
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
dynamic, self-adjusting array of unsigned char
unsigned char * GetBinaryOutputString()
When WriteToOutputString in on, then a string is allocated, written to, and can be retrieved with the...
object to represent cell connectivity
Definition: vtkCellArray.h:50