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

Method IntersectWithLine

Common/DataModel/vtkHigherOrderWedge.cxx:465–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463}
464
465int vtkHigherOrderWedge::IntersectWithLine(
466 const double* p1, const double* p2, double tol, double& t, double* x, double* pcoords, int& subId)
467{
468 double tFirst = VTK_DOUBLE_MAX;
469 bool intersection = false;
470 vtkVector3d tmpX;
471 vtkVector3d tmpP;
472 int tmpId;
473 this->GetOrder(); // Ensure Order is up to date.
474 for (int ff = 0; ff < this->GetNumberOfFaces(); ++ff)
475 {
476 vtkCell* bdy = this->GetFace(ff);
477 if (bdy->IntersectWithLine(p1, p2, tol, t, tmpX.GetData(), tmpP.GetData(), tmpId))
478 {
479 intersection = true;
480 if (t < tFirst)
481 {
482 tFirst = t;
483 for (int ii = 0; ii < 3; ++ii)
484 {
485 x[ii] = tmpX[ii];
486 pcoords[ii] = tmpP[ii]; // Translate this after we're sure it's the closest hit.
487 subId = ff;
488 }
489 }
490 }
491 }
492 if (intersection)
493 {
494 this->TransformFaceToCellParams(subId, pcoords);
495 }
496 return intersection ? 1 : 0;
497}
498
499int vtkHigherOrderWedge::TriangulateLocalIds(int vtkNotUsed(index), vtkIdList* ptIds)
500{

Callers

nothing calls this directly

Calls 5

GetOrderMethod · 0.95
GetNumberOfFacesMethod · 0.45
GetFaceMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected