9 const char*
ent_names[] = {
"Vertex",
"Edge",
"Face",
"Region" };
11 int main(
int argc,
char** argv )
15 std::cout <<
"Usage: " << argv[0] <<
" <filename>" << std::endl;
28 gid_tag =
mb->globalId_tag();
29 assert( NULL != gid_tag );
33 std::vector< moab::EntityHandle > sense_ents;
34 std::vector< int > senses;
45 rval =
mb->get_entities_by_type_and_tag( 0,
MBENTITYSET, &geom_tag, &dim_ptr, 1, chsets, 1,
false );
50 for( ch_it = chsets.
begin(); ch_it != chsets.
end(); ++ch_it )
54 rval =
mb->get_parent_meshsets( *ch_it, psets );
57 rval =
mb->tag_get_data( gid_tag, &( *ch_it ), 1, &chgid );
61 std::cout <<
ent_names[
dim] <<
" " << chgid <<
" has " << psets.
size() <<
" parents." << std::endl;
65 for( p_it = psets.
begin(); p_it != psets.
end(); ++p_it )
67 rval =
mb->tag_get_data( gid_tag, &( *p_it ), 1, &pgid );
69 rval = gt.
get_sense( *ch_it, *p_it, sense );
74 std::cout <<
"FORWARD" << std::endl;
76 std::cout <<
"REVERSE" << std::endl;
83 rval = gt.
get_senses( *ch_it, sense_ents, senses );
85 for(
unsigned int i = 0; i < sense_ents.size(); i++ )
87 rval =
mb->tag_get_data( gid_tag, &sense_ents[i], 1, &pgid );
92 std::cout <<
"REVERSED" << std::endl;
93 else if( 0 == senses[i] )
94 std::cout <<
"BOTH" << std::endl;
95 else if( 1 == senses[i] )
96 std::cout <<
"FORWARD" << std::endl;
98 std::cout <<
"(invalid)" << std::endl;