VTK  9.0.20200921
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 
93  vtkSmartPointer<vtkCamera> GetCamera(unsigned int id);
94 
98  size_t GetNumberOfCameras();
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
vtkGLTFImporter::Cameras
std::vector< vtkSmartPointer< vtkCamera > > Cameras
Definition: vtkGLTFImporter.h:116
vtkImporter
importer abstract class
Definition: vtkImporter.h:59
vtkImporter.h
vtkImporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkGLTFImporter::Textures
std::map< int, vtkSmartPointer< vtkTexture > > Textures
Definition: vtkGLTFImporter.h:117
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:32
vtkGLTFImporter::GetOutputsDescription
std::string GetOutputsDescription() override
Get a printable string describing all outputs.
Definition: vtkGLTFImporter.h:103
vtkImporter::ImportCameras
virtual void ImportCameras(vtkRenderer *)
Definition: vtkImporter.h:142
vtkGLTFImporter::Loader
vtkSmartPointer< vtkGLTFDocumentLoader > Loader
Definition: vtkGLTFImporter.h:118
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:65
vtkImporter::ImportLights
virtual void ImportLights(vtkRenderer *)
Definition: vtkImporter.h:143
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImporter::ImportBegin
virtual int ImportBegin()
Definition: vtkImporter.h:139
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:45
vtkSmartPointer.h
vtkGLTFImporter::OutputsDescription
std::string OutputsDescription
Definition: vtkGLTFImporter.h:119
vtkGLTFImporter
Import a GLTF file.
Definition: vtkGLTFImporter.h:72
vtkImporter::ImportActors
virtual void ImportActors(vtkRenderer *)
Definition: vtkImporter.h:141
vtkX3D::string
Definition: vtkX3D.h:496
vtkGLTFDocumentLoader
Deserialize a GLTF model file.
Definition: vtkGLTFDocumentLoader.h:62
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67