Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkNodePredicateFirstLevel.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 
14 
16 {
17 }
18 
20 {
21 }
22 
24 {
25  if (node == nullptr)
26  throw std::invalid_argument("NodePredicateFirstLevel: invalid node");
27 
29  throw std::invalid_argument("NodePredicateFirstLevel: DataStorage is invalid");
30 
31  mitk::DataStorage::SetOfObjects::ConstPointer list = m_DataStorage.Lock()->GetSources(node, nullptr, true);
32  return (list->Size() == 0);
33 }
Data management class that handles 'was created by' relations.
itk::SmartPointer< T > Lock() const
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
bool CheckNode(const mitk::DataNode *node) const override
Checks, if the node is a source node of m_BaseNode (e.g. if m_BaseNode "was created from" node) ...
mitk::DataStorage::Pointer m_DataStorage
bool IsExpired() const noexcept
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
NodePredicateFirstLevel(mitk::DataStorage *ds)
Constructor - This class can either search only for direct source objects or for all source objects...
~NodePredicateFirstLevel() override
Standard Destructor.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57