wxArt2D
Public Member Functions | Public Attributes | List of all members
a2dVpathCBCurveSegment Class Reference

Cubic Bezier curve. More...

#include <polyver.h>

Inheritance diagram for a2dVpathCBCurveSegment:
Inheritance graph
[legend]
Collaboration diagram for a2dVpathCBCurveSegment:
Collaboration graph
[legend]

Public Member Functions

 a2dVpathCBCurveSegment (double x1, double y1, double x2, double y2, double x3, double y3, a2dPATHSEG type=a2dPATHSEG_CBCURVETO, a2dPATHSEG_END close=a2dPATHSEG_END_OPEN)
 constructor More...
 
 a2dVpathCBCurveSegment (a2dVpathSegmentPtr prev, double x1, double y1, double x3, double y3, a2dPATHSEG type=a2dPATHSEG_CBCURVETO, a2dPATHSEG_END close=a2dPATHSEG_END_OPEN)
 constructor More...
 
 a2dVpathCBCurveSegment (const a2dVpathCBCurveSegment &other)
 copy constructor
 
 ~a2dVpathCBCurveSegment ()
 destructor
 
virtual a2dVpathSegmentClone ()
 create exact copy
 
virtual double Length (a2dVpathSegmentPtr prev)
 calculate length
 
void PositionAt (a2dVpathSegmentPtr prev, double t, double &xt, double &yt)
 calculate position at t, used for length
 
- Public Member Functions inherited from a2dVpathSegment
 a2dVpathSegment (double x, double y, a2dPATHSEG type=a2dPATHSEG_LINETO, a2dPATHSEG_END close=a2dPATHSEG_END_OPEN)
 constructor More...
 
 a2dVpathSegment (const a2dVpathSegment &other)
 constructor
 
virtual ~a2dVpathSegment ()
 destructor
 
a2dPATHSEG GetType () const
 easy way to test type of segment
 
bool GetBin () const
 used in processing
 
void SetBin (bool bin)
 used in processing
 
a2dPATHSEG_END GetClose () const
 is this segment the closing a part since the last move
 
void SetClose (a2dPATHSEG_END close)
 set this segment is closing a part since the last move
 

Public Attributes

double m_x2
 control point 1
 
double m_y2
 control point 1
 
double m_x3
 control point 2
 
double m_y3
 control point 2
 
- Public Attributes inherited from a2dVpathSegment
double m_x1
 x endpoint of line
 
double m_y1
 y endpoint of line
 
bool m_bin: 1
 Marker for walking over the segments.
 
a2dPATHSEG m_type: 5
 easy way to test type of segment
 
a2dPATHSEG_END m_close: 3
 is the path closing here or not
 

Detailed Description

Cubic Bezier curve.

Create a curved segment based on Cubic Bezier spline let P0 be end point of previous segment let P1 be inbetween point of this segment (m_x2, m_y2) let P2 be second inbetween point of this segment (m_x3, m_y3) let P3 be end point of this segment (m_x1, m_y1)

Then the formula describing points on the curve are:

For ( 0 <= t <= 1 ) Point(t) = (1-t)^3*P0 + 3*t*(1-t)^2*P1 + 3*t^2*(1-t)*P2 + t^3*P3

Definition at line 1045 of file polyver.h.

Constructor & Destructor Documentation

a2dVpathCBCurveSegment::a2dVpathCBCurveSegment ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3,
a2dPATHSEG  type = a2dPATHSEG_CBCURVETO,
a2dPATHSEG_END  close = a2dPATHSEG_END_OPEN 
)

constructor

Parameters
x1endpoint of curve
y1endpoint of curve
x2first control point coming from previous segment in path
y2first control point coming from previous segment in path
x3second control point coming from previous segment in path
y3second control point coming from previous segment in path
typedraw or move towards point
closeif true close this path with the last move command/segment

Definition at line 3647 of file polyver.cpp.

a2dVpathCBCurveSegment::a2dVpathCBCurveSegment ( a2dVpathSegmentPtr  prev,
double  x1,
double  y1,
double  x3,
double  y3,
a2dPATHSEG  type = a2dPATHSEG_CBCURVETO,
a2dPATHSEG_END  close = a2dPATHSEG_END_OPEN 
)

constructor

Parameters
prevprevious segment
x1endpoint of curve
y1endpoint of curve
x3second control point coming from previous segment in path
y3second control point coming from previous segment in path
typedraw or move towards point
closeif true close this path with the last move command/segment
Remarks
x2 first control point is mirror of second control point of previous segment in path, if Cubic else last endpoint
y2 first control point is mirror of second control point of previous segment in path, if Cubic else last endpoint

Definition at line 3662 of file polyver.cpp.


The documentation for this class was generated from the following files:
a2dVpathCBCurveSegment Class Reference -- Sun Oct 12 2014 17:04:53 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation