Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkNodePredicateSource.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  : NodePredicateBase(), m_BaseNode(n), m_SearchAllSources(allsources), m_DataStorage(ds)
17 {
18 }
19 
21 {
22 }
23 
25 {
27  {
28  const mitk::DataStorage::SetOfObjects::STLContainerType sources =
29  m_DataStorage.Lock()->GetSources(childNode, nullptr, !m_SearchAllSources)->CastToSTLConstContainer();
30 
31  return std::find(sources.cbegin(), sources.cend(), m_BaseNode.Lock()) != sources.cend();
32  }
33 
34  return false;
35 }
Data management class that handles 'was created by' relations.
itk::SmartPointer< T > Lock() const
mitk::WeakPointer< mitk::DataNode > m_BaseNode
NodePredicateSource(mitk::DataNode *n, bool allsources, mitk::DataStorage *ds)
Constructor - This class can either search only for direct source objects or for all source objects...
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
mitk::DataStorage::Pointer m_DataStorage
~NodePredicateSource() override
Standard Destructor.
bool CheckNode(const mitk::DataNode *childNode) const override
Checks, if m_BaseNode is a source node of childNode (e.g. if childNode "was created from" m_BaseNode)...
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57