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 =========================================================================*/
21 #ifndef vtkX3DExporterXMLWriter_h
22 #define vtkX3DExporterXMLWriter_h
23 
24 #include "vtkIOExportModule.h" // For export macro
25 #include "vtkX3DExporterWriter.h"
26 
27 class vtkX3DExporterXMLNodeInfoStack;
28 
30 {
31 
32 public:
33  static vtkX3DExporterXMLWriter *New();
35  void PrintSelf(ostream& os, vtkIndent indent);
36 
37  virtual void CloseFile();
38  virtual int OpenFile(const char* file);
39  virtual void Flush();
40 
41  virtual int OpenStream();
42 
43  void StartDocument();
44  void EndDocument();
45 
46  // Elements
47  void StartNode(int elementID);
48  void EndNode();
49 
50  // Attributes
51  // SFString / MFString
52  void SetField(int attributeID, const char*, bool mfstring = true);
53  // SFInt32
54  void SetField(int attributeID, int);
55  // SFFloat
56  void SetField(int attributeID, float);
57  // SFDouble
58  void SetField(int attributeID, double);
59  // SFBool
60  void SetField(int attributeID, bool);
61 
62  // For MFxxx attributes
63  void SetField(int attributeID, int type, const double* a);
64  void SetField(int attributeID, int type, vtkDataArray* a);
65  void SetField(int attributeID, const double* values, size_t size);
66  // MFInt32, SFIMAGE
67  void SetField(int attributeID, const int* values, size_t size, bool image = false);
68 
69 protected:
72 
73 private:
74 
75  const char* GetNewline() { return "\n"; };
76  void AddDepth();
77  void SubDepth();
78 
79  std::string ActTab;
80  int Depth;
81  ostream *OutputStream;
82  vtkX3DExporterXMLNodeInfoStack* InfoStack;
83 
84  vtkX3DExporterXMLWriter(const vtkX3DExporterXMLWriter&); // Not implemented.
85  void operator=(const vtkX3DExporterXMLWriter&); // Not implemented.
86 
87 };
88 
89 #endif
90 
X3D Exporter Writer.
virtual void StartNode(int nodeID)=0
virtual void EndNode()=0
#define VTKIOEXPORT_EXPORT
virtual void CloseFile()=0
virtual int OpenStream()=0
void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void SetField(int attributeID, const char *value, bool mfstring=false)=0
X3D Exporter XML Writer.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual void StartDocument()=0
virtual void EndDocument()=0
static vtkObject * New()
virtual int OpenFile(const char *file)=0