1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3 * Copyright (C) 2008 Emweb bv, Herent, Belgium.
4 *
5 * See the LICENSE file for terms of use.
6 */
7
8 #include <Wt/WLineF.h>
9 #include <Wt/WPointF.h>
10
11 namespace Wt {
12
WLineF()13 WLineF::WLineF()
14 : x1_(0), y1_(0), x2_(0), y2_(0)
15 { }
16
WLineF(const WPointF & p1,const WPointF & p2)17 WLineF::WLineF(const WPointF& p1, const WPointF& p2)
18 : x1_(p1.x()), y1_(p1.y()), x2_(p2.x()), y2_(p2.y())
19 { }
20
WLineF(double x1,double y1,double x2,double y2)21 WLineF::WLineF(double x1, double y1, double x2, double y2)
22 : x1_(x1), y1_(y1), x2_(x2), y2_(y2)
23 { }
24
p1()25 WPointF WLineF::p1() const
26 {
27 return WPointF(x1_, y1_);
28 }
29
p2()30 WPointF WLineF::p2() const
31 {
32 return WPointF(x2_, y2_);
33 }
34
35 bool WLineF::operator==(const WLineF& other) const
36 {
37 return (x1_ == other.x1_)
38 && (y1_ == other.y1_)
39 && (x2_ == other.x2_)
40 && (y2_ == other.y2_);
41 }
42
43 bool WLineF::operator!=(const WLineF& other) const
44 {
45 return !(*this == other);
46 }
47
48 }
49