Annotation2D

From IGSTK

Jump to: navigation, search

New Features Requested

  • Capability to modify the annotation text
    • In the current version, the annotation can only be specified at the beginning and can never be modified
  • Capability to modify the annotation text property
    • Text color
    • Font size
  • When the render window is resized, the annotation's corner position should be updated automatically.
    • Update the annotation view port when the render window is resized

Modifications to the Class

  • Modify the state machine to allow text and property changes in any order
  • Move the method that sets the annotation viewport to protected section.
    • In the current version, the RequestSetAnnotationsViewPort method is in the public section. This should be changed.
    • Make the View class to be a friend of the Annotation 2D class so that the view class can invoke the RequestSetAnnotationsViewPort
    • In the UpdateSize() method of the View class, update the ViewPort of the Annotation 2D object
  • Add Safeguards to make sure the annotation text is displayed properly
    • Add a maximum size constraint on the font size
    • Check for overlapping text
    • These safeguards should work also when the ViewPort is resized
  • Look at replacing the vtkActor2D with a vtkTextActor in the annotation 2D class
    • Define the SetJustification() for every one of the actors, according to whether they are on the left or the right side of the viewport.

Test Use Cases

  • Test all combinations of
    • Resizing the View (via the main application Window)
    • Changing font size
    • Changing font color
    • Changing the text content
  • This is four features, that tested in every order require : 4*3*2*1 = 24 tests
  • Additional tests will be required for the four corners. (4 corners x 4 features ) = 16
  • Add regression tests for verifying the rendering of the text.
  • Test the use of special characters in the String
    • "\n" for multi-line
      • Verify its behavior on the bottom annotations.
    • "\t"  ? do we want to support it
      • Filter it ?
    • "\\" ??
  • Support adding a "file name" type of string ?
    • For example "C:\Program Files\Data\Patient"
Personal tools
TOOLBOX
LANGUAGES