Superclass of all classes generating base data (instances of class mitk::BaseData) as output. More...
#include <mitkBaseDataSource.h>
Public Types | |
typedef mitk::BaseData | OutputType |
typedef OutputType::Pointer | OutputTypePointer |
Public Member Functions | |
mitkClassMacro (BaseDataSource, BaseProcess) | |
virtual itk::DataObject::Pointer | MakeOutput (unsigned int idx)=0 |
virtual void | SetOutput (OutputType *output) |
virtual void | SetOutput (unsigned int idx, OutputType *output) |
virtual OutputType * | GetOutput () |
virtual OutputType * | GetOutput (unsigned int idx) |
Protected Member Functions | |
BaseDataSource () | |
virtual | ~BaseDataSource () |
Superclass of all classes generating base data (instances of class mitk::BaseData) as output.
In itk and vtk the generated result of a ProcessObject is only guaranteed to be up-to-date, when Update() of the ProcessObject or the generated DataObject is called immediately before access of the data stored in the DataObject. This is also true for subclasses of mitk::BaseProcess and thus for mitk::BaseDataSource.
Definition at line 39 of file mitkBaseDataSource.h.
Definition at line 44 of file mitkBaseDataSource.h.
Definition at line 46 of file mitkBaseDataSource.h.
mitk::BaseDataSource::BaseDataSource | ( | ) | [protected] |
Definition at line 22 of file mitkBaseDataSource.cpp.
{ // Pure virtual functions may not be called in the constructor... // see ( see Bjarne Stroustrup's C++ PL 3rd ed section 15.4.3 ) //OutputType::Pointer output = static_cast<OutputType*> ( this->MakeOutput( 0 ).GetPointer() ); //Superclass::SetNumberOfRequiredOutputs( 1 ); //Superclass::SetNthOutput( 0, output.GetPointer() ); }
mitk::BaseDataSource::~BaseDataSource | ( | ) | [protected, virtual] |
Definition at line 33 of file mitkBaseDataSource.cpp.
{ }
mitk::BaseDataSource::OutputType * mitk::BaseDataSource::GetOutput | ( | ) | [virtual] |
Returns the output with index 0 of the base data source
Definition at line 53 of file mitkBaseDataSource.cpp.
{ if ( this->GetNumberOfOutputs() < 1 ) { return 0; } return static_cast<OutputType*> ( Superclass::GetOutput( 0 ) ); }
mitk::BaseDataSource::OutputType * mitk::BaseDataSource::GetOutput | ( | unsigned int | idx ) | [virtual] |
Returns the n'th output of the base data source
idx | the index of the wanted output |
Definition at line 64 of file mitkBaseDataSource.cpp.
{ return static_cast<OutputType*> ( Superclass::GetOutput( idx ) ); }
virtual itk::DataObject::Pointer mitk::BaseDataSource::MakeOutput | ( | unsigned int | idx ) | [pure virtual] |
Allocates a new output object and returns it. This function is pure virtual because mitk::BaseData contains pure virtual functions and can not directly be instantiated. This must be done by subclasses, which know which subclasses of mitk::BaseData they want to instantiate. Thus, these classes have to set their output themselves via this->SetOutput(MakeOutput(0)) in the constructor!
idx | the index of the output for which an object should be created |
mitk::BaseDataSource::mitkClassMacro | ( | BaseDataSource | , |
BaseProcess | |||
) |
void mitk::BaseDataSource::SetOutput | ( | OutputType * | output ) | [virtual] |
Allows to set the output of the base data source.
output | the intended output of the base data source |
Definition at line 39 of file mitkBaseDataSource.cpp.
{ this->SetNthOutput( 0, output ); }
void mitk::BaseDataSource::SetOutput | ( | unsigned int | idx, |
OutputType * | output | ||
) | [virtual] |
Allows to set the n-th output of the base data source.
idx | The index of the output |
output | The intended output of the base data source |
Definition at line 46 of file mitkBaseDataSource.cpp.
{ this->SetNthOutput(idx, output); }