Added constructor Direction from Line, Ray and Segment.

This commit is contained in:
Michael Hoffmann 2001-06-21 16:08:47 +00:00
parent ac5cb26909
commit b4b7b077b6
4 changed files with 67 additions and 4 deletions

View File

@ -25,6 +25,9 @@
#define CGAL_DIRECTION_2_H #define CGAL_DIRECTION_2_H
#include <CGAL/Vector_2.h> #include <CGAL/Vector_2.h>
#include <CGAL/Line_2.h>
#include <CGAL/Ray_2.h>
#include <CGAL/Segment_2.h>
CGAL_BEGIN_NAMESPACE CGAL_BEGIN_NAMESPACE
@ -35,8 +38,11 @@ public:
typedef R_ R; typedef R_ R;
typedef typename R::RT RT; typedef typename R::RT RT;
typedef typename R::FT FT; typedef typename R::FT FT;
typedef typename R::Vector_2_base RVector_2; typedef typename R::Vector_2_base RVector_2;
typedef typename R::Direction_2_base RDirection_2; typedef typename R::Direction_2_base RDirection_2;
typedef typename R::Line_2_base RLine_2;
typedef typename R::Ray_2_base RRay_2;
typedef typename R::Segment_2_base RSegment_2;
Direction_2() Direction_2()
{} {}
@ -53,6 +59,18 @@ public:
: RDirection_2(v) : RDirection_2(v)
{} {}
Direction_2(const RLine_2& l)
: RDirection_2(l)
{}
Direction_2(const RRay_2& r)
: RDirection_2(r)
{}
Direction_2(const RSegment_2& s)
: RDirection_2(s)
{}
Direction_2(const RT &x, const RT &y) Direction_2(const RT &x, const RT &y)
: RDirection_2(x,y) : RDirection_2(x,y)
{} {}

View File

@ -146,6 +146,9 @@ public:
DirectionH2(const DirectionH2<R>& d ); DirectionH2(const DirectionH2<R>& d );
DirectionH2(const PointH2<R> & p ); DirectionH2(const PointH2<R> & p );
DirectionH2(const VectorH2<R> & v ); DirectionH2(const VectorH2<R> & v );
DirectionH2(const LineH2<R> & l );
DirectionH2(const RayH2<R> & r );
DirectionH2(const SegmentH2<R> & s );
DirectionH2(const RT& x, const RT& y); DirectionH2(const RT& x, const RT& y);
DirectionH2(const RT& x, const RT& y, const RT& w ); DirectionH2(const RT& x, const RT& y, const RT& w );
@ -418,6 +421,21 @@ CGAL_KERNEL_CTOR_INLINE
DirectionH2<R>::DirectionH2(const VectorH2<R> & v ) DirectionH2<R>::DirectionH2(const VectorH2<R> & v )
: Direction_handle_2_ ( v) {} : Direction_handle_2_ ( v) {}
template <class R >
CGAL_KERNEL_CTOR_INLINE
DirectionH2<R>::DirectionH2(const LineH2<R> & l )
: Direction_handle_2_ ( l.direction()) {}
template <class R >
CGAL_KERNEL_CTOR_INLINE
DirectionH2<R>::DirectionH2(const RayH2<R> & r )
: Direction_handle_2_ ( r.direction()) {}
template <class R >
CGAL_KERNEL_CTOR_INLINE
DirectionH2<R>::DirectionH2(const SegmentH2<R> & s )
: Direction_handle_2_ ( s.direction()) {}
template <class R > template <class R >
CGAL_KERNEL_CTOR_INLINE CGAL_KERNEL_CTOR_INLINE
DirectionH2<R>::DirectionH2(const RT& x, const RT& y) DirectionH2<R>::DirectionH2(const RT& x, const RT& y)

View File

@ -172,6 +172,15 @@ class DirectionH3
DirectionH3(const VectorH3<R> & v ) DirectionH3(const VectorH3<R> & v )
: Direction_handle_3_(v) {} : Direction_handle_3_(v) {}
DirectionH3(const LineH3<R> & l )
: Direction_handle_3_(l.direction()) {}
DirectionH3(const RayH3<R> & r )
: Direction_handle_3_(r.direction()) {}
DirectionH3(const SegmentH3<R> & s )
: Direction_handle_3_(s.direction()) {}
DirectionH3(const RT& x, const RT& y, DirectionH3(const RT& x, const RT& y,
const RT& z, const RT& w = RT(1) ); const RT& z, const RT& w = RT(1) );

View File

@ -25,6 +25,9 @@
#define CGAL_DIRECTION_2_H #define CGAL_DIRECTION_2_H
#include <CGAL/Vector_2.h> #include <CGAL/Vector_2.h>
#include <CGAL/Line_2.h>
#include <CGAL/Ray_2.h>
#include <CGAL/Segment_2.h>
CGAL_BEGIN_NAMESPACE CGAL_BEGIN_NAMESPACE
@ -35,8 +38,11 @@ public:
typedef R_ R; typedef R_ R;
typedef typename R::RT RT; typedef typename R::RT RT;
typedef typename R::FT FT; typedef typename R::FT FT;
typedef typename R::Vector_2_base RVector_2; typedef typename R::Vector_2_base RVector_2;
typedef typename R::Direction_2_base RDirection_2; typedef typename R::Direction_2_base RDirection_2;
typedef typename R::Line_2_base RLine_2;
typedef typename R::Ray_2_base RRay_2;
typedef typename R::Segment_2_base RSegment_2;
Direction_2() Direction_2()
{} {}
@ -53,6 +59,18 @@ public:
: RDirection_2(v) : RDirection_2(v)
{} {}
Direction_2(const RLine_2& l)
: RDirection_2(l)
{}
Direction_2(const RRay_2& r)
: RDirection_2(r)
{}
Direction_2(const RSegment_2& s)
: RDirection_2(s)
{}
Direction_2(const RT &x, const RT &y) Direction_2(const RT &x, const RT &y)
: RDirection_2(x,y) : RDirection_2(x,y)
{} {}