Implementation of PlanarFigure representing a line through two control points. More...
#include <mitkPlanarLine.h>
Public Types | |
typedef PlanarLine | Self |
typedef PlanarFigure | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
virtual const char * | GetClassName () const |
unsigned int | GetMinimumNumberOfControlPoints () const |
Place figure in its minimal configuration (a point at least) onto the given 2D geometry. | |
unsigned int | GetMaximumNumberOfControlPoints () const |
Line has 2 control points per definition. | |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
PlanarLine () | |
virtual | ~PlanarLine () |
virtual void | GeneratePolyLine () |
Generates the poly-line representation of the planar figure. | |
virtual void | GenerateHelperPolyLine (double mmPerDisplayUnit, unsigned int displayHeight) |
Generates the poly-lines that should be drawn the same size regardless of zoom. | |
virtual void | EvaluateFeaturesInternal () |
Calculates feature quantities of the planar figure. | |
virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const |
Protected Attributes | |
const unsigned int | FEATURE_ID_LENGTH |
Implementation of PlanarFigure representing a line through two control points.
Definition at line 35 of file mitkPlanarLine.h.
typedef itk::SmartPointer<const Self> mitk::PlanarLine::ConstPointer |
Reimplemented from mitk::PlanarFigure.
Definition at line 38 of file mitkPlanarLine.h.
typedef itk::SmartPointer<Self> mitk::PlanarLine::Pointer |
Reimplemented from mitk::PlanarFigure.
Definition at line 38 of file mitkPlanarLine.h.
typedef PlanarLine mitk::PlanarLine::Self |
Reimplemented from mitk::PlanarFigure.
Definition at line 38 of file mitkPlanarLine.h.
Reimplemented from mitk::PlanarFigure.
Definition at line 38 of file mitkPlanarLine.h.
mitk::PlanarLine::PlanarLine | ( | ) | [protected] |
Definition at line 23 of file mitkPlanarLine.cpp.
References mitk::PlanarFigure::m_PolyLines, and mitk::PlanarFigure::ResetNumberOfControlPoints().
: FEATURE_ID_LENGTH( this->AddFeature( "Length", "mm" ) ) { // Line has two control points this->ResetNumberOfControlPoints( 2 ); m_PolyLines->InsertElement( 0, VertexContainerType::New()); }
mitk::PlanarLine::~PlanarLine | ( | ) | [protected, virtual] |
Definition at line 33 of file mitkPlanarLine.cpp.
{ }
void mitk::PlanarLine::EvaluateFeaturesInternal | ( | ) | [protected, virtual] |
Calculates feature quantities of the planar figure.
Implements mitk::PlanarFigure.
Definition at line 80 of file mitkPlanarLine.cpp.
{ // Calculate line length const Point3D &p0 = this->GetWorldControlPoint( 0 ); const Point3D &p1 = this->GetWorldControlPoint( 1 ); double length = p0.EuclideanDistanceTo( p1 ); this->SetQuantity( FEATURE_ID_LENGTH, length ); }
void mitk::PlanarLine::GenerateHelperPolyLine | ( | double | mmPerDisplayUnit, |
unsigned int | displayHeight | ||
) | [protected, virtual] |
Generates the poly-lines that should be drawn the same size regardless of zoom.
Implements mitk::PlanarFigure.
Definition at line 74 of file mitkPlanarLine.cpp.
{
// A line does not require a helper object
}
void mitk::PlanarLine::GeneratePolyLine | ( | ) | [protected, virtual] |
Generates the poly-line representation of the planar figure.
Implements mitk::PlanarFigure.
Definition at line 65 of file mitkPlanarLine.cpp.
{ // TODO: start line at specified start point... // Generate poly-line m_PolyLines->ElementAt( 0 )->Reserve( 2 ); m_PolyLines->ElementAt( 0 )->ElementAt( 0 ) = m_ControlPoints->ElementAt( 0 ); m_PolyLines->ElementAt( 0 )->ElementAt( 1 ) = m_ControlPoints->ElementAt( 1 ); }
virtual const char* mitk::PlanarLine::GetClassName | ( | ) | const [virtual] |
Reimplemented from mitk::PlanarFigure.
unsigned int mitk::PlanarLine::GetMaximumNumberOfControlPoints | ( | ) | const [inline, virtual] |
Line has 2 control points per definition.
Implements mitk::PlanarFigure.
Definition at line 59 of file mitkPlanarLine.h.
{
return 2;
}
unsigned int mitk::PlanarLine::GetMinimumNumberOfControlPoints | ( | ) | const [inline, virtual] |
Place figure in its minimal configuration (a point at least) onto the given 2D geometry.
Must be implemented in sub-classes.Line has 2 control points per definition.
Implements mitk::PlanarFigure.
Definition at line 52 of file mitkPlanarLine.h.
{
return 2;
}
static Pointer mitk::PlanarLine::New | ( | ) | [static] |
void mitk::PlanarLine::PrintSelf | ( | std::ostream & | os, |
itk::Indent | indent | ||
) | const [protected, virtual] |
Reimplemented from mitk::PlanarFigure.
Definition at line 91 of file mitkPlanarLine.cpp.
{ Superclass::PrintSelf( os, indent ); }
const unsigned int mitk::PlanarLine::FEATURE_ID_LENGTH [protected] |
Definition at line 82 of file mitkPlanarLine.h.