hwrawdatac.cc

来自「手写识别是模式识别中研究得一个热点」· CC 代码 · 共 79 行

CC
79
字号
#include "HWRawDataC.hh"#define MYDEBUG 0ostream& operator << (ostream& outfile, HWHeaderC Header){  outfile << Header.Magic << '\n' << Header.String << '\n';  return outfile;}ostream& operator << (ostream& outfile, HWRawDataC Record){  outfile << Record.Type << ' ' << Record.Time;  if (Record.Type == 0)    {      outfile << ' ' << Record.DataPoint.XPos << ' ' << Record.DataPoint.YPos	<< ' ' << Record.DataPoint.XTilt << ' ' << Record.DataPoint.YTilt	  << ' ' << Record.DataPoint.Pressure;    }  outfile << '\n';  return outfile;}ostream& operator << (ostream& outfile, HWDataPointC Point){  outfile << Point.XPos << ", " << Point.YPos;  return outfile;}istream& operator >> (istream& infile, HWHeaderC& Header){  char ch;  if (MYDEBUG)    cerr << "Start read: " << infile.tellg() << '\n';  infile.getline(Header.Magic, 20, '\n');  if (MYDEBUG)    cerr << "Mid read: " << infile.tellg() << '\n';  infile.getline(Header.String, 1000, '\n');  if (MYDEBUG)    cerr << "End read: " << infile.tellg() << " String is " << Header.String << "\n";  return infile;}istream& operator >> (istream& infile, HWRawDataC& Record){  if (MYDEBUG)    cerr << "Start read: " << infile.tellg() << '\n';  infile >> Record.Type >> Record.Time;  if (MYDEBUG)    cerr << "Read, type = " << Record.Type << '\n';  if (Record.Type == 0)    {      infile >> Record.DataPoint.XPos >> Record.DataPoint.YPos	>> Record.DataPoint.XTilt >> Record.DataPoint.YTilt	  >> Record.DataPoint.Pressure;    }  if (MYDEBUG)    cerr << "End read: " << infile.tellg() << '\n';  return infile;}int operator ==(const HWDataPointC& P1, const HWDataPointC& P2){  return P1.XPos == P2.XPos && P1.YPos == P2.YPos;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?