Selection In ParaQ

From ParaQ Wiki
Revision as of 16:24, 6 June 2006 by Utkarsh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This documents discusses a design for Selection in ParaQ.

Background

  • pqServerManagerModel -- graph model for the vtkSMProxyManager state.
  • pqPipelineModel -- tree model generated using pqServerManagerModel. This is QAbstractItemModel subclass.


Design

SelectionModel.png

  • Qt provides a QItemSelectionModel. As per the Trolltech documentation it keeps the indexes for items in a model. The same selection model object can be shared among several views that have use the same underlying model. QItemSelectionModel, generally speaking, keeps a QItemSelection object. QItemSelection can be thought of as a collection QModelIndex objects for the selected enties. These QModelIndex objects depend on the model. Given a QModelIndex, pqPipelineModel knows exactly which pqServerManagerModelItem (and in turn which vtkSMProxy) the index is refering to.
  • pqServerManagerModel keeps a collection of pqServerManagerModelItems which represent source/filter/display proxies. We define a new class pqSMSelection which is a collection of pqServerManagerModelItems. Note pqSMSelection is not a subclass of QItemSelection nor does it use QModelIndex objects. Thus is due to the fact that QModelIndex use (row, column) to identify the model item, which doesn't apply to the graph model (pqServerManagerModel). Given a pqSMSelection object, pqServerManagerModel knows exactly what proxies are selected in the selection.
  • We define a Selection Adaptor. Given a pqPipelineModel and a QItemSelection for it, the Selection Adaptor generates a pqSelection object. This is quite trivial since it is very easy to obtain a pqServerManagerModelItem, given a pqPipelineModelItem. Additionally, the Selecion Adaptor can convert a pqSelection object to a QItemSelection object for the pqPipelineModel (again, a straight forward task).

=