VTK  9.2.5
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=========================================================================*/
26#ifndef vtkGeoJSONWriter_h
27#define vtkGeoJSONWriter_h
28
29#include "vtkIOGeoJSONModule.h" // For export macro
30#include "vtkWriter.h"
31
32class vtkLookupTable;
33
34class VTKIOGEOJSON_EXPORT vtkGeoJSONWriter : public vtkWriter
35{
36public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42
48
50
53 vtkSetMacro(WriteToOutputString, bool);
54 vtkGetMacro(WriteToOutputString, bool);
55 vtkBooleanMacro(WriteToOutputString, bool);
57
59
64 vtkGetMacro(OutputStringLength, int);
65 vtkGetStringMacro(OutputString);
66 unsigned char* GetBinaryOutputString()
67 {
68 return reinterpret_cast<unsigned char*>(this->OutputString);
69 }
71
73
79 vtkSetMacro(ScalarFormat, int);
80 vtkGetMacro(ScalarFormat, int);
82
84
88 vtkGetObjectMacro(LookupTable, vtkLookupTable);
90
96
103
104protected:
107
108 // Only accepts vtkPolyData
109 int FillInputPortInformation(int port, vtkInformation* info) override;
110
111 // Implementation of Write()
112 void WriteData() override;
113
114 // Helper for Write that writes attributes out
117
121
123
124 // Internal helpers
125 ostream* OpenFile();
127 void CloseFile(ostream*);
128 class Internals;
129 Internals* WriterHelper;
130 char* FileName;
131
132private:
133 vtkGeoJSONWriter(const vtkGeoJSONWriter&) = delete;
134 void operator=(const vtkGeoJSONWriter&) = delete;
135};
136
137#endif // vtkGeoJSONWriter_h
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:56
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:40
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:39
abstract class to write data to file(s)
Definition: vtkWriter.h:46
int vtkIdType
Definition: vtkType.h:332