VTK  9.1.0
vtkGeoJSONWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkGeoJSONWriter.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=========================================================================*/
23#ifndef vtkGeoJSONWriter_h
24#define vtkGeoJSONWriter_h
25
26#include "vtkIOGeoJSONModule.h" // For export macro
27#include "vtkWriter.h"
28
29class vtkLookupTable;
30
31class VTKIOGEOJSON_EXPORT vtkGeoJSONWriter : public vtkWriter
32{
33public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
37
39
45
47
50 vtkSetMacro(WriteToOutputString, bool);
51 vtkGetMacro(WriteToOutputString, bool);
52 vtkBooleanMacro(WriteToOutputString, bool);
54
56
61 vtkGetMacro(OutputStringLength, int);
62 vtkGetStringMacro(OutputString);
63 unsigned char* GetBinaryOutputString()
64 {
65 return reinterpret_cast<unsigned char*>(this->OutputString);
66 }
68
70
76 vtkSetMacro(ScalarFormat, int);
77 vtkGetMacro(ScalarFormat, int);
79
81
85 vtkGetObjectMacro(LookupTable, vtkLookupTable);
87
93
100
101protected:
104
105 // Only accepts vtkPolyData
106 int FillInputPortInformation(int port, vtkInformation* info) override;
107
108 // Implementation of Write()
109 void WriteData() override;
110
111 // Helper for Write that writes attributes out
114
118
120
121 // Internal helpers
122 ostream* OpenFile();
124 void CloseFile(ostream*);
125 class Internals;
126 Internals* WriterHelper;
127 char* FileName;
128
129private:
130 vtkGeoJSONWriter(const vtkGeoJSONWriter&) = delete;
131 void operator=(const vtkGeoJSONWriter&) = delete;
132};
133
134#endif // vtkGeoJSONWriter_h
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
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:113
Store vtkAlgorithm input/output information.
map scalar values into colors via a lookup table
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
abstract class to write data to file(s)
Definition: vtkWriter.h:46
int vtkIdType
Definition: vtkType.h:332