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 "mitkPointSetSource.h" 00020 00021 00022 mitk::PointSetSource::PointSetSource() 00023 { 00024 // Create the output. 00025 OutputType::Pointer output = dynamic_cast<OutputType*>(this->MakeOutput(0).GetPointer()); 00026 Superclass::SetNumberOfRequiredInputs(0); 00027 Superclass::SetNumberOfRequiredOutputs(1); 00028 Superclass::SetNthOutput(0, output.GetPointer()); 00029 } 00030 00031 00032 00033 00034 mitk::PointSetSource::~PointSetSource() 00035 { 00036 } 00037 00038 00039 00040 00041 itk::DataObject::Pointer mitk::PointSetSource::MakeOutput ( unsigned int /*idx */) 00042 { 00043 return OutputType::New().GetPointer(); 00044 } 00045 00046 00047 00048 00049 void mitk::PointSetSource::SetOutput( OutputType* output ) 00050 { 00051 itkWarningMacro(<< "SetOutput(): This method is slated to be removed from ITK. Please use GraftOutput() in possible combination with DisconnectPipeline() instead." ); 00052 this->ProcessObject::SetNthOutput( 0, output ); 00053 } 00054 00055 00056 00057 00058 void mitk::PointSetSource::GraftOutput(OutputType *graft) 00059 { 00060 this->GraftNthOutput(0, graft); 00061 } 00062 00063 void mitk::PointSetSource::GraftNthOutput(unsigned int /*idx*/, OutputType* /*graft*/) 00064 { 00065 itkWarningMacro(<< "GraftNthOutput(): This method is not yet implemented for mitk. Implement it before using!!" ); 00066 assert(false); 00067 } 00068 00069 00070 00071 mitk::PointSetSource::OutputType* mitk::PointSetSource::GetOutput() 00072 { 00073 if ( this->GetNumberOfOutputs() < 1 ) 00074 { 00075 return 0; 00076 } 00077 else 00078 { 00079 return dynamic_cast<OutputType*> 00080 (this->BaseProcess::GetOutput(0)); 00081 } 00082 } 00083 00084 00085 00086 00087 mitk::PointSetSource::OutputType* mitk::PointSetSource::GetOutput ( unsigned int idx ) 00088 { 00089 return dynamic_cast<OutputType*> ( this->ProcessObject::GetOutput( idx ) ); 00090 } 00091 00092