Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::gui::Bounds Struct Reference

List of all members.

Detailed Description

the bounds of a Component

The bounds are described by the position of component's top left corner, its width and its height.

Author:
Daniel Seibert


Public Member Functions

 Bounds (const int &x, const int &y, const int &w, const int &h)
 Bounds (const Point &p=Point(), const Size &s=Size())
bool contains (const Bounds &b) const
 checks if b is completely contained inside this bounds object
Bounds decrease (const Fringe &f) const
 decreases these bounds by the given fringe
Bounds increase (const Fringe &f) const
 increases these bounds by the given fringe
Bounds intersect (const int &x, const int &y, const int &w, const int &h) const
 intersects these bounds with the given ones
Bounds intersect (const Bounds &b) const
 intersects these bounds with b
bool isEmpty () const
 checks if this bounds object is empty
bool isInside (const Point &p) const
 checks if p is inside of this bounds.
bool operator!= (const Bounds &b) const
bool operator== (const Bounds &b) const

Public Attributes

Point pos
Size size


Constructor & Destructor Documentation

ONE::gui::Bounds::Bounds const Point p = Point(),
const Size s = Size()
 

ONE::gui::Bounds::Bounds const int &  x,
const int &  y,
const int &  w,
const int &  h
 


Member Function Documentation

bool ONE::gui::Bounds::contains const Bounds b  )  const [inline]
 

checks if b is completely contained inside this bounds object

Bounds ONE::gui::Bounds::decrease const Fringe f  )  const
 

decreases these bounds by the given fringe

Returns:
the decreased bounds

Bounds ONE::gui::Bounds::increase const Fringe f  )  const
 

increases these bounds by the given fringe

Returns:
the increased bounds

Bounds ONE::gui::Bounds::intersect const int &  x,
const int &  y,
const int &  w,
const int &  h
const [inline]
 

intersects these bounds with the given ones

The intersection is calculated between this bounds object and the bounds defined by the parameters. The returned object contains the area that both objects have in common.

Parameters:
x the left edge
y the top edge
w the width
h the height
Returns:
the intersection of the bounds

Bounds ONE::gui::Bounds::intersect const Bounds b  )  const [inline]
 

intersects these bounds with b

See Bounds::intersect(int,int,int,int) for details.

Parameters:
b the bounds
Returns:
the intersection of the bounds

bool ONE::gui::Bounds::isEmpty  )  const [inline]
 

checks if this bounds object is empty

Returns:
true if the width or the height are 0

bool ONE::gui::Bounds::isInside const Point p  )  const [inline]
 

checks if p is inside of this bounds.

p is inside if the point's coordinates are greater or equal than the bounds position and are less or equal than the bounds position plus the bounds dimension.

Parameters:
p a point
Returns:
if p is inside this bounds

bool ONE::gui::Bounds::operator!= const Bounds b  )  const [inline]
 

bool ONE::gui::Bounds::operator== const Bounds b  )  const [inline]
 


Member Data Documentation

Point ONE::gui::Bounds::pos
 

Size ONE::gui::Bounds::size
 


Generated on Wed Sep 7 19:03:15 2005 for ONEngine by  doxygen 1.4.3