VTK  9.2.6
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 =========================================================================*/
40 #ifndef vtkOBJExporter_h
41 #define vtkOBJExporter_h
42 
43 #include "vtkExporter.h"
44 #include "vtkIOExportModule.h" // For export macro
45 #include <fstream> // For ofstream
46 #include <map> // For map
47 #include <vector> // For string
48 
49 class vtkActor;
50 class vtkTexture;
51 
52 class VTKIOEXPORT_EXPORT vtkOBJExporter : public vtkExporter
53 {
54 public:
55  static vtkOBJExporter* New();
56  vtkTypeMacro(vtkOBJExporter, vtkExporter);
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
64  vtkSetFilePathMacro(FilePrefix);
65  vtkGetFilePathMacro(FilePrefix);
67 
69 
72  vtkSetStringMacro(OBJFileComment);
73  vtkGetStringMacro(OBJFileComment);
75 
77 
80  vtkSetStringMacro(MTLFileComment);
81  vtkGetStringMacro(MTLFileComment);
83 
84 protected:
86  ~vtkOBJExporter() override;
87 
88  void WriteData() override;
90  vtkActor* anActor, std::ostream& fpObj, std::ostream& fpMat, std::string& modelName, int& id);
91  char* FilePrefix;
95  std::map<std::string, vtkTexture*> TextureFileMap;
96 
97 private:
98  vtkOBJExporter(const vtkOBJExporter&) = delete;
99  void operator=(const vtkOBJExporter&) = delete;
100 };
101 
102 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:61
abstract class to write a scene to a file
Definition: vtkExporter.h:48
a simple class to control print indentation
Definition: vtkIndent.h:49
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:78
@ string
Definition: vtkX3D.h:496