Gnash  0.8.11dev
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
gnash::geometry::Point2d Class Reference

2D Point class More...

#include <Point2d.h>

Public Member Functions

 Point2d ()
 Construct a Point2d with default x and y coordinates. More...
 
 Point2d (boost::int32_t cx, boost::int32_t cy)
 Construct a Point2d with given x and y ordinates. More...
 
 Point2d (const Point2d &p0, const Point2d &p1, float t)
 Construct a Point2d as an interpolation of the given input points. More...
 
Point2dsetTo (const boost::int32_t cx, const boost::int32_t cy)
 Set coordinates to given values. More...
 
Point2dsetTo (const Point2d &p0, const Point2d &p1, float t)
 Set coordinates to the ones of the interpolation between the given input points. More...
 
boost::int64_t squareDistance (const Point2d &p) const
 Return square distance between this and the given point. More...
 
boost::int32_t distance (const Point2d &p) const
 Return distance between this and the given point. More...
 
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. More...
 

Public Attributes

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

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
p0first point
p1second point
tinterpolation 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 gnash::renderer::opengl::trace_curve().

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

References gnash::key::p.

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

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

Referenced by gnash::Path::withinSquareDistance().

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
p0first point
p1second point
tinterpolation factor, between 0 and 1
Returns
a reference to this instance

References gnash::key::t, x, and y.

static boost::int64_t gnash::geometry::Point2d::squareDistance ( const Point2d p0,
const Point2d p1 
)
inlinestatic

Return square distance between two given points.

References x, and y.

Referenced by distance(), 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

boost::int32_t gnash::geometry::Point2d::x
boost::int32_t gnash::geometry::Point2d::y

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