Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::Line< TCoordRep, NPointDimension > Class Template Reference

Descibes a line. More...

#include <mitkLine.h>

Inheritance diagram for mitk::Line< TCoordRep, NPointDimension >:

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
 

Detailed Description

template<class TCoordRep, unsigned int NPointDimension = 3>
class mitk::Line< TCoordRep, NPointDimension >

Descibes a line.

Definition at line 32 of file mitkLine.h.

Constructor & Destructor Documentation

template<class TCoordRep, unsigned int NPointDimension = 3>
mitk::Line< TCoordRep, NPointDimension >::Line ( )
inline

Definition at line 35 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
mitk::Line< TCoordRep, NPointDimension >::Line ( const itk::Point< TCoordRep, NPointDimension > &  point,
const itk::Vector< TCoordRep, NPointDimension > &  direction 
)
inline

Define line by point and direction.

Length of direction defines the the length of the line

Definition at line 45 of file mitkLine.h.

Member Function Documentation

template<class TCoordRep, unsigned int NPointDimension = 3>
static int mitk::Line< TCoordRep, NPointDimension >::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 
)
inlinestatic

Calculates the intersection points of a straight line in 3D with a box.

Parameters
x1,y1,z1first corner of the box
x2,y2,z2second corner of the box
p,dstraight line: p point on it, d direction of line
s1first intersection point (valid only if s_num>0)
s2second intersection point (valid only if s_num==2)
Returns
number of intersection points (0<=s_num<=2)

Definition at line 350 of file mitkLine.h.

Referenced by mitk::PlaneGeometryDataMapper2D::CutCrossLineWithReferenceGeometry().

template<class TCoordRep, unsigned int NPointDimension = 3>
double mitk::Line< TCoordRep, NPointDimension >::Distance ( const itk::Point< TCoordRep, NPointDimension > &  point) const
inline
template<class TCoordRep, unsigned int NPointDimension = 3>
itk::Vector<TCoordRep, NPointDimension>& mitk::Line< TCoordRep, NPointDimension >::GetDirection ( )
inline

Get the direction vector of the line.

Definition at line 77 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
itk::Point<TCoordRep, NPointDimension>& mitk::Line< TCoordRep, NPointDimension >::GetPoint ( )
inline

Get start point of the line.

Definition at line 56 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
const itk::Point<TCoordRep, NPointDimension> mitk::Line< TCoordRep, NPointDimension >::GetPoint ( TCoordRep  t) const
inline

Get point on the line with parameter t.

Returns
m_Point+t*m_Direction

Definition at line 61 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
const itk::Point<TCoordRep, NPointDimension>& mitk::Line< TCoordRep, NPointDimension >::GetPoint1 ( ) const
inline
template<class TCoordRep, unsigned int NPointDimension = 3>
itk::Point<TCoordRep, NPointDimension> mitk::Line< TCoordRep, NPointDimension >::GetPoint2 ( ) const
inline
template<class TCoordRep, unsigned int NPointDimension = 3>
bool mitk::Line< TCoordRep, NPointDimension >::IsParallel ( const Line< TCoordRep, NPointDimension > &  line) const
inline

Test if a lines is parallel to this line.

Definition at line 205 of file mitkLine.h.

Referenced by mitk::DisplayInteractor::CheckRotationPossible(), and mitk::Line< double, 2 >::IsPartOfLine().

template<class TCoordRep, unsigned int NPointDimension = 3>
bool mitk::Line< TCoordRep, NPointDimension >::IsPartOfLine ( const itk::Point< TCoordRep, NPointDimension > &  point) const
inline

Test if a point is part of the line (line having infinite length)

Definition at line 195 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
bool mitk::Line< TCoordRep, NPointDimension >::IsPartOfLine ( const Line< TCoordRep, NPointDimension > &  line) const
inline

Test if a line is part of the line (line having infinite length)

Definition at line 219 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
bool mitk::Line< TCoordRep, NPointDimension >::IsPartOfStraightLine ( const itk::Point< TCoordRep, NPointDimension > &  point) const
inline

Test if a point is part of the line.

