Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
VTK
VTK
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 378
    • Issues 378
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 77
    • Merge Requests 77
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • VTK
  • VTKVTK
  • Issues
  • #17504

Closed
Open
Opened Jan 24, 2019 by Mark Stock@mstock
  • Report abuse
  • New issue
Report abuse New issue

raw encoding in AppendedData in a vtkXML file fails to load in ParaView

I've been banging my head against this all day now. I would like my program to write compact .vtu files for easy reading into ParaView. base64 encoding increases file size over raw and introduces extra dependencies into my code, so I'd like to avoid it; as I would like to avoid the heavy dependency of linking directly into VTK. All of the documentation I see tells me that raw encoding is available in AppendedData, and writing XML myself seems easy (I use tinyxml2).

Most reports of problems using raw-encoded data in .vtu files stem from the author forgetting the (usually) 4-byte precusror to the raw data block. This precursor tells the reader how many bytes are in the following raw data block. I have this precursor, I have header_type="UInt32" in my header, and I write a uint32_t to my appended data block just after the underscore and before the raw data.

Yet ParaView (using VTK) still fails to read it, with

ERROR: In /builddir/build/BUILD/ParaView-v5.4.1/VTK/IO/XMLParser/vtkXMLParser.cxx, line 399
vtkXMLDataParser (0x56290e8a2450): Error parsing XML in stream at line 18, column 2, byte index 1720: mismatched tag

Which is funny, because that's the line after the AppendedData section, and the underscore is at byte 1718, and the uint32_t at bytes 1719-1722.

The test file is attached. Only one PointData field is in AppendedData, as all ascii-encoded data reads just fine. When I encode this failing data as ascii, it reads correctly.

I'm using ParaView 5.4.1, which pulled a VTK from sometime (I can't figure that out from github). broken.vtu

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
No due date
0
Labels
None
Assign labels
  • View project labels
Reference: vtk/vtk#17504