📄 function_objects.h
字号:
#endif// For the non specialized template will do the right thing,// namely return a copy of an FTnamespace CartesianKernelFunctors { template <typename K> class Compute_squared_radius_3 { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Sphere_3 Sphere_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; result_type operator()( const Sphere_3& s) const { return s.rep().squared_radius(); } result_type operator()( const Point_3& p, const Point_3& q) const { return squared_radiusC3(p.x(), p.y(), p.z(), q.x(), q.y(), q.z()); } result_type operator()( const Point_3& p, const Point_3& q, const Point_3& r) const { return squared_radiusC3(p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), r.x(), r.y(), r.z()); } result_type operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { return squared_radiusC3(p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), r.x(), r.y(), r.z(), s.x(), s.y(), s.z()); } }; template <typename K> class Compute_volume_3 { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; result_type operator()(const Point_3& p0, const Point_3& p1, const Point_3& p2, const Point_3& p3) const { return det3x3_by_formula<FT>(p1.x()-p0.x(), p1.y()-p0.y(), p1.z()-p0.z(), p2.x()-p0.x(), p2.y()-p0.y(), p2.z()-p0.z(), p3.x()-p0.x(), p3.y()-p0.y(), p3.z()-p0.z())/6; } result_type operator()( const Tetrahedron_3& t ) const { return this->operator()(t.vertex(0), t.vertex(1), t.vertex(2), t.vertex(3)); } result_type operator()( const Iso_cuboid_3& c ) const { return c.rep().volume(); } }; template <typename K> class Compute_x_2 : Has_qrt { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_2& p) const { return p.rep().x(); } const result_type & operator()(const Vector_2& v) const { return v.rep().x(); } }; template <typename K> class Compute_x_3 : Has_qrt { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_3& p) const { return p.rep().x(); } const result_type & operator()(const Vector_3& v) const { return v.rep().x(); } }; template <typename K> class Compute_y_2 : Has_qrt { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_2& p) const { return p.rep().y(); } const result_type & operator()(const Vector_2& v) const { return v.rep().y(); } }; template <typename K> class Compute_y_3 : Has_qrt { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_3& p) const { return p.rep().y(); } const result_type & operator()(const Vector_3& v) const { return v.rep().y(); } }; template <typename K> class Compute_z_3 : Has_qrt { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_3& p) const { return p.rep().z(); } const result_type & operator()(const Vector_3& v) const { return v.rep().z(); } }; template <typename K> class Compute_dx_2 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Direction_2 Direction_2; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Direction_2& d) const { return d.rep().dx(); } }; template <typename K> class Compute_dx_3 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Direction_3 Direction_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Direction_3& d) const { return d.rep().dx(); } }; template <typename K> class Compute_dy_2 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Direction_2 Direction_2; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Direction_2& d) const { return d.rep().dy(); } }; template <typename K> class Compute_dy_3 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Direction_3 Direction_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Direction_3& d) const { return d.rep().dy(); } }; template <typename K> class Compute_dz_3 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Direction_3 Direction_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Direction_3& d) const { return d.rep().dz(); } }; template <typename K> class Compute_hx_2 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_2& p) const { return p.rep().hx(); } const result_type & operator()(const Vector_2& v) const { return v.rep().hx(); } }; template <typename K> class Compute_hx_3 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_3& p) const { return p.rep().hx(); } const result_type & operator()(const Vector_3& v) const { return v.rep().hx(); } }; template <typename K> class Compute_hy_2 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_2& p) const { return p.rep().hy(); } const result_type & operator()(const Vector_2& v) const { return v.rep().hy(); } }; template <typename K> class Compute_hy_3 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_3& p) const { return p.rep().hy(); } const result_type & operator()(const Vector_3& v) const { return v.rep().hy(); } }; template <typename K> class Compute_hz_3 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_3& p) const { return p.rep().hz(); } const result_type & operator()(const Vector_3& v) const { return v.rep().hz(); } }; template <typename K> class Compute_hw_2 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_2& p) const { return p.rep().hw(); } const result_type & operator()(const Vector_2& v) const { return v.rep().hw(); } }; template <typename K> class Compute_hw_3 : public Has_qrt { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: typedef FT result_type; typedef Arity_tag< 1 > Arity; const result_type & operator()(const Point_3& p) const { return p.rep().hw(); } const result_type & operator()(const Vector_3& v) const { return v.rep().hw(); } }; template <typename K> class Compute_xmin_2 : public Has_qrt { typedef typename K::FT FT;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -