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

display
A pointer to a display structure returned by a successful XOpenDisplay call.

workstation
The resource identifier of the workstation.

dc_count
The number of device coordinate points.

dc_points
An 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

Invoke PEXMapDCToWC to map the device coordinate points to world coordinate points using the specified workstation.

This function checks each view in the workstation's current view table, which has an inverse, to see if it contains all the specified device coordinate points. (If the view transform has no inverse, it is not considered.) This function returns the index of the view with the highest view transformation input priority that contains all of the points. If no view contains all the points, then the view index 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) are not transformed nor returned, so the number of points returned may be less than the number sent.

PEXlib allocates memory for the return value. Invoke XFree to deallocate the memory.

Errors

BadPEXWorkstation
The specified workstation resource identifier is invalid.

See Also

For a list of PHIGS Workstation functions and related topics, see PHIGS Workstation.