MCPcopy Create free account
hub / github.com/Kitware/VTK / CheckIntersection

Method CheckIntersection

Filters/HyperTree/vtkHyperTreeGridPlaneCutter.cxx:732–755  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

730
731//------------------------------------------------------------------------------
732bool 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//------------------------------------------------------------------------------
758bool vtkHyperTreeGridPlaneCutter::CheckIntersection(double cellCoords[8][3])

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected