Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

mitk::PlanarLine Class Reference

Implementation of PlanarFigure representing a line through two control points. More...

#include <mitkPlanarLine.h>

Inheritance diagram for mitk::PlanarLine:
Inheritance graph
[legend]
Collaboration diagram for mitk::PlanarLine:
Collaboration graph
[legend]

List of all members.

Public Types

typedef PlanarLine Self
typedef PlanarFigure Superclass
typedef itk::SmartPointer< SelfPointer
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

Detailed Description

Implementation of PlanarFigure representing a line through two control points.

Definition at line 35 of file mitkPlanarLine.h.


Member Typedef Documentation

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.

Reimplemented from mitk::PlanarFigure.

Definition at line 38 of file mitkPlanarLine.h.

Reimplemented from mitk::PlanarFigure.

Definition at line 38 of file mitkPlanarLine.h.


Constructor & Destructor Documentation

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.

{
}

Member Function Documentation

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 );
}

Member Data Documentation

const unsigned int mitk::PlanarLine::FEATURE_ID_LENGTH [protected]

Definition at line 82 of file mitkPlanarLine.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines