1 #ifndef _TRANSFORMATIONTYPE_H
2 #define _TRANSFORMATIONTYPE_H
4 #ifdef QUADTREE_DISABLED
5 //#define TRANSFORM_OBJECTS_NOT_VIEW
6 //#define TRANSFORM_BEZIERS_TO_PATH
16 #ifdef TRANSFORM_BEZIERS_TO_PATH
17 #if PATHREAL == REAL_SINGLE
19 #elif PATHREAL == REAL_DOUBLE
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
35 #ifdef TRANSFORM_BEZIERS_TO_PATH
37 #if PATHREAL == REAL_MPFRCPP
39 #if REALTYPE != REAL_MPFRCPP
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);}