13 #include <QTextStream>
27 m_isGnuplot (isGnuplot),
47 QString filename (
"grid.gnuplot");
48 QFile file (filename);
49 QTextStream fileStr (&file);
53 file.open (QIODevice::WriteOnly | QIODevice::Append);
59 bool GridLog::inBounds (
int x,
int y)
const
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";
92 if (m_isGnuplot && inBounds (x, y)) {
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";
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())) {
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";