------------------------------------------------------------------------------
| 730 | |
| 731 | //------------------------------------------------------------------------------ |
| 732 | bool vtkHyperTreeGridPlaneCutter::CheckIntersection(double cellCoords[8][3], double functEval[8]) |
| 733 | { |
| 734 | // Iterate over cell vertices |
| 735 | int i; |
| 736 | for (i = 0; i < 8; ++i) |
| 737 | { |
| 738 | // Evaluate the plane in every coordinate |
| 739 | functEval[i] = cellCoords[i][0] * this->Plane[0] + cellCoords[i][1] * this->Plane[1] + |
| 740 | cellCoords[i][2] * this->Plane[2] - this->Plane[3]; |
| 741 | } // i |
| 742 | |
| 743 | // Evaluate plane equation at first corner |
| 744 | double firstVal = functEval[0]; |
| 745 | |
| 746 | // Check if there is any sign change |
| 747 | i = 7; |
| 748 | while (i && functEval[i] * firstVal > 0.) |
| 749 | { |
| 750 | --i; |
| 751 | } |
| 752 | |
| 753 | // Intersection if while statement broke early |
| 754 | return (i != 0); |
| 755 | } |
| 756 | |
| 757 | //------------------------------------------------------------------------------ |
| 758 | bool vtkHyperTreeGridPlaneCutter::CheckIntersection(double cellCoords[8][3]) |
no outgoing calls
no test coverage detected