1 /*=========================================================================
2  *
3  *  Copyright Insight Software Consortium
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *         http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  *=========================================================================*/
18 #include "itkXMLFilterWatcher.h"
19 
20 namespace itk
21 {
ShowProgress()22 void XMLFilterWatcher::ShowProgress()
23 {
24     if ( this->GetProcess() )
25     {
26         int steps = this->GetSteps();
27         steps++;
28         this->SetSteps(steps);
29         if ( !this->GetQuiet() )
30         {
31             std::cout << "<filter-progress>"
32             << this->GetProcess()->GetProgress()
33             << "</filter-progress>"
34             << std::endl;
35             std::cout << std::flush;
36         }
37     }
38 }
39 
StartFilter()40 void XMLFilterWatcher::StartFilter()
41 {
42     this->SetSteps(0);
43     this->SetIterations(0);
44     this->GetTimeProbe().Start();
45     if ( !this->GetQuiet() )
46     {
47         std::cout << "<filter-start>"
48         << std::endl;
49         std::cout << "<filter-name>"
50         << ( this->GetProcess()
51             ? this->GetProcess()->GetNameOfClass() : "None" )
52         << "</filter-name>"
53         << std::endl;
54         std::cout << "<filter-comment>"
55         << " \"" << this->GetComment() << "\" "
56         << "</filter-comment>"
57         << std::endl;
58         std::cout << "</filter-start>"
59         << std::endl;
60         std::cout << std::flush;
61     }
62 }
63 
EndFilter()64 void XMLFilterWatcher::EndFilter()
65 {
66 }
67 
68 }
69