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 MITKNODEPREDICATEDATA_H_HEADER_INCLUDED_ 00020 #define MITKNODEPREDICATEDATA_H_HEADER_INCLUDED_ 00021 00022 #include "mitkNodePredicateBase.h" 00023 00024 namespace mitk { 00025 class BaseData; 00026 00027 //##Documentation 00028 //## @brief Predicate that evaluates if the given DataNodes data object pointer equals a given pointer 00029 //## 00030 //## NodePredicateData(NULL) returns true if a DataNode does not have a data object (e.g. ->GetData() returns NULL). 00031 //## This could return an unexpected number of nodes (e.g. the root node of the tree) 00032 //## @warning NodePredicateData holds a weak pointer to a BaseData! NodePredicateData p(mitk::BaseData::New()); will not work. 00033 //## Intended use is: NodePredicateData p(myDataObject); result = myDataStorage->GetSubset(p); Then work with result, do not reuse p later. 00034 //## 00035 //## @ingroup DataStorage 00036 class MITK_CORE_EXPORT NodePredicateData : public NodePredicateBase 00037 { 00038 public: 00039 mitkClassMacro(NodePredicateData, NodePredicateBase); 00040 mitkNewMacro1Param(NodePredicateData, mitk::BaseData*); 00041 00042 //##Documentation 00043 //## @brief Standard Destructor 00044 virtual ~NodePredicateData(); 00045 00046 //##Documentation 00047 //## @brief Checks, if the nodes data object is of a specific data type 00048 virtual bool CheckNode(const mitk::DataNode* node) const; 00049 00050 protected: 00051 //##Documentation 00052 //## @brief Protected constructor, use static instantiation functions instead 00053 NodePredicateData(mitk::BaseData* d); 00054 00055 mitk::BaseData* m_DataObject; 00056 }; 00057 } // namespace mitk 00058 00059 #endif /* MITKNODEPREDICATEDATA_H_HEADER_INCLUDED_ */