Version: 6.3.1
Public Member Functions | Private Member Functions | Private Attributes

SUIT_TreeModel.TreeSync Class Reference

Functor class for synchronizing data tree and tree model when the data tree is changed outside the model.

Public Member Functions

 TreeSync (SUIT_TreeModel *)
 Constructor.
bool isEqual (const ObjPtr &, const ItemPtr &) const
 Check if item corresponds to the specified data object.
ObjPtr nullSrc () const
 Get null data object.
ItemPtr nullTrg () const
 Get null tree item.
ItemPtr createItem (const ObjPtr &, const ItemPtr &, const ItemPtr &) const
 Create an item corresponding to the specified data object.
void updateItem (const ObjPtr &, const ItemPtr &) const
 Update tree item.
void deleteItemWithChildren (const ItemPtr &) const
 Delete item with all children recursively.
QList< ObjPtrchildren (const ObjPtr &) const
 Get all the children of the specified data object.
QList< ItemPtrchildren (const ItemPtr &) const
 Get all the children of the specified tree item.
ItemPtr parent (const ItemPtr &) const
 Get item which is the parent for the specified item.

Private Member Functions

bool needUpdate (const ItemPtr &) const
 Check if the tree item needs updating.

Private Attributes

SUIT_TreeModelmyModel

Constructor & Destructor Documentation

SUIT_TreeModel.TreeSync::TreeSync ( SUIT_TreeModel model)
Parameters:
modeltree model

Member Function Documentation

bool SUIT_TreeModel.TreeSync::isEqual ( const ObjPtr obj,
const ItemPtr item 
) const
Parameters:
objdata object
itemtree item
Returns:
true if item corresponds to the data object

References SUIT_TreeModel.TreeItem.dataObject(), PyInterp.obj, and SUIT_DataObject.root().

SUIT_TreeModel::ObjPtr SUIT_TreeModel.TreeSync::nullSrc ( ) const
Returns:
null data object
SUIT_TreeModel::ItemPtr SUIT_TreeModel.TreeSync::nullTrg ( ) const
Returns:
null tree item
SUIT_TreeModel::ItemPtr SUIT_TreeModel.TreeSync::createItem ( const ObjPtr obj,
const ItemPtr parent,
const ItemPtr after 
) const
Parameters:
objdata object
parentparent tree item
aftertree item after each new one should be inserted
Returns:
created item

References SUIT_DataObject.update().

void SUIT_TreeModel.TreeSync::updateItem ( const ObjPtr obj,
const ItemPtr item 
) const
Parameters:
objreference data object
itemtree item to be updated

References SUIT_DataObject.update().

void SUIT_TreeModel.TreeSync::deleteItemWithChildren ( const ItemPtr item) const
Parameters:
itemtree item
QList< SUIT_TreeModel::ObjPtr > SUIT_TreeModel.TreeSync::children ( const ObjPtr obj) const
Parameters:
objdata object
Returns:
list of the children

References SUIT_DataObject.children().

QList< SUIT_TreeModel::ItemPtr > SUIT_TreeModel.TreeSync::children ( const ItemPtr item) const
Parameters:
itemtree item
Returns:
list of the children

References SUIT_TreeModel.TreeItem.children().

SUIT_TreeModel::ItemPtr SUIT_TreeModel.TreeSync::parent ( const ItemPtr item) const
Parameters:
itemtree item
Returns:
parent item

References SUIT_TreeModel.TreeItem.parent().

bool SUIT_TreeModel.TreeSync::needUpdate ( const ItemPtr item) const [private]
Parameters:
itemtree item to be checked
Returns:
true if item needs updating
Todo:
finalize this method

References SUIT_TreeModel.TreeItem.dataObject(), and PyInterp.obj.


Field Documentation

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS