20#ifndef vtkXdmfReaderInternal_h
21#define vtkXdmfReaderInternal_h
36#include VTKXDMF2_HEADER(XdmfArray.h)
37#include VTKXDMF2_HEADER(XdmfAttribute.h)
38#include VTKXDMF2_HEADER(XdmfDOM.h)
40#include VTKXDMF2_HEADER(XdmfDataDesc.h)
42#include VTKXDMF2_HEADER(XdmfDataItem.h)
43#include VTKXDMF2_HEADER(XdmfGrid.h)
45#include VTKXDMF2_HEADER(XdmfTopology.h)
47#include VTKXDMF2_HEADER(XdmfGeometry.h)
49#include VTKXDMF2_HEADER(XdmfTime.h)
51#include VTKXDMF2_HEADER(XdmfSet.h)
61#include <vtksys/SystemTools.hxx>
74 bool Parse(
const char* xmffilename);
82 const std::vector<std::string>&
GetDomains() {
return this->Domains; }
111 void UpdateDomains();
114 int ActiveDomainIndex;
115 xdmf2::XdmfDOM XMLDOM;
117 std::vector<std::string> Domains;
119 char* LastReadContents;
120 size_t LastReadContentsLength;
121 std::string LastReadFilename;
131 vtkXdmfArraySelection::const_iterator iter = other.begin();
132 for (; iter != other.end(); ++iter)
134 (*this)[iter->first] = iter->second;
138 void AddArray(
const char* name,
bool status =
true) { (*this)[name] = status; }
142 vtkXdmfArraySelection::iterator iter = this->find(name);
143 if (iter != this->end())
154 vtkXdmfArraySelection::iterator iter = this->find(name);
155 return (iter != this->end());
165 for (vtkXdmfArraySelection::iterator iter = this->begin(); iter != this->end(); ++iter)
170 return iter->first.c_str();
184 XdmfInt64 NumberOfGrids;
185 xdmf2::XdmfGrid* XMFGrids;
187 XdmfXmlNode XMLDomain;
188 xdmf2::XdmfDOM* XMLDOM;
190 unsigned int GridsOverflowCounter;
193 std::map<std::string, vtkIdType> GridCenteredAttrbuteRoots;
194 std::map<vtkIdType, std::map<XdmfInt64, vtkIdType>> GridCenteredAttrbuteValues;
202 std::map<XdmfFloat64, int> TimeSteps;
204 std::map<int, XdmfFloat64> TimeStepsRev;
217 bool IsValid() {
return (this->XMLDomain != 0); }
247 const std::map<XdmfFloat64, int>&
GetTimeSteps() {
return this->TimeSteps; }
263 std::map<int, XdmfFloat64>::iterator iter = this->TimeStepsRev.find(index);
264 return (iter != this->TimeStepsRev.end()) ? iter->second : 0.0;
273 xdmf2::XdmfGrid*
GetGrid(xdmf2::XdmfGrid* xmfGrid,
double time);
324 void CollectMetaData();
327 void CollectMetaData(xdmf2::XdmfGrid* xmfGrid,
vtkIdType silParent);
330 void CollectNonLeafMetaData(xdmf2::XdmfGrid* xmfGrid,
vtkIdType silParent);
333 void CollectLeafMetaData(xdmf2::XdmfGrid* xmfGrid,
vtkIdType silParent);
340 bool UpdateGridAttributeInSIL(xdmf2::XdmfAttribute* xmfAttribute,
vtkIdType gridSILId);
Base class for graph data types.
An editable directed graph.
helper class to build a SIL i.e.
void SetArrayStatus(const char *name, bool status)
void AddArray(const char *name, bool status=true)
bool ArrayIsEnabled(const char *name)
bool HasArray(const char *name)
int GetArraySetting(const char *name)
void Merge(const vtkXdmfArraySelection &other)
const char * GetArrayName(int index)
bool Parse(const char *xmffilename)
Parse an xmf file (or string).
bool SetActiveDomain(int index)
Set the active domain.
bool ParseString(const char *xmfdata, size_t length)
Parse an xmf file (or string).
vtkXdmfDocument()
Constructor/Destructor.
const std::vector< std::string > & GetDomains()
Returns the names for available domains.
~vtkXdmfDocument()
Constructor/Destructor.
vtkXdmfDomain * GetActiveDomain()
Returns the active domain.
bool SetActiveDomain(const char *domainname)
Set the active domain.
bool IsValid()
After instantiating, check that the domain is valid.
vtkXdmfDomain(xdmf2::XdmfDOM *xmlDom, int domain_index)
int GetIndexForTime(double time)
Given a time value, returns the index.
XdmfInt64 GetNumberOfGrids()
Returns the number of top-level grids present in this domain.
xdmf2::XdmfGrid * GetGrid(XdmfInt64 cc)
Provides access to a top-level grid from this domain.
int GetVTKDataType()
Returns the VTK data type need for this domain.
int GetVTKDataType(xdmf2::XdmfGrid *xmfGrid)
const std::map< int, XdmfFloat64 > & GetTimeStepsRev()
vtkXdmfArraySelection * GetSetsSelection()
bool IsStructured(xdmf2::XdmfGrid *)
Returns true if the grids is a structured dataset.
bool GetOriginAndSpacing(xdmf2::XdmfGrid *, double origin[3], double spacing[3])
Returns the spacing and origin for the grid if the grid topology == XDMF_2DCORECTMESH or XDMF_3DCOREC...
xdmf2::XdmfGrid * GetGrid(xdmf2::XdmfGrid *xmfGrid, double time)
If xmfGrid is a temporal collection, returns the child-grid matching the requested time.
vtkXdmfArraySelection * GetPointArraySelection()
bool GetWholeExtent(xdmf2::XdmfGrid *, int extents[6])
Returns the whole extents for the dataset if the grid if IsStructured() returns true for the given gr...
static int GetDataDimensionality(xdmf2::XdmfGrid *xmfGrid)
vtkXdmfArraySelection * GetGridSelection()
vtkXdmfArraySelection * GetCellArraySelection()
XdmfFloat64 GetTimeForIndex(int index)
Returns the time value at the given index.
const std::map< XdmfFloat64, int > & GetTimeSteps()
Returns the timesteps.