Class that does special logging for GridLog and GridRemoval classes.
More...
#include <GridLog.h>
|
| GridLog (bool isGnuplot) |
| Single constructor.
|
virtual | ~GridLog () |
void | showInputPixel (const QPoint &p, double halfWidth) |
| Show pixels that are inputs to GridHealer.
|
void | showOutputScanLinePixel (int x, int y, double radius) |
| Show scan line pixel that is the output of GridHealer.
|
void | showOutputTrapezoid (const QPoint &p0, const QPoint &p1, const QPoint &p2, const QPoint &p3) |
| Show trapezoids that are intermediate results in GridHealer.
|
Class that does special logging for GridLog and GridRemoval classes.
Output file is appended to since multiple instances of this class are expected to be used each time this application is executed
Definition at line 17 of file GridLog.h.
◆ GridLog()
GridLog::GridLog |
( |
bool | isGnuplot | ) |
|
Single constructor.
Definition at line 26 of file GridLog.cpp.
26 :
27 m_isGnuplot (isGnuplot),
28 m_logStr (&m_log)
29{
30 if (m_isGnuplot) {
31
32
38 m_logStr << "\n";
39 }
40}
◆ ~GridLog()
Definition at line 42 of file GridLog.cpp.
43{
44 if (m_isGnuplot) {
45
46
47 QString filename ("grid.gnuplot");
48 QFile file (filename);
49 QTextStream fileStr (&file);
50
52
53 file.open (QIODevice::WriteOnly | QIODevice::Append);
54 fileStr << m_log;
55 file.close ();
56 }
57}
const QString GNUPLOT_FILE_MESSAGE
◆ showInputPixel()
void GridLog::showInputPixel |
( |
const QPoint & | p, |
|
|
double | halfWidth ) |
Show pixels that are inputs to GridHealer.
Definition at line 68 of file GridLog.cpp.
70{
71 int x = p.x();
72 int y = p.y();
73
78
79 m_logStr << x - halfWidth << " " << - (y - halfWidth) << "\n";
80 m_logStr << x + halfWidth << " " << - (y - halfWidth) << "\n";
81 m_logStr << x + halfWidth << " " << - (y + halfWidth) << "\n";
82 m_logStr << x - halfWidth << " " << - (y + halfWidth) << "\n";
83 m_logStr << x - halfWidth << " " << - (y - halfWidth) << "\n";
84 m_logStr << "\n";
85 }
86}
◆ showOutputScanLinePixel()
void GridLog::showOutputScanLinePixel |
( |
int | x, |
|
|
int | y, |
|
|
double | radius ) |
Show scan line pixel that is the output of GridHealer.
Definition at line 88 of file GridLog.cpp.
91{
92 if (m_isGnuplot && inBounds (x, y)) {
93
94
95 m_logStr << x << " " << - (y - radius) << "\n";
96 m_logStr << x + radius << " " << - (y ) << "\n";
97 m_logStr << x << " " << - (y + radius) << "\n";
98 m_logStr << x - radius << " " << - (y ) << "\n";
99 m_logStr << x << " " << - (y - radius) << "\n";
100 m_logStr << "\n";
101 }
102}
◆ showOutputTrapezoid()
void GridLog::showOutputTrapezoid |
( |
const QPoint & | p0, |
|
|
const QPoint & | p1, |
|
|
const QPoint & | p2, |
|
|
const QPoint & | p3 ) |
Show trapezoids that are intermediate results in GridHealer.
Definition at line 104 of file GridLog.cpp.
108{
109 if (m_isGnuplot) {
110
111
112 if (inBounds (p0.x(), p0.y()) ||
113 inBounds (p1.x(), p1.y()) ||
114 inBounds (p2.x(), p2.y()) ||
115 inBounds (p3.x(), p3.y())) {
116
117 m_logStr << p0.x() << " " << - p0.y() << "\n";
118 m_logStr << p1.x() << " " << - p1.y() << "\n";
119 m_logStr << p2.x() << " " << - p2.y() << "\n";
120 m_logStr << p3.x() << " " << - p3.y() << "\n";
121 m_logStr << p0.x() << " " << - p0.y() << "\n";
122 m_logStr << "\n";
123 }
124 }
125}
The documentation for this class was generated from the following files: