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 #include "mitkBaseDataSource.h" 00020 00021 00022 mitk::BaseDataSource::BaseDataSource() 00023 { 00024 // Pure virtual functions may not be called in the constructor... 00025 // see ( see Bjarne Stroustrup's C++ PL 3rd ed section 15.4.3 ) 00026 //OutputType::Pointer output = static_cast<OutputType*> ( this->MakeOutput( 0 ).GetPointer() ); 00027 //Superclass::SetNumberOfRequiredOutputs( 1 ); 00028 //Superclass::SetNthOutput( 0, output.GetPointer() ); 00029 } 00030 00031 00032 00033 mitk::BaseDataSource::~BaseDataSource() 00034 { 00035 } 00036 00037 00038 00039 void mitk::BaseDataSource::SetOutput( OutputType* output ) 00040 { 00041 this->SetNthOutput( 0, output ); 00042 } 00043 00044 00045 00046 void mitk::BaseDataSource::SetOutput( unsigned int idx, OutputType* output ) 00047 { 00048 this->SetNthOutput(idx, output); 00049 } 00050 00051 00052 00053 mitk::BaseDataSource::OutputType* mitk::BaseDataSource::GetOutput() 00054 { 00055 if ( this->GetNumberOfOutputs() < 1 ) 00056 { 00057 return 0; 00058 } 00059 return static_cast<OutputType*> ( Superclass::GetOutput( 0 ) ); 00060 } 00061 00062 00063 00064 mitk::BaseDataSource::OutputType* mitk::BaseDataSource::GetOutput ( unsigned int idx ) 00065 { 00066 return static_cast<OutputType*> ( Superclass::GetOutput( idx ) ); 00067 } 00068 00069