📄 inputreader.cpp
字号:
// InputReader.cpp: implementation of the InputReader class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "InputReader.h"
#include <fstream>
#include <sstream>
using namespace std;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
void InputReader::Read(string filename) throw()
{
ifstream in(filename.c_str());
if(!in) {
::AfxMessageBox(_T("Failed to open..."));
return;
}
double x, y, z;
m_vecPoints.clear();
while(!in.eof()) {
string line;
getline(in, line);
istringstream iss(line);
iss >> x >> y >> z;
m_vecPoints.push_back(Point3D(x, y, z));
}
}
void InputReader::Dump(ostream& os) const throw()
{
for(int i=0; i<m_vecPoints.size(); i++)
os << m_vecPoints[i].x << "\t" << m_vecPoints[i].y << "\t" << m_vecPoints[i].z << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -