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:
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 
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, int)
vtkX3DExporterXMLWriter
X3D Exporter XML Writer.
Definition: vtkX3DExporterXMLWriter.h:30
vtkX3DExporterXMLWriter::StartDocument
void StartDocument()
vtkIOExportModule.h
vtkX3DExporterXMLWriter::EndDocument
void EndDocument()
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, const int *values, size_t size, bool image=false)
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, const double *values, size_t size)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, double)
vtkX3DExporterXMLWriter::Flush
virtual void Flush()
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, int type, const double *a)
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, float)
vtkX3DExporterXMLWriter::New
static vtkX3DExporterXMLWriter * New()
vtkgl::values
GLboolean GLenum GLenum GLvoid * values
Definition: vtkgl.h:11354
vtkX3DExporterXMLWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkX3DExporterXMLWriter::StartNode
void StartNode(int elementID)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkX3DExporterWriter
X3D Exporter Writer.
Definition: vtkX3DExporterWriter.h:35
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, int type, vtkDataArray *a)
vtkX3DExporterXMLWriter::CloseFile
virtual void CloseFile()
vtkX3DExporterXMLWriter::~vtkX3DExporterXMLWriter
~vtkX3DExporterXMLWriter()
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, bool)
vtkgl::a
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
vtkX3DExporterXMLWriter::EndNode
void EndNode()
vtkX3DExporterXMLWriter::SetField
void SetField(int attributeID, const char *, bool mfstring=true)
vtkX3DExporterXMLWriter::OpenStream
virtual int OpenStream()
vtkX3DExporterXMLWriter::vtkX3DExporterXMLWriter
vtkX3DExporterXMLWriter()
vtkgl::type
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
vtkgl::string
GLsizei const GLchar ** string
Definition: vtkgl.h:12011
vtkgl::image
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: vtkgl.h:11341
vtkX3DExporterXMLWriter::OpenFile
virtual int OpenFile(const char *file)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
vtkX3DExporterWriter.h
VTKIOEXPORT_EXPORT
#define VTKIOEXPORT_EXPORT
Definition: vtkIOExportModule.h:15