Public Member Functions | Static Public Member Functions | Public Attributes

gnash::geometry::Point2d Class Reference

2D Point class More...

#include <Point2d.h>

List of all members.

Public Member Functions

 Point2d ()
 Construct a Point2d with default x and y coordinates.
 Point2d (boost::int32_t cx, boost::int32_t cy)
 Construct a Point2d with given x and y ordinates.
 Point2d (const Point2d &p0, const Point2d &p1, float t)
 Construct a Point2d as an interpolation of the given input points.
Point2dsetTo (const boost::int32_t cx, const boost::int32_t cy)
 Set coordinates to given values.
Point2dsetTo (const Point2d &p0, const Point2d &p1, float t)
 Set coordinates to the ones of the interpolation between the given input points.
boost::int64_t squareDistance (const Point2d &p) const
 Return square distance between this and the given point.
boost::int32_t distance (const Point2d &p) const
 Return distance between this and the given point.
bool operator== (const Point2d &p) const
bool operator!= (const Point2d &p) const

Static Public Member Functions

static boost::int64_t squareDistance (const Point2d &p0, const Point2d &p1)
 Return square distance between two given points.

Public Attributes

boost::int32_t x
 The x coordinate.
boost::int32_t y
 The y coordinate.

Detailed Description

2D Point class

A point which contains a x and a y coorinate in TWIPS.


Constructor & Destructor Documentation

gnash::geometry::Point2d::Point2d (  )  [inline]

Construct a Point2d with default x and y coordinates.

gnash::geometry::Point2d::Point2d ( boost::int32_t  cx,
boost::int32_t  cy 
) [inline]

Construct a Point2d with given x and y ordinates.

gnash::geometry::Point2d::Point2d ( const Point2d p0,
const Point2d p1,
float  t 
) [inline]

Construct a Point2d as an interpolation of the given input points.

Parameters:
p0 first point
p1 second point
t interpolation factor, between 0 and 1

Member Function Documentation

boost::int32_t gnash::geometry::Point2d::distance ( const Point2d p  )  const [inline]

Return distance between this and the given point.

References squareDistance().

Referenced by main(), and gnash::trace_curve().

bool gnash::geometry::Point2d::operator!= ( const Point2d p  )  const [inline]
bool gnash::geometry::Point2d::operator== ( const Point2d p  )  const [inline]

References x, and y.

Point2d& gnash::geometry::Point2d::setTo ( const Point2d p0,
const Point2d p1,
float  t 
) [inline]

Set coordinates to the ones of the interpolation between the given input points.

Parameters:
p0 first point
p1 second point
t interpolation factor, between 0 and 1
Returns:
a reference to this instance

References x, and y.

Point2d& gnash::geometry::Point2d::setTo ( const boost::int32_t  cx,
const boost::int32_t  cy 
) [inline]

Set coordinates to given values.

Returns:
a reference to this instance

References x, and y.

Referenced by main(), and gnash::Path::withinSquareDistance().

static boost::int64_t gnash::geometry::Point2d::squareDistance ( const Point2d p0,
const Point2d p1 
) [inline, static]

Return square distance between two given points.

References x, and y.

Referenced by distance(), main(), squareDistance(), gnash::Edge::squareDistancePtCurve(), and gnash::Edge::squareDistancePtSeg().

boost::int64_t gnash::geometry::Point2d::squareDistance ( const Point2d p  )  const [inline]

Return square distance between this and the given point.

References squareDistance().


Member Data Documentation


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