MCPcopy Create free account
hub / github.com/MITK/MITK / CheckNode

Method CheckNode

Modules/Core/src/DataManagement/mitkNodePredicateOr.cpp:38–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38bool mitk::NodePredicateOr::CheckNode(const DataNode *node) const
39{
40 if (m_ChildPredicates.empty())
41 throw std::invalid_argument("NodePredicateOr: no child predicates available");
42
43 if (node == nullptr)
44 throw std::invalid_argument("NodePredicateOr: invalid node");
45
46 /* return the disjunction of the child predicate. If any predicate returns true, we return true too. Return false only
47 * if all child predicates return false */
48 for (auto it = m_ChildPredicates.cbegin(); it != m_ChildPredicates.cend(); ++it)
49 if ((*it)->CheckNode(node) == true)
50 return true;
51 return false; // none of the childs was true, so return false
52}

Calls 1

emptyMethod · 0.45