VTK
vtkX3DExporterXMLWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkX3DExporterXMLWriter.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 =========================================================================*/
22 #ifndef vtkX3DExporterXMLWriter_h
23 #define vtkX3DExporterXMLWriter_h
24 
25 #include "vtkIOExportModule.h" // For export macro
26 #include "vtkX3DExporterWriter.h"
27 
28 class vtkX3DExporterXMLNodeInfoStack;
29 
30 class VTKIOEXPORT_EXPORT vtkX3DExporterXMLWriter : public vtkX3DExporterWriter
31 {
32 
33 public:
34  static vtkX3DExporterXMLWriter *New();
36  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
37 
38  void CloseFile() VTK_OVERRIDE;
39  int OpenFile(const char* file) VTK_OVERRIDE;
40  void Flush() VTK_OVERRIDE;
41 
42  int OpenStream() VTK_OVERRIDE;
43 
44  void StartDocument() VTK_OVERRIDE;
45  void EndDocument() VTK_OVERRIDE;
46 
47  // Elements
48  void StartNode(int elementID) VTK_OVERRIDE;
49  void EndNode() VTK_OVERRIDE;
50 
51  // Attributes
52  // SFString / MFString
53  void SetField(int attributeID, const char*, bool mfstring = true) VTK_OVERRIDE;
54  // SFInt32
55  void SetField(int attributeID, int) VTK_OVERRIDE;
56  // SFFloat
57  void SetField(int attributeID, float) VTK_OVERRIDE;
58  // SFDouble
59  void SetField(int attributeID, double) VTK_OVERRIDE;
60  // SFBool
61  void SetField(int attributeID, bool) VTK_OVERRIDE;
62 
63  // For MFxxx attributes
64  void SetField(int attributeID, int type, const double* a) VTK_OVERRIDE;
65  void SetField(int attributeID, int type, vtkDataArray* a) VTK_OVERRIDE;
66  void SetField(int attributeID, const double* values, size_t size) VTK_OVERRIDE;
67  // MFInt32, SFIMAGE
68  void SetField(int attributeID, const int* values, size_t size, bool image = false) VTK_OVERRIDE;
69 
70 protected:
72  ~vtkX3DExporterXMLWriter() VTK_OVERRIDE;
73 
74 private:
75 
76  const char* GetNewline() { return "\n"; };
77  void AddDepth();
78  void SubDepth();
79 
80  std::string ActTab;
81  int Depth;
82  ostream *OutputStream;
83  vtkX3DExporterXMLNodeInfoStack* InfoStack;
84 
85  vtkX3DExporterXMLWriter(const vtkX3DExporterXMLWriter&) VTK_DELETE_FUNCTION;
86  void operator=(const vtkX3DExporterXMLWriter&) VTK_DELETE_FUNCTION;
87 
88 };
89 
90 #endif
91 
X3D Exporter Writer.
virtual void CloseFile()=0
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
X3D Exporter XML Writer.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...