VTK  9.6.20260614
vtkOBJWriter.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
20
21#ifndef vtkOBJWriter_h
22#define vtkOBJWriter_h
23
24#include "vtkIOGeometryModule.h" // For export macro
25#include "vtkWriter.h"
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkDataSet;
30class vtkImageData;
31class vtkPolyData;
33
34class VTKIOGEOMETRY_EXPORT vtkOBJWriter : public vtkWriter
35{
36public:
37 static vtkOBJWriter* New();
38 vtkTypeMacro(vtkOBJWriter, vtkWriter);
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42
47 vtkDataSet* GetInput(int port);
49
51
56 vtkSetFilePathMacro(TextureFileName);
57 vtkGetFilePathMacro(TextureFileName);
59
61
67
69
81 vtkSetMacro(WriteColorArray, bool);
82 vtkGetMacro(WriteColorArray, bool);
83 vtkBooleanMacro(WriteColorArray, bool);
85
87
90 vtkSetMacro(ColorArrayName, std::string);
91 vtkGetMacro(ColorArrayName, std::string);
93
95
99 vtkSetMacro(UseRelativeTexturePath, bool);
100 vtkGetMacro(UseRelativeTexturePath, bool);
101 vtkBooleanMacro(UseRelativeTexturePath, bool);
103
104protected:
106 ~vtkOBJWriter() override;
107
108 bool WriteDataAndReturn() override;
109 int FillInputPortInformation(int port, vtkInformation* info) override;
110
111private:
112 vtkOBJWriter(const vtkOBJWriter&) = delete;
113 void operator=(const vtkOBJWriter&) = delete;
114
115 char* FileName{ nullptr };
116 char* TextureFileName{ nullptr };
117
118 std::string ColorArrayName;
119 bool WriteColorArray{ false };
120
121 bool UseRelativeTexturePath{ false };
122};
123
124VTK_ABI_NAMESPACE_END
125#endif
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
vtkGetFilePathMacro(TextureFileName)
Get/Set the path to an existing texture file for the OBJ.
vtkSetFilePathMacro(FileName)
Get/Set the file name of the OBJ file.
vtkSetFilePathMacro(TextureFileName)
Get/Set the path to an existing texture file for the OBJ.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
static vtkOBJWriter * New()
vtkGetFilePathMacro(FileName)
Get/Set the file name of the OBJ file.
bool WriteDataAndReturn() override
vtkDataSet * GetInput(int port)
Get the inputs to this writer.
vtkPolyData * GetInputGeometry()
Get the inputs to this writer.
~vtkOBJWriter() override
vtkImageData * GetInputTexture()
Get the inputs to this writer.
concrete dataset represents vertices, lines, polygons, and triangle strips
dynamic, self-adjusting array of unsigned char