Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ben Boeckel
Xdmf
Commits
1beec635
Commit
1beec635
authored
Mar 11, 2008
by
Jerry Clarke
Browse files
Added CollectionType = Unset | Temporal | Spatial
parent
384a56ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
libsrc/XdmfGrid.cxx
View file @
1beec635
...
...
@@ -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
){
...
...
libsrc/XdmfGrid.h
View file @
1beec635
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment