Orfeo Toolbox  3.16
itkMeshSource.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkMeshSource.txx,v $
5  Language: C++
6  Date: $Date: 2009-02-05 22:04:14 $
7  Version: $Revision: 1.26 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkMeshSource_txx
18 #define __itkMeshSource_txx
19 
20 #include "itkMeshSource.h"
21 
22 namespace itk
23 {
24 
28 template<class TOutputMesh>
31 {
32  // Create the output. We use static_cast<> here because we know the default
33  // output must be of type TOutputMesh
34  OutputMeshPointer output
35  = static_cast<TOutputMesh*>(this->MakeOutput(0).GetPointer());
36 
38  this->ProcessObject::SetNthOutput( 0, output.GetPointer() );
39 
40  m_GenerateDataRegion = 0;
41  m_GenerateDataNumberOfRegions = 0;
42 }
43 
47 template<class TOutputMesh>
50 ::MakeOutput(unsigned int)
51 {
52  return static_cast<DataObject*>(TOutputMesh::New().GetPointer());
53 }
54 
58 template<class TOutputMesh>
62 {
63  if (this->GetNumberOfOutputs() < 1)
64  {
65  return 0;
66  }
67 
68  return static_cast<TOutputMesh*>
69  (this->ProcessObject::GetOutput(0));
70 }
71 
72 
76 template<class TOutputMesh>
79 ::GetOutput(unsigned int idx)
80 {
81  return static_cast<TOutputMesh*>
82  (this->ProcessObject::GetOutput(idx));
83 }
84 
85 
89 template<class TOutputMesh>
90 void
93 {
94  itkWarningMacro(<< "SetOutput(): This method is slated to be removed from ITK. Please use GraftOutput() in possible combination with DisconnectPipeline() instead." );
95  this->ProcessObject::SetNthOutput(0, output);
96 }
97 
98 
102 template<class TOutputMesh>
103 void
106 {
107  Superclass::GenerateInputRequestedRegion();
108 }
109 
110 
114 template<class TOutputMesh>
115 void
118 {
119  this->GraftNthOutput(0, graft);
120 }
121 
122 
126 template<class TOutputMesh>
127 void
129 ::GraftNthOutput(unsigned int idx, DataObject *graft)
130 {
131  if ( idx >= this->GetNumberOfOutputs() )
132  {
133  itkExceptionMacro(<<"Requested to graft output " << idx <<
134  " but this filter only has " << this->GetNumberOfOutputs() << " Outputs.");
135  }
136 
137  if ( !graft )
138  {
139  itkExceptionMacro(<<"Requested to graft output that is a NULL pointer" );
140  }
141 
142  DataObject * output = this->GetOutput( idx );
143 
144  // Call Graft on the Mesh in order to copy meta-information, and containers.
145  output->Graft( graft );
146 }
147 
148 
152 template<class TOutputMesh>
153 void
155 ::PrintSelf(std::ostream& os, Indent indent) const
156 {
157  Superclass::PrintSelf(os,indent);
158 }
159 
160 } // end namespace itk
161 
162 #endif

Generated at Sat Feb 2 2013 23:52:42 for Orfeo Toolbox with doxygen 1.8.1.1