28 #ifndef vtkGLTFDocumentLoader_h
29 #define vtkGLTFDocumentLoader_h
32 #include "vtkIOGeometryModule.h"
44 VTK_ABI_NAMESPACE_BEGIN
95 UNSIGNED_SHORT = 5123,
255 void UpdateTransform();
280 double Rotation = 0.0;
419 void GetInterpolatedData(
float t,
size_t numberOfComponents, std::vector<float>* output,
420 bool forceStep =
false,
bool isRotation =
false)
const;
532 bool ApplyAnimation(
float t,
int animationId,
bool forceStep =
false);
537 void ResetAnimation(
int animationId);
559 bool LoadModelMetaDataFromStream(
566 bool LoadModelData(
const std::vector<char>& glbBuffer);
571 bool BuildModelVTKGeometry();
576 std::shared_ptr<Model> GetInternalModel();
586 virtual std::vector<std::string> GetSupportedExtensions();
591 const std::vector<std::string>& GetUsedExtensions();
609 void BuildGlobalTransforms();
614 static void ComputeJointMatrices(
const Model& model,
const Skin& skin,
Node& node,
631 vtkSetMacro(GLBStart, vtkTypeInt64);
632 vtkGetMacro(GLBStart, vtkTypeInt64);
641 vtkSetMacro(LoadAnimation,
bool);
642 vtkGetMacro(LoadAnimation,
bool);
643 vtkBooleanMacro(LoadAnimation,
bool);
652 vtkSetMacro(LoadImages,
bool);
653 vtkGetMacro(LoadImages,
bool);
654 vtkBooleanMacro(LoadImages,
bool);
663 vtkSetMacro(LoadSkinMatrix,
bool);
664 vtkGetMacro(LoadSkinMatrix,
bool);
665 vtkBooleanMacro(LoadSkinMatrix,
bool);
673 struct AccessorLoadingWorker;
675 struct SparseAccessorLoadingWorker;
677 template <
typename Type>
678 struct BufferDataExtractionWorker;
686 bool LoadSkinMatrixData();
692 bool ExtractPrimitiveAttributes(Primitive& primitive);
700 bool ExtractPrimitiveAccessorData(Primitive& primitive);
706 bool BuildPolyDataFromPrimitive(Primitive& primitive);
711 bool BuildPolyDataFromSkin(Skin& skin);
716 bool LoadAnimationData();
721 bool LoadImageData();
723 std::shared_ptr<Model> InternalModel;
725 static const std::vector<std::string> SupportedExtensions;
726 std::vector<std::string> UsedExtensions;
727 bool IsBinary =
false;
728 vtkTypeInt64 GLBStart = 0;
733 bool LoadAnimation =
true;
734 bool LoadImages =
true;
735 bool LoadSkinMatrix =
true;
738 VTK_ABI_NAMESPACE_END
int InverseBindMatricesAccessorId
InterpolationMode Interpolation
std::vector< double > Offset
std::vector< float > InitialWeights
This struct contains all data from a gltf asset.
std::vector< float > Rotation
std::string BufferMetaData
std::vector< double > Color
std::vector< int > Children
std::vector< Sampler > Samplers
abstract base class for most VTK objects
represent and manipulate 4x4 transformation matrices
AccessorType
Defines an accessor's type.
vtkSmartPointer< vtkResourceStream > Stream
std::vector< float > Scale
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Abstract class used for custom streams.
This struct describes a glTF animation object.
vtkSmartPointer< vtkMatrix4x4 > Transform
vtkSmartPointer< vtkMatrix4x4 > GlobalTransform
std::set< float > AllTimestamps
vtkSmartPointer< vtkFloatArray > OutputData
std::vector< Image > Images
vtkSmartPointer< vtkMatrix4x4 > Matrix
This struct describes a glTF textureInfo object, mostly used in material descriptions They contain tw...
std::map< std::string, int > AttributeIndices
vtkSmartPointer< vtkPolyData > Armature
dynamic, self-adjusting array of float
This struct describes a glTF scene object.
std::vector< struct Primitive > Primitives
std::map< std::string, int > AttributeIndices
Target
Define an openGL draw target.
vtkSmartPointer< vtkPolyData > Geometry
std::vector< vtkSmartPointer< vtkMatrix4x4 > > InverseBindMatrices
PbrMetallicRoughness PbrMetallicRoughness
std::map< std::string, vtkSmartPointer< vtkFloatArray > > AttributeValues
concrete dataset represents vertices, lines, polygons, and triangle strips
std::vector< Accessor > Accessors
std::vector< MorphTarget > Targets
Node::Extensions ExtensionMetaData
std::vector< Animation::Channel > Channels
std::vector< Light > Lights
std::vector< double > Min
ComponentType IndicesComponentType
Node::Extensions::KHRLightsPunctual KHRLightsPunctualMetaData
vtkSmartPointer< vtkURILoader > URILoader
unsigned int NumberOfComponents
vtkSmartPointer< vtkCellArray > Indices
TextureInfo NormalTexture
vtkSmartPointer< vtkFloatArray > InputData
double NormalTextureScale
virtual void PrepareData()
Some extensions require a preparation on the model before building VTK objects.
std::vector< Skin > Skins
std::vector< double > EmissiveFactor
std::vector< Animation > Animations
This struct describes a glTF texture object.
This struct describes a glTF camera object.
This struct describes a glTF node object.
This struct describes a glTF primitive object.
std::vector< Texture > Textures
a simple class to control print indentation
double SpotInnerConeAngle
std::vector< float > Weights
topologically and geometrically regular array of data
std::vector< double > Scale
abstract superclass for arrays of numeric data
Extensions ExtensionMetaData
std::map< std::string, vtkSmartPointer< vtkDataArray > > AttributeValues
std::vector< Mesh > Meshes
std::map< std::string, int > AttributeIndices
This struct describes an accessor.sparse glTF object.
std::vector< int > Joints
This struct contains extension metadata.
std::vector< Camera > Cameras
std::vector< float > InitialTranslation
std::vector< double > Max
Primitive::Extensions ExtensionMetaData
This struct describes a glTF image object.
This struct describes a glTF material object.
std::vector< float > InitialRotation
#define ELEMENT_ARRAY_BUFFER
std::vector< BufferView > BufferViews
double SpotOuterConeAngle
object to represent cell connectivity
Helper class for readers and importer that need to load more than one resource.
std::vector< std::vector< char > > Buffers
std::vector< unsigned int > Nodes
std::vector< float > Translation
std::vector< Material > Materials
This struct describes a glTF sampler object.
TextureInfo OcclusionTexture
std::vector< float > InitialScale
vtkSmartPointer< vtkImageData > ImageData
double OcclusionTextureStrength
Deserialize a GLTF model file.
This struct describes an accessor glTF object.
ComponentType ComponentTypeValue
TextureInfo EmissiveTexture
This struct describes a glTF bufferView object.
std::vector< Scene > Scenes
std::vector< Node > Nodes
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
This struct describes a glTF asset.
Primitive::Extensions::KHRDracoMeshCompression KHRDracoMetaData
KHRLightsPunctual KHRLightsPunctualMetaData
std::vector< float > Weights
This struct describes a glTF mesh object.
represent and manipulate 3D points
ComponentType
Define a type for different data components.
This struct describes a glTF Morph Target object.
This struct describes a glTF sampler object.
dynamic, self-adjusting array of unsigned short
std::vector< Animation::Sampler > Samplers