Subversion Repositories gelsvn

Rev

Rev 595 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 595 Rev 630
1
/* ----------------------------------------------------------------------- *
1
/* ----------------------------------------------------------------------- *
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
3
 * Copyright (C) the authors and DTU Informatics
3
 * Copyright (C) the authors and DTU Informatics
4
 * For license and list of authors, see ../../doc/intro.pdf
4
 * For license and list of authors, see ../../doc/intro.pdf
5
 * ----------------------------------------------------------------------- */
5
 * ----------------------------------------------------------------------- */
6
 
6
 
7
/** @file Vec3d.h
7
/** @file Vec3d.h
8
 * @brief 3D double vector class.
8
 * @brief 3D double vector class.
9
 */
9
 */
10
 
10
 
11
#ifndef __CGLA_VEC3D_H__
11
#ifndef __CGLA_VEC3D_H__
12
#define __CGLA_VEC3D_H__
12
#define __CGLA_VEC3D_H__
13
 
13
 
14
#include "ArithVec3Float.h"
14
#include "ArithVec3Float.h"
15
#include "Vec3i.h"
15
#include "Vec3i.h"
16
#include "Vec3usi.h"
16
#include "Vec3usi.h"
17
#include "Vec3f.h"
17
#include "Vec3f.h"
18
 
18
 
19
 
19
 
20
namespace CGLA {
20
namespace CGLA {
21
 
21
 
22
	/** \brief A 3D double vector. 
22
	/** \brief A 3D double vector. 
23
 
23
 
24
	Useful for high precision arithmetic. */
24
	Useful for high precision arithmetic. */
25
 
25
 
26
	class Vec3d: public ArithVec3Float<double,Vec3d>
26
	class Vec3d: public ArithVec3Float<double,Vec3d>
27
	{
27
	{
28
	public:
28
	public:
29
 
29
 
30
		/// Construct 0 vector
30
		/// Construct 0 vector
31
		Vec3d(){}
31
		Vec3d(){}
32
 
32
 
33
		/// Construct vector
33
		/// Construct vector
34
		Vec3d(double a, double b, double c): ArithVec3Float<double,Vec3d>(a,b,c) {}
34
		Vec3d(double a, double b, double c): ArithVec3Float<double,Vec3d>(a,b,c) {}
35
 
35
 
36
		/// Construct vector where all coords = a 
36
		/// Construct vector where all coords = a 
37
		explicit Vec3d(double a):
37
		explicit Vec3d(double a):
38
			ArithVec3Float<double,Vec3d>(a,a,a) {}
38
			ArithVec3Float<double,Vec3d>(a,a,a) {}
39
 
39
 
40
		/// Convert from int vector
40
		/// Convert from int vector
41
		explicit Vec3d(const Vec3i& v): 
41
		explicit Vec3d(const Vec3i& v): 
42
			ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
42
			ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
43
 
43
 
44
		/// Construct from a 3D unsigned int vector.
44
		/// Construct from a 3D unsigned int vector.
45
		explicit Vec3d(const Vec3usi& v): 
45
		explicit Vec3d(const Vec3usi& v): 
46
			ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
46
			ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
47
 
47
 
48
		/// Convert from float vector
48
		/// Convert from float vector
49
		explicit Vec3d(const Vec3f& v): 
49
		explicit Vec3d(const Vec3f& v): 
50
			ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
50
			ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
51
	};
51
	};
52
 
52
 
53
 
53
 
54
}
54
}
55
#endif
55
#endif
56
 
56