VTK  9.3.0
vtkGLTFWriter.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
30 #ifndef vtkGLTFWriter_h
31 #define vtkGLTFWriter_h
32 
33 #include "vtkIOGeometryModule.h" // For export macro
34 #include "vtkWriter.h"
35 
36 #include <string> // for std::string
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 class VTKIOGEOMETRY_EXPORT vtkGLTFWriter : public vtkWriter
41 {
42 public:
43  static vtkGLTFWriter* New();
44  vtkTypeMacro(vtkGLTFWriter, vtkWriter);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
51  vtkSetStringMacro(FileName);
52  vtkGetStringMacro(FileName);
54 
56 
59  vtkSetStringMacro(TextureBaseDirectory);
60  vtkGetStringMacro(TextureBaseDirectory);
62 
64 
71  vtkSetStringMacro(PropertyTextureFile);
72  vtkGetStringMacro(PropertyTextureFile);
74 
76 
80  vtkGetMacro(InlineData, bool);
81  vtkSetMacro(InlineData, bool);
82  vtkBooleanMacro(InlineData, bool);
84 
86 
92  vtkGetMacro(SaveNormal, bool);
93  vtkSetMacro(SaveNormal, bool);
94  vtkBooleanMacro(SaveNormal, bool);
96 
98 
108  vtkGetMacro(SaveBatchId, bool);
109  vtkSetMacro(SaveBatchId, bool);
110  vtkBooleanMacro(SaveBatchId, bool);
112 
114 
122  vtkGetMacro(SaveTextures, bool);
123  vtkSetMacro(SaveTextures, bool);
124  vtkBooleanMacro(SaveTextures, bool);
126 
128 
133  vtkGetMacro(CopyTextures, bool);
134  vtkSetMacro(CopyTextures, bool);
135  vtkBooleanMacro(CopyTextures, bool);
137 
139 
149  vtkGetMacro(SaveActivePointColor, bool);
150  vtkSetMacro(SaveActivePointColor, bool);
151  vtkBooleanMacro(SaveActivePointColor, bool);
153 
155 
165  vtkGetMacro(RelativeCoordinates, bool);
166  vtkSetMacro(RelativeCoordinates, bool);
167  vtkBooleanMacro(RelativeCoordinates, bool);
169 
171 
176  vtkGetMacro(Binary, bool);
178 
183 
187  void WriteToStream(ostream& out, vtkDataObject* in);
193  static std::vector<std::string> GetFieldAsStringVector(vtkDataObject* obj, const char* name);
194 
195 protected:
197  ~vtkGLTFWriter() override;
198 
199  void WriteData() override;
202 
203  char* FileName;
213  bool Binary;
214 
215 private:
216  vtkGLTFWriter(const vtkGLTFWriter&) = delete;
217  void operator=(const vtkGLTFWriter&) = delete;
218 };
219 
220 VTK_ABI_NAMESPACE_END
221 #endif
general representation of visualization data
Definition: vtkDataObject.h:55
export a scene into GLTF 2.0 format.
Definition: vtkGLTFWriter.h:41
~vtkGLTFWriter() override
std::string WriteToString()
Write the result to a string instead of a file.
void WriteToStreamMultiBlock(ostream &out, vtkMultiBlockDataSet *in)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
char * PropertyTextureFile
static std::vector< std::string > GetFieldAsStringVector(vtkDataObject *obj, const char *name)
This is used to read texture_uri fields that contain a list of texture paths.
void WriteToStream(ostream &out, vtkDataObject *in)
Write the result to a provided ostream.
bool RelativeCoordinates
bool SaveActivePointColor
static vtkGLTFWriter * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void WriteData() override
char * TextureBaseDirectory
a simple class to control print indentation
Definition: vtkIndent.h:29
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
abstract class to write data to file(s)
Definition: vtkWriter.h:35
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ name
Definition: vtkX3D.h:219
@ string
Definition: vtkX3D.h:490