Skip to content

The new view system

gpasquie edited this page Aug 27, 2014 · 6 revisions

The old medAbstractView has been split into 3 different classes: medAbstractView, medAbstractLayeredView and medAbstractImageView.

  • medAbstractView is the base class. It can handle only one data at a time and provides base view methods such as zoom, pan...
  • medAbstractLayeredView inherits medAbstractView and can contain multiple data.
  • medAbstractImageView inherits medAbstractLayeredView and provides functionalities specific to images.

The views contains a list of navigators and a list of interactors.

  • Interactors are helper classes defined in order to manipulate an object with regards to user inputs, such as mouse and keyboard.
  • Navigators are helpers classes defined in order to manipulate a scene, or a camera, with regards to user inputs, such as mouse and keyboard.

For each view, there are 2 kinds of interactors and navigators: the primary ones and the additional ones.

  • The primary ones inherit the abstract interactor/navigator class corresponding to the type of view. For example, if you manipulate a medAbstractLayeredView, the primary interactors/navigators, should inherit from medAbstractLayeredViewInteractor/medAbstractLayeredViewNavigator. This way, you are sure that at least one interactor/navigator implements the API provided by the view. Example?
  • The additional ones can directly inherit from medAbstractInteractor/medAbstractNavigator. They can be used to provide extra functionalities. For example vtkDataMeshNavigator is used as an additional navigator for the medVtkView to provide specific navigation features when the medVtkView contains meshes.

When you add a data to a view, the view will instantiate all interactors able to manipulate this kind of data. For one data, you must have at least one primary interactor (to be sure to provide the functionalities required by the view) and you can have additional interactors.