RectangleOverlap

Search for usage in LXR

RectangleOverlap Class Reference

#include <rectangleoverlap.h>

Public Member Functions

 RectangleOverlap (const QPointF &center, int width, int height, double rotationDegrees=0.0)
 
bool intersects (const QPointF &center, int width, int height, double rotationDegrees=0.0) const
 

Detailed Description

This class checks if two rectangles overlap.

It is more general that QRect::intersects in that the rectangles are not necessarily aligned to the axes (that is they can be specified as rotated around their center points).

Checks if two potentially rotated rectangles intersect.

Author
Hy Murveit

Definition at line 26 of file rectangleoverlap.h.

Constructor & Destructor Documentation

◆ RectangleOverlap()

RectangleOverlap::RectangleOverlap ( const QPointF & center,
int width,
int height,
double rotationDegrees = 0.0 )

Constructor specifying reference rectangle.

Parameters
centerthe center of the rectangle
widthits width
heightits height
rotationDegreesamount in degrees the rectangle is rotated counter-clockwise

Definition at line 87 of file rectangleoverlap.cpp.

Member Function Documentation

◆ intersects()

bool RectangleOverlap::intersects ( const QPointF & center,
int width,
int height,
double rotationDegrees = 0.0 ) const

Check if the input rectangle overlaps the reference rectangle.

Parameters
centerthe center of the input rectangle
widthits width
heightits height
rotationDegreesamount in degrees the rectangle is rotated counter-clockwise
Returns
true if the rectangles overlap

Definition at line 92 of file rectangleoverlap.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.