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 BASEPROCESS_H_HEADER_INCLUDED_C19BE6FC 00020 #define BASEPROCESS_H_HEADER_INCLUDED_C19BE6FC 00021 00022 #if(_MSC_VER==1200) 00023 #include <itkFixedArray.h> 00024 #endif 00025 00026 #include "mitkCommon.h" 00027 #include <itkProcessObject.h> 00028 00029 namespace mitk { 00030 00031 class BaseData; 00032 00033 //##Documentation 00034 //## @brief Superclass of all classes generating some kind of mitk::BaseData. 00035 //## 00036 //## Superclass of all classes generating some kind of mitk::BaseData. 00037 //## In itk and vtk the generated result of a ProcessObject is only guaranteed 00038 //## to be up-to-date, when Update() of the ProcessObject or the generated 00039 //## DataObject is called immediately before access of the data stored in the 00040 //## DataObject. This is also true for subclasses of mitk::BaseProcess. But 00041 //## many of the subclasses of mitk::BaseProcess define additional access 00042 //## functions to the generated output that guarantee an up-to-date result, see 00043 //## for example mitk::ImageSource. 00044 //## @ingroup Process 00045 class MITK_CORE_EXPORT BaseProcess : public itk::ProcessObject 00046 { 00047 public: 00048 mitkClassMacro(BaseProcess, itk::ProcessObject); 00049 00050 //##Documentation 00051 //## @brief Access itk::ProcessObject::m_Updating 00052 //## 00053 //## m_Updating indicates when the pipeline is executing. 00054 //## It prevents infinite recursion when pipelines have loops. 00055 //## \sa itk::ProcessObject::m_Updating 00056 bool Updating() const 00057 { 00058 return m_Updating; 00059 } 00060 00061 //##Documentation 00062 //## @brief Helps to deal with the weak-pointer-problem. 00063 virtual void UnRegister() const; 00064 00065 //##Documentation 00066 //## @brief Helps to deal with the weak-pointer-problem. 00067 virtual int GetExternalReferenceCount() const; 00068 00069 protected: 00070 00071 BaseProcess(); 00072 00073 virtual ~BaseProcess(); 00074 00075 //##Documentation 00076 //## @brief Protected methods for setting outputs. 00077 //## 00078 //## Subclasses make use of them for getting output. 00079 //## These are only overwritten because of itk::DataObject::ConnectSource being 00080 //## private and non-virtual: the important stuff is done in 00081 //## mitk::BaseData::ConnectSource. 00082 virtual void SetNthOutput(unsigned int num, itk::DataObject *output); 00083 00084 //##Documentation 00085 //## @brief Protected methods for setting outputs. 00086 //## 00087 //## Subclasses make use of them for getting output. 00088 //## These are only overwritten because of itk::DataObject::ConnectSource being 00089 //## private and non-virtual: the important stuff is done in 00090 //## mitk::BaseData::ConnectSource. 00091 virtual void AddOutput(itk::DataObject *output); 00092 00093 private: 00094 00095 //##Documentation 00096 //## @brief Helps to deal with the weak-pointer-problem. 00097 mutable bool m_Unregistering; 00098 00099 //##Documentation 00100 //## @brief Helps to deal with the weak-pointer-problem. 00101 mutable bool m_CalculatingExternalReferenceCount; 00102 00103 //##Documentation 00104 //## @brief Helps to deal with the weak-pointer-problem. 00105 mutable int m_ExternalReferenceCount; 00106 }; 00107 00108 } // namespace mitk 00109 00110 #endif /* BASEPROCESS_H_HEADER_INCLUDED_C19BE6FC */