vtkQtTreeModelAdapter Class Reference

#include <vtkQtTreeModelAdapter.h>

Inheritance diagram for vtkQtTreeModelAdapter:

Inheritance graph
[legend]
Collaboration diagram for vtkQtTreeModelAdapter:

Collaboration graph
[legend]

List of all members.


Detailed Description

Adapts a tree to a Qt item model.

vtkQtTreeModelAdapter is a QAbstractItemModel with a vtkTree as its underlying data model.

See also:
vtkQtAbstractModelAdapter vtkQtTableModelAdapter
Tests:
vtkQtTreeModelAdapter (Tests)

Definition at line 49 of file vtkQtTreeModelAdapter.h.


Public Member Functions

 vtkQtTreeModelAdapter (QObject *parent=0, vtkTree *tree=0)
 ~vtkQtTreeModelAdapter ()
unsigned long GetVTKDataObjectMTime () const
virtual void SetKeyColumnName (const char *name)
virtual void SetColorColumnName (const char *name)
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Qt::ItemFlags flags (const QModelIndex &index) const
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
QModelIndex parent (const QModelIndex &index) const
int rowCount (const QModelIndex &parent=QModelIndex()) const
int columnCount (const QModelIndex &parent=QModelIndex()) const
virtual void SetVTKDataObject (vtkDataObject *data)
virtual vtkDataObjectGetVTKDataObject () const
virtual vtkSelectionQModelIndexListToVTKIndexSelection (const QModelIndexList qmil) const
virtual QItemSelection VTKIndexSelectionToQItemSelection (vtkSelection *vtksel) const
void setTree (vtkTree *t)
vtkTreetree () const
Qt::DropActions supportedDragActions () const
virtual QMimeData * mimeData (const QModelIndexList &indexes) const
virtual QStringList mimeTypes () const

Protected Member Functions

void treeModified ()
void GenerateVTKIndexToQtModelIndex (vtkIdType vtk_index, QModelIndex qmodel_index)

Protected Attributes

vtkTreeTree
vtkAdjacentVertexIteratorChildIterator
unsigned long TreeMTime
QVector< QModelIndex > VTKIndexToQtModelIndex
QHash< QModelIndex, QVariant > IndexToDecoration

Constructor & Destructor Documentation

vtkQtTreeModelAdapter::vtkQtTreeModelAdapter ( QObject *  parent = 0,
vtkTree tree = 0 
)

vtkQtTreeModelAdapter::~vtkQtTreeModelAdapter (  ) 


Member Function Documentation

virtual void vtkQtTreeModelAdapter::SetVTKDataObject ( vtkDataObject data  )  [virtual]

Set/Get the VTK data object as input to this adapter

Implements vtkQtAbstractModelAdapter.

virtual vtkDataObject* vtkQtTreeModelAdapter::GetVTKDataObject (  )  const [virtual]

Set/Get the VTK data object as input to this adapter

Implements vtkQtAbstractModelAdapter.

unsigned long vtkQtTreeModelAdapter::GetVTKDataObjectMTime (  )  const

Get the stored VTK data object modification time of when the adaption to a Qt model was done. This is in general not the same this as the data objects modification time. It is the mod time of the object when it was placed into the Qt model adapter. You can use this mtime as part of the checking to see whether you need to update the the adapter by call SetVTKDataObject again. :)

virtual vtkSelection* vtkQtTreeModelAdapter::QModelIndexListToVTKIndexSelection ( const QModelIndexList  qmil  )  const [virtual]

Selection conversion from VTK land to Qt land

Implements vtkQtAbstractModelAdapter.

virtual QItemSelection vtkQtTreeModelAdapter::VTKIndexSelectionToQItemSelection ( vtkSelection vtksel  )  const [virtual]

Selection conversion from VTK land to Qt land

Implements vtkQtAbstractModelAdapter.

virtual void vtkQtTreeModelAdapter::SetKeyColumnName ( const char *  name  )  [virtual]

Set/Get the key column. The key column is used as the row headers in a table view, and as the first column in a tree view. Set to -1 for no key column. The default is no key column.

Implements vtkQtAbstractModelAdapter.

virtual void vtkQtTreeModelAdapter::SetColorColumnName ( const char *  name  )  [virtual]

Set/Get the column storing the rgba color values for each row. The color column is used as the row headers in a table view, and as the first column in a tree view. Set to -1 for no key column. The default is no key column.

Implements vtkQtAbstractModelAdapter.

void vtkQtTreeModelAdapter::setTree ( vtkTree t  ) 

Set up the model based on the current tree.

vtkTree* vtkQtTreeModelAdapter::tree (  )  const [inline]

Set up the model based on the current tree.

Definition at line 86 of file vtkQtTreeModelAdapter.h.

QVariant vtkQtTreeModelAdapter::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

bool vtkQtTreeModelAdapter::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

Qt::ItemFlags vtkQtTreeModelAdapter::flags ( const QModelIndex &  index  )  const

QVariant vtkQtTreeModelAdapter::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

QModelIndex vtkQtTreeModelAdapter::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

QModelIndex vtkQtTreeModelAdapter::parent ( const QModelIndex &  index  )  const

int vtkQtTreeModelAdapter::rowCount ( const QModelIndex &  parent = QModelIndex()  )  const

int vtkQtTreeModelAdapter::columnCount ( const QModelIndex &  parent = QModelIndex()  )  const

Qt::DropActions vtkQtTreeModelAdapter::supportedDragActions (  )  const

If drag/drop is enabled in the view, the model will package up the current pedigreeid vtkSelection into a QMimeData when items are dragged. Currently only leaves of the tree can be dragged.

virtual QMimeData* vtkQtTreeModelAdapter::mimeData ( const QModelIndexList &  indexes  )  const [virtual]

If drag/drop is enabled in the view, the model will package up the current pedigreeid vtkSelection into a QMimeData when items are dragged. Currently only leaves of the tree can be dragged.

virtual QStringList vtkQtTreeModelAdapter::mimeTypes (  )  const [virtual]

If drag/drop is enabled in the view, the model will package up the current pedigreeid vtkSelection into a QMimeData when items are dragged. Currently only leaves of the tree can be dragged.

void vtkQtTreeModelAdapter::treeModified (  )  [protected]

void vtkQtTreeModelAdapter::GenerateVTKIndexToQtModelIndex ( vtkIdType  vtk_index,
QModelIndex  qmodel_index 
) [protected]


Member Data Documentation

Definition at line 113 of file vtkQtTreeModelAdapter.h.

Definition at line 114 of file vtkQtTreeModelAdapter.h.

unsigned long vtkQtTreeModelAdapter::TreeMTime [protected]

Definition at line 115 of file vtkQtTreeModelAdapter.h.

QVector<QModelIndex> vtkQtTreeModelAdapter::VTKIndexToQtModelIndex [protected]

Definition at line 116 of file vtkQtTreeModelAdapter.h.

QHash<QModelIndex, QVariant> vtkQtTreeModelAdapter::IndexToDecoration [protected]

Definition at line 117 of file vtkQtTreeModelAdapter.h.


The documentation for this class was generated from the following file:

Generated on Wed Aug 24 12:00:48 2011 for VTK by  doxygen 1.5.6