Medical Imaging Interaction Toolkit  2016.11.0
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,
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 
18 
20 {
21 }
22 
24 {
25 }
26 
28 {
29  if (node == nullptr)
30  throw std::invalid_argument("NodePredicateFirstLevel: invalid node");
31 
32  if (m_DataStorage.IsNull())
33  throw std::invalid_argument("NodePredicateFirstLevel: DataStorage is invalid");
34 
35  mitk::DataStorage::SetOfObjects::ConstPointer list = m_DataStorage->GetSources(node, nullptr, true);
36  return (list->Size() == 0);
37 }
Data management class that handles 'was created by' relations.
itk::SmartPointer< const Self > ConstPointer
virtual 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
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...
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
virtual ~NodePredicateFirstLevel()
Standard Destructor.