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
19 #ifndef vtkOBJExporter_h
20 #define vtkOBJExporter_h
21 
22 #include "vtkExporter.h"
23 #include "vtkIOExportModule.h" // For export macro
24 #include <fstream> // For ofstream
25 #include <map> // For map
26 #include <vector> // For string
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkActor;
30 class vtkTexture;
31 
32 class VTKIOEXPORT_EXPORT vtkOBJExporter : public vtkExporter
33 {
34 public:
35  static vtkOBJExporter* New();
36  vtkTypeMacro(vtkOBJExporter, vtkExporter);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
44  vtkSetFilePathMacro(FilePrefix);
45  vtkGetFilePathMacro(FilePrefix);
47 
49 
52  vtkSetStringMacro(OBJFileComment);
53  vtkGetStringMacro(OBJFileComment);
55 
57 
60  vtkSetStringMacro(MTLFileComment);
61  vtkGetStringMacro(MTLFileComment);
63 
64 protected:
66  ~vtkOBJExporter() override;
67 
68  void WriteData() override;
70  vtkActor* anActor, std::ostream& fpObj, std::ostream& fpMat, std::string& modelName, int& id);
71  char* FilePrefix;
75  std::map<std::string, vtkTexture*> TextureFileMap;
76 
77 private:
78  vtkOBJExporter(const vtkOBJExporter&) = delete;
79  void operator=(const vtkOBJExporter&) = delete;
80 };
81 
82 VTK_ABI_NAMESPACE_END
83 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
abstract class to write a scene to a file
Definition: vtkExporter.h:37
a simple class to control print indentation
Definition: vtkIndent.h:29
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:58
@ string
Definition: vtkX3D.h:490