David's final changes: more profiler features, fixes.
[ipdf/code.git] / src / transformationtype.h
1 #ifndef _TRANSFORMATIONTYPE_H
2 #define _TRANSFORMATIONTYPE_H
3
4 #ifdef QUADTREE_DISABLED
5 //#define TRANSFORM_OBJECTS_NOT_VIEW
6 //#define TRANSFORM_BEZIERS_TO_PATH
7 #endif
8
9 #include "gmprat.h"
10 #include <mpreal.h>
11 #include "real.h"
12
13 namespace IPDF
14 {
15         
16 #ifdef TRANSFORM_BEZIERS_TO_PATH
17 #if PATHREAL == REAL_SINGLE
18         typedef float PReal;
19 #elif PATHREAL == REAL_DOUBLE
20         typedef double PReal;
21 #elif PATHREAL == REAL_LONG_DOUBLE
22         typedef long double PReal;
23 #elif PATHREAL == REAL_MPFRCPP
24         typedef mpfr::mpreal PReal;
25 #elif PATHREAL == REAL_GMPRAT
26         typedef Gmprat PReal;
27 #endif
28 #else
29         typedef Real PReal;
30 #endif
31
32 typedef PReal VReal;
33
34
35 #ifdef TRANSFORM_BEZIERS_TO_PATH
36
37 #if PATHREAL == REAL_MPFRCPP
38
39 #if REALTYPE != REAL_MPFRCPP
40         #include <mpreal.h>
41
42         inline double Double(const mpfr::mpreal & r) {return r.toDouble();}
43         inline float Float(const mpfr::mpreal & r) {return r.toDouble();}
44         inline int64_t Int64(const mpfr::mpreal & r) {return r.toLong();}
45         inline mpfr::mpreal Sqrt(const mpfr::mpreal & r) {return mpfr::sqrt(r, mpfr::mpreal::get_default_rnd());}
46         inline mpfr::mpreal Abs(const mpfr::mpreal & r) {return mpfr::abs(r, mpfr::mpreal::get_default_rnd());}
47         //inline mpfr::mpreal RealFromStr(const char * str) {return mpfr::mpreal(strtod(str, NULL));}
48         inline std::string Str(const mpfr::mpreal & a) {std::stringstream s; s << a; return s.str();}
49         inline size_t Size(const mpfr::mpreal & a) {return a.get_prec();}
50         inline mpfr::mpreal Log10(const mpfr::mpreal & a) {return mpfr::log10(a);}              
51         inline mpfr::mpreal Exp(const mpfr::mpreal & a) {return mpfr::pow(2.817, a);}
52
53 #endif
54 #endif
55 #endif
56
57 }
58 #endif
59

UCC git Repository :: git.ucc.asn.au