Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

mitk::NodePredicateOr Class Reference
[Data Storage Classes]

Composite predicate that forms a logical OR relation from its child predicates. More...

#include <mitkNodePredicateOr.h>

Inheritance diagram for mitk::NodePredicateOr:
Inheritance graph
[legend]
Collaboration diagram for mitk::NodePredicateOr:
Collaboration graph
[legend]

List of all members.

Public Types

typedef NodePredicateOr Self
typedef NodePredicateCompositeBase Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
 itkFactorylessNewMacro (NodePredicateOr)
virtual ~NodePredicateOr ()
 Standard Destructor.
virtual bool CheckNode (const DataNode *node) const
 Checks, if the node fulfills any of the subpredicates conditions.

Static Public Member Functions

static Pointer New (const NodePredicateBase *_arga, const NodePredicateBase *_argb)

Protected Member Functions

 NodePredicateOr ()
 Constructor.
 NodePredicateOr (const NodePredicateBase *p1, const NodePredicateBase *p2)
 Convenience constructor that adds p1 and p2 to list of child predicates.

Detailed Description

Composite predicate that forms a logical OR relation from its child predicates.

Definition at line 33 of file mitkNodePredicateOr.h.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::NodePredicateOr::ConstPointer

Reimplemented from mitk::NodePredicateCompositeBase.

Definition at line 36 of file mitkNodePredicateOr.h.

typedef itk::SmartPointer<Self> mitk::NodePredicateOr::Pointer

Reimplemented from mitk::NodePredicateCompositeBase.

Definition at line 36 of file mitkNodePredicateOr.h.

Reimplemented from mitk::NodePredicateCompositeBase.

Definition at line 36 of file mitkNodePredicateOr.h.

Reimplemented from mitk::NodePredicateCompositeBase.

Definition at line 36 of file mitkNodePredicateOr.h.


Constructor & Destructor Documentation

mitk::NodePredicateOr::~NodePredicateOr (  ) [virtual]

Standard Destructor.

Definition at line 35 of file mitkNodePredicateOr.cpp.

{
}
mitk::NodePredicateOr::NodePredicateOr (  ) [protected]

Constructor.

Definition at line 23 of file mitkNodePredicateOr.cpp.

: NodePredicateCompositeBase()
{
}
mitk::NodePredicateOr::NodePredicateOr ( const NodePredicateBase p1,
const NodePredicateBase p2 
) [protected]

Convenience constructor that adds p1 and p2 to list of child predicates.

Definition at line 28 of file mitkNodePredicateOr.cpp.

References mitk::NodePredicateCompositeBase::AddPredicate().

: NodePredicateCompositeBase()
{
  this->AddPredicate(p1);
  this->AddPredicate(p2);
}

Member Function Documentation

bool mitk::NodePredicateOr::CheckNode ( const DataNode node ) const [virtual]

Checks, if the node fulfills any of the subpredicates conditions.

Implements mitk::NodePredicateBase.

Definition at line 40 of file mitkNodePredicateOr.cpp.

{
  if (m_ChildPredicates.empty())
    throw std::invalid_argument("NodePredicateOr: no child predicates available");

  if (node == NULL)
    throw std::invalid_argument("NodePredicateOr: invalid node");

  /* return the disjunction of the child predicate. If any predicate returns true, we return true too. Return false only if all child predicates return false */
  for (ChildPredicates::const_iterator it = m_ChildPredicates.begin(); it != m_ChildPredicates.end(); ++it)
    if ((*it)->CheckNode(node) == true)
      return true;
  return false; // none of the childs was true, so return false
}
virtual const char* mitk::NodePredicateOr::GetClassName (  ) const [virtual]

Reimplemented from mitk::NodePredicateCompositeBase.

mitk::NodePredicateOr::itkFactorylessNewMacro ( NodePredicateOr   )
static Pointer mitk::NodePredicateOr::New ( const NodePredicateBase _arga,
const NodePredicateBase _argb 
) [inline, static]

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