[MOAB-dev] commit/MOAB: danwu: Merged master into error_handling_enhancement
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Mar 26 11:57:23 CDT 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/bba4b3597e00/
Changeset: bba4b3597e00
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-26 17:57:19
Summary: Merged master into error_handling_enhancement
Affected #: 8 files
diff --git a/MeshFiles/unittest/io/cylcube.sat b/MeshFiles/unittest/io/cylcube.sat
new file mode 100644
index 0000000..0b65976
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.sat
@@ -0,0 +1,202 @@
+1900 0 2 0
+10 Cubit 12.2 17 ACIS 19.0.2 Linux 24 Thu Feb 6 08:36:54 2014
+1 9.9999999999999995e-07 1e-10
+body $2 -1 -1 $-1 $3 $-1 $4 T 25 -5 -5 35 5 5 #
+body $5 -1 -1 $-1 $6 $-1 $-1 T -5 -5 -5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $7 $-1 $0 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+lump $8 -1 -1 $-1 $-1 $9 $0 T 25 -5 -5 35 5 5 #
+transform $-1 -1 1 0 0 0 1 0 0 0 1 0 0 0 1 no_rotate no_reflect no_shear #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $10 $-1 $1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+lump $11 -1 -1 $-1 $-1 $12 $1 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $-1 $2 $0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $13 $-1 $3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+shell $-1 -1 -1 $-1 $-1 $-1 $14 $-1 $3 T 25 -5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $5 $1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $15 $-1 $6 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+shell $-1 -1 -1 $-1 $-1 $-1 $16 $-1 $6 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $17 $8 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+face $18 -1 -1 $-1 $19 $20 $9 $-1 $21 forward single T 25 -5 5 35 5 5 F #
+simple-snl-attrib $-1 -1 $22 $11 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+face $23 -1 -1 $-1 $24 $25 $12 $-1 $26 forward single T -5 -5 -5 5 5 5 F #
+simple-snl-attrib $-1 -1 $27 $13 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 2 0 7 1 2 618932362 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $28 $-1 $14 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+face $29 -1 -1 $-1 $30 $31 $9 $-1 $32 reversed single T 25 -5 -5 35 5 -5 F #
+loop $-1 -1 -1 $-1 $-1 $33 $14 T 25 -5 5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 5 0 0 1 1 0 0 forward_v I I I I #
+simple-snl-attrib $-1 -1 $34 $15 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 3 0 7 1 3 885205176 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $35 $-1 $16 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+face $36 -1 -1 $-1 $37 $38 $12 $-1 $39 forward single T -5 -5 -5 5 5 -5 F #
+loop $-1 -1 -1 $-1 $40 $41 $16 T -5 -5 -5 5 5 -5 unknown #
+cone-surface $-1 -1 -1 $-1 0 0 0 0 0 1 5 0 0 1 I I 0 1 5 forward I I I I #
+simple-snl-attrib $-1 -1 $-1 $17 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 4 4 1 1 0 0 #
+simple-snl-attrib $-1 -1 $42 $18 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $43 $-1 $19 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+face $44 -1 -1 $-1 $45 $46 $9 $-1 $47 reversed single T 25 -5 -5 35 -5 5 F #
+loop $-1 -1 -1 $-1 $-1 $48 $19 T 25 -5 -5 35 5 -5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 -5 0 0 1 1 0 0 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $49 $50 $51 $52 forward $20 $-1 #
+simple-snl-attrib $-1 -1 $-1 $22 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 5 5 1 1 0 0 #
+simple-snl-attrib $-1 -1 $53 $23 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $54 $-1 $24 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+face $55 -1 -1 $-1 $-1 $56 $12 $-1 $57 forward single T -5 -5 5 5 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $58 $24 T -5 -5 -5 5 5 -5 unknown #
+plane-surface $-1 -1 -1 $-1 0 0 -5 0 0 -1 -1 0 0 forward_v I I I I #
+loop $-1 -1 -1 $-1 $-1 $59 $16 T -5 -5 5 5 5 5 unknown #
+coedge $-1 -1 -1 $-1 $41 $41 $58 $60 reversed $25 $-1 #
+simple-snl-attrib $-1 -1 $-1 $28 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $61 $29 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $62 $-1 $30 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+face $63 -1 -1 $-1 $64 $65 $9 $-1 $66 reversed single T 25 -5 -5 25 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $67 $30 T 25 -5 -5 35 -5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 -5 0 0 1 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $68 $69 $70 $71 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $72 $33 $73 $74 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $33 $72 $75 $76 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $77 $78 $33 $52 reversed $79 $-1 #
+edge $80 -1 -1 $-1 $81 -5 $82 5 $51 $83 forward @7 unknown T 35 -5 5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $35 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $84 $36 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $85 $-1 $37 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+loop $-1 -1 -1 $-1 $-1 $86 $37 T -5 -5 5 5 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 0 0 5 0 0 1 1 0 0 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $58 $58 $41 $60 forward $38 $-1 #
+coedge $-1 -1 -1 $-1 $59 $59 $86 $87 reversed $40 $-1 #
+edge $88 -1 -1 $-1 $89 0 $89 6.2831853071795862 $58 $90 forward @7 unknown T -5 -5 -5 5 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $43 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $91 $44 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $92 $-1 $45 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+face $93 -1 -1 $-1 $94 $95 $9 $-1 $96 reversed single T 25 5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $97 $45 T 25 -5 -5 25 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 25 0 0 1 0 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $98 $75 $99 $100 forward $46 $-1 #
+coedge $-1 -1 -1 $-1 $101 $48 $98 $102 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $48 $101 $103 $104 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $78 $77 $48 $71 reversed $79 $-1 #
+edge $105 -1 -1 $-1 $106 -5 $107 5 $70 $108 forward @7 unknown T 35 -5 -5 35 5 -5 #
+coedge $-1 -1 -1 $-1 $50 $49 $109 $110 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $111 $112 $49 $74 reversed $95 $-1 #
+edge $113 -1 -1 $-1 $82 -5 $114 5 $73 $115 forward @7 unknown T 25 5 5 35 5 5 #
+coedge $-1 -1 -1 $-1 $67 $116 $50 $76 reversed $46 $-1 #
+edge $117 -1 -1 $-1 $118 -5 $81 5 $75 $119 forward @7 unknown T 25 -5 5 35 -5 5 #
+coedge $-1 -1 -1 $-1 $70 $51 $116 $120 forward $79 $-1 #
+coedge $-1 -1 -1 $-1 $51 $70 $111 $121 reversed $79 $-1 #
+loop $-1 -1 -1 $-1 $-1 $77 $94 T 35 -5 -5 35 5 5 unknown #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $122 $-1 $52 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+vertex $123 -1 -1 $-1 $52 $124 #
+vertex $125 -1 -1 $-1 $52 $126 #
+straight-curve $-1 -1 -1 $-1 35 0 5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $54 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $127 $55 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+coedge $-1 -1 -1 $-1 $86 $86 $59 $87 forward $56 $-1 #
+edge $128 -1 -1 $-1 $129 0 $129 6.2831853071795862 $86 $130 forward @7 unknown T -5 -5 5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $131 $-1 $60 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 13 #
+vertex $132 -1 -1 $-1 $60 $133 #
+ellipse-curve $-1 -1 -1 $-1 0 0 -5 0 0 -1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $62 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $134 $63 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $135 $-1 $64 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+face $136 -1 -1 $-1 $-1 $79 $9 $-1 $137 reversed single T 35 -5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $111 $64 T 25 5 -5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 5 0 0 -1 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $138 $109 $112 $139 forward $65 $-1 #
+coedge $-1 -1 -1 $-1 $116 $67 $68 $102 reversed $46 $-1 #
+coedge $-1 -1 -1 $-1 $109 $138 $67 $100 reversed $65 $-1 #
+edge $140 -1 -1 $-1 $118 -5 $141 5 $99 $142 forward @7 unknown T 25 -5 -5 25 -5 5 #
+coedge $-1 -1 -1 $-1 $69 $68 $138 $143 forward $31 $-1 #
+edge $144 -1 -1 $-1 $107 -5 $141 5 $98 $145 forward @7 unknown T 25 -5 -5 35 -5 -5 #
+coedge $-1 -1 -1 $-1 $112 $111 $69 $104 reversed $95 $-1 #
+edge $146 -1 -1 $-1 $147 -5 $106 5 $103 $148 forward @7 unknown T 25 5 -5 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $149 $-1 $71 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+vertex $150 -1 -1 $-1 $71 $151 #
+vertex $152 -1 -1 $-1 $120 $153 #
+straight-curve $-1 -1 -1 $-1 35 0 -5 0 -1 0 I I #
+coedge $-1 -1 -1 $-1 $97 $99 $72 $110 reversed $65 $-1 #
+edge $154 -1 -1 $-1 $114 -5 $118 5 $109 $155 forward @7 unknown T 25 -5 5 25 5 5 #
+coedge $-1 -1 -1 $-1 $103 $73 $78 $121 forward $95 $-1 #
+coedge $-1 -1 -1 $-1 $73 $103 $97 $139 reversed $95 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $156 $-1 $74 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+vertex $157 -1 -1 $-1 $74 $158 #
+straight-curve $-1 -1 -1 $-1 30 5 5 -1 0 0 I I #
+coedge $-1 -1 -1 $-1 $75 $98 $77 $120 reversed $46 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $159 $-1 $76 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+vertex $160 -1 -1 $-1 $110 $161 #
+straight-curve $-1 -1 -1 $-1 30 -5 5 1 0 0 I I #
+edge $162 -1 -1 $-1 $81 -5 $107 5 $77 $163 forward @7 unknown T 35 -5 -5 35 -5 5 #
+edge $164 -1 -1 $-1 $82 -5 $106 5 $78 $165 forward @7 unknown T 35 5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $80 $52 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $166 $-1 $81 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+point $-1 -1 -1 $-1 35 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $167 $-1 $82 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+point $-1 -1 -1 $-1 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $85 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $168 $-1 $87 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 14 #
+vertex $169 -1 -1 $-1 $87 $170 #
+ellipse-curve $-1 -1 -1 $-1 0 0 5 0 0 1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $88 $60 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 13 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $171 $-1 $89 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+point $-1 -1 -1 $-1 5 0 -5 #
+simple-snl-attrib $-1 -1 $-1 $92 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $172 $93 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $173 $-1 $94 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+plane-surface $-1 -1 -1 $-1 35 0 0 -1 0 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $99 $97 $101 $143 reversed $65 $-1 #
+edge $174 -1 -1 $-1 $114 -5 $147 5 $112 $175 forward @7 unknown T 25 5 -5 25 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $176 $-1 $100 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+vertex $177 -1 -1 $-1 $143 $178 #
+straight-curve $-1 -1 -1 $-1 25 -5 0 0 0 -1 I I #
+edge $179 -1 -1 $-1 $141 -5 $147 5 $138 $180 forward @7 unknown T 25 -5 -5 25 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $181 $-1 $102 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+straight-curve $-1 -1 -1 $-1 30 -5 -5 -1 0 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $182 $-1 $104 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+vertex $183 -1 -1 $-1 $104 $184 #
+straight-curve $-1 -1 -1 $-1 30 5 -5 1 0 0 I I #
+simple-snl-attrib $-1 -1 $-1 $105 $71 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $185 $-1 $106 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+point $-1 -1 -1 $-1 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $186 $-1 $107 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+point $-1 -1 -1 $-1 35 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $187 $-1 $110 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+straight-curve $-1 -1 -1 $-1 25 0 5 0 -1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $113 $74 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $188 $-1 $114 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+point $-1 -1 -1 $-1 25 5 5 #
+simple-snl-attrib $-1 -1 $-1 $117 $76 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $189 $-1 $118 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+point $-1 -1 -1 $-1 25 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $190 $-1 $120 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 10 #
+straight-curve $-1 -1 -1 $-1 35 -5 0 0 0 -1 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $191 $-1 $121 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 12 #
+straight-curve $-1 -1 -1 $-1 35 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $123 $81 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $125 $82 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $128 $87 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 14 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $192 $-1 $129 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 10 #
+point $-1 -1 -1 $-1 5 0 5 #
+simple-snl-attrib $-1 -1 $-1 $132 $89 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $135 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $193 $136 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $194 $-1 $139 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 11 #
+straight-curve $-1 -1 -1 $-1 25 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $140 $100 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $195 $-1 $141 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+point $-1 -1 -1 $-1 25 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $196 $-1 $143 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+straight-curve $-1 -1 -1 $-1 25 0 -5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $144 $102 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $146 $104 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $197 $-1 $147 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+point $-1 -1 -1 $-1 25 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $150 $106 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $152 $107 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $154 $110 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $157 $114 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $160 $118 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $162 $120 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $164 $121 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 12 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $169 $129 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $173 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $-1 $174 $139 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 11 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $177 $141 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $179 $143 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $183 $147 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+End-of-ACIS-data
\ No newline at end of file
diff --git a/MeshFiles/unittest/io/cylcube.stp b/MeshFiles/unittest/io/cylcube.stp
new file mode 100644
index 0000000..bc4ec64
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.stp
@@ -0,0 +1,290 @@
+ISO-10303-21;
+HEADER;
+FILE_DESCRIPTION(('STEP AP214'),'1');
+FILE_NAME('/home/user/cylcube.stp','2014-02-15T18:13:39',(' '),(' '),'Spatial InterOp 3D',' ',' ');
+FILE_SCHEMA(('automotive_design'));
+ENDSEC;
+DATA;
+#1=PRODUCT_DEFINITION_CONTEXT('',#13,'design');
+#2=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#13);
+#3=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#14,#15);
+#4=SHAPE_DEFINITION_REPRESENTATION(#16,#17);
+#5=PRODUCT_DEFINITION_CONTEXT('',#18,'design');
+#6=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#18);
+#7=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#19,#20);
+#8=SHAPE_DEFINITION_REPRESENTATION(#21,#22);
+#9= (GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#25))GLOBAL_UNIT_ASSIGNED_CONTEXT((#27,#28,#29))REPRESENTATION_CONTEXT('NONE','WORKSPACE'));
+#13=APPLICATION_CONTEXT(' ');
+#14=PRODUCT_CATEGORY('part','NONE');
+#15=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#31));
+#16=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#32);
+#17=ADVANCED_BREP_SHAPE_REPRESENTATION('1',(#33,#34),#9);
+#18=APPLICATION_CONTEXT(' ');
+#19=PRODUCT_CATEGORY('part','NONE');
+#20=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#35));
+#21=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#36);
+#22=ADVANCED_BREP_SHAPE_REPRESENTATION('2',(#37,#38),#9);
+#25=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-06),#27,'','');
+#27= (CONVERSION_BASED_UNIT('MILLIMETRE',#41)LENGTH_UNIT()NAMED_UNIT(#44));
+#28= (NAMED_UNIT(#46)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
+#29= (NAMED_UNIT(#46)SOLID_ANGLE_UNIT()SI_UNIT($,.STERADIAN.));
+#31=PRODUCT('1','1','PART-1-DESC',(#52));
+#32=PRODUCT_DEFINITION('NONE','NONE',#53,#1);
+#33=MANIFOLD_SOLID_BREP('1',#54);
+#34=AXIS2_PLACEMENT_3D('',#55,#56,#57);
+#35=PRODUCT('2','2','PART-2-DESC',(#58));
+#36=PRODUCT_DEFINITION('NONE','NONE',#59,#5);
+#37=MANIFOLD_SOLID_BREP('2',#60);
+#38=AXIS2_PLACEMENT_3D('',#61,#62,#63);
+#41=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0),#64);
+#44=DIMENSIONAL_EXPONENTS(1.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#46=DIMENSIONAL_EXPONENTS(0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#52=PRODUCT_CONTEXT('',#13,'mechanical');
+#53=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#31,.NOT_KNOWN.);
+#54=CLOSED_SHELL('',(#65,#66,#67,#68,#69,#70));
+#55=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#56=DIRECTION('',(0.0,0.0,1.0));
+#57=DIRECTION('',(1.0,0.0,0.0));
+#58=PRODUCT_CONTEXT('',#18,'mechanical');
+#59=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#35,.NOT_KNOWN.);
+#60=CLOSED_SHELL('',(#71,#72,#73,#74));
+#61=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#62=DIRECTION('',(0.0,0.0,1.0));
+#63=DIRECTION('',(1.0,0.0,0.0));
+#64= (NAMED_UNIT(#44)LENGTH_UNIT()SI_UNIT(.MILLI.,.METRE.));
+#65=ADVANCED_FACE('',(#76),#77,.T.);
+#66=ADVANCED_FACE('',(#78),#79,.F.);
+#67=ADVANCED_FACE('',(#80),#81,.F.);
+#68=ADVANCED_FACE('',(#82),#83,.F.);
+#69=ADVANCED_FACE('',(#84),#85,.F.);
+#70=ADVANCED_FACE('',(#86),#87,.F.);
+#71=ADVANCED_FACE('',(#88),#89,.T.);
+#72=ADVANCED_FACE('',(#90),#91,.T.);
+#73=ADVANCED_FACE('',(#92),#93,.T.);
+#74=ADVANCED_FACE('',(#94),#95,.T.);
+#76=FACE_OUTER_BOUND('',#96,.T.);
+#77=PLANE('',#97);
+#78=FACE_OUTER_BOUND('',#98,.T.);
+#79=PLANE('',#99);
+#80=FACE_OUTER_BOUND('',#100,.T.);
+#81=PLANE('',#101);
+#82=FACE_OUTER_BOUND('',#102,.T.);
+#83=PLANE('',#103);
+#84=FACE_OUTER_BOUND('',#104,.T.);
+#85=PLANE('',#105);
+#86=FACE_OUTER_BOUND('',#106,.T.);
+#87=PLANE('',#107);
+#88=FACE_OUTER_BOUND('',#108,.T.);
+#89=CYLINDRICAL_SURFACE('',#109,5.0);
+#90=FACE_OUTER_BOUND('',#110,.T.);
+#91=CYLINDRICAL_SURFACE('',#111,5.0);
+#92=FACE_OUTER_BOUND('',#112,.T.);
+#93=PLANE('',#113);
+#94=FACE_OUTER_BOUND('',#114,.T.);
+#95=PLANE('',#115);
+#96=EDGE_LOOP('',(#116,#117,#118,#119));
+#97=AXIS2_PLACEMENT_3D('',#120,#121,#122);
+#98=EDGE_LOOP('',(#123,#124,#125,#126));
+#99=AXIS2_PLACEMENT_3D('',#127,#128,#129);
+#100=EDGE_LOOP('',(#130,#131,#132,#133));
+#101=AXIS2_PLACEMENT_3D('',#134,#135,#136);
+#102=EDGE_LOOP('',(#137,#138,#139,#140));
+#103=AXIS2_PLACEMENT_3D('',#141,#142,#143);
+#104=EDGE_LOOP('',(#144,#145,#146,#147));
+#105=AXIS2_PLACEMENT_3D('',#148,#149,#150);
+#106=EDGE_LOOP('',(#151,#152,#153,#154));
+#107=AXIS2_PLACEMENT_3D('',#155,#156,#157);
+#108=EDGE_LOOP('',(#158,#159,#160,#161));
+#109=AXIS2_PLACEMENT_3D('',#162,#163,#164);
+#110=EDGE_LOOP('',(#165,#166,#167,#168));
+#111=AXIS2_PLACEMENT_3D('',#169,#170,#171);
+#112=EDGE_LOOP('',(#172,#173));
+#113=AXIS2_PLACEMENT_3D('',#174,#175,#176);
+#114=EDGE_LOOP('',(#177,#178));
+#115=AXIS2_PLACEMENT_3D('',#179,#180,#181);
+#116=ORIENTED_EDGE('',*,*,#182,.T.);
+#117=ORIENTED_EDGE('',*,*,#183,.T.);
+#118=ORIENTED_EDGE('',*,*,#184,.T.);
+#119=ORIENTED_EDGE('',*,*,#185,.T.);
+#120=CARTESIAN_POINT('',(30.0,0.0,5.0));
+#121=DIRECTION('',(0.0,0.0,1.0));
+#122=DIRECTION('',(1.0,0.0,0.0));
+#123=ORIENTED_EDGE('',*,*,#186,.T.);
+#124=ORIENTED_EDGE('',*,*,#187,.T.);
+#125=ORIENTED_EDGE('',*,*,#188,.T.);
+#126=ORIENTED_EDGE('',*,*,#189,.T.);
+#127=CARTESIAN_POINT('',(30.0,0.0,-5.0));
+#128=DIRECTION('',(0.0,0.0,1.0));
+#129=DIRECTION('',(1.0,0.0,0.0));
+#130=ORIENTED_EDGE('',*,*,#190,.T.);
+#131=ORIENTED_EDGE('',*,*,#187,.F.);
+#132=ORIENTED_EDGE('',*,*,#191,.F.);
+#133=ORIENTED_EDGE('',*,*,#185,.F.);
+#134=CARTESIAN_POINT('',(30.0,-5.0,0.0));
+#135=DIRECTION('',(0.0,1.0,0.0));
+#136=DIRECTION('',(0.0,0.0,1.0));
+#137=ORIENTED_EDGE('',*,*,#192,.T.);
+#138=ORIENTED_EDGE('',*,*,#188,.F.);
+#139=ORIENTED_EDGE('',*,*,#190,.F.);
+#140=ORIENTED_EDGE('',*,*,#184,.F.);
+#141=CARTESIAN_POINT('',(25.0,0.0,0.0));
+#142=DIRECTION('',(1.0,0.0,0.0));
+#143=DIRECTION('',(0.0,0.0,-1.0));
+#144=ORIENTED_EDGE('',*,*,#193,.T.);
+#145=ORIENTED_EDGE('',*,*,#189,.F.);
+#146=ORIENTED_EDGE('',*,*,#192,.F.);
+#147=ORIENTED_EDGE('',*,*,#183,.F.);
+#148=CARTESIAN_POINT('',(30.0,5.0,0.0));
+#149=DIRECTION('',(0.0,-1.0,0.0));
+#150=DIRECTION('',(0.0,0.0,-1.0));
+#151=ORIENTED_EDGE('',*,*,#191,.T.);
+#152=ORIENTED_EDGE('',*,*,#186,.F.);
+#153=ORIENTED_EDGE('',*,*,#193,.F.);
+#154=ORIENTED_EDGE('',*,*,#182,.F.);
+#155=CARTESIAN_POINT('',(35.0,0.0,0.0));
+#156=DIRECTION('',(-1.0,0.0,0.0));
+#157=DIRECTION('',(0.0,0.0,1.0));
+#158=ORIENTED_EDGE('',*,*,#194,.F.);
+#159=ORIENTED_EDGE('',*,*,#195,.F.);
+#160=ORIENTED_EDGE('',*,*,#196,.F.);
+#161=ORIENTED_EDGE('',*,*,#197,.F.);
+#162=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#163=DIRECTION('',(0.0,0.0,1.0));
+#164=DIRECTION('',(1.0,0.0,0.0));
+#165=ORIENTED_EDGE('',*,*,#194,.T.);
+#166=ORIENTED_EDGE('',*,*,#198,.F.);
+#167=ORIENTED_EDGE('',*,*,#196,.T.);
+#168=ORIENTED_EDGE('',*,*,#199,.F.);
+#169=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#170=DIRECTION('',(0.0,0.0,1.0));
+#171=DIRECTION('',(1.0,0.0,0.0));
+#172=ORIENTED_EDGE('',*,*,#199,.T.);
+#173=ORIENTED_EDGE('',*,*,#195,.T.);
+#174=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#175=DIRECTION('',(0.0,0.0,-1.0));
+#176=DIRECTION('',(-1.0,0.0,0.0));
+#177=ORIENTED_EDGE('',*,*,#197,.T.);
+#178=ORIENTED_EDGE('',*,*,#198,.T.);
+#179=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#180=DIRECTION('',(0.0,0.0,1.0));
+#181=DIRECTION('',(1.0,0.0,0.0));
+#182=EDGE_CURVE('',#200,#201,#202,.T.);
+#183=EDGE_CURVE('',#201,#203,#204,.T.);
+#184=EDGE_CURVE('',#203,#205,#206,.T.);
+#185=EDGE_CURVE('',#205,#200,#207,.T.);
+#186=EDGE_CURVE('',#208,#209,#210,.T.);
+#187=EDGE_CURVE('',#209,#211,#212,.T.);
+#188=EDGE_CURVE('',#211,#213,#214,.T.);
+#189=EDGE_CURVE('',#213,#208,#215,.T.);
+#190=EDGE_CURVE('',#205,#211,#216,.T.);
+#191=EDGE_CURVE('',#200,#209,#217,.T.);
+#192=EDGE_CURVE('',#203,#213,#218,.T.);
+#193=EDGE_CURVE('',#201,#208,#219,.T.);
+#194=EDGE_CURVE('',#220,#221,#222,.T.);
+#195=EDGE_CURVE('',#223,#220,#224,.T.);
+#196=EDGE_CURVE('',#225,#223,#226,.T.);
+#197=EDGE_CURVE('',#221,#225,#227,.T.);
+#198=EDGE_CURVE('',#225,#221,#228,.T.);
+#199=EDGE_CURVE('',#220,#223,#229,.T.);
+#200=VERTEX_POINT('',#230);
+#201=VERTEX_POINT('',#231);
+#202=LINE('',#232,#233);
+#203=VERTEX_POINT('',#234);
+#204=LINE('',#235,#236);
+#205=VERTEX_POINT('',#237);
+#206=LINE('',#238,#239);
+#207=LINE('',#240,#241);
+#208=VERTEX_POINT('',#242);
+#209=VERTEX_POINT('',#243);
+#210=LINE('',#244,#245);
+#211=VERTEX_POINT('',#246);
+#212=LINE('',#247,#248);
+#213=VERTEX_POINT('',#249);
+#214=LINE('',#250,#251);
+#215=LINE('',#252,#253);
+#216=LINE('',#254,#255);
+#217=LINE('',#256,#257);
+#218=LINE('',#258,#259);
+#219=LINE('',#260,#261);
+#220=VERTEX_POINT('',#262);
+#221=VERTEX_POINT('',#263);
+#222=LINE('',#264,#265);
+#223=VERTEX_POINT('',#266);
+#224=CIRCLE('',#267,5.0);
+#225=VERTEX_POINT('',#268);
+#226=LINE('',#269,#270);
+#227=CIRCLE('',#271,5.0);
+#228=CIRCLE('',#272,5.0);
+#229=CIRCLE('',#273,5.0);
+#230=CARTESIAN_POINT('',(35.0,-5.0,5.0));
+#231=CARTESIAN_POINT('',(35.0,5.0,5.0));
+#232=CARTESIAN_POINT('',(35.0,0.0,5.0));
+#233=VECTOR('',#274,1.0);
+#234=CARTESIAN_POINT('',(25.0,5.0,5.0));
+#235=CARTESIAN_POINT('',(30.0,5.0,5.0));
+#236=VECTOR('',#275,1.0);
+#237=CARTESIAN_POINT('',(25.0,-5.0,5.0));
+#238=CARTESIAN_POINT('',(25.0,0.0,5.0));
+#239=VECTOR('',#276,1.0);
+#240=CARTESIAN_POINT('',(30.0,-5.0,5.0));
+#241=VECTOR('',#277,1.0);
+#242=CARTESIAN_POINT('',(35.0,5.0,-5.0));
+#243=CARTESIAN_POINT('',(35.0,-5.0,-5.0));
+#244=CARTESIAN_POINT('',(35.0,0.0,-5.0));
+#245=VECTOR('',#278,1.0);
+#246=CARTESIAN_POINT('',(25.0,-5.0,-5.0));
+#247=CARTESIAN_POINT('',(30.0,-5.0,-5.0));
+#248=VECTOR('',#279,1.0);
+#249=CARTESIAN_POINT('',(25.0,5.0,-5.0));
+#250=CARTESIAN_POINT('',(25.0,0.0,-5.0));
+#251=VECTOR('',#280,1.0);
+#252=CARTESIAN_POINT('',(30.0,5.0,-5.0));
+#253=VECTOR('',#281,1.0);
+#254=CARTESIAN_POINT('',(25.0,-5.0,0.0));
+#255=VECTOR('',#282,1.0);
+#256=CARTESIAN_POINT('',(35.0,-5.0,0.0));
+#257=VECTOR('',#283,1.0);
+#258=CARTESIAN_POINT('',(25.0,5.0,0.0));
+#259=VECTOR('',#284,1.0);
+#260=CARTESIAN_POINT('',(35.0,5.0,0.0));
+#261=VECTOR('',#285,1.0);
+#262=CARTESIAN_POINT('',(5.0,0.0,-5.0));
+#263=CARTESIAN_POINT('',(5.0,0.0,5.0));
+#264=CARTESIAN_POINT('',(5.0,-6.12303176911189E-16,0.0));
+#265=VECTOR('',#286,1.0);
+#266=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,-5.0));
+#267=AXIS2_PLACEMENT_3D('',#287,#288,#289);
+#268=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,5.0));
+#269=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,0.0));
+#270=VECTOR('',#290,1.0);
+#271=AXIS2_PLACEMENT_3D('',#291,#292,#293);
+#272=AXIS2_PLACEMENT_3D('',#294,#295,#296);
+#273=AXIS2_PLACEMENT_3D('',#297,#298,#299);
+#274=DIRECTION('',(0.0,1.0,0.0));
+#275=DIRECTION('',(-1.0,0.0,0.0));
+#276=DIRECTION('',(0.0,-1.0,0.0));
+#277=DIRECTION('',(1.0,0.0,0.0));
+#278=DIRECTION('',(0.0,-1.0,0.0));
+#279=DIRECTION('',(-1.0,0.0,0.0));
+#280=DIRECTION('',(0.0,1.0,0.0));
+#281=DIRECTION('',(1.0,0.0,0.0));
+#282=DIRECTION('',(0.0,0.0,-1.0));
+#283=DIRECTION('',(0.0,0.0,-1.0));
+#284=DIRECTION('',(0.0,0.0,-1.0));
+#285=DIRECTION('',(0.0,0.0,-1.0));
+#286=DIRECTION('',(0.0,0.0,1.0));
+#287=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#288=DIRECTION('',(0.0,0.0,-1.0));
+#289=DIRECTION('',(1.0,0.0,0.0));
+#290=DIRECTION('',(-0.0,-0.0,-1.0));
+#291=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#292=DIRECTION('',(0.0,0.0,1.0));
+#293=DIRECTION('',(1.0,0.0,0.0));
+#294=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#295=DIRECTION('',(0.0,0.0,1.0));
+#296=DIRECTION('',(1.0,0.0,0.0));
+#297=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#298=DIRECTION('',(0.0,0.0,-1.0));
+#299=DIRECTION('',(1.0,0.0,0.0));
+ENDSEC;
+END-ISO-10303-21;
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index f440f6a..cb362c9 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -26,7 +26,8 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test \
+ read_cgm_group_test
else
CGM_TEST =
endif
@@ -74,7 +75,13 @@ ccmio_test_SOURCES = $(srcdir)/../TestUtil.hpp ccmio_test.cpp
read_cgm_load_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_load_test.cpp
read_cgm_load_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS)
read_cgm_basic_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_basic_test.cpp
-read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS)
+read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cpp
+read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_connectivity_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_connectivity_test.cpp
+read_cgm_connectivity_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_group_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_group_test.cpp
+read_cgm_group_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
readutil_test_SOURCES = $(srcdir)/../TestUtil.hpp readutil_test.cpp
cgns_test_SOURCES=$(srcdir)/../TestUtil.hpp cgns_test.cpp
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 7a2d07d..75dcd1e 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -8,6 +8,8 @@
#include "Internals.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
using namespace moab;
@@ -31,40 +33,299 @@ static const char input_cube[] = "cube.sat";
#endif
#endif
-void read_cube_test()
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+void read_cube_verts_test();
+void read_cube_curves_test();
+void read_cube_tris_test();
+void read_cube_surfs_test();
+void read_cube_vols_test();
+void read_cube_vertex_pos_test();
+//void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
{
- Core mb;
+ int result = 0;
- ErrorCode rval = mb.load_file(input_cube); CHECK_ERR(rval);
+ result += RUN_TEST(read_cube_verts_test);
+ result += RUN_TEST(read_cube_curves_test);
+ result += RUN_TEST(read_cube_tris_test);
+ result += RUN_TEST(read_cube_surfs_test);
+ result += RUN_TEST(read_cube_vols_test);
+ result += RUN_TEST(read_cube_vertex_pos_test);
+
+ return result;
+}
+
- Tag geom_tag;
- rval = mb.tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
- geom_tag, MB_TAG_SPARSE|MB_TAG_CREAT);
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
+}
+
+// Gets the vertex entities from a simple cube file load and checks that the
+// correct number of them exist.
+void read_cube_verts_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ int number_of_vertices;
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_vertices );
+ CHECK_ERR(rval);
+ //For a cube there should be exactly 8 vertices
+ CHECK_EQUAL( 8, number_of_vertices );
+}
+
+// Gets the triangle entities from a simple cube file load and checks that the
+// correct number of them exist.
+void read_cube_tris_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
int number_of_tris;
- rval = mb.get_number_entities_by_type(0, MBTRI , number_of_tris);
+ rval = mb->get_number_entities_by_type( 0, MBTRI , number_of_tris );
std::cout << "Number of Triangles = " << number_of_tris << std::endl;
CHECK_ERR(rval);
+ //For a cube, there should be exactly 2 triangles per face
+ CHECK_EQUAL( 12, number_of_tris );
+}
- int number_of_vertices;
- rval = mb.get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+// Gets the curve entities from a simple cube file load and checks that the
+// correct number of them exist.
+void read_cube_curves_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+ //Get the geometry tag handle from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
+ //Get the curves from the mesh
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ //For a cube, there should be exactly 12 curves loaded from the file
+ CHECK_EQUAL( 12, number_of_curves );
+}
- if( number_of_tris != 12) rval = MB_FAILURE; CHECK_ERR(rval);
-
- if( number_of_vertices !=8) rval = MB_FAILURE; CHECK_ERR(rval);
+// Gets the surface entities from a simple cube file load and checks that the
+// correct number of them exist.
+void read_cube_surfs_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the number of surface from the mesh geometry data
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_surfs;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_surfs );
+ CHECK_ERR(rval);
+ //For a cube, there should be exactly 6 surfaces
+ CHECK_EQUAL( 6, number_of_surfs );
}
+
+void read_cube_vols_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
-int main(int /* argc */, char** /* argv */)
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the number of volumes from the mesh geometry data
+ int dim = 3;
+ void *val[] = {&dim};
+ int number_of_vols;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_vols );
+ CHECK_ERR(rval);
+ CHECK_EQUAL( 1, number_of_vols );
+}
+
+// Gets the vertex eitities from a simple cube file load and checks that
+// they are in the correct locations.
+void read_cube_vertex_pos_test()
{
- int result = 0;
- result += RUN_TEST( read_cube_test );
-
- return result;
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Retrieve all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR( rval );
+
+ int number_of_verts = verts.size();
+ CHECK_EQUAL( 8, number_of_verts );
+ //Get the vertex coordinates
+ double x[8];
+ double y[8];
+ double z[8];
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
+ CHECK_ERR(rval);
+
+ //Check against known locations of the vertices
+
+ std::vector<double> x_ref;
+ std::vector<double> y_ref;
+ std::vector<double> z_ref;
+
+ // Vertex 1
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 2
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 3
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 4
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 5
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 6
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 7
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 8
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+ std::cout << verts.size() << std::endl;
+ std::cout << x_ref.size() << std::endl;
+
+ for(unsigned int i=0; i<verts.size(); i++)
+ {
+ for(unsigned int j=0; j<x_ref.size(); j++)
+ {
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j] )
+ {
+ x_ref.erase( x_ref.begin()+j );
+ y_ref.erase( y_ref.begin()+j );
+ z_ref.erase( z_ref.begin()+j );
+ }
+ }
+ }
+
+ //After looping through each vertex loaded from the mesh
+ //there should be no entities left in the reference vector
+ int leftovers = x_ref.size();
+ CHECK_EQUAL( 0, leftovers );
+
}
+
+//Superfluous test for ReadCGM, but perhaps better
+//than the test in place for moab::delete_geometry()
+
+
+/*
+void delete_mesh_test()
+{
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ ErrorCode rval;
+
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range geom_sets[4];
+
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, geom_sets[dim] );
+ CHECK_ERR(rval);
+
+ if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
+
+ }
+
+ mb->delete_mesh();
+
+ Range geom_sets_after[4];
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val_after[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val_after, 1, geom_sets_after[dim] );
+ CHECK_ERR(rval);
+
+ if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
+
+ CHECK_ERR(rval);
+ }
+
+}
+
+*/
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
new file mode 100644
index 0000000..b750cbc
--- /dev/null
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -0,0 +1,252 @@
+
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+#include "moab/MeshTopoUtil.hpp"
+using namespace moab;
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+ std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+ << __LINE__ << std::endl; \
+ return A; } } while(false)
+
+
+#ifdef MESHDIR
+#ifdef HAVE_OCC_STEP
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.stp";
+#else
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cube[] = "cube.stp";
+#else
+static const char input_cube[] = "cube.sat";
+#endif
+#endif
+
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+void cube_verts_connectivity_test();
+void cube_tris_connectivity_test();
+void cube_tri_curve_coincidence_test();
+void cube_edge_adjacencies_test();
+void cube_tri_vertex_test();
+
+//Other functions
+void match_tri_edges_w_curve( Range tri_edges, Range curves );
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST(cube_verts_connectivity_test);
+ result += RUN_TEST(cube_tris_connectivity_test);
+ result += RUN_TEST(cube_tri_curve_coincidence_test);
+ result += RUN_TEST(cube_tri_vertex_test);
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+// Checks the adjacency of each vertex entity in a simple cube file load
+// to make sure it isn't adjacent to too many or too few triangles.
+void cube_verts_connectivity_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR(rval);
+
+ //Check that each vertex connects to at least 4 and no more than 6 triangles
+ for(Range::const_iterator i = verts.begin(); i!=verts.end(); i++)
+ {
+ std::vector<EntityHandle> adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
+ CHECK_ERR(rval);
+
+ int adj_size = adj_tris.size();
+ CHECK( adj_size >= 4 && adj_size <= 6 );
+ }
+
+}
+
+// Check that each triangle in the mesh is adjacent to
+// exactly three other triangles
+void cube_tris_connectivity_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+ int expected_num_of_adj_tris = 3;
+
+ for(Range::const_iterator i = tris.begin()+1; i!=tris.end(); i++)
+ {
+ Range adj_tris;
+ moab::MeshTopoUtil mu(mb);
+ //Use Triangle edges to get all adjacent triangles
+ rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris );
+ CHECK_ERR(rval);
+ CHECK_EQUAL( expected_num_of_adj_tris, (int)adj_tris.size() );
+
+ //Check that the entities we found from bridge_adjacencies
+ //are triangles
+ Range adj_tri_test = adj_tris.subset_by_type( MBTRI );
+ CHECK_EQUAL( (int)adj_tris.size(), (int) adj_tri_test.size() );
+
+ }
+
+}
+
+
+// Takes triangle edges and makes sure they match the EntityHandles of
+// curves in the case of a cube mesh
+void cube_tri_curve_coincidence_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get curves from the mesh
+ Range curves;
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
+ CHECK_ERR(rval);
+ curves.print();
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get the any curve edges that are a part of the triangle
+ Range tri_edges;
+ rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges );
+ CHECK_ERR(rval);
+ //Check that we've retrieved two edges from get_adjacencies
+ //For a this file (cube), each triangle should have two curve
+ //edges
+ int num_of_tri_edges = tri_edges.size();
+ CHECK_EQUAL( 2, num_of_tri_edges );
+ match_tri_edges_w_curve( tri_edges, curves );
+ CHECK_ERR(rval);
+ }
+}
+
+void match_tri_edges_w_curve( Range tri_edges, Range curves )
+{
+ int match_counter=0;
+ int num_of_tri_edges = tri_edges.size();
+ CHECK(num_of_tri_edges);
+ for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
+ {
+ for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
+ {
+ // If the edge handle matches a curve handle, increment the number
+ // matches
+ if( *i == *j ) match_counter++;
+ }
+ }
+ //Make sure that each edge returned from triangle edges
+ //has been matched to a curve
+ CHECK_EQUAL( num_of_tri_edges, match_counter );
+}
+
+// Ensures that each triangle edge is adjacent to no more than
+// two triangles.
+void cube_edge_adjacencies_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get the curves
+ Range curves;
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=curves.begin(); i!=curves.end(); i++)
+ {
+ //Get triangle adjacent to each edge
+ Range adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
+ CHECK_ERR(rval);
+
+ int num_adj_tris = adj_tris.size();
+ //Ensure that no edge is adjacent to more than two triangles
+ CHECK( num_adj_tris <= 2 );
+ }
+
+}
+
+// Checks, for each triangle, that none of the verices are the same
+void cube_tri_vertex_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all triangles
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get all triangle vertices
+ Range verts;
+ rval = mb->get_connectivity( &(*i), 1, verts );
+ CHECK_ERR(rval);
+ //Make sure that each vertex making up
+ //the triangle is different
+ int number_of_verts = verts.size();
+ CHECK( 3 == number_of_verts );
+ CHECK( verts[0]!=verts[1] );
+ CHECK( verts[1]!=verts[2] );
+ CHECK( verts[2]!=verts[0] );
+ }
+}
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
new file mode 100644
index 0000000..1098457
--- /dev/null
+++ b/test/io/read_cgm_group_test.cpp
@@ -0,0 +1,207 @@
+
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+
+using namespace moab;
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+ std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+ << __LINE__ << std::endl; \
+ return A; } } while(false)
+
+
+#ifdef MESHDIR
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
+#else
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
+#else
+static const char input_cylcube[] = "cylcube.sat";
+#endif
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+//Function for getting entity ids
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+//Function for checking retrieved group data
+void check_group_data( std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids );
+
+//Function for loading all reference data
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids);
+
+// List of tests in this file
+void read_cylcube_groups_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result+=RUN_TEST(read_cylcube_groups_test);
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+// Checks that group information is being read correctly if MOAB is
+// being build with CGM. If MOAB is built with OCC, it makes sure
+// no erroneous group data is loaded as STEP files do not hold
+// information about groups.
+void read_cylcube_groups_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube);
+
+ //Get (or create) the name and category tags
+ Tag name_tag, category_tag;
+
+ rval = mb->tag_get_handle( NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
+ name_tag, moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ rval = mb->tag_get_handle( CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE,
+ MB_TYPE_OPAQUE, category_tag,
+ moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the group entity handles
+ Range group_sets;
+ char query[CATEGORY_TAG_SIZE] = "Group\0";
+ //Has to be this way because of the way tags are created
+ void* val[] = {&query};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &category_tag, val, 1, group_sets);
+ CHECK_ERR(rval);
+ //Get group names and IDs
+ std::vector<int> g_ids;
+ std::vector<std::string> g_names;
+ std::vector<int> g_ent_ids;
+
+ for(Range::iterator i=group_sets.begin(); i!=group_sets.end(); i++)
+ {
+ int group_id = geom_id_by_handle( mb, *i );
+ g_ids.push_back(group_id);
+ //Get the group name
+ char group_name[NAME_TAG_SIZE+1];
+ rval = mb->tag_get_data( name_tag, &(*i), 1, &group_name);
+ CHECK_ERR(rval);
+ //Store group name
+ std::string temp(group_name);
+ g_names.push_back(temp);
+ //Get all entities in the group
+ Range group_ents;
+ rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false );
+ CHECK_ERR(rval);
+ if( group_ents.size() != 1) CHECK(false);
+ int grp_ent_id = geom_id_by_handle( mb, group_ents[0] );
+ g_ent_ids.push_back(grp_ent_id);
+
+ }
+ check_group_data( g_ids, g_names, g_ent_ids );
+}
+
+
+void check_group_data(std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids )
+{
+
+ // Step files do not contain group data, MOAB shouldn't return errors when trying to access
+ // this data but there shouldn't be any found.
+#ifdef HAVE_OCC_STEP
+ int num_g_ids = group_ids.size();
+ int num_g_names = group_names.size();
+
+ CHECK_EQUAL( 0, num_g_ids );
+ CHECK_EQUAL( 0, num_g_names );
+#else
+
+
+ //Initialize reference data
+ std::vector<int> group_ref_ids;
+ std::vector<std::string> group_ref_names;
+ std::vector<int> group_ref_ent_ids;
+ load_group_references( group_ref_ids, group_ref_names, group_ref_ent_ids );
+
+ // check that the correct number of entities were found
+ CHECK_EQUAL ( group_ref_ids.size(), group_ids.size() );
+ CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
+ CHECK_EQUAL ( group_ref_ent_ids.size(), group_ent_ids.size() );
+
+ //now make sure that each group has a matching group
+ for(unsigned int i=0 ; i<group_ids.size(); i++)
+ {
+ for(unsigned int j=0; j<group_ref_ids.size(); j++)
+ {
+ if( group_ids[i]==group_ref_ids[j]
+ && group_names[i] == group_ref_names[j]
+ && group_ent_ids[i]==group_ref_ent_ids[j])
+ {
+ group_ref_ids.erase(group_ref_ids.begin()+j);
+ group_ref_names.erase(group_ref_names.begin()+j);
+ group_ref_ent_ids.erase(group_ref_ent_ids.begin()+j);
+ continue;
+ }
+ }
+ }
+
+ // Check sizes of reference vectors after matching
+ // (all should be zero)
+ int leftovers = group_ref_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_names.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_ent_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+#endif
+}
+
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids )
+{
+ //First set of group info
+ names.push_back("Group 3"); ids.push_back(3); ent_ids.push_back(2);
+
+ //Second set of group info
+ names.push_back("Group 2"); ids.push_back(2); ent_ids.push_back(1);
+}
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
+ ErrorCode rval;
+ //Get the id_tag handle
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ CHECK_ERR(rval);
+ //Load the ID for the EntHandle given to the function
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ CHECK_ERR(rval);
+ return id;
+ }
diff --git a/test/io/read_cgm_load_test.cpp b/test/io/read_cgm_load_test.cpp
index 5377220..0a0f8ee 100644
--- a/test/io/read_cgm_load_test.cpp
+++ b/test/io/read_cgm_load_test.cpp
@@ -29,20 +29,22 @@ static const char input_file[] = "dum.sat";
#endif
#endif
+// Checks that a file can be loaded twice without errors
void read_multiple_test()
{
Core mb;
- ErrorCode rval = mb.load_file(input_file);
+ ErrorCode rval = mb.load_file( input_file );
CHECK_ERR(rval);
// second load
- rval = mb.load_file(input_file);
+ rval = mb.load_file( input_file );
CHECK_ERR(rval);
}
int main(int /* argc */, char** /* argv */)
{
+
int result = RUN_TEST( read_multiple_test );
return result;
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
new file mode 100644
index 0000000..26f3632
--- /dev/null
+++ b/test/io/read_cgm_senses_test.cpp
@@ -0,0 +1,584 @@
+
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+#include "MBTagConventions.hpp"
+#include "moab/GeomTopoTool.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+
+#define SENSE_FORWARD 1
+#define SENSE_REVERSE -1
+#define SENSE_UNKNOWN 0
+using namespace moab;
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+ std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+ << __LINE__ << std::endl; \
+ return A; } } while(false)
+
+
+#ifdef MESHDIR
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
+#else
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
+#else
+static const char input_cylcube[] = "cylcube.sat";
+#endif
+#endif
+
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// Functions containing known sense data
+ErrorCode load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+ErrorCode load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+ErrorCode load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+ErrorCode load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+
+// Functions used to compare sense information found in
+// the model to reference information
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses );
+
+//Function used to get id's from entity handles
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+// List of tests in this file
+void read_cylcube_curve_senses_test();
+void read_cylcube_surf_senses_test();
+void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST(read_cylcube_curve_senses_test);
+ result += RUN_TEST(read_cylcube_surf_senses_test);
+
+ return result;
+}
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+// Gets the sense data for each curve from a file
+// containing a cube and a cylinder. It then checks
+// that this sense data matches the reference
+// sense data from prior file reads.
+void read_cylcube_curve_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube );
+
+ //Get all curve handles
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of curves exist
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ //Step format adds a surface on the barrel of the cylinder.
+ //This created 4 extra surfaces in comparison to the .sat format from Cubit.
+ //(New surface breaks the barrel of the cylinder into two half-pipes)
+#ifdef HAVE_OCC_STEP
+ CHECK_EQUAL( 18, number_of_curves );
+#else
+ CHECK_EQUAL( 14, number_of_curves );
+#endif
+
+ //Get curve handles
+ Range curves;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, curves );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get curve data
+ moab::GeomTopoTool gt( mb, false );
+ // Initialize vectors for sense checking
+ std::vector<EntityHandle> surfs;
+ std::vector<int> senses;
+ std::vector<int> known_surf_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < curves.size() ; i++)
+ {
+
+ //Clean data from previous curve
+ surfs.clear();
+ senses.clear();
+ //Get sense info for the current curve
+ gt.get_senses( curves[i], surfs, senses );
+ CHECK_ERR(rval);
+
+ //Clear reference data from previous curve
+ known_surf_ids.clear();
+ known_senses.clear();
+ //Load known curve-sense ID data
+#ifdef HAVE_OCC_STEP
+ rval = load_stp_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ CHECK_ERR(rval);
+#else
+ rval = load_sat_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ CHECK_ERR(rval);
+#endif
+
+ //Check that each surf and sense has a match in the references
+ check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
+ }
+}
+
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
+
+ ErrorCode rval;
+ //Get the id_tag handle
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ CHECK_ERR(rval);
+ //Load the ID for the EntHandle given to the function
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ CHECK_ERR(rval);
+ return id;
+ }
+
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses )
+{
+
+ //Get ID's of the wrt entities
+ std::vector<int> wrt_ent_ids;
+ for(unsigned int i=0 ; i<wrt_ents.size() ; i++)
+ {
+ wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ) );
+ }
+
+ for(unsigned int i=0; i< wrt_ent_ids.size() ; i++)
+ {
+ for(unsigned int j=0; j< known_wrt_ids.size(); j++)
+ {
+ if( wrt_ent_ids[i] == known_wrt_ids [j] )
+ {
+ // Make sure the senses of the matching wrt entities
+ // are correct
+ CHECK_EQUAL( senses[i], known_senses[j] );
+ //Once a wrt entity is matched with a known entity,
+ // remove it from the list
+ wrt_ent_ids.erase( wrt_ent_ids.begin()+i );
+ senses.erase( senses.begin()+i );
+ }
+ }
+ }
+
+ // After both loops are complete, known_wrt_ents should be empty
+ int leftovers = wrt_ent_ids.size();
+ CHECK_EQUAL( leftovers, 0 );
+
+}
+
+//Loads two vectors with reference curve and curve_sense data
+ErrorCode load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
+
+ int curve_id = geom_id_by_handle( moab, curve );
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+//Loads two vectors with reference curve and curve_sense data
+ErrorCode load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
+
+ int curve_id = geom_id_by_handle( moab, curve );
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 15:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 16:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(10);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 17:
+ surf_ids_out.push_back(8); surf_ids_out.push_back(10);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 18:
+ surf_ids_out.push_back(8); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+// SURFACE SENSE CHECKING
+// Gets the sense data for each surface from a file
+// containing a cube and a cylinder. It then checks
+// that this sense data matches the reference
+// sense data from prior file reads.
+void read_cylcube_surf_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube );
+
+ //Get geometry tag for gathering surface information from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of surfaces exist
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_surfs;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_surfs );
+ CHECK_ERR(rval);
+ //Step format adds a surface on barrel of the cylinder.
+ // (Breaks it into two half-pipes)
+#ifdef HAVE_OCC_STEP
+ CHECK_EQUAL( 10, number_of_surfs );
+#else
+ CHECK_EQUAL( 9, number_of_surfs );
+#endif
+ // Get surface handles
+ Range surfs;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, surfs );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get surf data
+ moab::GeomTopoTool gt( mb, false );
+ std::vector<EntityHandle> vols;
+ std::vector<int> senses;
+ std::vector<int> known_vol_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < surfs.size(); i++)
+ {
+ //Clean data from previous surface
+ vols.clear();
+ senses.clear();
+ // Get sense information for the current
+ // surface from the mesh
+ gt.get_senses( surfs[i], vols, senses );
+ CHECK_ERR(rval);
+ //Clear previous reverence data
+ known_vol_ids.clear();
+ known_senses.clear();
+ // Load known surface-volume data
+ // for this surface and check that it's correct
+#ifdef HAVE_OCC_STEP
+ rval = load_stp_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ CHECK_ERR(rval);
+#else
+ rval = load_sat_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ CHECK_ERR(rval);
+#endif
+ // Check sense information from the loaded mesh against
+ // reference sense information
+ check_sense_data( mb, vols, senses, known_vol_ids, known_senses );
+
+ }
+
+}
+
+//Loads reference surface to volume sense data into the reference vectors
+ErrorCode load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf );
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+//Loads reference surface to volume sense data into the reference vectors
+ErrorCode load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf );
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 10:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ std::cout << "Failure to find surface sense reference data. Returning failure..." << std::endl;
+ return MB_FAILURE;
+ }
+ return MB_SUCCESS;
+}
+
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list