VTK
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 
32 class vtkLookupTable;
33 
34 class VTKIOGEOJSON_EXPORT vtkGeoJSONWriter : public vtkWriter
35 {
36 public:
37  static vtkGeoJSONWriter* New();
38  virtual void PrintSelf( ostream& os, vtkIndent indent );
39  vtkTypeMacro(vtkGeoJSONWriter,vtkWriter);
40 
42 
45  vtkSetStringMacro(FileName);
46  vtkGetStringMacro(FileName);
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 
104 protected:
106  virtual ~vtkGeoJSONWriter();
107 
108  // Only accepts vtkPolyData
110 
111  // Implementation of Write()
112  void WriteData();
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 
132 private:
133  vtkGeoJSONWriter(const vtkGeoJSONWriter&) VTK_DELETE_FUNCTION;
134  void operator=(const vtkGeoJSONWriter&) VTK_DELETE_FUNCTION;
135 };
136 
137 #endif // vtkGeoJSONWriter_h
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkGeoJSONWriter::WriteToOutputString
bool WriteToOutputString
Definition: vtkGeoJSONWriter.h:118
vtkGeoJSONWriter::RegisterAndGetOutputString
char * RegisterAndGetOutputString()
This convenience method returns the string, sets the IVAR to NULL, so that the user is responsible fo...
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkGeoJSONWriter::GetOutputStdString
vtkStdString GetOutputStdString()
When WriteToOutputString is on, this method returns a copy of the output string in a vtkStdString.
vtkGeoJSONWriter::WriteScalar
void WriteScalar(vtkDataArray *da, vtkIdType ptId)
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkGeoJSONWriter
Convert vtkPolyData to Geo JSON format.
Definition: vtkGeoJSONWriter.h:35
vtkGeoJSONWriter::CloseFile
void CloseFile(ostream *)
vtkGeoJSONWriter::vtkGeoJSONWriter
vtkGeoJSONWriter()
vtkGeoJSONWriter::GetBinaryOutputString
unsigned char * GetBinaryOutputString()
Definition: vtkGeoJSONWriter.h:66
vtkGeoJSONWriter::ConditionalComma
void ConditionalComma(vtkIdType, vtkIdType)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkWriter
abstract class to write data to file(s)
Definition: vtkWriter.h:43
vtkGeoJSONWriter::OutputString
char * OutputString
Definition: vtkGeoJSONWriter.h:119
vtkGeoJSONWriter::OpenFile
ostream * OpenFile()
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkGeoJSONWriter::OutputStringLength
int OutputStringLength
Definition: vtkGeoJSONWriter.h:120
vtkGeoJSONWriter::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkGeoJSONWriter::WriteData
void WriteData()
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGeoJSONWriter::WriterHelper
Internals * WriterHelper
Definition: vtkGeoJSONWriter.h:128
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:75
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkGeoJSONWriter::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkWriter.h
vtkGeoJSONWriter::SetLookupTable
void SetLookupTable(vtkLookupTable *lut)
Controls the lookup table to use when ValueMode is set to map colors;.
vtkGeoJSONWriter::New
static vtkGeoJSONWriter * New()
vtkGeoJSONWriter::LookupTable
vtkLookupTable * LookupTable
Definition: vtkGeoJSONWriter.h:116
vtkGeoJSONWriter::~vtkGeoJSONWriter
virtual ~vtkGeoJSONWriter()
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
vtkGeoJSONWriter::ScalarFormat
int ScalarFormat
Definition: vtkGeoJSONWriter.h:122
vtkGeoJSONWriter::FileName
char * FileName
Definition: vtkGeoJSONWriter.h:130