Public Member Functions | Static Public Member Functions | Public Attributes

gnash::Edge Class Reference

Defines an edge with a control point and an anchor point. More...

#include <Geometry.h>

Collaboration diagram for gnash::Edge:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Edge ()
 Edge (boost::int32_t cx, boost::int32_t cy, boost::int32_t ax, boost::int32_t ay)
 Edge (const Edge &from)
 Edge (const point &ncp, const point &nap)
bool straight () const
void transform (const SWFMatrix &mat)
 Transform the edge according to the given SWFMatrix.

Static Public Member Functions

static double squareDistancePtSeg (const point &p, const point &A, const point &B)
 Return squared distance between point pt and segment A-B.
static double distancePtSeg (const point &pt, const point &A, const point &B)
 Return distance between point pt and segment A-B.
static point pointOnCurve (const point &A, const point &C, const point &B, float t)
 Find point of the quadratic curve defined by points A,C,B.
static boost::int64_t squareDistancePtCurve (const point &A, const point &C, const point &B, const point &p, float t)

Public Attributes

point cp
point ap

Detailed Description

Defines an edge with a control point and an anchor point.

Could be a quadratic bezier curve, or a straight line(degenerated curve).


Constructor & Destructor Documentation

gnash::Edge::Edge (  )  [inline]
gnash::Edge::Edge ( boost::int32_t  cx,
boost::int32_t  cy,
boost::int32_t  ax,
boost::int32_t  ay 
) [inline]
gnash::Edge::Edge ( const Edge from  )  [inline]
gnash::Edge::Edge ( const point ncp,
const point nap 
) [inline]

Member Function Documentation

static double gnash::Edge::distancePtSeg ( const point pt,
const point A,
const point B 
) [inline, static]

Return distance between point pt and segment A-B.

References squareDistancePtSeg().

static point gnash::Edge::pointOnCurve ( const point A,
const point C,
const point B,
float  t 
) [inline, static]

Find point of the quadratic curve defined by points A,C,B.

Parameters:
A The first point
C The second point (control point)
B The third point (anchor point)
ret The point to write result into
t the step factor between 0 and 1

References gnash::key::R.

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

static boost::int64_t gnash::Edge::squareDistancePtCurve ( const point A,
const point C,
const point B,
const point p,
float  t 
) [inline, static]

Return square distance between point pt and the point on curve found by applying the T parameter to the quadratic bezier curve function

Parameters:
A The first point of the bezier curve
C The second point of the bezier curve (control point)
B The third point of the bezier curve (anchor point)
p The point we want to compute distance from
t the step factor between 0 and 1

References pointOnCurve(), and gnash::geometry::Point2d::squareDistance().

static double gnash::Edge::squareDistancePtSeg ( const point p,
const point A,
const point B 
) [inline, static]
bool gnash::Edge::straight (  )  const [inline]

References ap, and cp.

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

void gnash::Edge::transform ( const SWFMatrix mat  )  [inline]

Transform the edge according to the given SWFMatrix.

References ap, cp, and gnash::SWFMatrix::transform().


Member Data Documentation


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