KWWidgets/Projects/3DWidgets/Widgets/ChangingArchitecture: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
mNo edit summary
Line 4: Line 4:


:This I commenced by looking at the vtkSliderWidget and how it interacts with the main classes regarding the restructuring project - the vtkAbstractWidget and vtkWidgetRepresentation classes and their derivatives.
:This I commenced by looking at the vtkSliderWidget and how it interacts with the main classes regarding the restructuring project - the vtkAbstractWidget and vtkWidgetRepresentation classes and their derivatives.
<center>[[Image:Class_Diagram_vtKSliderWidget.png]]</center>


'''Comparing Structure'''
'''Old architecture'''
:How to structure the callback?
<center>[[Image:3DWidgets_arch_before.jpg]]</center>
:After looking at vtkSliderWidget and vtkDistanceWidget, I have come across parts of two methods of dealing with callbacks. One (above) defines the required callback methods in the widget (vtkSliderWidget) whereas the other (below, based on vtkDistanceWidget) provides the possiblity to create CallbackMapper classes inheriting from vtkCallbackMapper to provide preset callback methods.
 
:I feel that the second method is more inline with the 3DWidget reauthoring - separating events from representation. Also, it provides the possiblity to have different callbacks depending on widget use.
'''New architecture'''
:For example, a program may have a "View" and "Interact" modes. In "View" mode, CallbackMapperA is used where left-clicking will update a window with data XYZ. In "Interact" mode, CallbackMapperB is used where left-clicking selects the object for manipulation.
<center>[[Image:3DWidgets_arch_after.jpg]]</center>
:Which of these methods is better for the reauthoring?
 
'''Differences between the two architectures'''
<center>[[Image:3DWidgets_arch_differences.jpg]]</center>


==Analysis and overview of new architecture==
==Analysis and overview of new architecture==

Revision as of 15:11, 5 June 2006

Analysis and overview of existing architecture

Architecture

In order to apply the redesigned architecture regarding the vtk 3D Widgets, I started by learning how it had been applied to vtkSliderWidget and how I could use this as a basis for comparison with the designated widgets, specifically vtkBoxWidget.
This I commenced by looking at the vtkSliderWidget and how it interacts with the main classes regarding the restructuring project - the vtkAbstractWidget and vtkWidgetRepresentation classes and their derivatives.

Old architecture

3DWidgets arch before.jpg

New architecture

3DWidgets arch after.jpg

Differences between the two architectures

3DWidgets arch differences.jpg

Analysis and overview of new architecture

Comparing the two architectures

Methodology

  • study both architectures
  • study source code; vtkBoxWidget (Old) and vtkSliderWidget (new)
  • separate source code into new classes
  • study events
  • compare vtkBoxWidget Old and New
  • methods
    * added
    * removed
    * edited
  • example code
    *changes to original


Class Diagram vtkMyWidget.jpg