VTK  9.3.1
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;
69  void WriteAnActor(
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
abstract class to write a scene to a file
Definition: vtkExporter.h:36
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
virtual void WriteData()=0
char * OBJFileComment
a simple class to control print indentation
Definition: vtkIndent.h:28
handles properties associated with a texture map
Definition: vtkTexture.h:57
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
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
export a scene into Wavefront format.