OTB  6.7.0
Orfeo Toolbox
otbPersistentFilterStreamingDecorator.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbPersistentFilterStreamingDecorator_hxx
22 #define otbPersistentFilterStreamingDecorator_hxx
23 
25 
26 namespace otb
27 {
31 template <class TFilter>
34 {
35  m_Filter = FilterType::New();
36  m_Streamer = StreamerType::New();
37 }
39 
40 template <class TFilter>
41 void
43 ::GenerateData(void)
44 {
45  // Reset the filter before the generation.
46  this->GetFilter()->Reset();
47 
48  /*
49  for (unsigned int idx = 0; idx < this->GetFilter()->GetNumberOfOutputs(); ++idx)
50  {
51  this->GetStreamer()->SetNthInput(idx, this->GetFilter()->GetOutput(idx));
52  }
53  */
54 
55  this->GetStreamer()->SetInput(this->GetFilter()->GetOutput());
56  this->GetStreamer()->Update();
57 
58  // Synthetize data after the streaming of the whole image.
59  this->GetFilter()->Synthetize();
60 }
61 
62 template <class TFilter>
63 void
65 ::Update(void)
66 {
67  this->GenerateData();
68 }
69