ScalarTypeDeferer.h
Go to the documentation of this file.
1#ifndef GfxTL__SCALARTYPEDEFERER_HEADER__
2#define GfxTL__SCALARTYPEDEFERER_HEADER__
3#include <memory>
4#include <vector>
5
6#include <GfxTL/Array.h>
7#include <GfxTL/VectorXD.h>
8#include <MiscLib/Vector.h>
9
10namespace GfxTL
11{
12 template <class PointT>
14 {
15 typedef typename PointT::value_type ScalarType;
16 };
17
18 template <class ScalarT>
19 struct ScalarTypeDeferer<ScalarT*>
20 {
21 typedef ScalarT ScalarType;
22 };
23
24 template <class ScalarT>
25 struct ScalarTypeDeferer<const ScalarT*>
26 {
27 typedef ScalarT ScalarType;
28 };
29
30 template <unsigned int DimT, class ScalarT>
31 struct ScalarTypeDeferer<VectorXD<DimT, ScalarT>>
32 {
33 typedef ScalarT ScalarType;
34 };
35
36 template <>
38 {
39 typedef float ScalarType;
40 };
41
42 template <>
43 struct ScalarTypeDeferer<double>
44 {
45 typedef double ScalarType;
46 };
47
48 template <>
50 {
51 typedef int ScalarType;
52 };
53
54 template <>
55 struct ScalarTypeDeferer<char>
56 {
57 typedef char ScalarType;
58 };
59
60 template <>
61 struct ScalarTypeDeferer<short>
62 {
63 typedef short ScalarType;
64 };
65
66 template <class IteratorT>
71
72 template <class T>
73 struct ScalarTypeDeferer<std::auto_ptr<T>>
74 {
75 typedef T ScalarType;
76 };
77
78 template <class T, class A>
80 {
81 typedef T ScalarType;
82 };
83
84 template <class T, class A>
85 struct ScalarTypeDeferer<std::vector<T, A>>
86 {
87 typedef T ScalarType;
88 };
89}; // namespace GfxTL
90
91#endif
#define float
Definition 16_Level.h:22
Eigen::Matrix< T, 3, 1 > Vector
Definition AABox.h:10
ArrayAccessor< 1, IteratorT >::value_type ScalarType
value_type::value_type ScalarType