• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • Okular
  • NormalizedRect
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Okular::NormalizedRect Class Reference

#include <area.h>

Public Member Functions

 NormalizedRect ()
 
 NormalizedRect (double left, double top, double right, double bottom)
 
 NormalizedRect (const QRect &rectangle, double xScale, double yScale)
 
 NormalizedRect (const NormalizedRect &)
 
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
 
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)
 

Static Public Member Functions

static NormalizedRect fromQRectF (const QRectF &rect)
 

Public Attributes

double bottom
 
double left
 
double right
 
double top
 

Detailed Description

NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.

See also
NormalizedPoints.

Definition at line 105 of file area.h.

Constructor & Destructor Documentation

NormalizedRect::NormalizedRect ( )

Creates a null normalized rectangle.

class NormalizedRect

See also
isNull()

Definition at line 126 of file area.cpp.

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

Definition at line 129 of file area.cpp.

NormalizedRect::NormalizedRect ( const QRect &  rectangle,
double  xScale,
double  yScale 
)

Creates a normalized rectangle of the given rectangle which is normalized by the scaling factors xScale and yScale.

Definition at line 133 of file area.cpp.

NormalizedRect::NormalizedRect ( const NormalizedRect &  rect)

Definition at line 137 of file area.cpp.

Member Function Documentation

NormalizedPoint NormalizedRect::center ( ) const

Returns the center of the rectangle.

Since
0.10 (KDE 4.4)

Definition at line 227 of file area.cpp.

bool NormalizedRect::contains ( double  x,
double  y 
) const

Returns whether the normalized rectangle contains the normalized coordinates x and y.

Definition at line 156 of file area.cpp.

double Okular::NormalizedRect::distanceSqr ( double  x,
double  y,
double  xScale,
double  yScale 
) const
inline

Returns the distance of the point x y xScale yScale to the closest edge or 0 if the point is within the rectangle.

Since
0.17 (KDE 4.11)

Definition at line 286 of file area.h.

NormalizedRect NormalizedRect::fromQRectF ( const QRectF &  rect)
static

Build a normalized rect from a QRectF.

Definition at line 140 of file area.cpp.

QRect NormalizedRect::geometry ( int  xScale,
int  yScale 
) const

Returns the rectangle that accrues when the normalized rectangle is multiplyed with the scaling xScale and yScale.

Definition at line 239 of file area.cpp.

bool NormalizedRect::intersects ( const NormalizedRect &  other) const

Returns whether the normalized rectangle intersects the other normalized rectangle.

Definition at line 161 of file area.cpp.

bool NormalizedRect::intersects ( const NormalizedRect *  other) const

This is an overloaded member function, provided for convenience.

It behaves essentially like the above function.

Definition at line 166 of file area.cpp.

bool NormalizedRect::intersects ( double  left,
double  top,
double  right,
double  bottom 
) const

Returns whether the normalized rectangle intersects an other normalized rectangle, which is defined by left, top, right and bottom.

Definition at line 171 of file area.cpp.

bool Okular::NormalizedRect::isBottom ( const NormalizedPoint &  pt) const
inline

Returns true if the point pt is located to the bottom of the rectangle.

Since
0.14 (KDE 4.8)

Definition at line 231 of file area.h.

bool Okular::NormalizedRect::isBottomOrLevel ( const NormalizedPoint &  pt) const
inline

Returns true if the point pt is located under the top of the rectangle.

Since
0.14 (KDE 4.8)

Definition at line 249 of file area.h.

bool Okular::NormalizedRect::isLeft ( const NormalizedPoint &  pt) const
inline

Returns true if the point pt is located to the right of the left arm of rectangle.

Since
0.14 (KDE 4.8)

Definition at line 267 of file area.h.

bool NormalizedRect::isNull ( ) const

Returns whether this normalized rectangle is a null normalized rect.

Definition at line 151 of file area.cpp.

bool Okular::NormalizedRect::isRight ( const NormalizedPoint &  pt) const
inline

Returns true if the point pt is located to the left of the right arm of rectangle.

Since
0.14 (KDE 4.8)

Definition at line 276 of file area.h.

bool Okular::NormalizedRect::isTop ( const NormalizedPoint &  pt) const
inline

Returns true if the point pt is located on the top of the rectangle.

Since
0.14 (KDE 4.8)

Definition at line 240 of file area.h.

bool Okular::NormalizedRect::isTopOrLevel ( const NormalizedPoint &  pt) const
inline

Returns true if the point pt is located above the bottom of the rectangle.

Since
0.14 (KDE 4.8)

Definition at line 258 of file area.h.

NormalizedRect NormalizedRect::operator& ( const NormalizedRect &  other) const

Returns the intersection of this normalized rectangle with the specified other.

If the rects do not intersect then the result is null.

Since
0.7 (KDE 4.1)

Definition at line 196 of file area.cpp.

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

Definition at line 209 of file area.cpp.

bool NormalizedRect::operator== ( const NormalizedRect &  other) const

Returns whether the normalized rectangle is equal to the other normalized rectangle.

Definition at line 218 of file area.cpp.

NormalizedRect NormalizedRect::operator| ( const NormalizedRect &  other) const

Returns the normalized bounding rectangle of the normalized rectangle combined with the other normalized rectangle.

Definition at line 176 of file area.cpp.

NormalizedRect & NormalizedRect::operator|= ( const NormalizedRect &  other)

Sets the normalized rectangle to the normalized bounding rectangle of itself combined with the other normalized rectangle.

Definition at line 187 of file area.cpp.

QRect NormalizedRect::roundedGeometry ( int  xScale,
int  yScale 
) const

Same functionality as geometry, but the output is now rounded before typecasting to int.

Since
0.14 (KDE 4.8)

Definition at line 249 of file area.cpp.

void NormalizedRect::transform ( const QTransform &  matrix)

Transforms the normalized rectangle with the operations defined by matrix.

Definition at line 259 of file area.cpp.

Member Data Documentation

double Okular::NormalizedRect::bottom

The normalized bottom coordinate.

Definition at line 320 of file area.h.

double Okular::NormalizedRect::left

The normalized left coordinate.

Definition at line 305 of file area.h.

double Okular::NormalizedRect::right

The normalized right coordinate.

Definition at line 315 of file area.h.

double Okular::NormalizedRect::top

The normalized top coordinate.

Definition at line 310 of file area.h.


The documentation for this class was generated from the following files:
  • area.h
  • area.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal