217 static int tc111[][20] = {{0, 1}};
218 static int tn111[] = {2, 0};
219 static int tc112[][20] = {{0, 1, 2}};
220 static int tn112[] = {2, 0};
221 static int tc231[][20] = {{1, 2}, {2, 0}, {0, 1}};
222 static int tn231[] = {2, 2, 2, 0};
223 static int tc232[][20] = {{1, 3, 2}, {2, 4, 0}, {0, 5, 1}};
224 static int tn232[] = {3, 3, 3, 0};
225 static int tc241[][20] = {{3, 0}, {1, 2}, {0, 1}, {2, 3}};
226 static int tn241[] = {2, 2, 2, 2, 0};
227 static int tc242[][20] = {{3, 7, 0}, {1, 5, 2}, {0, 4, 1}, {2, 6, 3}};
228 static int tn242[] = {3, 3, 3, 3, 0};
229 static int tc341[][20] = {{1, 2, 3}, {0, 3, 2}, {0, 1, 3}, {0, 2, 1}};
230 static int tn341[] = {3, 3, 3, 3, 0};
231 static int tc342[][20] = {{1, 4, 2, 9, 3, 8},
235 static int tn342[] = {6, 6, 6, 6, 0};
236 static int tc351[][20] = {
237 {1, 2, 5, 4}, {2, 0, 3, 5}, {0, 1, 4, 3}, {2, 1, 0}, {3, 4, 5}};
238 static int tn351[] = {4, 4, 4, 3, 3, 0};
239 static int tc352[][20] = {{1, 6, 2, 14, 5, 9, 4, 13},
240 {2, 7, 0, 12, 3, 10, 5, 14},
241 {0, 8, 1, 13, 4, 11, 3, 12},
243 {3, 11, 4, 9, 5, 10}};
244 static int tn352[] = {8, 8, 8, 6, 6, 0};
245 static int tc361[][20] = {{3, 0, 4, 7}, {1, 2, 6, 5}, {0, 1, 5, 4},
246 {2, 3, 7, 6}, {3, 2, 1, 0}, {4, 5, 6, 7}};
247 static int tn361[] = {4, 4, 4, 4, 4, 4, 0};
248 static int tc362[][20] = {
249 {3, 11, 0, 16, 4, 15, 7, 19}, {1, 9, 2, 18, 6, 13, 5, 17},
250 {0, 8, 1, 17, 5, 12, 4, 16}, {2, 10, 3, 19, 7, 14, 6, 18},
251 {3, 10, 2, 9, 1, 8, 0, 11}, {4, 12, 5, 13, 6, 14, 7, 15}};
252 static int tn362[] = {8, 8, 8, 8, 8, 8, 0};
253 static int tc541[][20] = {{3, 2, 1, 0}, {4, 5, 6, 7}};
254 static int tn541[] = {4, 4, 0};
255 static int tc542[][20] = {{3, 10, 2, 9, 1, 8, 0, 11},
256 {4, 12, 5, 13, 6, 14, 7, 15}};
257 static int tn542[] = {8, 8, 0};
258 static int tc611[][20] = {{0, 1}};
259 static int tn611[] = {2, 0};
260 static int tc612[][20] = {{0, 1, 2}};
261 static int tn612[] = {3, 0};
262 static int tc731[][20] = {{0, 1, 2}, {2, 1, 0}};
263 static int tn731[] = {3, 3, 0};
264 static int tc732[][20] = {{0, 3, 1, 4, 2, 5}, {2, 4, 1, 3, 0, 5}};
265 static int tn732[] = {6, 6, 0};
266 static int tc741[][20] = {{0, 1, 2, 3}, {3, 2, 1, 0}};
267 static int tn741[] = {4, 4, 0};
268 static int tc742[][20] = {{0, 4, 1, 5, 2, 6, 3, 7}, {3, 6, 2, 5, 1, 4, 0, 7}};
269 static int tn742[] = {4, 4, 0};
270 #define CODE_GENERATE(x) \
272 n = tn##x[face_id]; \
273 return tc##x[face_id];
305 const int type_list[] = {111, 112, 231, 232, 241, 242, 351, 352, 361,
306 362, 541, 542, 611, 612, 731, 732, 741, 742};
307 int type_n =
sizeof(type_list);
309 for (
int i = 0; i < type_n; i++) {
310 if (type == type_list[i])
return true;
328 set<CElemItem>::iterator iter;
334 for (
int i = 0; i < n; i++) {
343 set<CElemItem>::iterator iter;
346 if (iter->ID ==
id)
return (
CElemItem *)&(*iter);
362 if (n <= 0)
return false;
368 if (line[0] ==
'!') {
373 char *token = strtok(line,
",\r\n");
375 if (!token)
return false;
377 if (sscanf(token,
"%d", &item.
ID) != 1)
return false;
379 for (
int i = 0; i < n; i++) {
380 token = strtok(0,
",\r\n");
382 if (!token)
return false;
386 if (sscanf(token,
"%d", &nid) != 1)
return false;