Commit 1beec635 authored by Jerry Clarke's avatar Jerry Clarke
Browse files

Added CollectionType = Unset | Temporal | Spatial

parent 384a56ab
......@@ -58,6 +58,7 @@ XdmfGrid::XdmfGrid() {
this->AssignedAttribute = NULL;
this->NumberOfAttributes = 0;
this->GridType = XDMF_GRID_UNSET;
this->CollectionType = XDMF_GRID_COLLECTION_UNSET;
this->NumberOfChildren = 0;
this->Debug = 0;
}
......@@ -155,6 +156,19 @@ XdmfGrid::Build(){
return(XDMF_SUCCESS);
}
XdmfInt32
XdmfGrid::SetCollectionTypeFromString(XdmfConstString aCollectionType){
if(XDMF_WORD_CMP(aCollectionType, "Temporal")){
this->SetCollectionType(XDMF_GRID_COLLECTION_TEMPORAL);
}else if(XDMF_WORD_CMP(aCollectionType, "Spatial")){
this->SetCollectionType(XDMF_GRID_COLLECTION_SPATIAL);
}else{
XdmfErrorMessage("Unknown Collection Type : " << aCollectionType);
return(XDMF_FAIL);
}
return(XDMF_SUCCESS);
}
XdmfInt32
XdmfGrid::SetGridTypeFromString(XdmfConstString aGridType){
if(XDMF_WORD_CMP(aGridType, "Uniform")){
......@@ -172,6 +186,21 @@ XdmfGrid::SetGridTypeFromString(XdmfConstString aGridType){
return(XDMF_SUCCESS);
}
XdmfConstString
XdmfGrid::GetCollectionTypeAsString(){
if((this->GridType & XDMF_GRID_MASK) == XDMF_GRID_COLLECTION){
switch(this->CollectionType){
case XDMF_GRID_COLLECTION_TEMPORAL :
return("Temporal");
case XDMF_GRID_COLLECTION_SPATIAL :
return("Spatial");
default :
return("Unset");
}
}
return(0);
}
XdmfConstString
XdmfGrid::GetGridTypeAsString(){
if(this->GridType & XDMF_GRID_MASK){
......
......@@ -47,6 +47,10 @@ class XdmfTime;
#define XDMF_GRID_SECTION_DATA_ITEM 0x200000
#define XDMF_GRID_SECTION_MASK 0xF00000
#define XDMF_GRID_COLLECTION_TEMPORAL 0x0001
#define XDMF_GRID_COLLECTION_SPATIAL 0x0002
#define XDMF_GRID_COLLECTION_UNSET 0x0FFFF
//! In memory representation of an XDMF Grid
/*!
XdmfGrid is the in memory representation of the Xdmf Grid
......@@ -158,6 +162,11 @@ public:
XdmfInt32 SetGridTypeFromString(XdmfConstString GridType);
//! Get the Collection Type as a string
XdmfConstString GetCollectionTypeAsString();
XdmfInt32 SetCollectionTypeFromString(XdmfConstString CollectionType);
//! Build the XML (OUTPUT)
XdmfInt32 Build();
......@@ -171,6 +180,10 @@ public:
XdmfGetValueMacro( GridType, XdmfInt32);
//! Set the Grid Type
XdmfSetValueMacro( GridType, XdmfInt32);
//! Get the Collection Type
XdmfGetValueMacro( CollectionType, XdmfInt32);
//! Set the Collection Type
XdmfSetValueMacro( CollectionType, XdmfInt32);
//! Get Build Time Flag
XdmfGetValueMacro( BuildTime, XdmfInt32);
//! Set the Build Time Flag
......@@ -285,6 +298,7 @@ protected:
XdmfInt32 TimeIsMine;
XdmfInt32 NumberOfAttributes;
XdmfInt32 GridType;
XdmfInt32 CollectionType;
XdmfInt32 NumberOfChildren;
XdmfInt32 BuildTime;
XdmfGrid **Children;
......
Supports Markdown
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