00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef MITKNODEPREDICATESOURCE_H_HEADER_INCLUDED_ 00020 #define MITKNODEPREDICATESOURCE_H_HEADER_INCLUDED_ 00021 00022 #include "mitkNodePredicateBase.h" 00023 #include "mitkDataStorage.h" 00024 #include "mitkDataNode.h" 00025 #include "mitkWeakPointer.h" 00026 00027 namespace mitk { 00028 00029 //##Documentation 00030 //## @brief Predicate that evaluates if the given node is a direct or indirect source node of a specific node 00031 //## 00032 //## @warning This class seems to be obsolete since mitk::DataStorage::GetDerivations(). 00033 //## Since there is no real use case up until now, NodePredicateSource is NOT WORKING YET. 00034 //## If you need it working, inform us. 00035 //## 00036 //## @ingroup DataStorage 00037 class MITK_CORE_EXPORT NodePredicateSource : public NodePredicateBase 00038 { 00039 public: 00040 00041 mitkClassMacro(NodePredicateSource, NodePredicateBase); 00042 mitkNewMacro3Param(NodePredicateSource, mitk::DataNode*, bool, mitk::DataStorage*); 00043 00044 //##Documentation 00045 //## @brief Standard Destructor 00046 virtual ~NodePredicateSource(); 00047 00048 //##Documentation 00049 //## @brief Checks, if the node is a source node of m_BaseNode (e.g. if m_BaseNode "was created from" node) 00050 virtual bool CheckNode(const mitk::DataNode* node) const; 00051 00052 protected: 00053 //##Documentation 00054 //## @brief Constructor - This class can either search only for direct source objects or for all source objects 00055 NodePredicateSource(mitk::DataNode* n, bool allsources, mitk::DataStorage* ds); 00056 00057 mitk::WeakPointer<mitk::DataNode> m_BaseNode; 00058 bool m_SearchAllSources; 00059 mitk::WeakPointer<mitk::DataStorage> m_DataStorage; 00060 }; 00061 00062 } // namespace mitk 00063 00064 #endif /* MITKNODEPREDICATESOURCE_H_HEADER_INCLUDED_ */