VTK
vtkX3DExporterFIWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkX3DExporterFIWriter.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 =========================================================================*/
20 #ifndef vtkX3DExporterFIWriter_h
21 #define vtkX3DExporterFIWriter_h
22 
23 #include "vtkIOExportModule.h" // For export macro
24 #include "vtkX3DExporterWriter.h"
25 
26 class vtkX3DExporterFIByteWriter;
27 class vtkX3DExporterFINodeInfoStack;
29 
30 class VTKIOEXPORT_EXPORT vtkX3DExporterFIWriter : public vtkX3DExporterWriter
31 {
32 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
37  void CloseFile() override;
38  int OpenFile(const char* file) override;
39  int OpenStream() override;
40 
41  //void Write(const char* str);
42 
43  void Flush() override;
44 
45  void StartDocument() override;
46  void EndDocument() override;
47 
48  // Elements
49  void StartNode(int elementID) override;
50  void EndNode() override;
51 
52  // Attributes
53  // SFString / MFString
54  //void SetField(int attributeID, const std::string &value);
55  void SetField(int attributeID, const char*, bool mfstring = false) override;
56  // SFInt32
57  void SetField(int attributeID, int) override;
58  // SFFloat
59  void SetField(int attributeID, float) override;
60  // SFDouble
61  void SetField(int attributeID, double) override;
62  // SFBool
63  void SetField(int attributeID, bool) override;
64 
65  // For MFxxx attributes
66  void SetField(int attributeID, int type, const double* a) override;
67  void SetField(int attributeID, int type, vtkDataArray* a) override;
68  void SetField(int attributeID, const double* values, size_t size) override;
69 
70  // MFInt32
71  void SetField(int attributeID, int type, vtkCellArray* a);
72  void SetField(int attributeID, const int* values, size_t size, bool image = false) override;
73 
75 
78  vtkSetClampMacro(Fastest, vtkTypeBool, 0, 1);
79  vtkBooleanMacro(Fastest, vtkTypeBool);
80  vtkGetMacro(Fastest, vtkTypeBool);
82 
83 protected:
86 
87 private:
88  void StartAttribute(int attributeID, bool literal, bool addToTable = false);
89  void EndAttribute();
90 
91  void CheckNode(bool callerIsAttribute = true);
92  bool IsLineFeedEncodingOn;
93 
94  //int Depth;
95  vtkX3DExporterFIByteWriter* Writer;
96  vtkX3DExporterFINodeInfoStack* InfoStack;
97  vtkZLibDataCompressor* Compressor;
98 
99  vtkTypeBool Fastest;
100 
102  void operator=(const vtkX3DExporterFIWriter&) = delete;
103 
104 };
105 
106 #endif
107 
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, const double *values, size_t size) override
Sets the field specified with attributeID of the active node to the given value.
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkX3D::image
@ image
Definition: vtkX3D.h:374
vtkX3DExporterFIWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3DExporterFIWriter::~vtkX3DExporterFIWriter
~vtkX3DExporterFIWriter() override
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, double) override
Sets the field specified with attributeID of the active node to the given value.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, int type, const double *a) override
Sets the field specified with attributeID of the active node to the given value.
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, const char *, bool mfstring=false) override
Sets the field specified with attributeID of the active node to the given value.
vtkX3DExporterFIWriter
Definition: vtkX3DExporterFIWriter.h:31
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, float) override
Sets the field specified with attributeID of the active node to the given value.
vtkX3DExporterFIWriter::CloseFile
void CloseFile() override
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, int type, vtkDataArray *a) override
Sets the field specified with attributeID of the active node to the given value.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkX3DExporterWriter
X3D Exporter Writer.
Definition: vtkX3DExporterWriter.h:36
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:51
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, bool) override
Sets the field specified with attributeID of the active node to the given value.
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkZLibDataCompressor
Data compression using zlib.
Definition: vtkZLibDataCompressor.h:33
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, int) override
Sets the field specified with attributeID of the active node to the given value.
vtkX3DExporterFIWriter::EndDocument
void EndDocument() override
Ends a document and sets all necessary information or necessary bytes to finish the encoding correctl...
vtkX3DExporterFIWriter::New
static vtkX3DExporterFIWriter * New()
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, const int *values, size_t size, bool image=false) override
Sets the field specified with attributeID of the active node to the given value.
vtkX3DExporterFIWriter::StartDocument
void StartDocument() override
Starts a document and sets all necessary information, i.e.
vtkX3DExporterFIWriter::vtkX3DExporterFIWriter
vtkX3DExporterFIWriter()
vtkX3DExporterFIWriter::Flush
void Flush() override
vtkX3DExporterFIWriter::SetField
void SetField(int attributeID, int type, vtkCellArray *a)
vtkX3DExporterFIWriter::EndNode
void EndNode() override
vtkX3DExporterFIWriter::StartNode
void StartNode(int elementID) override
Starts/ends a new X3D node specified via nodeID.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkX3DExporterFIWriter::OpenStream
int OpenStream() override
Init data support to be a stream instead of a file.
vtkX3DExporterFIWriter::OpenFile
int OpenFile(const char *file) override
Opens the file specified with file returns 1 if successful otherwise 0.
vtkX3DExporterWriter.h