DeformableSurfaceLogger.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2013-2015 Imperial College London
5  * Copyright 2013-2015 Andreas Schuh
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef MIRTK_DeformableSurfaceLogger_H
21 #define MIRTK_DeformableSurfaceLogger_H
22 
23 #include "mirtk/Observer.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Prints progress of deformable surface to output stream
31  */
33 {
34  mirtkObjectMacro(DeformableSurfaceLogger);
35 
36  // ---------------------------------------------------------------------------
37  // Attributes
38 
39  /// Verbosity level
40  mirtkPublicAttributeMacro(int, Verbosity);
41 
42  /// Output stream for progress report
43  mirtkPublicAggregateMacro(ostream, Stream);
44 
45  /// Whether to use SGR commands for colored terminal output
46  mirtkPublicAttributeMacro(bool, Color);
47 
48  /// Whether to flush stream buffer after each printed message
49  mirtkPublicAttributeMacro(bool, FlushBuffer);
50 
51  int _NumberOfIterations; ///< Number of actual line search iterations
52  int _NumberOfSteps; ///< Number of iterative line search steps
53  int _NumberOfGradientSteps; ///< Number of gradient descent steps
54 
55  // ---------------------------------------------------------------------------
56  // Construction/Destruction
57 private:
58 
59  /// Copy construction
60  /// \note Intentionally not implemented.
62 
63  /// Assignment operator
64  /// \note Intentionally not implemented.
66 
67 public:
68 
69  /// Constructor
70  DeformableSurfaceLogger(ostream * = &cout);
71 
72  /// Destructor
73  virtual ~DeformableSurfaceLogger();
74 
75  /// Handle event and print message to output stream
76  void HandleEvent(Observable *, Event, const void *);
77 
78 };
79 
80 
81 } // namespace mirtk
82 
83 #endif // MIRTK_DeformableSurfaceLogger_H
void HandleEvent(Observable *, Event, const void *)
Handle event and print message to output stream.
Definition: IOConfig.h:41
Event
Events that can be observed.
Definition: Event.h:32
virtual ~DeformableSurfaceLogger()
Destructor.