okular
Okular::NormalizedPoint Class Reference
#include <area.h>
Public Member Functions | |
NormalizedPoint () | |
NormalizedPoint (double x, double y) | |
NormalizedPoint (int x, int y, int xScale, int yScale) | |
double | distanceSqr (double x, double y, double xScale, double yScale) const |
NormalizedPoint & | operator= (const NormalizedPoint &) |
void | transform (const QTransform &matrix) |
Static Public Member Functions | |
static double | distanceSqr (double x, double y, double xScale, double yScale, const NormalizedPoint &start, const NormalizedPoint &end) |
Public Attributes | |
double | x |
double | y |
Detailed Description
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Normalized means that the coordinates are between 0 and 1 so that it is page size independent.
Example: The normalized point is (0.5, 0.3)
If you want to draw it on a 800x600 page, just multiply the x coordinate (0.5) with the page width (800) and the y coordinate (0.3) with the page height (600), so the point will be drawn on the page at (400, 180).
That allows you to zoom the page by just multiplying the normalized points with the zoomed page size.
Constructor & Destructor Documentation
NormalizedPoint::NormalizedPoint | ( | ) |
NormalizedPoint::NormalizedPoint | ( | double | x, |
double | y | ||
) |
NormalizedPoint::NormalizedPoint | ( | int | x, |
int | y, | ||
int | xScale, | ||
int | yScale | ||
) |
Member Function Documentation
double NormalizedPoint::distanceSqr | ( | double | x, |
double | y, | ||
double | xScale, | ||
double | yScale | ||
) | const |
|
static |
NormalizedPoint & NormalizedPoint::operator= | ( | const NormalizedPoint & | p | ) |
void NormalizedPoint::transform | ( | const QTransform & | matrix | ) |
Member Data Documentation
double Okular::NormalizedPoint::x |
double Okular::NormalizedPoint::y |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.