Subversion Repositories gelsvn

Rev

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

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