------------------------------------------------------------------------------ This method works fine for all "rectangular" cells, not triangular and tetrahedral topologies.
| 518 | // This method works fine for all "rectangular" cells, not triangular |
| 519 | // and tetrahedral topologies. |
| 520 | double vtkCell::GetParametricDistance(const double pcoords[3]) |
| 521 | { |
| 522 | int i; |
| 523 | double pDist, pDistMax = 0.0; |
| 524 | |
| 525 | for (i = 0; i < 3; i++) |
| 526 | { |
| 527 | if (pcoords[i] < 0.0) |
| 528 | { |
| 529 | pDist = -pcoords[i]; |
| 530 | } |
| 531 | else if (pcoords[i] > 1.0) |
| 532 | { |
| 533 | pDist = pcoords[i] - 1.0; |
| 534 | } |
| 535 | else // inside the cell in the parametric direction |
| 536 | { |
| 537 | pDist = 0.0; |
| 538 | } |
| 539 | pDistMax = std::max(pDist, pDistMax); |
| 540 | } |
| 541 | return pDistMax; |
| 542 | } |
| 543 | |
| 544 | //------------------------------------------------------------------------------ |
| 545 | void vtkCell::PrintSelf(ostream& os, vtkIndent indent) |