34 if ( line.IsNull() || line->GetSize() != 2 )
36 mitkThrow() <<
"Line must consist of exact two points.";
40 m_LinePoint1[0] = line->GetPoint(0)[0];
41 m_LinePoint1[1] = line->GetPoint(0)[1];
42 m_LinePoint1[2] = line->GetPoint(0)[2];
43 m_LinePoint2[0] = line->GetPoint(1)[0];
44 m_LinePoint2[1] = line->GetPoint(1)[1];
45 m_LinePoint2[2] = line->GetPoint(1)[2];
74 if ( m_TargetSurface.IsNull() )
76 mitkThrow() <<
"Target surface must not be null.";
79 m_TargetSurfaceVtk = m_TargetSurface->GetVtkPolyData();
84 transformFilter->SetInputData(0, m_TargetSurfaceVtk);
85 transformFilter->SetTransform(m_TargetSurface->GetGeometry()->GetVtkTransform());
86 transformFilter->Update();
87 m_TargetSurfaceVtk = transformFilter->GetOutput();
91 cellLocator->SetDataSet(m_TargetSurfaceVtk);
92 cellLocator->BuildLocator();
96 if ( cellLocator->IntersectWithLine(m_LinePoint1, m_LinePoint2, points, cellIds) != 0 )
98 m_IsIntersecting =
true;
100 points->GetPoint(0, m_IntersectionPoint);
101 m_IntersectionCellId = cellIds->GetId(0);
105 m_IsIntersecting =
false;