# synfig::Distance Class Reference

`#include <distance.h>`

List of all members.

## Public Types

enum | System { SYSTEM_UNITS, SYSTEM_PIXELS, SYSTEM_POINTS, SYSTEM_INCHES, SYSTEM_METERS, SYSTEM_MILLIMETERS, SYSTEM_CENTIMETERS, SYSTEM_END }
typedef Real | value_type

## Public Member Functions

| Distance ()
| Distance (const value_type &value, System system)
| Distance (const synfig::String &string)
| operator Real () const
Distance & | operator= (const Real &rhs)
Distance & | operator= (const synfig::String &rhs)
synfig::String | get_string (int digits=4) const
const System & | get_system () const
const Real & | get () const
Real | get (System system, const RendDesc &rend_desc) const
void | convert (System system, const RendDesc &rend_desc)
Real | meters () const
Real | meters (const RendDesc &rend_desc) const
Real | units (const RendDesc &rend_desc) const
const Distance & | operator+= (const Distance &rhs)
const Distance & | operator-= (const Distance &rhs)
const Distance & | operator+= (const float &rhs)
const Distance & | operator-= (const float &rhs)
const Distance & | operator*= (const float &rhs)
const Distance & | operator/= (const float &rhs)

## Static Public Member Functions

static Real | meters_to_system (Real x, System target_system)
static System | ident_system (const synfig::String &str)
static synfig::String | system_name (System system)
static synfig::String | system_local_name (System system)

## Classes

class | BadSystem

## Member Typedef Documentation

typedef Real synfig::Distance::value_type

## Member Enumeration Documentation

enum synfig::Distance::System

Enumerator:

  SYSTEM_UNITS |
  SYSTEM_PIXELS |
  SYSTEM_POINTS |
  SYSTEM_INCHES |
  SYSTEM_METERS |
  SYSTEM_MILLIMETERS |
  SYSTEM_CENTIMETERS |
  SYSTEM_END | For internal use only.

## Constructor & Destructor Documentation

synfig::Distance::Distance | ( |  | ) | `[inline]`

synfig::Distance::Distance | ( | const value_type & | value,
|  | System | system |
| ) |  |  | `[inline]`

Distance::Distance | ( | const synfig::String & | string | ) | `[explicit]`

## Member Function Documentation

synfig::Distance::operator Real | ( |  | ) | const`[inline]`

Distance& synfig::Distance::operator= | ( | const Real & | rhs | ) | `[inline]`

Distance & Distance::operator= | ( | const synfig::String & | rhs | ) |

References synfig::error(), and ident_system().

synfig::String Distance::get_string | ( | int | digits = `4` | ) | const

References system_name().

const System& synfig::Distance::get_system | ( |  | ) | const`[inline]`

const Real& synfig::Distance::get | ( |  | ) | const`[inline]`

Real Distance::get | ( | Distance::System | target,
|  | const RendDesc & | rend_desc |
| ) |  |  | const

References synfig::RendDesc::get_x_res(), meters(), METERS_PER_UNIT, meters_to_system(), SYSTEM_PIXELS, SYSTEM_UNITS, and units().

void Distance::convert | ( | Distance::System | target,
|  | const RendDesc & | rend_desc |
| ) |  |  |

Real Distance::meters | ( |  | ) | const

References CENTIMETERS_PER_METER, INCHES_PER_METER, MILLIMETERS_PER_METER, POINTS_PER_METER, SYSTEM_CENTIMETERS, SYSTEM_INCHES, SYSTEM_METERS, SYSTEM_MILLIMETERS, and SYSTEM_POINTS.

Referenced by get(), meters(), operator+=(), operator-=(), and units().

Real Distance::meters | ( | const RendDesc & | rend_desc | ) | const

References synfig::RendDesc::get_x_res(), meters(), METERS_PER_UNIT, SYSTEM_PIXELS, and SYSTEM_UNITS.

Real Distance::units | ( | const RendDesc & | rend_desc | ) | const

References synfig::RendDesc::get_x_res(), meters(), METERS_PER_UNIT, SYSTEM_PIXELS, and SYSTEM_UNITS.

Referenced by get().

Real Distance::meters_to_system | ( | Real | x,
|  | System | target_system |
| ) |  |  | `[static]`

References CENTIMETERS_PER_METER, INCHES_PER_METER, MILLIMETERS_PER_METER, POINTS_PER_METER, SYSTEM_CENTIMETERS, SYSTEM_INCHES, SYSTEM_METERS, SYSTEM_MILLIMETERS, and SYSTEM_POINTS.

Referenced by get(), operator+=(), and operator-=().

Distance::System Distance::ident_system | ( | const synfig::String & | str | ) | `[static]`

References SYSTEM_CENTIMETERS, SYSTEM_INCHES, SYSTEM_METERS, SYSTEM_MILLIMETERS, SYSTEM_PIXELS, SYSTEM_POINTS, SYSTEM_UNITS, and synfig::warning().

Referenced by operator=().

synfig::String Distance::system_name | ( | Distance::System | system | ) | `[static]`

References SYSTEM_CENTIMETERS, SYSTEM_INCHES, SYSTEM_METERS, SYSTEM_MILLIMETERS, SYSTEM_PIXELS, SYSTEM_POINTS, and SYSTEM_UNITS.

Referenced by get_string().

synfig::String Distance::system_local_name | ( | Distance::System | system | ) | `[static]`

References _, SYSTEM_CENTIMETERS, SYSTEM_INCHES, SYSTEM_METERS, SYSTEM_MILLIMETERS, SYSTEM_PIXELS, SYSTEM_POINTS, and SYSTEM_UNITS.

const Distance& synfig::Distance::operator+= | ( | const Distance & | rhs | ) | `[inline]`

References meters(), and meters_to_system().

const Distance& synfig::Distance::operator-= | ( | const Distance & | rhs | ) | `[inline]`

References meters(), and meters_to_system().

const Distance& synfig::Distance::operator+= | ( | const float & | rhs | ) | `[inline]`

const Distance& synfig::Distance::operator-= | ( | const float & | rhs | ) | `[inline]`

const Distance& synfig::Distance::operator*= | ( | const float & | rhs | ) | `[inline]`

const Distance& synfig::Distance::operator/= | ( | const float & | rhs | ) | `[inline]`

The documentation for this class was generated from the following files:

- distance.h
- distance.cpp