| 390 | */ |
| 391 | |
| 392 | bool vtkExodusIIReaderIntPointCheck::StartIntegrationPoints( |
| 393 | std::string cellType, std::string iptName) |
| 394 | { |
| 395 | struct |
| 396 | { |
| 397 | const char* RE; |
| 398 | int Rank; |
| 399 | } cellTypes[] = { { "[Qq][Uu][Aa][Dd]", 2 }, { "[Hh][Ee][Xx]", 3 }, { "[Tt][Ee][Tt]", 3 }, |
| 400 | { "[Tt][Rr][Ii]", 2 }, { "[Ww][Ee][Dd][Gg][Ee]", 3 }, { "[Pp][Yy][Rr]", 3 } }; |
| 401 | vtksys::RegularExpression ctrexp; |
| 402 | std::string::size_type expectedRank = static_cast<std::string::size_type>(-1); |
| 403 | for (unsigned int i = 0; i < sizeof(cellTypes) / sizeof(cellTypes[0]); ++i) |
| 404 | { |
| 405 | ctrexp.compile(cellTypes[i].RE); |
| 406 | if (ctrexp.find(cellType)) |
| 407 | { |
| 408 | expectedRank = cellTypes[i].Rank; |
| 409 | break; |
| 410 | } |
| 411 | } |
| 412 | std::string::size_type rank = iptName.size(); |
| 413 | if (expectedRank > 0 && rank != expectedRank) |
| 414 | { |
| 415 | this->Rank = 0; |
| 416 | return false; |
| 417 | } |
| 418 | this->Rank = rank; |
| 419 | this->IntPtMin.clear(); |
| 420 | this->IntPtMax.clear(); |
| 421 | for (std::string::size_type i = 0; i < rank; ++i) |
| 422 | { |
| 423 | int ival = iptName[i] - '0'; |
| 424 | if (ival < 0 || ival > 9) |
| 425 | { |
| 426 | this->Rank = 0; |
| 427 | return false; |
| 428 | } |
| 429 | this->IntPtMin.push_back(ival); |
| 430 | this->IntPtMax.push_back(ival); |
| 431 | } |
| 432 | this->IntPtNames.clear(); // clear out any old values |
| 433 | this->IntPtNames.insert(iptName); |
| 434 | return true; |
| 435 | } |
| 436 | |
| 437 | bool vtkExodusIIReaderIntPointCheck::AddIntegrationPoint(std::string iptName) |
| 438 | { |