GeoGen Development snapshot a3
Public Member Functions

GGen_Path Class Reference

List of all members.

Public Member Functions

 GGen_Path ()
void AddPoint (GGen_Point &point)
void AddPointByCoords (GGen_CoordOffset x, GGen_CoordOffset y)
void Clear ()
void Flip (GGen_CoordOffset origin_x, GGen_CoordOffset origin_y, GGen_Direction direction)
GGen_CoordOffset GetAverageX ()
GGen_CoordOffset GetAverageY ()
GGen_CoordOffset GetCenterX ()
GGen_CoordOffset GetCenterY ()
GGen_CoordOffset GetMaxX ()
GGen_CoordOffset GetMaxY ()
GGen_CoordOffset GetMinX ()
GGen_CoordOffset GetMinY ()
void InsertPoint (uint32 index, GGen_Point &point)
void InsertPointByCoords (uint32 index, GGen_CoordOffset x, GGen_CoordOffset y)
void Move (GGen_CoordOffset x, GGen_CoordOffset y)
void RemovePoint (uint32 index)
void Rotate (GGen_CoordOffset origin_x, GGen_CoordOffset origin_y, int32 angle)
void Scale (GGen_CoordOffset origin_x, GGen_CoordOffset origin_y, double ratio_x, double ratio_y)
void Shear (GGen_CoordOffset origin_x, GGen_CoordOffset origin_y, int32 horizontal_shear, int32 vertical_shear)
void Transform (GGen_CoordOffset origin_x, GGen_CoordOffset origin_y, double a11, double a12, double a21, double a22)

Detailed Description

GGen_Path represents a continuous linear sequence of GGen_Point objects.


Constructor & Destructor Documentation

GGen_Path::GGen_Path ( )

Creates a new empty Path object.


Member Function Documentation

void GGen_Path::AddPoint ( GGen_Point point)

Adds a point to the end of the path.

Parameters:
pointPoint to be added.
void GGen_Path::AddPointByCoords ( GGen_CoordOffset  x,
GGen_CoordOffset  y 
)

Adds a point to the end of the path.

Parameters:
xX coordinate of the point to be added.
yY coordinate of the point to be added.
void GGen_Path::Clear ( )

Removes all points from the path.

void GGen_Path::Flip ( GGen_CoordOffset  origin_x,
GGen_CoordOffset  origin_y,
GGen_Direction  direction 
)

Flips the path vertically or horizontally.

Parameters:
origin_xX coordinate of flip origin.
origin_yY coordinate of flip origin.
directionDirection along which is the flip performed.
GGen_CoordOffset GGen_Path::GetAverageX ( )

Returns X coordinate of path's center of mass.

Returns:
X coordinate of path's center of mass.
GGen_CoordOffset GGen_Path::GetAverageY ( )

Returns Y coordinate of path's center of mass.

Returns:
Y coordinate of path's center of mass.
GGen_CoordOffset GGen_Path::GetCenterX ( )

Returns X coordinate of path's unweighted center.

Returns:
X coordinate of path's unweighted center.
GGen_CoordOffset GGen_Path::GetCenterY ( )

Returns X coordinate of path's unweighted center.

Returns:
X coordinate of path's unweighted center.
GGen_CoordOffset GGen_Path::GetMaxX ( )

Returns X coordinate of the rightmost point in the path.

Returns:
X coordinate of the rightmost point in the path.
GGen_CoordOffset GGen_Path::GetMaxY ( )

Returns Y coordinate of the bottommost point in the path.

Returns:
Y coordinate of the bottommost point in the path.
GGen_CoordOffset GGen_Path::GetMinX ( )

Returns X coordinate of the leftmost point in the path.

Returns:
X coordinate of the leftmost point in the path.
GGen_CoordOffset GGen_Path::GetMinY ( )

Returns Y coordinate of the topmost point in the path.

Returns:
Y coordinate of the topmost point in the path.
void GGen_Path::InsertPoint ( uint32  index,
GGen_Point point 
)

Inserts a point into specific place in the path.

Parameters:
indexIndex of the point, after which the new point is inserted (starting at 0).
pointPoint to be added.
void GGen_Path::InsertPointByCoords ( uint32  index,
GGen_CoordOffset  x,
GGen_CoordOffset  y 
)

Inserts a point into specific place in the path.

Parameters:
indexIndex of the point, after which the new point is inserted (starting at 0).
xX coordinate of the point to be added.
yY coordinate of the point to be added.
void GGen_Path::Move ( GGen_CoordOffset  x,
GGen_CoordOffset  y 
)

Moves all points in the path by an offset.

Parameters:
xX offset.
yY offset.
void GGen_Path::RemovePoint ( uint32  index)

Removes a single point from the path.

Parameters:
indexIndex of the point to be removed (starting at 0).
void GGen_Path::Rotate ( GGen_CoordOffset  origin_x,
GGen_CoordOffset  origin_y,
int32  angle 
)

Rotates whole path around a point.

Parameters:
origin_xX coordinate of the point around which is the rotation performed.
origin_yY coordinate of the point around which is the rotation performed.
angleRotation angle in degrees.
void GGen_Path::Scale ( GGen_CoordOffset  origin_x,
GGen_CoordOffset  origin_y,
double  ratio_x,
double  ratio_y 
)

Scales the path.

Parameters:
origin_xX coordinate of scale origin.
origin_yY coordinate of scale origin.
ratio_xHorizontal scale ratio.
ratio_yVertical scale ratio
void GGen_Path::Shear ( GGen_CoordOffset  origin_x,
GGen_CoordOffset  origin_y,
int32  horizontal_shear,
int32  vertical_shear 
)

Shears the path vertically and/or horizontally.

Parameters:
origin_xX coordinate of shear origin.
origin_yY coordinate of shear origin.
horizontal_shearHorizontal shear factor (0 means no horizontal shearing).
vertical_shearHorizontal shear factor (1 means no horizontal shearing).
void GGen_Path::Transform ( GGen_CoordOffset  origin_x,
GGen_CoordOffset  origin_y,
double  a11,
double  a12,
double  a21,
double  a22 
)

Applies a linear transformation matrix onto the path.

Parameters:
origin_xX coordinate of the transformation origin.
origin_yY coordinate of the transformation origin.
a11Matrix element (1,1).
a12Matrix element (1,2).
a21Matrix element (2,1).
a22Matrix element (2,2).
Note:
Unlike with GGen_Data_2D, this operation is lossless (unless the matrix is degenerate).

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