VTK  9.3.20240424
vtkGeoJSONWriter.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
14#ifndef vtkGeoJSONWriter_h
15#define vtkGeoJSONWriter_h
16
17#include "vtkIOGeoJSONModule.h" // For export macro
18#include "vtkWriter.h"
19
20VTK_ABI_NAMESPACE_BEGIN
21class vtkLookupTable;
22
23class VTKIOGEOJSON_EXPORT vtkGeoJSONWriter : public vtkWriter
24{
25public:
27 void PrintSelf(ostream& os, vtkIndent indent) override;
29
31
37
39
42 vtkSetMacro(WriteToOutputString, bool);
43 vtkGetMacro(WriteToOutputString, bool);
44 vtkBooleanMacro(WriteToOutputString, bool);
46
48
53 vtkGetMacro(OutputStringLength, int);
54 vtkGetStringMacro(OutputString);
55 unsigned char* GetBinaryOutputString()
56 {
57 return reinterpret_cast<unsigned char*>(this->OutputString);
58 }
60
62
68 vtkSetMacro(ScalarFormat, int);
69 vtkGetMacro(ScalarFormat, int);
71
73
77 vtkGetObjectMacro(LookupTable, vtkLookupTable);
79
85
92
93protected:
96
97 // Only accepts vtkPolyData
98 int FillInputPortInformation(int port, vtkInformation* info) override;
99
100 // Implementation of Write()
101 void WriteData() override;
102
103 // Helper for Write that writes attributes out
106
110
112
113 // Internal helpers
114 ostream* OpenFile();
116 void CloseFile(ostream*);
117 class Internals;
118 Internals* WriterHelper;
119 char* FileName;
120
121private:
122 vtkGeoJSONWriter(const vtkGeoJSONWriter&) = delete;
123 void operator=(const vtkGeoJSONWriter&) = delete;
124};
125
126VTK_ABI_NAMESPACE_END
127#endif // vtkGeoJSONWriter_h
abstract superclass for arrays of numeric data
Convert vtkPolyData to Geo JSON format.
void SetLookupTable(vtkLookupTable *lut)
Controls the lookup table to use when ValueMode is set to map colors;.
void CloseFile(ostream *)
Internals * WriterHelper
vtkGetFilePathMacro(FileName)
Accessor for name of the file that will be opened on WriteData.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void WriteData() override
char * RegisterAndGetOutputString()
This convenience method returns the string, sets the IVAR to nullptr, so that the user is responsible...
vtkSetFilePathMacro(FileName)
Accessor for name of the file that will be opened on WriteData.
unsigned char * GetBinaryOutputString()
When WriteToOutputString in on, then a string is allocated, written to, and can be retrieved with the...
~vtkGeoJSONWriter() override
void WriteScalar(vtkDataArray *da, vtkIdType ptId)
ostream * OpenFile()
void ConditionalComma(vtkIdType, vtkIdType)
vtkStdString GetOutputStdString()
When WriteToOutputString is on, this method returns a copy of the output string in a vtkStdString.
static vtkGeoJSONWriter * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLookupTable * LookupTable
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
map scalar values into colors via a lookup table
Wrapper around std::string to keep symbols short.
abstract class to write data to file(s)
Definition vtkWriter.h:35
int vtkIdType
Definition vtkType.h:315