Subversion Repositories gelsvn

Rev

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

Rev 89 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 Vec2f.h
-
 
8
 * @brief 2D float vector class.
-
 
9
 */
-
 
10
 
1
#ifndef __CGLA_VEC2F_H__
11
#ifndef __CGLA_VEC2F_H__
2
#define __CGLA_VEC2F_H__
12
#define __CGLA_VEC2F_H__
3
 
13
 
4
#include "ArithVec2Float.h"
14
#include "ArithVec2Float.h"
5
#include "Vec2i.h"
15
#include "Vec2i.h"
6
 
16
 
7
 
17
 
8
namespace CGLA {
18
namespace CGLA {
9
 
19
 
10
	/** \brief 2D floating point vector */
20
	/** \brief 2D floating point vector */
11
 
21
 
12
	class Vec2f: public ArithVec2Float<float,Vec2f>
22
	class Vec2f: public ArithVec2Float<float,Vec2f>
13
	{
23
	{
14
	public:
24
	public:
15
 
25
 
16
		Vec2f() {}
26
		Vec2f() {}
17
		Vec2f(float _a,float _b): ArithVec2Float<float,Vec2f>(_a,_b) {}
27
		Vec2f(float _a,float _b): ArithVec2Float<float,Vec2f>(_a,_b) {}
18
 
28
 
19
		template<class T, class V, unsigned int N>
29
		template<class T, class V, unsigned int N>
20
		explicit Vec2f(const ArithVec<T,V,N>& v): 
30
		explicit Vec2f(const ArithVec<T,V,N>& v): 
21
			ArithVec2Float<float,Vec2f>(static_cast<float>(v[0]),
31
			ArithVec2Float<float,Vec2f>(static_cast<float>(v[0]),
22
																	static_cast<float>(v[1])) {}
32
																	static_cast<float>(v[1])) {}
23
 
33
 
24
		explicit Vec2f(float a): ArithVec2Float<float,Vec2f>(a,a) {}
34
		explicit Vec2f(float a): ArithVec2Float<float,Vec2f>(a,a) {}
25
	};
35
	};
26
 
36
 
27
 
37
 
28
 
38
 
29
}
39
}
30
#endif
40
#endif
31
 
41