• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

Length Class Reference

Represents a phyical length. More...

#include <length.h>

List of all members.


Public Member Functions

double getLength_in_bigPoints () const
double getLength_in_cicero () const
double getLength_in_cm () const
double getLength_in_didot () const
double getLength_in_inch () const
double getLength_in_m () const
double getLength_in_mm () const
double getLength_in_pica () const
double getLength_in_scaledPoints () const
double getLength_in_TeXPoints () const
bool isNearlyEqual (const Length &o) const
 Length ()
Length operator* (const double l) const
Length operator+ (const Length &o) const
Length operator- (const Length &o) const
Length operator/ (const double l) const
double operator/ (const Length &o) const
bool operator< (const Length &o) const
bool operator<= (const Length &o) const
bool operator> (const Length &o) const
bool operator>= (const Length &o) const
void setLength_in_bigPoints (double l)
void setLength_in_cicero (double l)
void setLength_in_cm (double l)
void setLength_in_didot (double l)
void setLength_in_inch (double l)
void setLength_in_m (double l)
void setLength_in_mm (double l)
void setLength_in_pica (double l)
void setLength_in_scaledPoints (double l)
void setLength_in_TeXPoints (double l)

Detailed Description

Represents a phyical length.

This class is used to represent a physical length. Its main purpose it to help in the conversion of units, and to avoid confusion about units. To avoid misunderstandings, there is no default constructor so that this class needs to be explicitly initialized with one of the functions below.

Warning:
Lengths are stored internally in mm. If you convert to or from any other unit, expect floating point round-off errors.
Author:
Stefan Kebekus <kebekus@kde.org>
Version:
1.0.0

Definition at line 41 of file length.h.


Constructor & Destructor Documentation

Length::Length (  )  [inline]

constructs a 'length = 0mm' object

Definition at line 45 of file length.h.


Member Function Documentation

double Length::getLength_in_bigPoints (  )  const [inline]

returns the length in big points (1/72 of an inch)

Definition at line 94 of file length.h.

double Length::getLength_in_cicero (  )  const [inline]

returns the length in ciceros (0.178 inches)

Definition at line 103 of file length.h.

double Length::getLength_in_cm (  )  const [inline]

returns the length in centimeters

Definition at line 82 of file length.h.

double Length::getLength_in_didot (  )  const [inline]

returns the length in didots (0.0148 inches)

Definition at line 100 of file length.h.

double Length::getLength_in_inch (  )  const [inline]

returns the length in inches

Definition at line 88 of file length.h.

double Length::getLength_in_m (  )  const [inline]

returns the length in meters

Definition at line 85 of file length.h.

double Length::getLength_in_mm (  )  const [inline]

returns the length in millimeters

Definition at line 79 of file length.h.

double Length::getLength_in_pica (  )  const [inline]

returns the length in picas (1/6 of an inch)

Definition at line 97 of file length.h.

double Length::getLength_in_scaledPoints (  )  const [inline]

returns the length in scaled points (1 scaled point = 65536 TeX points)

Definition at line 106 of file length.h.

double Length::getLength_in_TeXPoints (  )  const [inline]

returns the length in TeX points

Definition at line 91 of file length.h.

bool Length::isNearlyEqual ( const Length &  o  )  const [inline]

returns true is lengths differ by no more than 2mm

Definition at line 109 of file length.h.

Length Length::operator* ( const double  l  )  const [inline]

Multiplication of a length.

Returns:
a multiplied length as a Length

Definition at line 155 of file length.h.

Length Length::operator+ ( const Length &  o  )  const [inline]

Sum of two lengthes.

Returns:
the sum of the lengthes as a Length

Definition at line 133 of file length.h.

Length Length::operator- ( const Length &  o  )  const [inline]

Difference of two lengthes.

Returns:
the difference of the lengthes as a Length

Definition at line 139 of file length.h.

Length Length::operator/ ( const double  l  )  const [inline]

Division of a length.

Warning:
There is no safeguared to prevent you from division by zero. If the number in the denominator is near 0.0, a floating point exception may occur.
Returns:
a fraction of the original length as a Length

Definition at line 149 of file length.h.

double Length::operator/ ( const Length &  o  )  const [inline]

Ratio of two lengthes.

Warning:
There is no safeguared to prevent you from division by zero. If the length in the denominator is near 0.0, a floating point exception may occur.
Returns:
the ratio of the two lengthes as a double

Definition at line 127 of file length.h.

bool Length::operator< ( const Length &  o  )  const [inline]

Definition at line 113 of file length.h.

bool Length::operator<= ( const Length &  o  )  const [inline]

Definition at line 117 of file length.h.

bool Length::operator> ( const Length &  o  )  const [inline]

Comparison of two lengthes.

Definition at line 112 of file length.h.

bool Length::operator>= ( const Length &  o  )  const [inline]

Comparison of two lengthes.

Definition at line 116 of file length.h.

void Length::setLength_in_bigPoints ( double  l  )  [inline]

sets the length in big points (1/72 of an inch)

Definition at line 63 of file length.h.

void Length::setLength_in_cicero ( double  l  )  [inline]

sets the length in ciceros (0.178 inches)

Definition at line 72 of file length.h.

void Length::setLength_in_cm ( double  l  )  [inline]

sets the length in centimeters

Definition at line 51 of file length.h.

void Length::setLength_in_didot ( double  l  )  [inline]

sets the length in didots (0.0148 inches)

Definition at line 69 of file length.h.

void Length::setLength_in_inch ( double  l  )  [inline]

sets the length in inches

Definition at line 57 of file length.h.

void Length::setLength_in_m ( double  l  )  [inline]

sets the length in meters

Definition at line 54 of file length.h.

void Length::setLength_in_mm ( double  l  )  [inline]

sets the length in millimeters

Definition at line 48 of file length.h.

void Length::setLength_in_pica ( double  l  )  [inline]

sets the length in picas (1/6 of an inch)

Definition at line 66 of file length.h.

void Length::setLength_in_scaledPoints ( double  l  )  [inline]

sets the length in scaled points (1 scaled point = 65536 TeX points)

Definition at line 75 of file length.h.

void Length::setLength_in_TeXPoints ( double  l  )  [inline]

sets the length in TeX points

Definition at line 60 of file length.h.


The documentation for this class was generated from the following file:
  • length.h

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal