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 "mitkMeshSource.h" 00020 00021 00022 mitk::MeshSource::MeshSource() 00023 { 00024 // Create the output. 00025 OutputType::Pointer output = dynamic_cast<OutputType*> ( this->MakeOutput( 0 ).GetPointer() ); 00026 assert (output.IsNotNull()); 00027 this->SetNumberOfRequiredInputs(0); 00028 this->SetNumberOfOutputs( 1 ); 00029 this->SetOutput(0, output.GetPointer()); 00030 } 00031 00032 00033 00034 00035 mitk::MeshSource::~MeshSource() 00036 { 00037 } 00038 00039 00040 00041 00042 itk::DataObject::Pointer mitk::MeshSource::MakeOutput ( unsigned int /*idx */) 00043 { 00044 return OutputType::New().GetPointer(); 00045 } 00046 00047 00048 00049 00050 void mitk::MeshSource::SetOutput( OutputType* output ) 00051 { 00052 this->ProcessObject::SetNthOutput( 0, output ); 00053 } 00054 00055 00056 00057 00058 void mitk::MeshSource::SetOutput( unsigned int idx, OutputType* output ) 00059 { 00060 this->ProcessObject::SetNthOutput(idx, output); 00061 } 00062 00063 00064 00065 00066 mitk::MeshSource::OutputType* mitk::MeshSource::GetOutput() 00067 { 00068 if ( this->GetNumberOfOutputs() < 1 ) 00069 { 00070 return 0; 00071 } 00072 else 00073 { 00074 return dynamic_cast<OutputType*> ( this->GetOutput( 0 ) ); 00075 } 00076 } 00077 00078 00079 00080 00081 mitk::MeshSource::OutputType* mitk::MeshSource::GetOutput ( unsigned int idx ) 00082 { 00083 return dynamic_cast<OutputType*> ( this->ProcessObject::GetOutput( idx ) ); 00084 } 00085 00086