Basic geometric shape classes.
Macros:
Definition of the parent class for 2D geometric shapes Destructor void (*destruct)(void); Get the area of the geometry
Output and side effect(s):
Return the area double (*getArea)(void);
Convert the geometry into a Bezier spline
Output and side effect(s):
Return the Bezier spline approximating the geometry. CapyBezierSpline (*getBezierSpline)(void);
Enumerations:
None.
Typedefs:
Parent class for 2D geometric shapes
Struct CapyTriangleCorner :
Struct CapyTriangleCorner's properties:
Location of the corner
Struct CapyTriangleCorner's methods:
None.
Struct CapyTriangle :
Struct CapyTriangle's properties:
Inherits CapyGeometry2D
Array of three positions, the locations of the triangle's corners.
Struct CapyTriangle's methods:
Destructor
Struct CapyQuadrilateralCorner :
Struct CapyQuadrilateralCorner's properties:
Location of the corner
Struct CapyQuadrilateralCorner's methods:
None.
Struct CapyQuadrilateral :
Struct CapyQuadrilateral's properties:
Inherits CapyGeometry2D
Array of four positions, the location of the quadrilateral's corners, in clockwise order.
Struct CapyQuadrilateral's methods:
Destructor
Get the bilinear coordinates of a point in the quadirlateral from its coordinates in world coordinate system
Input argument(s):
pos: the position in world coordinate system
coords: double[2] updated with the bilinear coordinates
Struct CapyCircleCenter :
Struct CapyCircleCenter's properties:
Location of the center
Struct CapyCircleCenter's methods:
None.
Struct CapyCircle :
Struct CapyCircle's properties:
Inherits CapyGeometry2D
Center
Radius
Struct CapyCircle's methods:
Destructor
Functions:
Create a CapyGeometry2D
Output and side effect(s):
Return a CapyGeometry2D
Create a CapyTriangle
Output and side effect(s):
Return a CapyTriangle, corners initialised to ((0, 0), (0, 1), (1, 0))
Allocate memory for a new CapyTriangle and create it
Output and side effect(s):
Return a CapyTriangle, corners initialised to ((0, 0), (0, 1), (1, 0))
Exception(s):
May raise CapyExc_MallocFailed.
Free the memory used by a CapyTriangle* and reset '*that' to NULL
Input argument(s):
that: a pointer to the CapyTriangle to free
Create a CapyQuadrilateral
Output and side effect(s):
Return a CapyQuadrilateral, corners initialised to ((0, 0), (0, 1), (1, 1), (1, 0))
Allocate memory for a new CapyQuadrilateral and create it
Output and side effect(s):
Return a CapyQuadrilateral, corners initialised to ((0, 0), (0, 1), (1, 1), (1, 0))
Exception(s):
May raise CapyExc_MallocFailed.
Free the memory used by a CapyQuadrilateral* and reset '*that' to NULL
Input argument(s):
that: a pointer to the CapyQuadrilateral to free
Create a CapyCircle
Output and side effect(s):
Return a CapyCircle, center initialised to (0, 0) and radius initialised to 1.
Allocate memory for a new CapyCircle and create it
Output and side effect(s):
Return a CapyCircle, center initialised to (0, 0) and radius initialised to 1.
Exception(s):
May raise CapyExc_MallocFailed.
Free the memory used by a CapyCircle* and reset '*that' to NULL
Input argument(s):
that: a pointer to the CapyCircle to free