Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "mitkPlanarLine.h"
00020 #include "mitkGeometry2D.h"
00021
00022
00023 mitk::PlanarLine::PlanarLine()
00024 : FEATURE_ID_LENGTH( this->AddFeature( "Length", "mm" ) )
00025 {
00026
00027 this->ResetNumberOfControlPoints( 2 );
00028
00029 m_PolyLines->InsertElement( 0, VertexContainerType::New());
00030 }
00031
00032
00033 mitk::PlanarLine::~PlanarLine()
00034 {
00035 }
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 void mitk::PlanarLine::GeneratePolyLine()
00066 {
00067
00068
00069 m_PolyLines->ElementAt( 0 )->Reserve( 2 );
00070 m_PolyLines->ElementAt( 0 )->ElementAt( 0 ) = m_ControlPoints->ElementAt( 0 );
00071 m_PolyLines->ElementAt( 0 )->ElementAt( 1 ) = m_ControlPoints->ElementAt( 1 );
00072 }
00073
00074 void mitk::PlanarLine::GenerateHelperPolyLine(double , unsigned int )
00075 {
00076
00077 }
00078
00079
00080 void mitk::PlanarLine::EvaluateFeaturesInternal()
00081 {
00082
00083 const Point3D &p0 = this->GetWorldControlPoint( 0 );
00084 const Point3D &p1 = this->GetWorldControlPoint( 1 );
00085 double length = p0.EuclideanDistanceTo( p1 );
00086
00087 this->SetQuantity( FEATURE_ID_LENGTH, length );
00088 }
00089
00090
00091 void mitk::PlanarLine::PrintSelf( std::ostream& os, itk::Indent indent) const
00092 {
00093 Superclass::PrintSelf( os, indent );
00094 }