MCPcopy Create free account
hub / github.com/Kitware/VTK / LoadMesh

Method LoadMesh

IO/Geometry/vtkGLTFDocumentLoaderInternals.cxx:769–798  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

767
768//------------------------------------------------------------------------------
769bool vtkGLTFDocumentLoaderInternals::LoadMesh(
770 const nlohmann::json& root, vtkGLTFDocumentLoader::Mesh& mesh)
771{
772 if (root.empty() || !root.is_object())
773 {
774 return false;
775 }
776
777 if (!vtkGLTFUtils::GetStringValue(root, "name", mesh.Name))
778 {
779 mesh.Name = "";
780 }
781
782 // Load primitives
783 for (const auto& glTFPrimitive : root.value("primitives", nlohmann::json::array()))
784 {
785 vtkGLTFDocumentLoader::Primitive primitive;
786 if (this->LoadPrimitive(glTFPrimitive, primitive))
787 {
788 mesh.Primitives.emplace_back(std::move(primitive));
789 }
790 }
791
792 // Load morph weights
793 if (!vtkGLTFUtils::GetFloatArray(root, "weights", mesh.Weights))
794 {
795 mesh.Weights.clear();
796 }
797 return true;
798}
799
800//------------------------------------------------------------------------------
801bool vtkGLTFDocumentLoaderInternals::LoadNode(

Callers 1

LoadModelMetaDataMethod · 0.95

Calls 8

LoadPrimitiveMethod · 0.95
arrayClass · 0.85
GetStringValueFunction · 0.70
GetFloatArrayFunction · 0.70
emptyMethod · 0.45
valueMethod · 0.45
emplace_backMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected