VTK: IO/Export/vtkOBJExporter.h Source File

| 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
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:
74 vtkOBJExporter();
75 ~vtkOBJExporter() override;
76
77 void WriteData() override;
78 void WriteAnActor(
79 vtkActor* anActor, std::ostream& fpObj, std::ostream& fpMat, std::string& modelName, int& id);
80 char* FilePrefix;
81 char* OBJFileComment;
82 char* MTLFileComment;
83 bool FlipTexture;
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
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
vtkExporter
abstract class to write a scene to a file
Definition: vtkExporter.h:37
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkOBJExporter
export a scene into Wavefront format.
Definition: vtkOBJExporter.h:42
vtkOBJExporter::New
static vtkOBJExporter * New()
vtkOBJExporter::WriteAnActor
void WriteAnActor(vtkActor *anActor, std::ostream &fpObj, std::ostream &fpMat, std::string &modelName, int &id)
vtkOBJExporter::vtkSetFilePathMacro
vtkSetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
vtkOBJExporter::WriteData
void WriteData() override
vtkOBJExporter::FilePrefix
char * FilePrefix
Definition: vtkOBJExporter.h:80
vtkOBJExporter::FlipTexture
bool FlipTexture
Definition: vtkOBJExporter.h:83
vtkOBJExporter::~vtkOBJExporter
~vtkOBJExporter() override
vtkOBJExporter::OBJFileComment
char * OBJFileComment
Definition: vtkOBJExporter.h:81
vtkOBJExporter::vtkGetFilePathMacro
vtkGetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
vtkOBJExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOBJExporter::vtkOBJExporter
vtkOBJExporter()
vtkOBJExporter::MTLFileComment
char * MTLFileComment
Definition: vtkOBJExporter.h:82
vtkOBJExporter::TextureFileMap
std::map< std::string, vtkTexture * > TextureFileMap
Definition: vtkOBJExporter.h:84
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:67
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkExporter.h