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