Public Member Functions

mitk::IsBaseDataTypeWithoutProperty< T > Class Template Reference

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>

Inheritance diagram for mitk::IsBaseDataTypeWithoutProperty< T >:
Inheritance graph
[legend]
Collaboration diagram for mitk::IsBaseDataTypeWithoutProperty< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 IsBaseDataTypeWithoutProperty (const char *propertyName)
virtual bool NodeMatches (DataNode *node) const
virtual DataTreeFilterFunctionClone () const
virtual ~IsBaseDataTypeWithoutProperty ()

Detailed Description

template<class T>
class mitk::IsBaseDataTypeWithoutProperty< T >

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.


Constructor & Destructor Documentation

template<class T >
mitk::IsBaseDataTypeWithoutProperty< T >::IsBaseDataTypeWithoutProperty ( const char *  propertyName ) [inline]

Definition at line 160 of file mitkDataTreeFilterFunctions.h.

      :m_PropertyName(propertyName)
      {
      }
template<class T >
virtual mitk::IsBaseDataTypeWithoutProperty< T >::~IsBaseDataTypeWithoutProperty (  ) [inline, virtual]

Definition at line 183 of file mitkDataTreeFilterFunctions.h.

{}

Member Function Documentation

template<class T >
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());
      }
template<class T >
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
      }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines