Medical Imaging Interaction Toolkit  2018.4.99-4c24e3cb
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkNodePredicateNot.h"
14 
16 {
17  m_ChildPredicates.push_back(p);
18 }
19 
21 {
22 }
23 
25 {
26  if (node == nullptr)
27  throw std::invalid_argument("NodePredicateNot: invalid node");
28 
29  // return the negation of the child predicate
30  return !m_ChildPredicates.front()->CheckNode(node);
31 }
32 
34 {
35  if (!m_ChildPredicates.empty())
36  m_ChildPredicates.clear();
37 
39 }
ChildPredicates m_ChildPredicates
list of child predicates
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.
void AddPredicate(const mitk::NodePredicateBase *p) override
Reimplemented, only one child predicate is allowed for the NOT predicate.
~NodePredicateNot() override
Standard Destructor.
NodePredicateNot(const mitk::NodePredicateBase *p)
Constructor.
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64