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