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
27
28class vtkX3DExporterXMLNodeInfoStack;
29
30class VTKIOEXPORT_EXPORT vtkX3DExporterXMLWriter : public vtkX3DExporterWriter
31{
32
33public:
36 void PrintSelf(ostream& os, vtkIndent indent);
37
38 virtual void CloseFile();
39 virtual int OpenFile(const char* file);
40 virtual void Flush();
41
42 virtual int OpenStream();
43
46
47 // Elements
48 void StartNode(int elementID);
49 void EndNode();
50
51 // Attributes
52 // SFString / MFString
53 void SetField(int attributeID, const char*, bool mfstring = true);
54 // SFInt32
55 void SetField(int attributeID, int);
56 // SFFloat
57 void SetField(int attributeID, float);
58 // SFDouble
59 void SetField(int attributeID, double);
60 // SFBool
61 void SetField(int attributeID, bool);
62
63 // For MFxxx attributes
64 void SetField(int attributeID, int type, const double* a);
65 void SetField(int attributeID, int type, vtkDataArray* a);
66 void SetField(int attributeID, const double* values, size_t size);
67 // MFInt32, SFIMAGE
68 void SetField(int attributeID, const int* values, size_t size, bool image = false);
69
70protected:
73
74private:
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
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
a simple class to control print indentation
Definition: vtkIndent.h:40
X3D Exporter Writer.
X3D Exporter XML Writer.
void SetField(int attributeID, bool)
Sets the field specified with attributeID of the active node to the given value.
void SetField(int attributeID, const char *, bool mfstring=true)
Sets the field specified with attributeID of the active node to the given value.
void SetField(int attributeID, const double *values, size_t size)
Sets the field specified with attributeID of the active node to the given value.
void SetField(int attributeID, int type, vtkDataArray *a)
Sets the field specified with attributeID of the active node to the given value.
static vtkX3DExporterXMLWriter * New()
void SetField(int attributeID, float)
Sets the field specified with attributeID of the active node to the given value.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void StartNode(int elementID)
Starts/ends a new X3D node specified via nodeID.
virtual void Flush()
virtual int OpenFile(const char *file)
Opens the file specified with file returns 1 if successful otherwise 0.
virtual int OpenStream()
Init data support to be a stream instead of a file.
void SetField(int attributeID, int)
Sets the field specified with attributeID of the active node to the given value.
virtual void CloseFile()
void EndDocument()
Ends a document and sets all necessary informations or necessary bytes to finish the encoding correct...
void SetField(int attributeID, double)
Sets the field specified with attributeID of the active node to the given value.
void StartDocument()
Starts a document and sets all necessary informations, i.e.
void SetField(int attributeID, int type, const double *a)
Sets the field specified with attributeID of the active node to the given value.
void SetField(int attributeID, const int *values, size_t size, bool image=false)
Sets the field specified with attributeID of the active node to the given value.
@ type
Definition: vtkX3D.h:516
@ image
Definition: vtkX3D.h:374
@ size
Definition: vtkX3D.h:253
@ string
Definition: vtkX3D.h:490