Okular::NormalizedRect
#include <area.h>
Public Member Functions  
NormalizedRect ()  
NormalizedRect (const NormalizedRect &)  
NormalizedRect (const QRect rectangle, double xScale, double yScale)  
NormalizedRect (double left, double top, double right, double bottom)  
NormalizedPoint  center () const 
bool  contains (double x, double y) const 
double  distanceSqr (double x, double y, double xScale, double yScale) const 
QRect  geometry (int xScale, int yScale) const 
QRectF  geometryF (float xScale, float yScale) const 
double  height () const 
bool  intersects (const NormalizedRect &other) const 
bool  intersects (const NormalizedRect *other) const 
bool  intersects (double left, double top, double right, double bottom) const 
bool  isBottom (const NormalizedPoint &pt) const 
bool  isBottomOrLevel (const NormalizedPoint &pt) const 
bool  isLeft (const NormalizedPoint &pt) const 
bool  isNull () const 
bool  isRight (const NormalizedPoint &pt) const 
bool  isTop (const NormalizedPoint &pt) const 
bool  isTopOrLevel (const NormalizedPoint &pt) const 
NormalizedRect  operator& (const NormalizedRect &other) const 
NormalizedRect &  operator= (const NormalizedRect &other) 
bool  operator== (const NormalizedRect &other) const 
NormalizedRect  operator (const NormalizedRect &other) const 
NormalizedRect &  operator= (const NormalizedRect &other) 
QRect  roundedGeometry (int xScale, int yScale) const 
void  transform (const QTransform &matrix) 
double  width () const 
Static Public Member Functions  
static NormalizedRect  fromQRectF (const QRectF &rect) 
Public Attributes  
double  bottom 
double  left 
double  right 
double  top 
Detailed Description
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
It describes a rectangular area on a reference area of undefined size. For more information about the normalized coordinate system, see NormalizedPoint.
In Okular, NormalizedRect can be used e. g. to describe bounding boxes of TextEntity objects, and the highlight area of text selections.
If you need to describe an area which consists of multiple rectangles, you can use RegularAreaRect instead.
 See also
 NormalizedPoint, RegularAreaRect, TextEntity
Constructor & Destructor Documentation
◆ NormalizedRect() [1/4]
NormalizedRect::NormalizedRect  (  ) 
◆ NormalizedRect() [2/4]
NormalizedRect::NormalizedRect  (  double  left, 
double  top,  
double  right,  
double  bottom  
) 
Creates a normalized rectangle with the normalized coordinates left
, top
, right
, bottom
.
If you need the x, y, width and height coordinates use the following formulas:
 x = left
 y = top
 width = right  left
 height = bottom  top
 Note
 The coordinates for
left
andtop
should be lower thanright
andbottom
, respectively. At negative width or height the behaviour of some operations is undefined.
◆ NormalizedRect() [3/4]
NormalizedRect::NormalizedRect  (  const QRect  rectangle, 
double  xScale,  
double  yScale  
) 
Creates a normalized rectangle from the given rectangle
on a reference area of size xScale
x yScale
.
 Note
 The rectangle should have positive width and height. You can use e. g. QRect::normalize() to ensure this. At negative width or height the behaviour of some operations is undefined.
◆ NormalizedRect() [4/4]

default 
Member Function Documentation
◆ center()
NormalizedPoint NormalizedRect::center  (  )  const 
◆ contains()
bool NormalizedRect::contains  (  double  x, 
double  y  
)  const 
◆ distanceSqr()

inline 
◆ fromQRectF()

static 
◆ geometry()
QRect NormalizedRect::geometry  (  int  xScale, 
int  yScale  
)  const 
◆ geometryF()
QRectF NormalizedRect::geometryF  (  float  xScale, 
float  yScale  
)  const 
◆ height()

inline 
◆ intersects() [1/3]
bool NormalizedRect::intersects  (  const NormalizedRect &  other  )  const 
◆ intersects() [2/3]
bool NormalizedRect::intersects  (  const NormalizedRect *  other  )  const 
◆ intersects() [3/3]
bool NormalizedRect::intersects  (  double  left, 
double  top,  
double  right,  
double  bottom  
)  const 
◆ isBottom()

inline 
◆ isBottomOrLevel()

inline 
◆ isLeft()

inline 
◆ isNull()
bool NormalizedRect::isNull  (  )  const 
◆ isRight()

inline 
◆ isTop()

inline 
◆ isTopOrLevel()

inline 
◆ operator&()
NormalizedRect NormalizedRect::operator&  (  const NormalizedRect &  other  )  const 
◆ operator=()

default 
◆ operator==()
bool NormalizedRect::operator==  (  const NormalizedRect &  other  )  const 
◆ operator()
NormalizedRect NormalizedRect::operator  (  const NormalizedRect &  other  )  const 
◆ operator=()
NormalizedRect & NormalizedRect::operator=  (  const NormalizedRect &  other  ) 
◆ roundedGeometry()
QRect NormalizedRect::roundedGeometry  (  int  xScale, 
int  yScale  
)  const 
◆ transform()
void NormalizedRect::transform  (  const QTransform &  matrix  ) 
◆ width()

inline 
Member Data Documentation
◆ bottom
double Okular::NormalizedRect::bottom 
◆ left
double Okular::NormalizedRect::left 
◆ right
double Okular::NormalizedRect::right 
◆ top
double Okular::NormalizedRect::top 
The documentation for this class was generated from the following files:
Documentation copyright © 19962023 The KDE developers.
Generated on Thu Nov 30 2023 03:57:01 by doxygen 1.8.17 written by Dimitri van Heesch, © 19972006
KDE's Doxygen guidelines are available online.