20 #ifndef vtkXdmfReaderInternal_h
21 #define vtkXdmfReaderInternal_h
35 #include "XdmfArray.h"
36 #include "XdmfAttribute.h"
39 #include "XdmfDataDesc.h"
41 #include "XdmfDataItem.h"
44 #include "XdmfTopology.h"
46 #include "XdmfGeometry.h"
56 #include <vtksys/SystemTools.hxx>
73 bool Parse(
const char*xmffilename);
74 bool ParseString(
const char* xmfdata,
size_t length);
82 {
return this->Domains; }
90 bool SetActiveDomain(
const char* domainname);
91 bool SetActiveDomain(
int index);
99 {
return this->ActiveDomain; }
112 void UpdateDomains();
115 int ActiveDomainIndex;
116 xdmf2::XdmfDOM XMLDOM;
118 std::vector<std::string> Domains;
120 char* LastReadContents;
121 size_t LastReadContentsLength;
132 vtkXdmfArraySelection::const_iterator iter = other.begin();
133 for (; iter != other.end(); ++iter)
135 (*this)[iter->first] = iter->second;
141 (*this)[
name] = status;
146 vtkXdmfArraySelection::iterator iter = this->find(name);
147 if (iter != this->end())
158 vtkXdmfArraySelection::iterator iter = this->find(name);
159 return (iter != this->end());
175 for (vtkXdmfArraySelection::iterator iter = this->begin();
176 iter != this->end(); ++iter)
181 return iter->first.c_str();
190 return static_cast<int>(this->
size());
198 XdmfInt64 NumberOfGrids;
199 xdmf2::XdmfGrid* XMFGrids;
201 XdmfXmlNode XMLDomain;
202 xdmf2::XdmfDOM* XMLDOM;
204 unsigned int GridsOverflowCounter;
207 std::map<std::string, vtkIdType> GridCenteredAttrbuteRoots;
209 std::map<XdmfInt64, vtkIdType> > GridCenteredAttrbuteValues;
217 std::map<XdmfFloat64, int> TimeSteps;
219 std::map<int, XdmfFloat64> TimeStepsRev;
233 {
return (this->XMLDomain != 0); }
237 {
return this->SIL; }
249 xdmf2::XdmfGrid* GetGrid(XdmfInt64 cc);
258 int GetVTKDataType();
265 {
return this->TimeSteps; }
267 {
return this->TimeStepsRev; }
273 int GetIndexForTime(
double time);
282 std::map<int, XdmfFloat64>::iterator iter = this->TimeStepsRev.find(index);
283 return (iter != this->TimeStepsRev.end()) ? iter->second : 0.0;
292 xdmf2::XdmfGrid* GetGrid(xdmf2::XdmfGrid* xmfGrid,
double time);
298 bool IsStructured(xdmf2::XdmfGrid*);
306 bool GetWholeExtent(xdmf2::XdmfGrid*,
int extents[6]);
314 bool GetOriginAndSpacing(xdmf2::XdmfGrid*,
double origin[3],
double spacing[3]);
321 int GetVTKDataType(xdmf2::XdmfGrid* xmfGrid);
325 static int GetDataDimensionality(xdmf2::XdmfGrid* xmfGrid);
328 {
return this->PointArrays; }
330 {
return this->CellArrays; }
332 {
return this->Grids; }
334 {
return this->Sets; }
347 void CollectMetaData();
350 void CollectMetaData(xdmf2::XdmfGrid* xmfGrid, vtkIdType silParent);
353 void CollectNonLeafMetaData(xdmf2::XdmfGrid* xmfGrid, vtkIdType silParent);
356 void CollectLeafMetaData(xdmf2::XdmfGrid* xmfGrid, vtkIdType silParent);
363 bool UpdateGridAttributeInSIL(
364 xdmf2::XdmfAttribute* xmfAttribute, vtkIdType gridSILId);
void AddArray(const char *name, bool status=true)
bool ArrayIsEnabled(const char *name)
bool IsValid()
After instantiating, check that the domain is valid.
vtkXdmfArraySelection * GetPointArraySelection()
void SetArrayStatus(const char *name, bool status)
const std::map< int, XdmfFloat64 > & GetTimeStepsRev()
vtkXdmfArraySelection * GetSetsSelection()
const std::map< XdmfFloat64, int > & GetTimeSteps()
Returns the timesteps.
bool HasArray(const char *name)
vtkXdmfDomain * GetActiveDomain()
Returns the active domain.
Base class for graph data types.
vtkXdmfArraySelection * GetCellArraySelection()
const std::vector< std::string > & GetDomains()
Returns the names for available domains.
void Merge(const vtkXdmfArraySelection &other)
An editable directed graph.
vtkXdmfArraySelection * GetGridSelection()
XdmfFloat64 GetTimeForIndex(int index)
Returns the time value at the given index.
XdmfInt64 GetNumberOfGrids()
Returns the number of top-level grids present in this domain.
const char * GetArrayName(int index)
helper class to build a SIL i.e.
int GetArraySetting(const char *name)