13 #ifndef mitkBaseDataSource_h
14 #define mitkBaseDataSource_h
17 #include <itkProcessObject.h>
20 #define mitkBaseDataSourceGetOutputDeclarations \
21 OutputType *GetOutput(); \
22 const OutputType *GetOutput() const; \
23 OutputType *GetOutput(DataObjectPointerArraySizeType idx); \
24 const OutputType *GetOutput(DataObjectPointerArraySizeType idx) const;
26 #define mitkBaseDataSourceGetOutputDefinitions(className) \
27 className::OutputType *className::GetOutput(void) \
29 return itkDynamicCastInDebugMode<OutputType *>(this->GetPrimaryOutput()); \
31 const className::OutputType *className::GetOutput(void) const \
33 return itkDynamicCastInDebugMode<const OutputType *>(this->GetPrimaryOutput()); \
35 className::OutputType *className::GetOutput(DataObjectPointerArraySizeType idx) \
37 OutputType *out = dynamic_cast<OutputType *>(this->ProcessObject::GetOutput(idx)); \
38 if (out == nullptr && this->ProcessObject::GetOutput(idx) != nullptr) \
40 itkWarningMacro(<< "Unable to convert output number " << idx << " to type " << typeid(OutputType).name()); \
44 const className::OutputType *className::GetOutput(DataObjectPointerArraySizeType idx) const \
46 const OutputType *out = dynamic_cast<const OutputType *>(this->ProcessObject::GetOutput(idx)); \
47 if (out == nullptr && this->ProcessObject::GetOutput(idx) != nullptr) \
49 itkWarningMacro(<< "Unable to convert output number " << idx << " to type " << typeid(OutputType).name()); \
128 DataObjectPointer
MakeOutput(DataObjectPointerArraySizeType idx)
override = 0;
Superclass of all classes generating some kind of mitk::BaseData.
virtual void GraftOutput(const DataObjectIdentifierType &key, OutputType *output)
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override=0
virtual void GraftOutput(OutputType *output)
Graft the specified BaseData onto this BaseDataSource's output.
itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
mitkClassMacroItkParent(BaseDataSource, itk::ProcessObject)
DataObjectPointer MakeOutput(const DataObjectIdentifierType &name) override=0
~BaseDataSource() override
virtual void GraftNthOutput(unsigned int idx, OutputType *output)
Graft the specified base data object onto this BaseDataSource's idx'th output.
bool Updating() const
Access itk::ProcessObject::m_Updating.
Base of all data objects.
#define mitkBaseDataSourceGetOutputDeclarations
Find image slices visible on a given plane.