Subversion Repositories gelsvn

Rev

Rev 214 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
61 jab 1
#include <fstream>
2
#include "Geometry/load_raw.h"
3
 
4
using namespace CGLA;
5
using namespace std;
6
 
7
namespace Geometry
8
{
9
 
10
	template<class T>
11
	bool load_raw(const string& file, RGrid<T>& grid)
12
	{
13
			int sz = grid.get_size();
14
			ifstream f(file.c_str(),ios::binary);
15
			if(f)
16
			{
17
					f.read(reinterpret_cast<char*>(grid.get()),sz*sizeof(T));
18
					return true;
19
			}
20
			cout << "Could not open volume" << endl;
21
			return false;
22
	}
23
 
24
		template bool load_raw(const string&, RGrid<unsigned char>& grid);
25
 
26
}