#include <mlListContainer.h>

Public Member Functions | |
| ListContainerTemplate (int inputNum, int outputNum) | |
| Constructor The values inputNum and outputNum specify the number of input and output image fields, resp. | |
| virtual | ~ListContainerTemplate () |
| Destructor. | |
| virtual T * | getList () |
| Get pointer to the active list object Use this pointer for list access after testing that it is != 0. | |
Public Attributes | |
| T::itemType | _currentItem |
| List item object used by insertItem() and modifyItem(). | |
Protected Member Functions | |
List object access | |
| virtual bool | setActiveList (Base *basePtr) |
| Set the active list pointer _listPtr to basePtr, provided that it is of the correct type. | |
| virtual ListBase * | getInternalList () |
| Return address of internal list object. | |
| virtual MLssize_t | getId (MLssize_t index) |
| Return the item id of the item index. | |
Handle item property fields | |
| virtual void | updatePropertyFields () |
| Update property fields from the current list item. | |
List modifications | |
| virtual void | deleteItems (MLssize_t index, MLssize_t num) |
| Remove num items, starting at item index. | |
| virtual void | insertItem (MLssize_t index, bool fromCurrentItem) |
| Insert an item at position index. | |
| virtual bool | modifyItem (MLssize_t index, Field *field, bool fromCurrentItem) |
| Modify item at position index. | |
| virtual void | copyItemToTemplate (MLssize_t index) |
| Copy values from item at position index to the template fields. | |
| virtual void | copyTemplateToCurrent () |
| Copy the values of the templates fields to _currentItem. | |
| virtual void | initItem (MLssize_t index) |
| Initialize the list item at position index. | |
Protected Attributes | |
| T * | _listPtr |
| Pointer to the active list object Use this pointer for list access after testing that it is != 0. | |
Class template for container modules for a specific list class. Contains a list object storing the internal list and implements the method to access this object.
To implement an instance of ListContainerTemplate with a given list type T (where T must be a subclass of BaseListTemplate), the following steps are necessary:
Definition at line 369 of file mlListContainer.h.
| ml::ListContainerTemplate< T >::ListContainerTemplate | ( | int | inputNum, | |
| int | outputNum | |||
| ) | [inline] |
Constructor The values inputNum and outputNum specify the number of input and output image fields, resp.
Constructor.
Definition at line 493 of file mlListContainer.h.
References ml::ListContainerBase::_fldInputList, ml::ListContainerBase::_fldOutputList, ml::ListContainerTemplate< T >::_listPtr, ml::ListContainerBase::_lockNotification, ml::FieldContainer::addBase(), ml::Module::getFieldContainer(), ml::RuntimeType::getName(), ML_CHECK_RUNTIME_TYPE, ML_TRACE_IN, and ml::BaseField::setBaseValue().
| virtual ml::ListContainerTemplate< T >::~ListContainerTemplate | ( | ) | [inline, virtual] |
| void ml::ListContainerTemplate< T >::copyItemToTemplate | ( | MLssize_t | index | ) | [inline, protected, virtual] |
Copy values from item at position index to the template fields.
Implements ml::ListContainerBase.
Reimplemented in ml::XMarkerListContainer.
Definition at line 686 of file mlListContainer.h.
References ml::ListContainerBase::_fldNewName, ML_TRACE_IN, and ml::StringField::setStringValue().
| void ml::ListContainerTemplate< T >::copyTemplateToCurrent | ( | ) | [inline, protected, virtual] |
Copy the values of the templates fields to _currentItem.
Implements ml::ListContainerBase.
Reimplemented in ml::XMarkerListContainer.
Definition at line 699 of file mlListContainer.h.
References ml::ListContainerTemplate< T >::_currentItem, ml::ListContainerBase::_fldNewName, ml::StringField::getStringValue(), and ML_TRACE_IN.
| void ml::ListContainerTemplate< T >::deleteItems | ( | MLssize_t | index, | |
| MLssize_t | num | |||
| ) | [inline, protected, virtual] |
Remove num items, starting at item index.
Implements ml::ListContainerBase.
Definition at line 585 of file mlListContainer.h.
References ml::ListContainerTemplate< T >::_listPtr, ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.
| MLssize_t ml::ListContainerTemplate< T >::getId | ( | MLssize_t | index | ) | [inline, protected, virtual] |
Return the item id of the item index.
Implements ml::ListContainerBase.
Definition at line 550 of file mlListContainer.h.
References ml::ListContainerTemplate< T >::_listPtr, and ML_TRACE_IN.
Referenced by ml::ListContainerTemplate< T >::modifyItem().
| virtual ListBase* ml::ListContainerTemplate< T >::getInternalList | ( | ) | [inline, protected, virtual] |
Return address of internal list object.
Implements ml::ListContainerBase.
Definition at line 406 of file mlListContainer.h.
| virtual T* ml::ListContainerTemplate< T >::getList | ( | ) | [inline, virtual] |
Get pointer to the active list object Use this pointer for list access after testing that it is != 0.
If the pointer is 0, an external object of a wrong type is connected to the input base field, in which case the module should be completely deactivated.
Definition at line 386 of file mlListContainer.h.
Referenced by ml::ITKNodeContainerFromBasePointer(), ml::ITKPointSetFromBasePointer(), and ml::ITKPolylineFromBasePointer().
| void ml::ListContainerTemplate< T >::initItem | ( | MLssize_t | index | ) | [inline, protected, virtual] |
Initialize the list item at position index.
This method is called by insertItem() if the fromCurrentItem argument is false. Moreover it is called when fldInit is touched.
This method is called by insertItem() if the fromCurrentItem argument is false. Moreover it is called when _fldClearItem is touched.
Implements ml::ListContainerBase.
Reimplemented in ml::XMarkerListContainer.
Definition at line 712 of file mlListContainer.h.
References ml::ListContainerTemplate< T >::_listPtr, and ML_TRACE_IN.
Referenced by ml::ListContainerTemplate< T >::insertItem().
| void ml::ListContainerTemplate< T >::insertItem | ( | MLssize_t | index, | |
| bool | fromCurrentItem | |||
| ) | [inline, protected, virtual] |
Insert an item at position index.
If fromCurrentItem is true, the new item is initialized from _currentItem.
If fromCurrentItem is true, the new item is initialized from _currentItem.
Implements ml::ListContainerBase.
Definition at line 609 of file mlListContainer.h.
References ml::ListContainerTemplate< T >::_currentItem, ml::ListContainerTemplate< T >::_listPtr, ml::ListContainerTemplate< T >::initItem(), ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.
| bool ml::ListContainerTemplate< T >::modifyItem | ( | MLssize_t | index, | |
| Field * | field, | |||
| bool | fromCurrentItem | |||
| ) | [inline, protected, virtual] |
Modify item at position index.
If fromCurrentItem is true, the item is copied from _currentItem, otherwise the item property corresponding to the property field field is modified. Return true if item has been modified.
If fromCurrentItem is true, the item is copied from _currentItem, otherwise the item property corresponding to the property field field is modified. Return true if item has been modified.
Implements ml::ListContainerBase.
Reimplemented in ml::XMarkerListContainer.
Definition at line 647 of file mlListContainer.h.
References ml::ListContainerTemplate< T >::_currentItem, ml::ListContainerBase::_fldId, ml::ListContainerBase::_fldName, ml::ListContainerTemplate< T >::_listPtr, ml::ListContainerTemplate< T >::getId(), ml::StringField::getStringValue(), ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::IntField::setIntValue().
| bool ml::ListContainerTemplate< T >::setActiveList | ( | Base * | basePtr | ) | [inline, protected, virtual] |
Set the active list pointer _listPtr to basePtr, provided that it is of the correct type.
Set the active list pointer _listPtr to basePtr, provided that it is of the correct type.
Otherwise the _listPtr is set to zero. Returns true if object is of correct type.
Otherwise the _listPtr is set to zero. Returns true if object is of correct type.
Implements ml::ListContainerBase.
Definition at line 529 of file mlListContainer.h.
References ml::ListContainerTemplate< T >::_listPtr, ML_BASE_IS_A, ML_TRACE_IN, and T.
| void ml::ListContainerTemplate< T >::updatePropertyFields | ( | ) | [inline, protected, virtual] |
Update property fields from the current list item.
Implements ml::ListContainerBase.
Reimplemented in ml::XMarkerListContainer.
Definition at line 562 of file mlListContainer.h.
References ml::ListContainerBase::_fldId, ml::ListContainerBase::_fldIndex, ml::ListContainerBase::_fldName, ml::ListContainerTemplate< T >::_listPtr, ml::ListContainerBase::_lockNotification, ml::BaseItem::getId(), ml::IntField::getIntValue(), ML_TRACE_IN, ml::BaseItem::name(), ml::IntField::setIntValue(), and ml::StringField::setStringValue().
| T::itemType ml::ListContainerTemplate< T >::_currentItem |
List item object used by insertItem() and modifyItem().
A derived editor module should use this variable to store a new or modified item and then call doInsertItem() or doModifyItem() with fromCurrentItem = true.
Definition at line 392 of file mlListContainer.h.
Referenced by ml::ListContainerTemplate< T >::copyTemplateToCurrent(), ml::ListContainerTemplate< T >::insertItem(), and ml::ListContainerTemplate< T >::modifyItem().
T* ml::ListContainerTemplate< T >::_listPtr [protected] |
Pointer to the active list object Use this pointer for list access after testing that it is != 0.
If the pointer is 0, an external object of a wrong type is connected to the input base field, in which case the module should be completely deactivated.
Definition at line 456 of file mlListContainer.h.
Referenced by ml::ListContainerTemplate< T >::deleteItems(), ml::ListContainerTemplate< T >::getId(), ml::ListContainerTemplate< T >::initItem(), ml::ListContainerTemplate< T >::insertItem(), ml::ListContainerTemplate< T >::ListContainerTemplate(), ml::ListContainerTemplate< T >::modifyItem(), ml::ListContainerTemplate< T >::setActiveList(), and ml::ListContainerTemplate< T >::updatePropertyFields().
1.5.8