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

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

#include <Geometry.h>

Public Member Functions

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

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. More...
 
static double distancePtSeg (const point &pt, const point &A, const point &B)
 Return distance between point pt and segment A-B. More...
 
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. More...
 
static std::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

§ Edge() [1/4]

constexpr gnash::Edge::Edge ( )
inline

§ Edge() [2/4]

constexpr gnash::Edge::Edge ( std::int32_t  cx,
std::int32_t  cy,
std::int32_t  ax,
std::int32_t  ay 
)
inline

§ Edge() [3/4]

constexpr gnash::Edge::Edge ( const Edge from)
inline

§ Edge() [4/4]

constexpr gnash::Edge::Edge ( const point ncp,
const point nap 
)
inline

Member Function Documentation

§ distancePtSeg()

static double gnash::Edge::distancePtSeg ( const point pt,
const point A,
const point B 
)
inlinestatic

Return distance between point pt and segment A-B.

References squareDistancePtSeg().

§ pointOnCurve()

static point gnash::Edge::pointOnCurve ( const point A,
const point C,
const point B,
float  t 
)
inlinestatic

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

Parameters
AThe first point
CThe second point (control point)
BThe third point (anchor point)
Returns
The point.
Parameters
tthe step factor between 0 and 1

References gnash::key::R.

Referenced by squareDistancePtCurve().

§ squareDistancePtCurve()

static std::int64_t gnash::Edge::squareDistancePtCurve ( const point A,
const point C,
const point B,
const point p,
float  t 
)
inlinestatic

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

Parameters
AThe first point of the bezier curve
CThe second point of the bezier curve (control point)
BThe third point of the bezier curve (anchor point)
pThe point we want to compute distance from
tthe step factor between 0 and 1

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

§ squareDistancePtSeg()

static double gnash::Edge::squareDistancePtSeg ( const point p,
const point A,
const point B 
)
inlinestatic

Return squared distance between point pt and segment A-B.

References gnash::geometry::Point2d::squareDistance(), gnash::key::u, gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.

Referenced by distancePtSeg().

§ straight()

bool gnash::Edge::straight ( ) const
inline

§ transform()

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

Transform the edge according to the given SWFMatrix.

References gnash::SWFMatrix::transform().

Member Data Documentation

§ ap

point gnash::Edge::ap

§ cp

point gnash::Edge::cp

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