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