LibCapy - rulerandcompass

RulerAndCompass class.

Macros:

Size of the hash table in dictionaries of points, circles, and segments

Enumerations:

None.

Typedefs:

None.

Struct CapyRulerAndCompass :

Struct CapyRulerAndCompass's properties:

Pen for drawing

Size for drawing points (default: 0.0, points are not drawn if the radius is less than 1.0)

Dictionary of points

Dictionary of segments

Dictionary of circles

Struct CapyRulerAndCompass's methods:

Destructor

Add a segment to the geometry

Input argument(s):

label: label of the segment
pointA: the label of the first extremity of the segment
pointB: the label of the second extremity of the segment

Output and side effect(s):

Add the segment to the geometry

Add a circle to the geometry given two points

Input argument(s):

label: label of the circle
center: the label of the center of the circle
point: the label of a point on the circle

Output and side effect(s):

Add the circle to the geometry

Add a circle to the geometry given three points

Input argument(s):

label: label of the circle
center: the label of the center of the circle
pointA: the label of the first point defining the radius
pointB: the label of the second point defining the radius

Output and side effect(s):

Add the circle to the geometry

Add the point(s) of the intersection of two geometries

Input argument(s):

labelA: label of the first intersection
labelB: label of the second intersection
geomA: the label of the first geometry
geomB: the label of the second geometry

Output and side effect(s):

The point(s) at the intersection of the geometries are added. If there is no intersection nothing happens. If there is only one intersection 'labelB' is ignored. Return the number of intersection

Draw all the geometries

Input argument(s):

img: the image on which to draw

Output and side effect(s):

The geometries are drawn on 'img' using 'that->pen'.

Draw the requested geometry

Input argument(s):

img: the image on which to draw
lbl: the label of the geometry

Output and side effect(s):

The geometry 'lbl' are drawn on 'img' using 'that->pen'. If the label is not found nothing happens.

Draw an arc of a circle between two given points

Input argument(s):

img: the image on which to draw
lblCircle: the label of the circle
lblPointA: the label of the origin point
lblPointB: the label of the destination point

Output and side effect(s):

Draw the arc of the circle between the projection of the points on the circle, counter-clockwise. If the label are not found nothing happens.

Functions:

Create a CapyRulerAndCompass

Input argument(s):

pointA: the first initial point
pointB: the second initial point

Output and side effect(s):

Return a CapyRulerAndCompass with 'pointA' and 'pointB' as initial points for the geometry, respectively labeled 'a' and 'b'

Allocate memory for a new CapyRulerAndCompass and create it

Input argument(s):

pointA: the first initial point
pointB: the second initial point

Output and side effect(s):

Return a CapyRulerAndCompass with 'pointA' and 'pointB' as initial points for the geometry, respectively labeled 'a' and 'b'

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyRulerAndCompass* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyRulerAndCompass to free

2025-04-08
in LibCapy,
0 views
Copyright 2021-2025 Baillehache Pascal