VTK  9.3.0
vtkOBJExporter.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
28 #ifndef vtkOBJExporter_h
29 #define vtkOBJExporter_h
30 
31 #include "vtkExporter.h"
32 #include "vtkIOExportModule.h" // For export macro
33 #include <fstream> // For ofstream
34 #include <map> // For map
35 #include <vector> // For string
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 class vtkActor;
39 class vtkTexture;
40 
41 class VTKIOEXPORT_EXPORT vtkOBJExporter : public vtkExporter
42 {
43 public:
44  static vtkOBJExporter* New();
45  vtkTypeMacro(vtkOBJExporter, vtkExporter);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
53  vtkSetFilePathMacro(FilePrefix);
54  vtkGetFilePathMacro(FilePrefix);
56 
58 
61  vtkSetStringMacro(OBJFileComment);
62  vtkGetStringMacro(OBJFileComment);
64 
66 
69  vtkSetStringMacro(MTLFileComment);
70  vtkGetStringMacro(MTLFileComment);
72 
73 protected:
75  ~vtkOBJExporter() override;
76 
77  void WriteData() override;
79  vtkActor* anActor, std::ostream& fpObj, std::ostream& fpMat, std::string& modelName, int& id);
80  char* FilePrefix;
84  std::map<std::string, vtkTexture*> TextureFileMap;
85 
86 private:
87  vtkOBJExporter(const vtkOBJExporter&) = delete;
88  void operator=(const vtkOBJExporter&) = delete;
89 };
90 
91 VTK_ABI_NAMESPACE_END
92 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
abstract class to write a scene to a file
Definition: vtkExporter.h:37
a simple class to control print indentation
Definition: vtkIndent.h:38
export a scene into Wavefront format.
static vtkOBJExporter * New()
void WriteAnActor(vtkActor *anActor, std::ostream &fpObj, std::ostream &fpMat, std::string &modelName, int &id)
vtkSetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
void WriteData() override
~vtkOBJExporter() override
char * OBJFileComment
vtkGetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
char * MTLFileComment
std::map< std::string, vtkTexture * > TextureFileMap
handles properties associated with a texture map
Definition: vtkTexture.h:67
@ string
Definition: vtkX3D.h:490