VTK  9.0.3
vtkGLTFImporter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGLTFImporter.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 =========================================================================*/
15 
58 #ifndef vtkGLTFImporter_h
59 #define vtkGLTFImporter_h
60 
61 #include "vtkIOImportModule.h" // For export macro
62 #include "vtkImporter.h"
63 #include "vtkSmartPointer.h" // For SmartPointer
64 
65 #include <map> // For map
66 #include <vector> // For vector
67 
68 class vtkCamera;
70 class vtkTexture;
71 
72 class VTKIOIMPORT_EXPORT vtkGLTFImporter : public vtkImporter
73 {
74 public:
75  static vtkGLTFImporter* New();
76 
77  vtkTypeMacro(vtkGLTFImporter, vtkImporter);
78  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
81 
84  vtkSetStringMacro(FileName);
85  vtkGetStringMacro(FileName);
87 
94 
99 
103  std::string GetOutputsDescription() override { return this->OutputsDescription; };
104 
105 protected:
106  vtkGLTFImporter() = default;
107  ~vtkGLTFImporter() override;
108 
109  int ImportBegin() override;
110  void ImportActors(vtkRenderer* renderer) override;
111  void ImportCameras(vtkRenderer* renderer) override;
112  void ImportLights(vtkRenderer* renderer) override;
113 
114  char* FileName = nullptr;
115 
116  std::vector<vtkSmartPointer<vtkCamera> > Cameras;
117  std::map<int, vtkSmartPointer<vtkTexture> > Textures;
120 
121 private:
122  vtkGLTFImporter(const vtkGLTFImporter&) = delete;
123  void operator=(const vtkGLTFImporter&) = delete;
124 };
125 
126 #endif
a virtual camera for 3D rendering
Definition: vtkCamera.h:46
Deserialize a GLTF model file.
Import a GLTF file.
size_t GetNumberOfCameras()
Get the total number of cameras.
~vtkGLTFImporter() override
std::string OutputsDescription
std::map< int, vtkSmartPointer< vtkTexture > > Textures
std::string GetOutputsDescription() override
Get a printable string describing all outputs.
vtkGLTFImporter()=default
void ImportActors(vtkRenderer *renderer) override
static vtkGLTFImporter * New()
vtkSmartPointer< vtkGLTFDocumentLoader > Loader
int ImportBegin() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkCamera > GetCamera(unsigned int id)
glTF defines multiple camera objects, but no default behavior for which camera should be used.
void ImportLights(vtkRenderer *renderer) override
void ImportCameras(vtkRenderer *renderer) override
std::vector< vtkSmartPointer< vtkCamera > > Cameras
importer abstract class
Definition: vtkImporter.h:60
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract specification for renderers
Definition: vtkRenderer.h:59
Hold a reference to a vtkObjectBase instance.
handles properties associated with a texture map
Definition: vtkTexture.h:66
@ string
Definition: vtkX3D.h:496