Difference between revisions of "Projects:ARRA:VTKWidgetsTesting"

From NAMIC Wiki
Jump to: navigation, search
Line 18: Line 18:
 
== WORK IN PROGRESS ==
 
== WORK IN PROGRESS ==
  
 
+
=== Widgets ===
 
Notes made while writing the Widget tests: (priorities taken from here: [[Projects:ARRA:SlicerAM:KWWidgets#PRIORITY_WIDGETS | Priority Widgets]], indentation shows inheritance)
 
Notes made while writing the Widget tests: (priorities taken from here: [[Projects:ARRA:SlicerAM:KWWidgets#PRIORITY_WIDGETS | Priority Widgets]], indentation shows inheritance)
 
*'''vtkInteractorObserver''' defines the Enabled variable and the On/Off methods. Testing them in isolation shows that there are missing checks for having an interactor defined, as the test crashes consistently even after creating a render window and interactor to pass to the widget
 
*'''vtkInteractorObserver''' defines the Enabled variable and the On/Off methods. Testing them in isolation shows that there are missing checks for having an interactor defined, as the test crashes consistently even after creating a render window and interactor to pass to the widget
Line 33: Line 33:
 
**'''vtkHoverWidget'''
 
**'''vtkHoverWidget'''
 
***'''vtkBaloonWidget'''
 
***'''vtkBaloonWidget'''
 +
 +
=== Representations ===
  
 
Testing the representations:
 
Testing the representations:
Line 38: Line 40:
 
**'''vtkWidgetRepresentation'''
 
**'''vtkWidgetRepresentation'''
 
***'''vtkAngleRepresentation'''
 
***'''vtkAngleRepresentation'''
***'''vtkBalloonRepresentation''' - no HoverRepresentation?
+
***'''vtkBalloonRepresentation''' - why no HoverRepresentation?
***'''vtkBiDimensionalRepresentation2D''' - missing 3D?
+
***'''vtkBiDimensionalRepresentation2D''' - is it missing 3D representation?
 
***'''vtkBorderRepresentation'''
 
***'''vtkBorderRepresentation'''
 
****'''vtkCaptionRepresentation'''
 
****'''vtkCaptionRepresentation'''
 
****'''vtkTextRepresentation'''
 
****'''vtkTextRepresentation'''
***'''vtkImplicitPlaneRepresentation''' - matches to vtkImplicitPlaneWidget2?
+
***'''vtkImplicitPlaneRepresentation''' - does it match to vtkImplicitPlaneWidget2?
***'''vtkLineRepresentation''' - matches to LineWidget2?
+
***'''vtkLineRepresentation''' - does it match to LineWidget2?
 
***'''vtkSeedRepresentation'''
 
***'''vtkSeedRepresentation'''
 
***'''vtkSplineRepresentation'''
 
***'''vtkSplineRepresentation'''

Revision as of 18:49, 29 July 2010

Home < Projects:ARRA:VTKWidgetsTesting

Preliminary Steps

Working from the Slicer3 VTK56 git repository.

First goal is to set up a similar infrastructure as used in Slicer3/Libs/MRML/Testing, which includes a file that defines basic testing macros (Slicer3/TestingMacros.h) that calls methods on super classes and chains macros together as you get down to testing subclasses. The file

 VTK/Widgets/Testing/Cxx/WidgetTestingMacros.h

is set up to define:

  EXERCISE_BASIC_OBJECT_METHODS (copied from Slicer, thanks to Luis Ibanez)
  TEST_SET_GET for various variable types (INT, BOOLEAN, STRING, DOUBLE, VECTOR3, CHAR)
  EXERCISE_BASIC_INTERACTOR_OBSERVER_METHODS for the superclass (could be moved/copied to VTK/Rendering/Testing, no tests yet)
  EXERCISE_BASIC_ABSTRACT_METHODS
  EXERCISE_BASIC_BORDER_METHODS to test widgets that inherit from vtkBorderWidget (Text)
  EXERCISE_BASIC_HOVER_METHOD to test widgets that inherit from vtkHoverWidget (Balloon)

Then new testing .cxx files were crafted and added to the CMakeLists.txt to use these basic macros to test every call.

Then extend it to exercise basic prop, widget representation, border representation methods once get to testing the widget representations.

WORK IN PROGRESS

Widgets

Notes made while writing the Widget tests: (priorities taken from here: Priority Widgets, indentation shows inheritance)

  • vtkInteractorObserver defines the Enabled variable and the On/Off methods. Testing them in isolation shows that there are missing checks for having an interactor defined, as the test crashes consistently even after creating a render window and interactor to pass to the widget
    • vtkAbstractWidget Set/Get Parent doesn't work in stand alone tests
      • vtkAngleWidget
      • vtkBidimensionalWidget
      • vtkImplicitPlaneWidget2
      • vtkLineWidget2
      • vtkSeedWidget
      • vtkSplineWidget2
    • vtkBorderWidget
      • vtkCaptionWidget
      • vtkTextWidget
    • vtkHoverWidget
      • vtkBaloonWidget

Representations

Testing the representations:

  • vtkProp
    • vtkWidgetRepresentation
      • vtkAngleRepresentation
      • vtkBalloonRepresentation - why no HoverRepresentation?
      • vtkBiDimensionalRepresentation2D - is it missing 3D representation?
      • vtkBorderRepresentation
        • vtkCaptionRepresentation
        • vtkTextRepresentation
      • vtkImplicitPlaneRepresentation - does it match to vtkImplicitPlaneWidget2?
      • vtkLineRepresentation - does it match to LineWidget2?
      • vtkSeedRepresentation
      • vtkSplineRepresentation