VTK  9.7.1
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
21 #ifndef vtkOBJWriter_h
22 #define vtkOBJWriter_h
23 
24 #include "vtkIOGeometryModule.h" // For export macro
25 #include "vtkWriter.h"
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkDataSet;
30 class vtkImageData;
31 class vtkPolyData;
33 
34 class VTKIOGEOMETRY_EXPORT vtkOBJWriter : public vtkWriter
35 {
36 public:
37  static vtkOBJWriter* New();
38  vtkTypeMacro(vtkOBJWriter, vtkWriter);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
45  vtkPolyData* GetInputGeometry();
46  vtkImageData* GetInputTexture();
47  vtkDataSet* GetInput(int port);
49 
51 
56  vtkSetFilePathMacro(TextureFileName);
57  vtkGetFilePathMacro(TextureFileName);
59 
61 
64  vtkSetFilePathMacro(FileName);
65  vtkGetFilePathMacro(FileName);
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 
104 protected:
105  vtkOBJWriter();
106  ~vtkOBJWriter() override;
107 
108  bool WriteDataAndReturn() override;
109  int FillInputPortInformation(int port, vtkInformation* info) override;
110 
111 private:
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 
124 VTK_ABI_NAMESPACE_END
125 #endif
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
abstract class to write data to file(s)
Definition: vtkWriter.h:35
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkDataObject * GetInput()
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
represent and manipulate attribute data in a dataset
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
dynamic, self-adjusting array of unsigned char
static vtkAlgorithm * New()
virtual bool WriteDataAndReturn()
write wavefront obj file
Definition: vtkOBJWriter.h:34