Wt::Point Class Reference

Class to handle x,y - points on the screen. More...

#include <point.h>

Collaboration diagram for Wt::Point:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Point ()
 Construct a point at (0, 0).
 Point (int x_, int y_)
 Construct a point.
int x () const
int y () const
void setX (int x_new)
void setY (int y_new)
Pointoperator+= (const Point &other)
 Shift a point.
Pointoperator-= (const Point &other)
 Shift a point.
Point operator+ (const Point &other) const
 Return a shifted point.
Point operator- (const Point &other) const
 Return a shifted point.
Point operator- () const
 return the negative of a point
bool operator== (const Point &other) const
 Compare two points.
bool operator!= (const Point &other) const
 Compare two points.

Private Attributes

int x_
 The point's x coordinate.
int y_
 The point's y coordinate.

Detailed Description

Class to handle x,y - points on the screen.

Definition at line 30 of file point.h.


Constructor & Destructor Documentation

Wt::Point::Point (  )  [inline]

Construct a point at (0, 0).

Definition at line 33 of file point.h.

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

00033 : x_(0), y_(0) {}

Wt::Point::Point ( int  x_,
int  y_ 
) [inline]

Construct a point.

Definition at line 36 of file point.h.

00036 : x_(x_), y_(y_) {}


Member Function Documentation

bool Wt::Point::operator!= ( const Point other  )  const [inline]

Compare two points.

Definition at line 89 of file point.h.

00089                                               {
00090         return !(*this == other);
00091     }

Point Wt::Point::operator+ ( const Point other  )  const [inline]

Return a shifted point.

Definition at line 69 of file point.h.

References Point(), x_, and y_.

00069                                               {
00070         return Point(x_ + other.x_, y_ + other.y_);
00071     }

Here is the call graph for this function:

Point& Wt::Point::operator+= ( const Point other  )  [inline]

Shift a point.

Definition at line 55 of file point.h.

References x_, and y_.

00055                                           {
00056         x_ += other.x_;
00057         y_ += other.y_;
00058         return *this;
00059     }

Point Wt::Point::operator- (  )  const [inline]

return the negative of a point

Definition at line 79 of file point.h.

References Point(), x_, and y_.

00079                             {
00080         return Point(-x_, -y_);
00081     }

Here is the call graph for this function:

Point Wt::Point::operator- ( const Point other  )  const [inline]

Return a shifted point.

Definition at line 74 of file point.h.

References Point(), x_, and y_.

00074                                               {
00075         return Point(x_ - other.x_, y_ - other.y_);
00076     }

Here is the call graph for this function:

Point& Wt::Point::operator-= ( const Point other  )  [inline]

Shift a point.

Definition at line 62 of file point.h.

References x_, and y_.

00062                                           {
00063         x_ -= other.x_;
00064         y_ -= other.y_;
00065         return *this;
00066     }

bool Wt::Point::operator== ( const Point other  )  const [inline]

Compare two points.

Definition at line 84 of file point.h.

References x_, and y_.

00084                                               {
00085         return (x_ == other.x_) && (y_ == other.y_);
00086     }

void Wt::Point::setX ( int  x_new  )  [inline]

Definition at line 46 of file point.h.

References x_.

Referenced by Wt::Rect::clipLine().

00046                          {
00047         x_ = x_new;
00048     }

void Wt::Point::setY ( int  y_new  )  [inline]

Definition at line 50 of file point.h.

References y_.

Referenced by Wt::Rect::clipLine().

00050                          {
00051         y_ = y_new;
00052     }

int Wt::Point::x (  )  const [inline]

Definition at line 38 of file point.h.

References x_.

Referenced by Wt::PixmapOf< Wt::SDLSurface >::blit(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaCopy(), Wt::Rect::clipLine(), Wt::Rect::contains(), Wt::Painter::drawLine(), Wt::Painter::drawPixmap(), Wt::Painter::drawPoint(), Wt::Painter::drawTiledPixmap(), Wt::MouseEvent::globalX(), Wt::SDLInput::handleMouseEvent(), Wt::Painter::isClipped(), Wt::Widget::mapToGlobal(), Wt::Widget::mapToParent(), Wt::Widget::move(), Wt::Rect::moveTopLeft(), Wt::operator<<(), Wt::SDLInput::EventInfo::operator==(), Wt::PixmapOf< Wt::SDLSurface >::pixel(), Wt::PixmapOf< Wt::SDLSurface >::pixelColor(), Wt::PixmapOf< Wt::SDLSurface >::setPixel(), Wt::PixmapOf< Wt::SDLSurface >::setPixelColor(), and Wt::MouseEvent::x().

00038                   {
00039         return x_;
00040     }

int Wt::Point::y (  )  const [inline]

Definition at line 42 of file point.h.

References y_.

Referenced by Wt::PixmapOf< Wt::SDLSurface >::blit(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaCopy(), Wt::Rect::clipLine(), Wt::Rect::contains(), Wt::Painter::drawLine(), Wt::Painter::drawPixmap(), Wt::Painter::drawPoint(), Wt::Painter::drawTiledPixmap(), Wt::MouseEvent::globalY(), Wt::SDLInput::handleMouseEvent(), Wt::Painter::isClipped(), Wt::Widget::mapToGlobal(), Wt::Widget::mapToParent(), Wt::Widget::move(), Wt::Rect::moveTopLeft(), Wt::operator<<(), Wt::SDLInput::EventInfo::operator==(), Wt::PixmapOf< Wt::SDLSurface >::pixel(), Wt::PixmapOf< Wt::SDLSurface >::pixelColor(), Wt::PixmapOf< Wt::SDLSurface >::setPixel(), Wt::PixmapOf< Wt::SDLSurface >::setPixelColor(), and Wt::MouseEvent::y().

00042                   {
00043         return y_;
00044     }


Member Data Documentation

int Wt::Point::x_ [private]

The point's x coordinate.

Definition at line 95 of file point.h.

Referenced by operator+(), operator+=(), operator-(), operator-=(), operator==(), setX(), and x().

int Wt::Point::y_ [private]

The point's y coordinate.

Definition at line 97 of file point.h.

Referenced by operator+(), operator+=(), operator-(), operator-=(), operator==(), setY(), and y().


The documentation for this class was generated from the following file:

Generated Fri Jul 28 19:30:57 2006.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.