Detailed Description

Helper class for generating stroke paths.

Inheritance diagram for Loonim.StrokePath:
Blaze.PointReceiverStepped Loonim.StrokePathMesh

Public Member Functions

void Generate (VectorPath path)
 Generates a stroke now using these settings. Note that the given path may be modified. More...
 
void MoveTo (float x, float y)
 
void AddPoint (float x, float y, float c)
 

Public Attributes

float Accuracy =1f
 The curve sampling accuracy (in terms of pixels). More...
 
int LineCapMode
 The line cap mode. More...
 
int LineJoinMode
 The line join mode. More...
 
float Width
 The width of the stroke. More...
 
float MiterLimit =4f
 The miter limit. More...
 
CurveSampler WidthFunction
 A width function. Varies the width of the stroke (between 1 and 0). It's multiplied by Width. More...
 

Protected Member Functions

virtual void StartMesh (bool closed, int lineCount)
 Called when we're starting to emit a mesh. More...
 
virtual void EmitLine (StrokePoint inner, StrokePoint outer)
 Called when we're emitting a line segment. More...
 
virtual void EndMesh ()
 Called when we're done emitting a mesh. More...
 

Properties

bool IncludeFirstNode [get]
 
float SampleDistance [get, set]
 
- Properties inherited from Blaze.PointReceiverStepped
bool IncludeFirstNode [get]
 
float SampleDistance [get, set]
 

Private Member Functions

void CompleteContour (bool closed)
 Called when a contour is completed. More...
 
void DrawCircle (List< StrokePoint > set, ref int count, float angle, float pX, float pY, float c, Vector2 center)
 Adds points to the given set for a circle of the given angle, starting at a point about a center. More...
 

Private Attributes

VectorLine CurrentLine
 The current line. More...
 
float OuterLength
 The current line length used when computing UV's. More...
 
float InnerLength
 The current line length used when computing UV's. More...
 
int InnerCount
 The number of verts on the inner edge. Not necessarily equal to InnerSet.Count. More...
 
int OuterCount
 The number of verts on the outer edge. Not necessarily equal to OuterSet.Count. More...
 
bool Outer =false
 True if we're sampling the outer curve. More...
 
bool ApplyLineJoinNow
 True when we just started a new line. Used to detect when to apply linejoin. More...
 
Vector2 EndNormal
 The end normal of the current line. Used to detect where to apply linejoin. More...
 
Vector2 StartNormal
 The start normal of the current line. Used to detect where to apply linejoin. More...
 
bool AtLeastOneLine
 True when we've seen at least one line on this contour.</summray> More...
 
float MiterLength
 The computed miter length, after applying the miter limit. More...
 
Vector2 OriginalLinePoint
 Used during linejoin. More...
 
float LineAngle
 The angle between the two lines. Used by linejoin. More...
 
List< StrokePointOuterSet =new List<StrokePoint>()
 The computed set of verts. More...
 
List< StrokePointInnerSet =new List<StrokePoint>()
 The computed set of verts. More...
 

Member Function Documentation

void Loonim.StrokePath.AddPoint ( float  x,
float  y,
float  c 
)
inline
void Loonim.StrokePath.CompleteContour ( bool  closed)
inlineprivate

Called when a contour is completed.

void Loonim.StrokePath.DrawCircle ( List< StrokePoint set,
ref int  count,
float  angle,
float  pX,
float  pY,
float  c,
Vector2  center 
)
inlineprivate

Adds points to the given set for a circle of the given angle, starting at a point about a center.

virtual void Loonim.StrokePath.EmitLine ( StrokePoint  inner,
StrokePoint  outer 
)
inlineprotectedvirtual

Called when we're emitting a line segment.

Reimplemented in Loonim.StrokePathMesh.

virtual void Loonim.StrokePath.EndMesh ( )
inlineprotectedvirtual

Called when we're done emitting a mesh.

Reimplemented in Loonim.StrokePathMesh.

void Loonim.StrokePath.Generate ( VectorPath  path)
inline

Generates a stroke now using these settings. Note that the given path may be modified.

void Loonim.StrokePath.MoveTo ( float  x,
float  y 
)
inline
virtual void Loonim.StrokePath.StartMesh ( bool  closed,
int  lineCount 
)
inlineprotectedvirtual

Called when we're starting to emit a mesh.

Reimplemented in Loonim.StrokePathMesh.

Member Data Documentation

float Loonim.StrokePath.Accuracy =1f

The curve sampling accuracy (in terms of pixels).

bool Loonim.StrokePath.ApplyLineJoinNow
private

True when we just started a new line. Used to detect when to apply linejoin.

bool Loonim.StrokePath.AtLeastOneLine
private

True when we've seen at least one line on this contour.</summray>

VectorLine Loonim.StrokePath.CurrentLine
private

The current line.

Vector2 Loonim.StrokePath.EndNormal
private

The end normal of the current line. Used to detect where to apply linejoin.

int Loonim.StrokePath.InnerCount
private

The number of verts on the inner edge. Not necessarily equal to InnerSet.Count.

float Loonim.StrokePath.InnerLength
private

The current line length used when computing UV's.

List<StrokePoint> Loonim.StrokePath.InnerSet =new List<StrokePoint>()
private

The computed set of verts.

float Loonim.StrokePath.LineAngle
private

The angle between the two lines. Used by linejoin.

int Loonim.StrokePath.LineCapMode

The line cap mode.

int Loonim.StrokePath.LineJoinMode

The line join mode.

float Loonim.StrokePath.MiterLength
private

The computed miter length, after applying the miter limit.

float Loonim.StrokePath.MiterLimit =4f

The miter limit.

Vector2 Loonim.StrokePath.OriginalLinePoint
private

Used during linejoin.

bool Loonim.StrokePath.Outer =false
private

True if we're sampling the outer curve.

int Loonim.StrokePath.OuterCount
private

The number of verts on the outer edge. Not necessarily equal to OuterSet.Count.

float Loonim.StrokePath.OuterLength
private

The current line length used when computing UV's.

List<StrokePoint> Loonim.StrokePath.OuterSet =new List<StrokePoint>()
private

The computed set of verts.

Vector2 Loonim.StrokePath.StartNormal
private

The start normal of the current line. Used to detect where to apply linejoin.

float Loonim.StrokePath.Width

The width of the stroke.

CurveSampler Loonim.StrokePath.WidthFunction

A width function. Varies the width of the stroke (between 1 and 0). It's multiplied by Width.

Property Documentation

bool Loonim.StrokePath.IncludeFirstNode
get
float Loonim.StrokePath.SampleDistance
getset