688 |
khor |
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 |
|
|
|
11 |
#ifndef __CGLA_VEC3D_H__
|
|
|
12 |
#define __CGLA_VEC3D_H__
|
|
|
13 |
|
|
|
14 |
#include "ArithVec3Float.h"
|
|
|
15 |
#include "Vec3i.h"
|
|
|
16 |
#include "Vec3usi.h"
|
|
|
17 |
#include "Vec3f.h"
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
namespace CGLA {
|
|
|
21 |
|
|
|
22 |
/** \brief A 3D double vector.
|
|
|
23 |
|
|
|
24 |
Useful for high precision arithmetic. */
|
|
|
25 |
|
|
|
26 |
class Vec3d: public ArithVec3Float<double,Vec3d>
|
|
|
27 |
{
|
|
|
28 |
public:
|
|
|
29 |
|
|
|
30 |
/// Construct 0 vector
|
|
|
31 |
Vec3d(){}
|
|
|
32 |
|
|
|
33 |
/// Construct vector
|
|
|
34 |
Vec3d(double a, double b, double c): ArithVec3Float<double,Vec3d>(a,b,c) {}
|
|
|
35 |
|
|
|
36 |
/// Construct vector where all coords = a
|
|
|
37 |
explicit Vec3d(double a):
|
|
|
38 |
ArithVec3Float<double,Vec3d>(a,a,a) {}
|
|
|
39 |
|
|
|
40 |
/// Convert from int vector
|
|
|
41 |
explicit Vec3d(const Vec3i& v):
|
|
|
42 |
ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
|
|
|
43 |
|
|
|
44 |
/// Construct from a 3D unsigned int vector.
|
|
|
45 |
explicit Vec3d(const Vec3usi& v):
|
|
|
46 |
ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
|
|
|
47 |
|
|
|
48 |
/// Convert from float vector
|
|
|
49 |
explicit Vec3d(const Vec3f& v):
|
|
|
50 |
ArithVec3Float<double,Vec3d>(v[0],v[1],v[2]) {}
|
|
|
51 |
};
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
}
|
|
|
55 |
#endif
|