37 #ifndef vtkGLTFDocumentLoader_h
38 #define vtkGLTFDocumentLoader_h
40 #include "vtkIOGeometryModule.h"
72 ELEMENT_ARRAY_BUFFER = 34963
100 UNSIGNED_SHORT = 5123,
349 NEAREST_MIPMAP_NEAREST = 9984,
350 LINEAR_MIPMAP_NEAREST = 9985,
351 NEAREST_MIPMAP_LINEAR = 9986,
352 LINEAR_MIPMAP_LINEAR = 9987
356 CLAMP_TO_EDGE = 33071,
357 MIRRORED_REPEAT = 33648,
420 bool forceStep =
false,
bool isRotation =
false)
const;
583 struct AccessorLoadingWorker;
585 struct SparseAccessorLoadingWorker;
587 template <
typename Type>
588 struct BufferDataExtractionWorker;
596 bool LoadSkinMatrixData();
602 bool ExtractPrimitiveAttributes(
Primitive& primitive);
610 bool ExtractPrimitiveAccessorData(
Primitive& primitive);
616 bool BuildPolyDataFromPrimitive(
Primitive& primitive);
621 bool LoadAnimationData();
626 bool LoadImageData();
636 std::shared_ptr<Model> InternalModel;
638 static const std::vector<std::string> SupportedExtensions;
639 std::vector<std::string> UsedExtensions;
object to represent cell connectivity
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of float
Deserialize a GLTF model file.
AccessorType
Defines an accessor's type.
const std::vector< std::string > & GetSupportedExtensions()
Get the list of extensions that are supported by this loader.
static vtkGLTFDocumentLoader * New()
void ResetAnimation(int animationId)
Restore the transforms that were modified by an animation to their initial state.
bool LoadModelData(const std::vector< char > &glbBuffer)
Load buffer data into the internal Model.
static unsigned int GetNumberOfComponentsForType(vtkGLTFDocumentLoader::AccessorType type)
Returns the number of components for a given accessor type.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Target
Define an openGL draw target.
bool ApplyAnimation(float t, int animationId, bool forceStep=false)
Apply the specified animation, at the specified time, to the internal Model.
~vtkGLTFDocumentLoader() override=default
vtkGLTFDocumentLoader()=default
std::shared_ptr< Model > GetInternalModel()
Get the internal Model.
const std::vector< std::string > & GetUsedExtensions()
Get the list of extensions that are used by the current model.
ComponentType
Define a type for different data components.
bool LoadFileBuffer(const std::string &fileName, std::vector< char > &glbBuffer)
Load the binary part of a binary glTF (.glb) file.
bool LoadModelMetaDataFromFile(std::string FileName)
Reset internal Model struct, and serialize glTF metadata (all json information) into it.
bool BuildModelVTKGeometry()
Converts the internal Model's loaded data into more convenient vtk objects.
topologically and geometrically regular array of data
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
abstract base class for most VTK objects
represent and manipulate 3D points
concrete dataset represents vertices, lines, polygons, and triangle strips
dynamic, self-adjusting array of unsigned short
This struct describes an accessor.sparse glTF object.
ComponentType IndicesComponentType
This struct describes an accessor glTF object.
unsigned int NumberOfComponents
std::vector< double > Max
std::vector< double > Min
ComponentType ComponentTypeValue
vtkSmartPointer< vtkFloatArray > OutputData
vtkSmartPointer< vtkFloatArray > InputData
InterpolationMode Interpolation
void GetInterpolatedData(float t, size_t numberOfComponents, std::vector< float > *output, bool forceStep=false, bool isRotation=false) const
Get the interpolated animation output at time t.
This struct describes a glTF animation object.
std::vector< Animation::Channel > Channels
std::vector< Animation::Sampler > Samplers
This struct describes a glTF bufferView object.
This struct describes a glTF camera object.
double SpotOuterConeAngle
double SpotInnerConeAngle
std::vector< double > Color
std::vector< Light > Lights
This struct contains extension metadata.
KHRLightsPunctual KHRLightsPunctualMetaData
This struct describes a glTF image object.
vtkSmartPointer< vtkImageData > ImageData
This struct describes a glTF material object.
std::vector< double > EmissiveFactor
TextureInfo NormalTexture
TextureInfo OcclusionTexture
double OcclusionTextureStrength
TextureInfo EmissiveTexture
double NormalTextureScale
PbrMetallicRoughness PbrMetallicRoughness
This struct describes a glTF mesh object.
std::vector< float > Weights
std::vector< struct Primitive > Primitives
This struct contains all data from a gltf asset.
std::vector< std::vector< char > > Buffers
std::vector< Camera > Cameras
std::vector< Image > Images
std::string BufferMetaData
std::vector< Mesh > Meshes
std::vector< Sampler > Samplers
std::vector< Skin > Skins
std::vector< Scene > Scenes
std::vector< BufferView > BufferViews
Extensions ExtensionMetaData
std::vector< Texture > Textures
std::vector< Node > Nodes
std::vector< Animation > Animations
std::vector< Material > Materials
std::vector< Accessor > Accessors
This struct describes a glTF Morph Target object.
std::map< std::string, vtkSmartPointer< vtkFloatArray > > AttributeValues
std::map< std::string, int > AttributeIndices
Node::Extensions::KHRLightsPunctual KHRLightsPunctualMetaData
This struct describes a glTF node object.
vtkSmartPointer< vtkTransform > GlobalTransform
vtkSmartPointer< vtkMatrix4x4 > Matrix
std::vector< float > Scale
Node::Extensions ExtensionMetaData
std::vector< int > Children
std::vector< float > InitialRotation
std::vector< float > Weights
vtkSmartPointer< vtkTransform > Transform
std::vector< float > InitialWeights
std::vector< float > InitialTranslation
std::vector< float > InitialScale
std::vector< float > Rotation
std::vector< float > Translation
This struct describes a glTF primitive object.
vtkSmartPointer< vtkCellArray > Indices
std::map< std::string, int > AttributeIndices
std::vector< MorphTarget > Targets
vtkSmartPointer< vtkPolyData > Geometry
std::map< std::string, vtkSmartPointer< vtkDataArray > > AttributeValues
This struct describes a glTF sampler object.
This struct describes a glTF scene object.
std::vector< unsigned int > Nodes
This struct describes a glTF asset.
std::vector< vtkSmartPointer< vtkMatrix4x4 > > InverseBindMatrices
std::vector< int > Joints
int InverseBindMatricesAccessorId
This struct describes a glTF textureInfo object, mostly used in material descriptions They contain tw...
This struct describes a glTF texture object.