Length of the direction vector defines the length of the line

Definition at line 176 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
bool mitk::Line< TCoordRep, NPointDimension >::operator!= ( const Line< TCoordRep, NPointDimension > &  line) const
inline

Test if two lines are not identical.

See also
operator==

Definition at line 254 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
const Line<TCoordRep, NPointDimension>& mitk::Line< TCoordRep, NPointDimension >::operator= ( const Line< TCoordRep, NPointDimension > &  line)
inline

Set the line by another line.

Definition at line 243 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
bool mitk::Line< TCoordRep, NPointDimension >::operator== ( const Line< TCoordRep, NPointDimension > &  line) const
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 229 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
itk::Point<TCoordRep, NPointDimension> mitk::Line< TCoordRep, NPointDimension >::Project ( const itk::Point< TCoordRep, NPointDimension > &  point) const
inline

Project a point on the line.

Definition at line 156 of file mitkLine.h.

Referenced by mitk::DisplayInteractor::CheckRotationPossible(), and mitk::Line< double, 2 >::Distance().

template<class TCoordRep, unsigned int NPointDimension = 3>
static int mitk::Line< TCoordRep, NPointDimension >::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 
)
inlinestatic

Calculates the intersection points of a straight line in 2D with a rectangle.

Parameters
x1,y1,x2,y2rectangle
p,dstraight line: p point on it, d direction of line
s1first intersection point (valid only if s_num>0)
s2second intersection point (valid only if s_num==2)
Returns
number of intersection points (0<=s_num<=2)

Definition at line 264 of file mitkLine.h.

Referenced by mitk::PlaneGeometryDataMapper2D::CutCrossLineWithPlaneGeometry(), and mitk::PlaneGeometry::IntersectWithPlane2D().

template<class TCoordRep, unsigned int NPointDimension = 3>
void mitk::Line< TCoordRep, NPointDimension >::Set ( const itk::Point< TCoordRep, NPointDimension > &  point,
const itk::Vector< TCoordRep, NPointDimension > &  direction 
)
inline

Define line by point and direction.

Length of direction defines the the length of the line

Definition at line 85 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
void mitk::Line< TCoordRep, NPointDimension >::SetDirection ( const itk::Vector< TCoordRep, NPointDimension > &  direction)
inline

Set the direction vector of the line.

Definition at line 80 of file mitkLine.h.

Referenced by mitk::PlaneGeometry::IntersectionLine().

template<class TCoordRep, unsigned int NPointDimension = 3>
void mitk::Line< TCoordRep, NPointDimension >::SetPoint ( const itk::Point< TCoordRep, NPointDimension > &  point1)
inline

Set/change start point of the line.

Definition at line 64 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
void mitk::Line< TCoordRep, NPointDimension >::SetPoint1 ( const itk::Point< TCoordRep, NPointDimension > &  point1)
inline

Set/change start point of the line.

Definition at line 104 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
void mitk::Line< TCoordRep, NPointDimension >::SetPoint2 ( const itk::Point< TCoordRep, NPointDimension > &  point2)
inline

Set/change end point of the line.

Definition at line 118 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
void mitk::Line< TCoordRep, NPointDimension >::SetPoints ( const itk::Point< TCoordRep, NPointDimension > &  point1,
const itk::Point< TCoordRep, NPointDimension > &  point2 
)
inline
template<class TCoordRep, unsigned int NPointDimension = 3>
void mitk::Line< TCoordRep, NPointDimension >::Transform ( itk::Transform< TCoordRep, NPointDimension, NPointDimension > &  transform)
inline

Transform the line with a Transform.

Definition at line 130 of file mitkLine.h.

template<class TCoordRep, unsigned int NPointDimension = 3>
void mitk::Line< TCoordRep, NPointDimension >::Transform ( const itk::Matrix< TCoordRep, NPointDimension, NPointDimension > &  matrix)
inline

Transform the line with a matrix.

Only the direction will be changed, not the start point.

Definition at line 140 of file mitkLine.h.

Member Data Documentation


The documentation for this class was generated from the following file: