tahoma2d/toonz/sources/include/tcg_wrap.h

51 lines
1.2 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef TCG_WRAP_H
#define TCG_WRAP_H
// tcg includes
#include "tcg/tcg_point.h"
// Toonz includes
#include "tgeometry.h"
//*************************************************************************************
// Toonz wrapper for tcg
//*************************************************************************************
2016-06-15 18:43:10 +12:00
namespace tcg {
2016-03-19 06:57:51 +13:00
template <>
struct point_traits<TPoint> {
2016-06-15 18:43:10 +12:00
typedef TPoint point_type;
typedef int value_type;
typedef double float_type;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
inline static value_type x(const point_type &p) { return p.x; }
inline static value_type y(const point_type &p) { return p.y; }
2016-03-19 06:57:51 +13:00
};
template <>
struct point_traits<TPointD> {
2016-06-15 18:43:10 +12:00
typedef TPointD point_type;
typedef double value_type;
typedef double float_type;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
inline static value_type x(const point_type &p) { return p.x; }
inline static value_type y(const point_type &p) { return p.y; }
2016-03-19 06:57:51 +13:00
};
template <>
struct point_traits<TThickPoint> {
2016-06-15 18:43:10 +12:00
typedef TThickPoint point_type;
typedef double value_type;
typedef double float_type;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
inline static value_type x(const point_type &p) { return p.x; }
inline static value_type y(const point_type &p) { return p.y; }
2016-03-19 06:57:51 +13:00
};
2016-06-15 18:43:10 +12:00
} // namespace tcg
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
#endif // TCG_WRAP_H