Tests the data entry of nodes for a specific type (given here as template parameter) AND for NOT having a given property (or it being a false bool property). More...
#include <mitkDataTreeFilterFunctions.h>
Public Member Functions | |
IsBaseDataTypeWithoutProperty (const char *propertyName) | |
virtual bool | NodeMatches (DataNode *node) const |
virtual DataTreeFilterFunction * | Clone () const |
virtual | ~IsBaseDataTypeWithoutProperty () |
Tests the data entry of nodes for a specific type (given here as template parameter) AND for NOT having a given property (or it being a false bool property).
To be used with mitk::DataTreeFilter, e.g.
treeFilter->SetFilter( mitk::IsBaseDataTypeWithoutProperty<mitk::Image>("segmentation") );
Definition at line 156 of file mitkDataTreeFilterFunctions.h.
mitk::IsBaseDataTypeWithoutProperty< T >::IsBaseDataTypeWithoutProperty | ( | const char * | propertyName ) | [inline] |
Definition at line 160 of file mitkDataTreeFilterFunctions.h.
:m_PropertyName(propertyName) { }
virtual mitk::IsBaseDataTypeWithoutProperty< T >::~IsBaseDataTypeWithoutProperty | ( | ) | [inline, virtual] |
Definition at line 183 of file mitkDataTreeFilterFunctions.h.
{}
virtual DataTreeFilterFunction* mitk::IsBaseDataTypeWithoutProperty< T >::Clone | ( | ) | const [inline, virtual] |
Implements mitk::DataTreeFilterFunction.
Definition at line 178 of file mitkDataTreeFilterFunctions.h.
{ return new IsBaseDataTypeWithoutProperty<T>(m_PropertyName.c_str()); }
virtual bool mitk::IsBaseDataTypeWithoutProperty< T >::NodeMatches | ( | DataNode * | node ) | const [inline, virtual] |
Implements mitk::DataTreeFilterFunction.
Definition at line 165 of file mitkDataTreeFilterFunctions.h.
References mitk::DataNode::GetData(), and mitk::DataNode::GetPropertyValue().
{ bool propVal(false); bool propertyExists(false); if (node) propertyExists = node->GetPropertyValue(m_PropertyName.c_str(), propVal ); return ( node != NULL && node->GetData() // node is not NULL, and node->GetData is also not NULL && dynamic_cast<T*>(node->GetData() ) // data is of a certain type && ( !propertyExists || !propVal )); // the property does not exist, OR its value is false }