Medical Imaging Interaction Toolkit
2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
|
Describes a line. More...
#include <mitkLine.h>
Public Member Functions | |
Line () | |
Line (const itk::Point< TCoordRep, NPointDimension > &point, const itk::Vector< TCoordRep, NPointDimension > &direction) | |
Define line by point and direction. More... | |
const itk::Point< TCoordRep, NPointDimension > & | GetPoint () const |
Get start point of the line. More... | |
itk::Point< TCoordRep, NPointDimension > & | GetPoint () |
Get start point of the line. More... | |
const itk::Point< TCoordRep, NPointDimension > | GetPoint (TCoordRep t) const |
Get point on the line with parameter t. More... | |
void | SetPoint (const itk::Point< TCoordRep, NPointDimension > &point1) |
Set/change start point of the line. More... | |
const itk::Vector< TCoordRep, NPointDimension > & | GetDirection () const |
Get the direction vector of the line. More... | |
itk::Vector< TCoordRep, NPointDimension > & | GetDirection () |
Get the direction vector of the line. More... | |
void | SetDirection (const itk::Vector< TCoordRep, NPointDimension > &direction) |
Set the direction vector of the line. More... | |
void | Set (const itk::Point< TCoordRep, NPointDimension > &point, const itk::Vector< TCoordRep, NPointDimension > &direction) |
Define line by point and direction. More... | |
void | SetPoints (const itk::Point< TCoordRep, NPointDimension > &point1, const itk::Point< TCoordRep, NPointDimension > &point2) |
Define line by two points. More... | |
void | SetPoint1 (const itk::Point< TCoordRep, NPointDimension > &point1) |
Set/change start point of the line. More... | |
const itk::Point< TCoordRep, NPointDimension > & | GetPoint1 () const |
Get start point of the line. More... | |
void | SetPoint2 (const itk::Point< TCoordRep, NPointDimension > &point2) |
Set/change end point of the line. More... | |
itk::Point< TCoordRep, NPointDimension > | GetPoint2 () const |
Get end point of the line. More... | |
void | Transform (itk::Transform< TCoordRep, NPointDimension, NPointDimension > &transform) |
Transform the line with a Transform. More... | |
void | Transform (const itk::Matrix< TCoordRep, NPointDimension, NPointDimension > &matrix) |
Transform the line with a matrix. More... | |
double | Distance (const itk::Point< TCoordRep, NPointDimension > &point) const |
Distance of a point from the line. More... | |
itk::Point< TCoordRep, NPointDimension > | Project (const itk::Point< TCoordRep, NPointDimension > &point) const |
Project a point on the line. More... | |
bool | IsPartOfStraightLine (const itk::Point< TCoordRep, NPointDimension > &point) const |
Test if a point is part of the line. More... | |
bool | IsPartOfLine (const itk::Point< TCoordRep, NPointDimension > &point) const |
Test if a point is part of the line (line having infinite length) More... | |
bool | IsParallel (const Line< TCoordRep, NPointDimension > &line) const |
Test if a lines is parallel to this line. More... | |
bool | IsPartOfLine (const Line< TCoordRep, NPointDimension > &line) const |
Test if a line is part of the line (line having infinite length) More... | |
bool | operator== (const Line< TCoordRep, NPointDimension > &line) const |
Test if the two lines are identical. More... | |
const Line< TCoordRep, NPointDimension > & | operator= (const Line< TCoordRep, NPointDimension > &line) |
Set the line by another line. More... | |
bool | operator!= (const Line< TCoordRep, NPointDimension > &line) const |
Test if two lines are not identical. More... | |
Static Public Member Functions | |
static int | RectangleLineIntersection (TCoordRep x1, TCoordRep y1, TCoordRep x2, TCoordRep y2, itk::Point< TCoordRep, 2 > p, itk::Vector< TCoordRep, 2 > d, itk::Point< TCoordRep, 2 > &s1, itk::Point< TCoordRep, 2 > &s2) |
Calculates the intersection points of a straight line in 2D with a rectangle. More... | |
static int | BoxLineIntersection (TCoordRep x1, TCoordRep y1, TCoordRep z1, TCoordRep x2, TCoordRep y2, TCoordRep z2, itk::Point< TCoordRep, 3 > p, itk::Vector< TCoordRep, 3 > d, itk::Point< TCoordRep, 3 > &s1, itk::Point< TCoordRep, 3 > &s2) |
Calculates the intersection points of a straight line in 3D with a box. More... | |
Protected Attributes | |
itk::Point< TCoordRep, NPointDimension > | m_Point |
itk::Vector< TCoordRep, NPointDimension > | m_Direction |
Describes a line.
Definition at line 28 of file mitkLine.h.
|
inline |
Definition at line 31 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Define line by point and direction.
Length of direction defines the the length of the line
Definition at line 41 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inlinestatic |
Calculates the intersection points of a straight line in 3D with a box.
x1,y1,z1 | first corner of the box |
x2,y2,z2 | second corner of the box |
p,d | straight line: p point on it, d direction of line |
s1 | first intersection point (valid only if s_num>0) |
s2 | second intersection point (valid only if s_num==2) |
Definition at line 346 of file mitkLine.h.
References mitk::eps.
|
inline |
Distance of a point from the line.
Definition at line 143 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::Project().
Referenced by mitk::Line< TCoordRep, NPointDimension >::IsPartOfLine(), and mitk::Line< TCoordRep, NPointDimension >::IsPartOfStraightLine().
|
inline |
Get the direction vector of the line.
Definition at line 73 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction.
|
inline |
Get the direction vector of the line.
Definition at line 70 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction.
Referenced by mitk::Line< TCoordRep, NPointDimension >::IsParallel(), and mitk::Line< TCoordRep, NPointDimension >::operator=().
|
inline |
Get start point of the line.
Definition at line 52 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Get start point of the line.
Definition at line 49 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Point.
Referenced by mitk::Line< TCoordRep, NPointDimension >::IsPartOfLine(), and mitk::Line< TCoordRep, NPointDimension >::operator=().
|
inline |
Get point on the line with parameter t.
Definition at line 57 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Get start point of the line.
Definition at line 111 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Point.
Referenced by mitk::Line< TCoordRep, NPointDimension >::operator==().
|
inline |
Get end point of the line.
Definition at line 117 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
Referenced by mitk::Line< TCoordRep, NPointDimension >::operator==().
|
inline |
Test if a lines is parallel to this line.
Definition at line 201 of file mitkLine.h.
References mitk::eps, mitk::Line< TCoordRep, NPointDimension >::GetDirection(), and mitk::Line< TCoordRep, NPointDimension >::m_Direction.
Referenced by mitk::Line< TCoordRep, NPointDimension >::IsPartOfLine().
|
inline |
Test if a point is part of the line (line having infinite length)
Definition at line 191 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::Distance(), and mitk::eps.
|
inline |
Test if a line is part of the line (line having infinite length)
Definition at line 215 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::Distance(), mitk::Line< TCoordRep, NPointDimension >::GetPoint(), and mitk::Line< TCoordRep, NPointDimension >::IsParallel().
|
inline |
Test if a point is part of the line.
Length of the direction vector defines the length of the line
Definition at line 172 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::Distance(), mitk::eps, mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
|
inline |
Set the line by another line.
Definition at line 239 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::GetDirection(), mitk::Line< TCoordRep, NPointDimension >::GetPoint(), mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Test if the two lines are identical.
Start point and direction and length of direction vector must be equal for identical lines.
Definition at line 225 of file mitkLine.h.
References mitk::eps, mitk::Line< TCoordRep, NPointDimension >::GetPoint1(), and mitk::Line< TCoordRep, NPointDimension >::GetPoint2().
|
inline |
Project a point on the line.
Definition at line 152 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
Referenced by mitk::Line< TCoordRep, NPointDimension >::Distance().
|
inlinestatic |
Calculates the intersection points of a straight line in 2D with a rectangle.
x1,y1,x2,y2 | rectangle |
p,d | straight line: p point on it, d direction of line |
s1 | first intersection point (valid only if s_num>0) |
s2 | second intersection point (valid only if s_num==2) |
Definition at line 260 of file mitkLine.h.
References mitk::eps.
|
inline |
Define line by point and direction.
Length of direction defines the the length of the line
Definition at line 81 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Set the direction vector of the line.
Definition at line 76 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction.
|
inline |
Set/change start point of the line.
Definition at line 60 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Set/change start point of the line.
Definition at line 100 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Set/change end point of the line.
Definition at line 114 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Define line by two points.
Definition at line 90 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
inline |
Transform the line with a matrix.
Only the direction will be changed, not the start point.
Definition at line 136 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction.
|
inline |
Transform the line with a Transform.
Definition at line 126 of file mitkLine.h.
References mitk::Line< TCoordRep, NPointDimension >::m_Direction, and mitk::Line< TCoordRep, NPointDimension >::m_Point.
|
protected |
Definition at line 406 of file mitkLine.h.
Referenced by mitk::Line< TCoordRep, NPointDimension >::GetDirection(), mitk::Line< TCoordRep, NPointDimension >::GetPoint(), mitk::Line< TCoordRep, NPointDimension >::GetPoint2(), mitk::Line< TCoordRep, NPointDimension >::IsParallel(), mitk::Line< TCoordRep, NPointDimension >::IsPartOfStraightLine(), mitk::Line< TCoordRep, NPointDimension >::Line(), mitk::Line< TCoordRep, NPointDimension >::operator=(), mitk::Line< TCoordRep, NPointDimension >::Project(), mitk::Line< TCoordRep, NPointDimension >::Set(), mitk::Line< TCoordRep, NPointDimension >::SetDirection(), mitk::Line< TCoordRep, NPointDimension >::SetPoint(), mitk::Line< TCoordRep, NPointDimension >::SetPoint1(), mitk::Line< TCoordRep, NPointDimension >::SetPoint2(), mitk::Line< TCoordRep, NPointDimension >::SetPoints(), and mitk::Line< TCoordRep, NPointDimension >::Transform().
|
protected |
Definition at line 405 of file mitkLine.h.
Referenced by mitk::Line< TCoordRep, NPointDimension >::GetPoint(), mitk::Line< TCoordRep, NPointDimension >::GetPoint1(), mitk::Line< TCoordRep, NPointDimension >::GetPoint2(), mitk::Line< TCoordRep, NPointDimension >::IsPartOfStraightLine(), mitk::Line< TCoordRep, NPointDimension >::Line(), mitk::Line< TCoordRep, NPointDimension >::operator=(), mitk::Line< TCoordRep, NPointDimension >::Project(), mitk::Line< TCoordRep, NPointDimension >::Set(), mitk::Line< TCoordRep, NPointDimension >::SetPoint(), mitk::Line< TCoordRep, NPointDimension >::SetPoint1(), mitk::Line< TCoordRep, NPointDimension >::SetPoint2(), mitk::Line< TCoordRep, NPointDimension >::SetPoints(), and mitk::Line< TCoordRep, NPointDimension >::Transform().