PEXMapDCToWC(3) — Subroutines
Name
PEXMapDCToWC - Map Device Coordinate Points to World Coordinate Points
Synopsis
Status PEXMapDCToWC(Display ∗display, PEXWorkstation workstation, unsigned long dc_count, PEXDeviceCoord ∗dc_points, unsigned int ∗view_index_return, unsigned long ∗wc_count_return, PEXCoord ∗∗wc_points_return)
Arguments
displayA pointer to a display structure returned by a successful XOpenDisplay call.
workstationThe resource identifier of the workstation.
dc_countThe number of device coordinate points.
dc_pointsAn array of device coordinates.
view_index_return
Returns the view index of the view containing most or all of the points.
wc_count_return
Returns the number of world coordinate points.
wc_points_return
Returns an array of world coordinate points.
Returns
Zero if unsuccessful, non-zero otherwise.
Description
This function maps the device coordinate points to world coordinate points using the specified workstation. Each view in the workstation’s current view table, which has an inverse, is checked to see if it contains all the specified device coordinate points. (If the view transform has no inverse, it is not considered.) The index of the view with the highest view transformation input priority that contains all of the points is returned. If no view contains all the points, the index of the view containing the most points is returned. The points are transformed to world coordinates by passing them through the inverse of the view transform associated with the view index. Points that are clipped (outside the viewport) will not be transformed and returned, so the number of points returned may be less than the number sent.
PEXlib allocates memory for the return value. XFree should be called to deallocate the memory.
Data Structures
typedef XID PEXWorkstation;
typedef struct {
short x;
short y;
float z;
} PEXDeviceCoord;
typedef struct {
float x;
float y;
float z;
} PEXCoord;
Errors
BadPEXWorkstation
The specified workstation resource identifier is invalid.
See Also
PEXMapWCToDC, PEXSetWorkstationViewPriority