VTK  9.2.6
vtkGLTFUtils.h File Reference
#include <vtk_nlohmannjson.h>
#include <VTK_NLOHMANN_JSON(json.hpp)>
#include <string>
#include <vector>
Include dependency graph for vtkGLTFUtils.h:

Go to the source code of this file.

Namespaces

namespace  vtkGLTFUtils
 Helper functions for glTF parsing and validation.
 

Typedefs

using vtkGLTFUtils::ChunkInfoType = std::pair<std::string, uint32_t>
 

Functions

bool vtkGLTFUtils::ValidateGLBFile (const std::string &magic, uint32_t version, uint32_t fileLength, std::vector< vtkGLTFUtils::ChunkInfoType > chunkInfo)
 Checks various binary glTF elements for validity.
 
bool vtkGLTFUtils::ExtractGLBFileInformation (const std::string &fileName, std::string &magic, uint32_t &version, uint32_t &fileLength, std::vector< vtkGLTFUtils::ChunkInfoType > &chunkInfo)
 Extract all header information from a binary glTF file.
 
bool vtkGLTFUtils::GetIntValue (const nlohmann::json &root, const std::string &key, int &value)
 Get int value from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::GetUIntValue (const nlohmann::json &root, const std::string &key, unsigned int &value)
 Get int value from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::GetDoubleValue (const nlohmann::json &root, const std::string &key, double &value)
 Get double value from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::GetStringValue (const nlohmann::json &root, const std::string &key, std::string &value)
 Get string value from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::GetBoolValue (const nlohmann::json &root, const std::string &key, bool &value)
 Get bool value from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::GetIntArray (const nlohmann::json &root, const std::string &key, std::vector< int > &value)
 Get int array from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::GetUIntArray (const nlohmann::json &root, const std::string &key, std::vector< unsigned int > &value)
 Get int array from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::GetFloatArray (const nlohmann::json &root, const std::string &key, std::vector< float > &value)
 Get float array from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::GetDoubleArray (const nlohmann::json &root, const std::string &key, std::vector< double > &value)
 Get double array from Json variable, with existence and type checks.
 
bool vtkGLTFUtils::CheckVersion (const nlohmann::json &glTFAsset)
 Check document version.
 
std::string vtkGLTFUtils::GetResourceFullPath (const std::string &resourcePath, const std::string &glTFFilePath)
 Compute the path to a resource from its path as specified in the glTF file, and the glTF file's path.
 
bool vtkGLTFUtils::GetBinaryBufferFromUri (const std::string &uri, const std::string &glTFFileName, std::vector< char > &buffer, size_t bufferSize)
 Load binary buffer from uri information.
 
std::string vtkGLTFUtils::GetDataUriMimeType (const std::string &uri)
 Extract MIME-Type from data-uri.
 

Variables

const uint32_t vtkGLTFUtils::GLBWordSize = 4
 
const uint32_t vtkGLTFUtils::GLBHeaderSize = 12
 
const uint32_t vtkGLTFUtils::GLBChunkHeaderSize = 8
 
const uint32_t vtkGLTFUtils::GLBVersion = 2