Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkNodePredicateNot.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkNodePredicateNot.h"
18 
20 {
21  m_ChildPredicates.push_back(p);
22 }
23 
25 {
26 }
27 
29 {
30  if (node == nullptr)
31  throw std::invalid_argument("NodePredicateNot: invalid node");
32 
33  // return the negation of the child predicate
34  return !m_ChildPredicates.front()->CheckNode(node);
35 }
36 
38 {
39  if (!m_ChildPredicates.empty())
40  m_ChildPredicates.clear();
41 
43 }
ChildPredicates m_ChildPredicates
list of child predicates
virtual bool CheckNode(const mitk::DataNode *node) const override
Checks, if the node does not fulfill the child predicate condition.
virtual void AddPredicate(const NodePredicateBase *p)
Adds a child predicate.
virtual void AddPredicate(const mitk::NodePredicateBase *p) override
Reimplemented, only one child predicate is allowed for the NOT predicate.
NodePredicateNot(const mitk::NodePredicateBase *p)
Constructor.
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
virtual ~NodePredicateNot()
Standard Destructor.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66