#include <berryGeometry.h>
|
static int | GetDimension (const QRect &toMeasure, bool width) |
|
static bool | IsHorizontal (int berrySideConstant) |
|
static QRect | GetExtrudedEdge (const QRect &toExtrude, int size, int orientation) |
|
static void | Normalize (QRect &rect) |
|
static int | GetClosestSide (const QRect &boundary, const QPoint &toTest) |
|
static int | GetDistanceFromEdge (const QRect &rectangle, const QPoint &testPoint, int edgeOfInterest) |
|
static int | GetOppositeSide (int directionConstant) |
|
static QRect | ToControl (QWidget *coordinateSystem, const QRect &toConvert) |
|
static QPoint | ToControl (QWidget *coordinateSystem, const QPoint &toConvert) |
|
static QRect | ToDisplay (QWidget *coordinateSystem, const QRect &toConvert) |
|
static QPoint | ToDisplay (QWidget *coordinateSystem, const QPoint &toConvert) |
|
Definition at line 29 of file berryGeometry.h.
int berry::Geometry::GetClosestSide |
( |
const QRect & |
boundary, |
|
|
const QPoint & |
toTest |
|
) |
| |
|
static |
int berry::Geometry::GetDimension |
( |
const QRect & |
toMeasure, |
|
|
bool |
width |
|
) |
| |
|
static |
Returns the height or width of the given rectangle.
- Parameters
-
toMeasure | rectangle to measure |
width | returns the width if true, and the height if false |
- Returns
- the width or height of the given rectangle
- Since
- 3.0
Definition at line 29 of file berryGeometry.cpp.
int berry::Geometry::GetDistanceFromEdge |
( |
const QRect & |
rectangle, |
|
|
const QPoint & |
testPoint, |
|
|
int |
edgeOfInterest |
|
) |
| |
|
static |
QRect berry::Geometry::GetExtrudedEdge |
( |
const QRect & |
toExtrude, |
|
|
int |
size, |
|
|
int |
orientation |
|
) |
| |
|
static |
Extrudes the given edge inward by the given distance. That is, if one side of the rectangle was sliced off with a given thickness, this returns the rectangle that forms the slice. Note that the returned rectangle will be inside the given rectangle if size > 0.
- Parameters
-
toExtrude | the rectangle to extrude. The resulting rectangle will share three sides with this rectangle. |
size | distance to extrude. A negative size will extrude outwards (that is, the resulting rectangle will overlap the original iff this is positive). |
orientation | the side to extrude. One of Constants::LEFT, Constants::RIGHT, Constants::TOP, or Constants::BOTTOM. The resulting rectangle will always share this side with the original rectangle. |
- Returns
- a rectangle formed by extruding the given side of the rectangle by the given distance.
Definition at line 44 of file berryGeometry.cpp.
References berry::Constants::BOTTOM, IsHorizontal(), Normalize(), and berry::Constants::RIGHT.
int berry::Geometry::GetOppositeSide |
( |
int |
directionConstant | ) |
|
|
static |
Returns the opposite of the given direction. That is, returns SWT.LEFT if given SWT.RIGHT and visa-versa.
- Parameters
-
swtDirectionConstant | one of SWT.LEFT, SWT.RIGHT, SWT.TOP, or SWT.BOTTOM |
- Returns
- one of SWT.LEFT, SWT.RIGHT, SWT.TOP, or SWT.BOTTOM
- Since
- 3.0
Definition at line 127 of file berryGeometry.cpp.
References berry::Constants::BOTTOM, berry::Constants::LEFT, berry::Constants::RIGHT, and berry::Constants::TOP.
bool berry::Geometry::IsHorizontal |
( |
int |
berrySideConstant | ) |
|
|
static |
void berry::Geometry::Normalize |
( |
QRect & |
rect | ) |
|
|
static |
Normalizes the given rectangle. That is, any rectangle with negative width or height becomes a rectangle with positive width or height that extends to the upper-left of the original rectangle.
- Parameters
-
Definition at line 73 of file berryGeometry.cpp.
Referenced by GetExtrudedEdge().
QRect berry::Geometry::ToControl |
( |
QWidget * |
coordinateSystem, |
|
|
const QRect & |
toConvert |
|
) |
| |
|
static |
Converts the given rectangle from display coordinates to the local coordinate system of the given object
- Parameters
-
coordinateSystem | local coordinate system (widget) being converted to |
toConvert | rectangle to convert |
- Returns
- a rectangle in control coordinates
- Since
- 3.0
Definition at line 141 of file berryGeometry.cpp.
QPoint berry::Geometry::ToControl |
( |
QWidget * |
coordinateSystem, |
|
|
const QPoint & |
toConvert |
|
) |
| |
|
static |
Converts the given point from display coordinates to the local coordinate system of the given object
- Parameters
-
coordinateSystem | local coordinate system (widget) being converted to |
toConvert | point to convert |
- Returns
- a point in control coordinates
- Since
- 3.0
Definition at line 148 of file berryGeometry.cpp.
QRect berry::Geometry::ToDisplay |
( |
QWidget * |
coordinateSystem, |
|
|
const QRect & |
toConvert |
|
) |
| |
|
static |
Converts the given rectangle from the local coordinate system of the given object into display coordinates.
- Parameters
-
coordinateSystem | local coordinate system (widget) being converted from |
toConvert | rectangle to convert |
- Returns
- a rectangle in display coordinates
- Since
- 3.0
Definition at line 153 of file berryGeometry.cpp.
QPoint berry::Geometry::ToDisplay |
( |
QWidget * |
coordinateSystem, |
|
|
const QPoint & |
toConvert |
|
) |
| |
|
static |
Converts the given point from the local coordinate system of the given object into display coordinates.
- Parameters
-
coordinateSystem | local coordinate system (widget) being converted from |
toConvert | point to convert |
- Returns
- a point in display coordinates
- Since
- 3.0
Definition at line 160 of file berryGeometry.cpp.
The documentation for this struct was generated from the following files: