Difference between revisions of "GrePolyFilletSharp"
(Created page with "GrePolyFilletSharp draws a sequence of one or more sharp fillets starting at the current (X,Y) position. This function can be hooked by the presentation driver. ;Simulatio...")
Revision as of 03:09, 16 January 2020
GrePolyFilletSharp draws a sequence of one or more sharp fillets starting at the current (X,Y) position.
This function can be hooked by the presentation driver.
- Simulation support
- This function is simulated by a handling routine in the graphics engine.
GrePolyFilletSharp(hdc, paptlPoint, cPoints, pfxSharp, pInstance, lFunction);
- hdc (HDC) - input
- Device context handle.
- paptlPoint (PPOINTL) - input
- Pointer to Coordinates array.
- An array of cPoints (X,Y) pairs where each group contains two pairs of (X,Y) coordinates for the control and end points of the fillets. If COM_TRANSFORM is not set, the function expects the points to be in screen coordinates.
- cPoints (LONG) - input
- Number of coordinate pairs.
- When this is passed as 0, it returns Successful.
- pfxSharp (PFIXED) - input
- Pointer to Sharpness array.
- An array of sharpness values with one element for each fillet. "Sharpness" is defined as a fixed-point value. The high-order WORD contains the integer portion; the low-order WORD contains the fractional portion. A value of 64KB gives a sharpness of 1.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGrePolyFilletSharp.
- rc (LONG) - returns
- Return codes.
- This function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected:
- GPI_OK Successful
- GPI_HITS Successful with correlate hit (returned by display drivers when the correlate flag is ON and a hit is detected)
- GPI_ERROR Error
- Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
- Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
#define INCL_GRE_ARCS #include <os2.h> HDC hdc; /* Device context handle. */ PPOINTL paptlPoint; /* Pointer to Coordinates array. */ LONG cPoints; /* Number of coordinate pairs. */ PFIXED pfxSharp; /* Pointer to Sharpness array. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGrePolyFilletSharp. */ LONG rc; /* Return codes. */ rc = GrePolyFilletSharp(hdc, paptlPoint, cPoints, pfxSharp, pInstance, lFunction);
As each fillet is drawn, the end point for the fillet becomes the start point for the next fillet. Upon completion, the current (X,Y) position is the end point of the last fillet. Each fillet is controlled by a set of coordinates for two connected lines and by a sharpness value. The fillet is tangential to the start point of the first line and to the end point of the second line.
The sharpness value is determined from:
Sharpness = WD/DB where: W is the mid-point of the line joining the end points B is the control point above the top of the fillet D is the point where the fillet intersects the line WC
Refer to the function "GpiPolyFillet" in the Presentation Manager Programming Reference for more information.