Static Public Member Functions

mitkPlanarArrowTestClass Class Reference

List of all members.

Static Public Member Functions

static void TestPlanarArrowPlacement (mitk::PlanarArrow::Pointer PlanarArrow)

Detailed Description

Definition at line 23 of file mitkPlanarArrowTest.cpp.


Member Function Documentation

static void mitkPlanarArrowTestClass::TestPlanarArrowPlacement ( mitk::PlanarArrow::Pointer  PlanarArrow ) [inline, static]

Definition at line 29 of file mitkPlanarArrowTest.cpp.

References MITK_TEST_CONDITION.

Referenced by mitkPlanarArrowTest().

{
  // Test for correct minimum number of control points in cross-mode
  MITK_TEST_CONDITION( PlanarArrow->GetMinimumNumberOfControlPoints() == 2, "Minimum number of control points" );

  // Test for correct maximum number of control points in cross-mode
  MITK_TEST_CONDITION( PlanarArrow->GetMaximumNumberOfControlPoints() == 2, "Maximum number of control points" );

  // Initial placement of PlanarArrow
  mitk::Point2D p0;
  p0[0] = 00.0; p0[1] = 0.0;
  PlanarArrow->PlaceFigure( p0 );

  // Add second control point
  mitk::Point2D p1;
  p1[0] = 50.0; p1[1] = 00.0;
  PlanarArrow->SetControlPoint(1, p1 );

  // Test for number of control points
  MITK_TEST_CONDITION( PlanarArrow->GetNumberOfControlPoints() == 2, "Number of control points after placement" );

  // Test for number of polylines
  const mitk::PlanarFigure::VertexContainerType* polyLine0 = PlanarArrow->GetPolyLine( 0 );
  MITK_TEST_CONDITION( PlanarArrow->GetPolyLinesSize() == 1, "Number of polylines after placement" );

  // Get polylines and check if the generated coordinates are OK
  const mitk::Point2D& pp0 = polyLine0->ElementAt( 0 );
  const mitk::Point2D& pp1 = polyLine0->ElementAt( 1 );
  MITK_TEST_CONDITION( (pp0 == p0) && (pp1 == p1), "Correct polyline 1" );

    
  // Test for number of measurement features
  // none yet 

}

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