Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
iMSTK
iMSTK
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 46
    • Issues 46
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 12
    • Merge Requests 12
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • iMSTK
  • iMSTKiMSTK
  • Issues
  • #297

Closed
Open
Created Mar 31, 2021 by Harald Scheirich@harald.scheirichDeveloper

'`VTKSurfaceMeshRenderDelegate` doesn't deal with data size changes

Any call that reallocates the underlying datastructure of points or tris will cause problems, any call to resize() or clear() to imstkDataArray and imstkVecDataArray will cause the internal storage reallocated. But in updateGeometry line 225 the delegate only checks for equality of the wrapping shared pointer, to update its internals. In contrast the vtk data is bound to the internal pointer of the imstkData/VecDataArray (see GeometryUtils::coupleVtkDataArray) so if the user _doesn't_ set new data in the mesh via mesh.initializeormesh.setVertexPositions` this check will fall through.

The check in line 225 could be made against the underlying structure that might fix some of the problems but i am not sure all cases are covered then. This is probably an issue with other delegates as well

If a structure takes a shared pointer and gives access to that shared pointer (i.e. the mesh taking the point data as a shared_ptr) then the assumption is that modifying this structure will result in the correct behavior of the rest of the system, otherwise the data should be taken by copy or other ways indicating to the user that this data cannot just be modified.

Edited Mar 31, 2021 by Harald Scheirich
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None