Commit 12f41a62 authored by Yohann Bearzi's avatar Yohann Bearzi

New XML HTG V2 for reader and writer

This new format squashes together every arrays which used to be split by
tree. They can still be read by tree, given some new meta information on
the structure of the htg. One can still load an htg with a depth
delimiter.

Squashing the information saves a lot of space in the file. Prior to
that, one XML element was created per tree, which made outrageous large
files on htg with millions of trees.
parent 06c19925
Pipeline #196616 running with stage
This diff is collapsed.
......@@ -121,10 +121,10 @@ protected:
// Return true if HyperTree identified by treeIndx is selected for
// the load.
bool IsSelectedHT(const vtkHyperTreeGrid* grid, unsigned int treeIndx) const;
bool IsSelectedHT(const vtkHyperTreeGrid* grid, vtkIdType treeIndx) const;
// Return the fixedLevel choice for this HyperTree
uint32_t GetFixedLevelOfThisHT(uint32_t numberOfLevels, unsigned int treeIndx) const;
unsigned int GetFixedLevelOfThisHT(unsigned int numberOfLevels, vtkIdType treeIndx) const;
const char* GetDataSetName() override;
......@@ -161,7 +161,8 @@ protected:
//----------- Used for the major version < 1
// Recover the structure of the HyperTreeGrid, used by ReadXMLData.
// Recover the structure of the HyperTreeGrid, used by ReadXMLData. File
// format version 0.
void ReadTrees_0(vtkXMLDataElement* elem);
// Used by ReadTopology to recursively build the tree
......@@ -170,15 +171,20 @@ protected:
//---------- Used for other the major version
// Recover the structure of the HyperTreeGrid, used by ReadXMLData.
// Recover the structure of the HyperTreeGrid, used by ReadXMLData. File
// format version 1.
void ReadTrees_1(vtkXMLDataElement* elem);
// Recover the structure of the HyperTreeGrid, used by ReadXMLData. File
// format version 2.
void ReadTrees_2(vtkXMLDataElement* elem);
// Number of vertices in HyperTreeGrid being read
vtkIdType NumberOfPoints;
vtkIdType NumberOfPieces;
// Fixed the load maximum level
uint32_t FixedLevel;
unsigned int FixedLevel;
bool Verbose = false;
......
This diff is collapsed.
......@@ -63,7 +63,6 @@
#ifndef vtkXMLHyperTreeGridWriter_h
#define vtkXMLHyperTreeGridWriter_h
#include "vtkBitArray.h" // For ivar
#include "vtkIOXMLModule.h" // For export macro
#include "vtkSmartPointer.h" // For internal attributes
#include "vtkXMLWriter.h"
......@@ -72,10 +71,13 @@
class OffsetsManagerGroup;
class OffsetsManagerArray;
class vtkBitArray;
class vtkIdList;
class vtkHyperTree;
class vtkHyperTreeGrid;
class vtkHyperTreeGridNonOrientedCursor;
class vtkTypeInt64Array;
class vtkTypeUInt32Array;
class VTKIOXML_EXPORT vtkXMLHyperTreeGridWriter : public vtkXMLWriter
{
......@@ -138,6 +140,7 @@ protected:
// Tree Descriptor and CellData
int WriteTrees_0(vtkIndent);
int WriteTrees_1(vtkIndent);
int WriteTrees_2(vtkIndent);
// </HyperTreeGrid>
int FinishPrimaryElement(vtkIndent);
......@@ -160,11 +163,24 @@ protected:
void WriteCellDataAppendedArrayDataHelper(vtkAbstractArray* array, vtkIdType numberOfVertices,
OffsetsManager& offsets, vtkHyperTree* tree);
struct HyperTreeGridMetaDataForVersion2
{
void Initialize();
vtkSmartPointer<vtkBitArray> Descriptors;
vtkSmartPointer<vtkTypeInt64Array> TreeIds;
vtkSmartPointer<vtkTypeInt64Array> NumberOfVerticesPerDepth;
vtkSmartPointer<vtkIdList> BreadthFirstIdMap;
vtkSmartPointer<vtkTypeUInt32Array> DepthPerTree;
} MetaDataForVersion2;
OffsetsManagerGroup* CoordsOMG;
OffsetsManagerGroup* DescriptorOMG;
OffsetsManagerGroup* NbVerticesByLevelOMG;
OffsetsManagerGroup* MaskOMG;
OffsetsManagerGroup* CellDataOMG;
OffsetsManagerGroup* TreeIdsOMG;
OffsetsManagerGroup* DepthPerTreeOMG;
int NumberOfTrees;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment