VTK  9.2.5
vtkOBJExporter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOBJExporter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
50 #ifndef vtkOBJExporter_h
51 #define vtkOBJExporter_h
52 
53 #include "vtkExporter.h"
54 #include "vtkIOExportModule.h" // For export macro
55 #include <fstream> // For ofstream
56 #include <map> // For map
57 #include <vector> // For string
58 
59 class vtkActor;
60 class vtkTexture;
61 
62 class VTKIOEXPORT_EXPORT vtkOBJExporter : public vtkExporter
63 {
64 public:
65  static vtkOBJExporter* New();
66  vtkTypeMacro(vtkOBJExporter, vtkExporter);
67  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
70 
74  vtkSetFilePathMacro(FilePrefix);
75  vtkGetFilePathMacro(FilePrefix);
77 
79 
82  vtkSetStringMacro(OBJFileComment);
83  vtkGetStringMacro(OBJFileComment);
85 
87 
90  vtkSetStringMacro(MTLFileComment);
91  vtkGetStringMacro(MTLFileComment);
93 
94 protected:
96  ~vtkOBJExporter() override;
97 
98  void WriteData() override;
100  vtkActor* anActor, std::ostream& fpObj, std::ostream& fpMat, std::string& modelName, int& id);
101  char* FilePrefix;
105  std::map<std::string, vtkTexture*> TextureFileMap;
106 
107 private:
108  vtkOBJExporter(const vtkOBJExporter&) = delete;
109  void operator=(const vtkOBJExporter&) = delete;
110 };
111 
112 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
abstract class to write a scene to a file
Definition: vtkExporter.h:48
a simple class to control print indentation
Definition: vtkIndent.h:119
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
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.
std::map< std::string, vtkTexture * > TextureFileMap
handles properties associated with a texture map
Definition: vtkTexture.h:178
@ string
Definition: vtkX3D.h:496