Enable loading cell/point data arrays in the BaseVTKLoader#2
Open
th-skam wants to merge 16 commits intoSofaDefrost:mainfrom
Open
Enable loading cell/point data arrays in the BaseVTKLoader#2th-skam wants to merge 16 commits intoSofaDefrost:mainfrom
th-skam wants to merge 16 commits intoSofaDefrost:mainfrom
Conversation
…unctions; limited to 9 components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for loading VTK cell and point data arrays as Data fields. Its creation was motivated by one recent use-case.
Two fields must be specified in the scene file:
Most of the new functions are inside the
BaseVTKLoader.loadDataArrayByName().doClearBuffers().vtkArrayDispatchfrom the vtk library is used to decide the types of the data amongfloat,double,signed/unsigned char,int,unsigned int,long,unsigned long,long long,unsigned long long. This should cover the types supported (at one point) by SOFA's native vtk loader (Int32/64/8 etc.).longandunsigned longare mapped to fixed-size equivalents depending on platform.An example can be found in
examples/xml/LoadDataArrays.scnand a test inTestCellPointData.cpp.I used an AI-agent to assist with development here so some care should be taken in review.