📄 function_objects.h
字号:
class Construct_opposite_circle_2 { typedef typename K::Circle_2 Circle_2; public: typedef Circle_2 result_type; typedef Arity_tag< 1 > Arity; Circle_2 operator()( const Circle_2& c) const { return c.opposite(); } }; template <typename K> class Construct_opposite_direction_2 { typedef typename K::Direction_2 Direction_2; typedef typename Direction_2::Rep Rep; public: typedef Direction_2 result_type; typedef Arity_tag< 1 > Arity; Direction_2 operator()( const Direction_2& d) const { return Rep(-d.dx(), -d.dy()); } }; template <typename K> class Construct_opposite_direction_3 { typedef typename K::Direction_3 Direction_3; typedef typename Direction_3::Rep Rep; public: typedef Direction_3 result_type; typedef Arity_tag< 1 > Arity; Direction_3 operator()( const Direction_3& d) const { return Rep(-d.dx(), -d.dy(), -d.dz()); } }; template <typename K> class Construct_opposite_line_2 { typedef typename K::Line_2 Line_2; public: typedef Line_2 result_type; typedef Arity_tag< 1 > Arity; Line_2 operator()( const Line_2& l) const { return Line_2( -l.a(), -l.b(), -l.c()); } }; template <typename K> class Construct_opposite_line_3 { typedef typename K::Line_3 Line_3; public: typedef Line_3 result_type; typedef Arity_tag< 1 > Arity; Line_3 operator()( const Line_3& l) const { return l.rep().opposite(); } }; template <typename K> class Construct_opposite_plane_3 { typedef typename K::Plane_3 Plane_3; public: typedef Plane_3 result_type; typedef Arity_tag< 1 > Arity; Plane_3 operator()( const Plane_3& p) const { return p.rep().opposite(); } }; template <typename K> class Construct_opposite_ray_2 { typedef typename K::Ray_2 Ray_2; public: typedef Ray_2 result_type; typedef Arity_tag< 1 > Arity; Ray_2 operator()( const Ray_2& r) const { return r.opposite(); } }; template <typename K> class Construct_opposite_ray_3 { typedef typename K::Ray_3 Ray_3; public: typedef Ray_3 result_type; typedef Arity_tag< 1 > Arity; Ray_3 operator()( const Ray_3& r) const { return r.opposite(); } }; template <typename K> class Construct_opposite_segment_2 { typedef typename K::Segment_2 Segment_2; public: typedef Segment_2 result_type; typedef Arity_tag< 1 > Arity; Segment_2 operator()( const Segment_2& s) const { return Segment_2(s.target(), s.source()); } }; template <typename K> class Construct_opposite_segment_3 { typedef typename K::Segment_3 Segment_3; public: typedef Segment_3 result_type; typedef Arity_tag< 1 > Arity; Segment_3 operator()( const Segment_3& s) const { return s.rep().opposite(); } }; template <typename K> class Construct_opposite_sphere_3 { typedef typename K::Sphere_3 Sphere_3; public: typedef Sphere_3 result_type; typedef Arity_tag< 1 > Arity; Sphere_3 operator()( const Sphere_3& s) const { return s.rep().opposite(); } }; template <typename K> class Construct_opposite_triangle_2 { typedef typename K::Triangle_2 Triangle_2; public: typedef Triangle_2 result_type; typedef Arity_tag< 1 > Arity; Triangle_2 operator()( const Triangle_2& t) const { return Triangle_2(t.vertex(0), t.vertex(2), t.vertex(1));} }; template <typename K> class Construct_perpendicular_line_3 { typedef typename K::Line_3 Line_3; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; public: typedef Line_3 result_type; typedef Arity_tag< 2 > Arity; Line_3 operator()( const Plane_3& pl, const Point_3& p) const { return pl.rep().perpendicular_line(p); } }; template <typename K> class Construct_perpendicular_plane_3 { typedef typename K::Line_3 Line_3; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; public: typedef Plane_3 result_type; typedef Arity_tag< 2 > Arity; Plane_3 operator()( const Line_3& l, const Point_3& p) const { return l.rep().perpendicular_plane(p); } }; template <typename K> class Construct_plane_3 { typedef typename K::RT RT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Direction_3 Direction_3; typedef typename K::Line_3 Line_3; typedef typename K::Ray_3 Ray_3; typedef typename K::Segment_3 Segment_3; typedef typename K::Plane_3 Plane_3; typedef typename Plane_3::Rep Rep; public: typedef Plane_3 result_type; typedef Arity_tag< 2 > Arity; Rep // Plane_3 operator()(Return_base_tag, const RT& a, const RT& b, const RT& c, const RT& d) const { return Rep(a, b, c, d); } Rep // Plane_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q, const Point_3& r) const { return Rep(p, q, r); } Rep // Plane_3 operator()(Return_base_tag, const Point_3& p, const Direction_3& d) const { return Rep(p, d); } Rep // Plane_3 operator()(Return_base_tag, const Point_3& p, const Vector_3& v) const { return Rep(p, v); } Rep // Plane_3 operator()(Return_base_tag, const Line_3& l, const Point_3& p) const { return Rep(l, p); } Rep // Plane_3 operator()(Return_base_tag, const Ray_3& r, const Point_3& p) const { return Rep(r, p); } Rep // Plane_3 operator()(Return_base_tag, const Segment_3& s, const Point_3& p) const { return Rep(s, p); } Plane_3 operator()(const RT& a, const RT& b, const RT& c, const RT& d) const { return this->operator()(Return_base_tag(), a, b, c, d); } Plane_3 operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return this->operator()(Return_base_tag(), p, q, r); } Plane_3 operator()(const Point_3& p, const Direction_3& d) const { return this->operator()(Return_base_tag(), p, d); } Plane_3 operator()(const Point_3& p, const Vector_3& v) const { return this->operator()(Return_base_tag(), p, v); } Plane_3 operator()(const Line_3& l, const Point_3& p) const { return this->operator()(Return_base_tag(), l, p); } Plane_3 operator()(const Ray_3& r, const Point_3& p) const { return this->operator()(Return_base_tag(), r, p); } Plane_3 operator()(const Segment_3& s, const Point_3& p) const { return this->operator()(Return_base_tag(), s, p); } }; template <typename K> class Construct_point_on_2 { typedef typename K::Point_2 Point_2; typedef typename K::Segment_2 Segment_2; typedef typename K::Line_2 Line_2; typedef typename K::Ray_2 Ray_2; public: typedef Point_2 result_type; typedef Arity_tag< 2 > Arity; Point_2 operator()( const Line_2& l, int i) const { return l.point(i); } Point_2 operator()( const Segment_2& s, int i) const { return s.point(i); } Point_2 operator()( const Ray_2& r, int i) const { return r.point(i); } }; template <typename K> class Construct_point_on_3 { typedef typename K::Point_3 Point_3; typedef typename K::Segment_3 Segment_3; typedef typename K::Line_3 Line_3; typedef typename K::Ray_3 Ray_3; typedef typename K::Plane_3 Plane_3; public: typedef Point_3 result_type; typedef Arity_tag< 2 > Arity; Point_3 operator()( const Line_3& l, int i) const { return l.rep().point(i); } Point_3 operator()( const Segment_3& s, int i) const { return s.point(i); } Point_3 operator()( const Ray_3& r, int i) const { return r.rep().point(i); } Point_3 operator()( const Plane_3& p) const { return p.rep().point(); } }; template <typename K> class Construct_projected_xy_point_2 { typedef typename K::Point_2 Point_2; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; public: typedef Point_2 result_type; typedef Arity_tag< 2 > Arity; Point_2 operator()( const Plane_3& h, const Point_3& p) const { return h.rep().to_2d(p); } }; template <typename K> class Construct_ray_2 { typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; typedef typename K::Direction_2 Direction_2; typedef typename K::Line_2 Line_2; typedef typename K::Ray_2 Ray_2; typedef typename Ray_2::Rep Rep; public: typedef Ray_2 result_type; typedef Arity_tag< 2 > Arity; Rep // Ray_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q) const { return Rep(p, q); } Rep // Ray_2 operator()(Return_base_tag, const Point_2& p, const Vector_2& v) const { return Rep(p, K().construct_translated_point_2_object()(p, v)); } Rep // Ray_2 operator()(Return_base_tag, const Point_2& p, const Direction_2& d) const { return Rep(p, K().construct_translated_point_2_object()(p, d.to_vector())); } Rep // Ray_2 operator()(Return_base_tag, const Point_2& p, const Line_2& l) const { return Rep(p, K().construct_translated_point_2_object()(p, l.to_vector())); } Ray_2 operator()(const Point_2& p, const Point_2& q) const { return this->operator()(Return_base_tag(), p, q); } Ray_2 operator()(const Point_2& p, const Vector_2& v) const { return this->operator()(Return_base_tag(), p, v); } Ray_2 operator()(const Point_2& p, const Direction_2& d) const { return this->operator()(Return_base_tag(), p, d); } Ray_2 operator()(const Point_2& p, const Line_2& l) const { return this->operator()(Return_base_tag(), p, l); } }; template <typename K> class Construct_ray_3 { typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Direction_3 Direction_3; typedef typename K::Line_3 Line_3; typedef typename K::Ray_3 Ray_3; typedef typename Ray_3::Rep Rep; public: typedef Ray_3 result_type; typedef Arity_tag< 2 > Arity; Rep // Ray_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { return Rep(p, q); } Rep // Ray_3 operator()(Return_base_tag, const Point_3& p, const Vector_3& v) const { return Rep(p, v); } Rep // Ray_3 operator()(Return_base_tag, const Point_3& p, const Direction_3& d) const { return Rep(p, d); } Rep // Ray_3 operator()(Return_base_tag, const Point_3& p, const Line_3& l) const { return Rep(p, l); } Ray_3 operator()(const Point_3& p, const Point_3& q) const { return this->operator()(Return_base_tag(), p, q); } Ray_3 operator()(const Point_3& p, const Vector_3& v) const { return this->operator()(Return_base_tag(), p, v); } Ray_3 operator()(const Point_3& p, const Direction_3& d) const { return this->operator()(Return_base_tag(), p, d); } Ray_3 operator()(const Point_3& p, const Line_3& l) const { return this->operator()(Return_base_tag(), p, l); } }; template <typename K> class Construct_segment_2 { typedef typename K::Segment_2 Segment_2; typedef typename Segment_2::Rep Rep; typedef typename K::Point_2 Point_2; public: typedef Segment_2 result_type; typedef Arity_tag< 2 > Arity; Rep // Segment_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q) const { return Rep(p, q); } Segment_2 operator()( const Point_2& p, const Point_2& q) const { return this->operator()(Return_base_tag(), p, q); } }; template <typename K> class Construct_segment_3 { typedef typename K::Segment_3 Segment_3; typedef typename K::Point_3 Point_3; typedef typename Segment_3::Rep Rep; public: typedef Segment_3 result_type; typedef Arity_tag< 2 > Arity; Rep // Segment_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { return Rep(p, q); } Segment_3 operator()( const Point_3& p, const Point_3& q) const { return this->operator()(Return_base_tag(), p, q); } }; template <typename K> class Construct_source_2 : Has_qrt { typedef typename K::Segment_2 Segment_2; typedef typename K::Ray_2 Ray_2; typedef typename K::Point_2 Point_2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -