Orfeo Toolbox  4.2
otbVectorDataToSpecificDescriptionFilterBase.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbVectorDataToSpecificDescriptionFilterBase_txx
19 #define __otbVectorDataToSpecificDescriptionFilterBase_txx
20 
22 
23 namespace otb
24 {
25 
26 // Constructor
27 template <class TVectorData>
30 {
31  this->SetNumberOfRequiredInputs(1);
32 }
33 
34 template <class TVectorData>
35 void
37 ::AddSupport(const DataObject * support, unsigned int idx)
38 {
39  // Process object is not const-correct so the const_cast is required here
40  // input(0) is dedicated to the input vector data, support #i is
41  // stored in input(i+1)
43  const_cast<DataObject *>(support));
44 }
45 
46 template <class TVectorData>
48 ::DataObject *
50 ::GetSupport(unsigned int idx)
51 {
52  if (this->GetNumberOfInputs() < idx+2)
53  {
54  return 0;
55  }
56 
57  return static_cast<const DataObject *>
58  (this->itk::ProcessObject::GetInput(idx+1));
59 }
60 
61 // PrintSelf Method
62 template <class TVectorData>
63 void
65 ::PrintSelf(std::ostream& os, itk::Indent indent) const
66 {
67  Superclass::PrintSelf(os, indent);
68  os<<indent<<"Number of Support: "<<(int)(this->GetNumberOfInputs())-1<<std::endl;
69 }
70 
71 } // end namespace otb
72 
73 #endif

Generated at Sat Aug 30 2014 16:32:04 for Orfeo Toolbox with doxygen 1.8.3.1