wxArt2D
Public Member Functions | Public Attributes | List of all members

Arc Segment in a2dVertexList. More...

#include <polyver.h>

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

Public Member Functions

 a2dArcSegment (double x1=0, double y1=0, double x2=0, double y2=0)
 create arc segment More...
 
 a2dArcSegment (const a2dLineSegment &prev, double xc, double yc, double angle)
 create arc segment More...
 
 a2dArcSegment (const a2dLineSegment &prev, double xc, double yc, double x1, double y1, double x2, double y2)
 create arc segment More...
 
 a2dArcSegment (const a2dArcSegment &other)
 copy constructor
 
 ~a2dArcSegment ()
 destructor
 
virtual a2dLineSegmentClone ()
 create exact copy
 
bool CalcR (const a2dLineSegment &prev, double &radius, double &center_x, double &center_y, double &beginrad, double &midrad, double &endrad, double &phit) const
 Calculation of center for the Arc. More...
 
virtual double Length (const a2dLineSegment &prev)
 calculate length
 
void CalcMidPoint (const a2dLineSegment &prev, double center_x, double center_y, double radius, bool clockwise)
 calculate new mid point bsed on prev segment radius and center. More...
 
a2dPoint2D GetMidPoint () const
 get middle on arc segment between end and start
 
void SetMidPoint (const a2dLineSegment &prev, double xm, double ym)
 set middle point of arc segment More...
 
double GetOx (const a2dLineSegment &prev) const
 Get origin X of arc.
 
double GetOy (const a2dLineSegment &prev) const
 Get origin Y of arc.
 
a2dPoint2D GetOrigin (const a2dLineSegment &prev) const
 Get origin of arc.
 
a2dBoundingBox GetBbox (const a2dLineSegment &prev, const a2dAffineMatrix &lworld=a2dIDENTITY_MATRIX) const
 Get bounding box of arc.
 
- Public Member Functions inherited from a2dLineSegment
 a2dLineSegment (double x=0, double y=0)
 constructor More...
 
 a2dLineSegment (const a2dPoint2D &point)
 
 a2dLineSegment (const a2dLineSegment &other)
 
bool GetArc () const
 
int GetPointCount () const
 
bool GetBin () const
 
void SetBin (bool bin)
 
a2dPoint2D GetPoint ()
 
void SetPoint (a2dPoint2D pos)
 
void SetSegType (a2dSegType type)
 Set the type of the segment.
 
a2dSegType GetSegType ()
 get the type of the segment
 
virtual a2dBoundingBox GetBbox (const a2dLineSegment &prev, const a2dAffineMatrix &lworld=a2dIDENTITY_MATRIX)
 

Public Attributes

double m_x2
 x2 x of arc midpoint
 
double m_y2
 y2 y of arc midpoint
 
- Public Attributes inherited from a2dLineSegment
double m_x
 x endpoint of line
 
double m_y
 y endpoint of line
 
bool m_bin: 1
 Marker for walking over the segments.
 
bool m_arc: 1
 arc segment
 
unsigned int m_pntCnt: 2
 
a2dSegType m_segtype: 3
 type of segment
 

Detailed Description

Arc Segment in a2dVertexList.

Create an circular Arc segment. From the previous segment to this segment position, create an arc passing through a thrid point. The Third point defines the Arc segment going clockwise or anticlockwise from begin to end point.

Definition at line 371 of file polyver.h.

Constructor & Destructor Documentation

a2dArcSegment::a2dArcSegment ( double  x1 = 0,
double  y1 = 0,
double  x2 = 0,
double  y2 = 0 
)

create arc segment

Begin point of arc is position/endpoint of previous segment

Parameters
x1x of arc endpoint
y1y of arc endpoint
x2x of arc midpoint
y2y of arc midpoint

Definition at line 302 of file polyver.cpp.

a2dArcSegment::a2dArcSegment ( const a2dLineSegment prev,
double  xc,
double  yc,
double  angle 
)

create arc segment

Begin point of arc is position/endpoint of previous segment

Parameters
prevprevious segment
xcx of arc center
ycy of arc center
angleangle of arc in degrees relative from the previous segment endpoint (negatif for clockwise)

Definition at line 310 of file polyver.cpp.

a2dArcSegment::a2dArcSegment ( const a2dLineSegment prev,
double  xc,
double  yc,
double  x1,
double  y1,
double  x2,
double  y2 
)

create arc segment

Begin point of arc is position/endpoint of previous segment

Parameters
prevprevious segment
xcx of arc center
ycy of arc center
x1x of arc endpoint
y1y of arc endpoint
x2x (xc,yc) ( x2,y2) define a line which the arc will cross
y2y (xc,yc) ( x2,y2) define a line which the arc will cross
Remarks
radius is defined by prev segment endpoint and (xc,yc), x1,y1 is adjusted to fit radius.

Definition at line 328 of file polyver.cpp.

Member Function Documentation

void a2dArcSegment::CalcMidPoint ( const a2dLineSegment prev,
double  center_x,
double  center_y,
double  radius,
bool  clockwise 
)

calculate new mid point bsed on prev segment radius and center.

Parameters
prevthe previous segment, to get start point of arc.
radiusradius of the circle calculated
center_xx of the center calculated
center_yy of the center calculated
clockwiseif true a clockwise arc segment is assumed for creating the mid point

Definition at line 389 of file polyver.cpp.

bool a2dArcSegment::CalcR ( const a2dLineSegment prev,
double &  radius,
double &  center_x,
double &  center_y,
double &  beginrad,
double &  midrad,
double &  endrad,
double &  phit 
) const

Calculation of center for the Arc.

output :

Parameters
prevthe previous segment, to get start point of arc.
radiusradius of the circle calculated
center_xx of the center calculated
center_yy of the center calculated
beginradcalculated starting angle in radians
midradcalculated middle angle in radians
endradcalculated end angle in radians
phittotal calculated in radians (AntiClockwise positif, else negatif )
Returns
true if the arc is indeed an Arc if a straight line return false.

Definition at line 411 of file polyver.cpp.

void a2dArcSegment::SetMidPoint ( const a2dLineSegment prev,
double  xm,
double  ym 
)

set middle point of arc segment

Parameters
prevthe previous segment, to get start point of arc.
xmx of middle point
ymy of middle point

Definition at line 362 of file polyver.cpp.


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