[MOAB-dev] r3949 - MOAB/trunk/src
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Tue May 25 09:20:18 CDT 2010
Author: tautges
Date: 2010-05-25 09:20:18 -0500 (Tue, 25 May 2010)
New Revision: 3949
Modified:
MOAB/trunk/src/Core.cpp
Log:
Changing set listing code a bit, to print opaque tag values when their size is
the same as NAME_TAG_SIZE. In this case, they're likely to be character string
tags representing some sort of name.
Modified: MOAB/trunk/src/Core.cpp
===================================================================
--- MOAB/trunk/src/Core.cpp 2010-05-25 14:14:43 UTC (rev 3948)
+++ MOAB/trunk/src/Core.cpp 2010-05-25 14:20:18 UTC (rev 3949)
@@ -3102,7 +3102,7 @@
result = this->tag_get_data_type(*vit, this_data_type);
int this_size;
result = this->tag_get_size(*vit, this_size);
- if (MB_SUCCESS != result || (int) sizeof(double) < this_size) continue;
+ if (MB_SUCCESS != result) continue;
// use double since this is largest single-valued tag
double dbl_val;
int int_val;
@@ -3114,21 +3114,36 @@
case MB_TYPE_INTEGER:
result = this->tag_get_data(*vit, &ms_handle, 1, &int_val);
if (MB_SUCCESS != result) continue;
- std::cout << indent_prefix << tag_name << " = " << int_val << std::endl;
+ std::cout << indent_prefix << tag_name << " = " << int_val;
+ if ((int)sizeof(int) < this_size) std::cout << " (mult values)";
+ std::cout << std::endl;
break;
case MB_TYPE_DOUBLE:
result = this->tag_get_data(*vit, &ms_handle, 1, &dbl_val);
if (MB_SUCCESS != result) continue;
- std::cout << indent_prefix << tag_name << " = " << dbl_val << std::endl;
+ std::cout << indent_prefix << tag_name << " = " << dbl_val ;
+ if ((int)sizeof(double) < this_size) std::cout << " (mult values)";
+ std::cout << std::endl;
break;
case MB_TYPE_HANDLE:
result = this->tag_get_data(*vit, &ms_handle, 1, &hdl_val);
if (MB_SUCCESS != result) continue;
- std::cout << indent_prefix << tag_name << " = " << hdl_val << std::endl;
+ std::cout << indent_prefix << tag_name << " = " << hdl_val ;
+ if ((int)sizeof(EntityHandle) < this_size) std::cout << " (mult values)";
+ std::cout << std::endl;
break;
- case MB_TYPE_BIT:
case MB_TYPE_OPAQUE:
+ if (NAME_TAG_SIZE == this_size) {
+ char dum_tag[NAME_TAG_SIZE];
+ result = this->tag_get_data(*vit, &ms_handle, 1, &dum_tag);
+ if (MB_SUCCESS != result) continue;
+ // insert NULL just in case there isn't one
+ dum_tag[NAME_TAG_SIZE-1] = '\0';
+ std::cout << indent_prefix << tag_name << " = " << dum_tag << std::endl;
+ }
break;
+ case MB_TYPE_BIT:
+ break;
More information about the moab-dev
mailing list