Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

Ars::XPoint Class Reference

#include <xrect.h>


Public Member Functions

 XPoint (const int initX=0, const int initY=0)
 XPoint (const XPoint &initPt)
XPoint operator+ (const XPoint &p) const
 Add the X and Y coordinates of the points.

XPoint operator- (const XPoint &p) const
 Subtract the X and Y coordinates of the points.

XPointoperator/= (const double v)
XPointoperator *= (const double v)
XPointoperator/= (const int v)
XPointoperator *= (const int v)
XPointoperator+= (const int v)
XPointoperator-= (const int v)
XPointoperator= (const XPoint &p)
 Assign the value of point p to the point.

const bool operator== (const XPoint &p) const
 Equality operator evaluates to true if the x and y coordinates are the same for both points.

const bool leftof (const XPoint &p) const
 true if the point is to the left of point p

const bool rightof (const XPoint &p) const
 true if the point is to the right of point p

const bool above (const XPoint &p) const
 true if the point is above point p

const bool below (const XPoint &p) const
 true if the point is below point p

const double dist (void)

Data Fields

int x
int y


Constructor & Destructor Documentation

Ars::XPoint::XPoint const int  initX = 0,
const int  initY = 0
[inline]
 

Definition at line 14 of file xrect.h.

References x, and y.

Referenced by operator+(), and operator-().

00014 : x( initX ) , y( initY )       {}

Ars::XPoint::XPoint const XPoint initPt  )  [inline]
 

Definition at line 17 of file xrect.h.

References x, and y.

00017 : x( initPt.x ) , y( initPt.y ) {};


Member Function Documentation

const bool Ars::XPoint::above const XPoint p  )  const [inline]
 

true if the point is above point p

Definition at line 45 of file xrect.h.

References y.

00045 { return (y < p.y); }

const bool Ars::XPoint::below const XPoint p  )  const [inline]
 

true if the point is below point p

Definition at line 48 of file xrect.h.

References y.

00048 { return (y > p.y); }

const double Ars::XPoint::dist void   )  [inline]
 

Definition at line 50 of file xrect.h.

References x, and y.

00051         {       return sqrt( (double)x * x + (double)y * y );   }

const bool Ars::XPoint::leftof const XPoint p  )  const [inline]
 

true if the point is to the left of point p

Definition at line 39 of file xrect.h.

References x.

00039 { return (x < p.x); }

XPoint& Ars::XPoint::operator *= const int  v  )  [inline]
 

Definition at line 28 of file xrect.h.

References x, and y.

00028 {       x *= v; y *= v; return *this;   }

XPoint& Ars::XPoint::operator *= const double  v  )  [inline]
 

Definition at line 26 of file xrect.h.

References x, and y.

00026 {       x = (int)(x * v);       y = (int)(y * v);       return *this;   }

XPoint Ars::XPoint::operator+ const XPoint p  )  const [inline]
 

Add the X and Y coordinates of the points.

Definition at line 21 of file xrect.h.

References x, XPoint(), and y.

00021 {       return XPoint( x + p.x , y + p.y );     }

XPoint& Ars::XPoint::operator+= const int  v  )  [inline]
 

Definition at line 29 of file xrect.h.

References x, and y.

00029 {       x += v; y += v; return *this;   }

XPoint Ars::XPoint::operator- const XPoint p  )  const [inline]
 

Subtract the X and Y coordinates of the points.

Definition at line 23 of file xrect.h.

References x, XPoint(), and y.

00023 {       return XPoint( x - p.x , y - p.y );     }

XPoint& Ars::XPoint::operator-= const int  v  )  [inline]
 

Definition at line 30 of file xrect.h.

References x, and y.

00030 {       x -= v; y -= v; return *this;   }

XPoint& Ars::XPoint::operator/= const int  v  )  [inline]
 

Definition at line 27 of file xrect.h.

References x, and y.

00027 {       x /= v; y /= v; return *this;   }

XPoint& Ars::XPoint::operator/= const double  v  )  [inline]
 

Definition at line 25 of file xrect.h.

References x, and y.

00025 {       x = (int)(x / v);       y = (int)(y / v);       return *this;   }

XPoint& Ars::XPoint::operator= const XPoint p  )  [inline]
 

Assign the value of point p to the point.

Definition at line 33 of file xrect.h.

References x, and y.

00033 {       x = p.x;        y = p.y;        return *this;   }

const bool Ars::XPoint::operator== const XPoint p  )  const [inline]
 

Equality operator evaluates to true if the x and y coordinates are the same for both points.

Definition at line 36 of file xrect.h.

References x, and y.

00036 { return ((x == p.x) && (y == p.y)); }

const bool Ars::XPoint::rightof const XPoint p  )  const [inline]
 

true if the point is to the right of point p

Definition at line 42 of file xrect.h.

References x.

00042 { return (x > p.x); }


Field Documentation

int Ars::XPoint::x
 

Definition at line 9 of file xrect.h.

Referenced by Ars::HPaint::_TextOut(), dist(), Ars::XGroupBox::Draw(), Ars::XEditBox::Draw(), Ars::XButtonImage::Draw(), Ars::HPaint::DrawLine(), Ars::HPaint::DrawPoint(), Ars::XEditBox::evMouseButtonDown(), Ars::XScrollBar::evMouseMove(), Ars::XEditBox::evMouseMove(), Ars::HPaint::GetMetrics(), Ars::HPaint::GetTextSize(), Ars::XRect::HitTest(), leftof(), operator *=(), Ars::XRect::operator+(), operator+(), operator+=(), Ars::XRect::operator-(), operator-(), operator-=(), operator/=(), operator=(), operator==(), Ars::HPaint::ReadPoint(), rightof(), Ars::XToolTip::SetWndText(), Ars::XToolTip::ShowTip(), Ars::HPaint::TextOutStr(), Ars::View::wmResize(), XPoint(), and Ars::XRect::XRect().

int Ars::XPoint::y
 

Definition at line 9 of file xrect.h.

Referenced by Ars::HPaint::_TextOut(), above(), below(), dist(), Ars::XGroupBox::Draw(), Ars::XButtonImage::Draw(), Ars::HPaint::DrawLine(), Ars::HPaint::DrawPoint(), Ars::XListBox::evMouseButtonDown(), Ars::XListBox::evMouseButtonUp(), Ars::XScrollBar::evMouseMove(), Ars::HPaint::GetMetrics(), Ars::HPaint::GetTextSize(), Ars::XRect::HitTest(), operator *=(), Ars::XRect::operator+(), operator+(), operator+=(), Ars::XRect::operator-(), operator-(), operator-=(), operator/=(), operator=(), operator==(), Ars::HPaint::ReadPoint(), Ars::XToolTip::SetWndText(), Ars::XToolTip::ShowTip(), Ars::HPaint::TextOutStr(), Ars::View::wmResize(), XPoint(), and Ars::XRect::XRect().


The documentation for this class was generated from the following file:
Generated on Fri Dec 5 04:07:01 2003 for Borqueror by doxygen 1.3.3