MCPcopy Create free account
hub / github.com/MITK/MITK / IntersectionPoint

Method IntersectionPoint

Modules/Core/src/DataManagement/mitkPlaneGeometry.cpp:653–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

651 }
652
653 bool PlaneGeometry::IntersectionPoint(const Line3D &line, Point3D &intersectionPoint) const
654 {
655 Vector3D planeNormal = this->GetNormal();
656 planeNormal.Normalize();
657
658 Vector3D lineDirection = line.GetDirection();
659 lineDirection.Normalize();
660
661 double t = planeNormal * lineDirection;
662 if (fabs(t) < eps)
663 {
664 return false;
665 }
666
667 Vector3D diff;
668 diff = this->GetOrigin() - line.GetPoint();
669 t = (planeNormal * diff) / t;
670
671 intersectionPoint = line.GetPoint() + lineDirection * t;
672 return true;
673 }
674
675 bool PlaneGeometry::IntersectionPointParam(const Line3D &line, double &t) const
676 {

Callers 6

GetSelectedPositionMethod · 0.80
CreateBoundingObjectMethod · 0.80
TestIntersectionPointMethod · 0.80
CheckRotationPossibleMethod · 0.80
CheckSwivelPossibleMethod · 0.80

Calls 4

GetNormalMethod · 0.95
NormalizeMethod · 0.80
GetOriginMethod · 0.45
GetPointMethod · 0.45

Tested by 1

TestIntersectionPointMethod · 0.64