PEXOCCSetCurveApprox - Set Curve Approximation Method (5.0)


Synopsis

 
     void PEXOCCSetCurveApprox(
          PEXOCC context,
          int method,
          double tolerance
     )
 

 
     void PEXSetCurveApprox(
          Display *display,
          XID resource_id,
          PEXOCRequestType req_type,
          int method,
          double tolerance
     )
 

Arguments

context
An OC context returned by a successful PEXCreateOCC call.

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

resource_id (OCC)
The resource identifier of the renderer or structure.

req_type (OCC)
The request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).

method
The curve approximation method (PEXApproxImpDep, PEXApproxConstantBetweenKnots, PEXApproxWCChordalSize, PEXApproxNPCChordalSize, PEXApproxDCChordalSize, PEXApproxWCChordalDev, PEXApproxNPCChordalDev, PEXApproxDCChordalDev, PEXApproxWCRelative, PEXApproxNPCRelative or PEXApproxDCRelative).

tolerance
The curve approximation tolerance (specific to each method).

Returns

None.

Description

Invoke PEXOCCSetCurveApprox to create an attribute output command which sets the curve approximation attribute in the renderer's pipeline state according to the value specified by method.

By setting the curve approximation attribute's ASF to PEXIndividual (see PEXOCCSetIndividualASF), you use the pipeline state's curve approximation entry to specify the smoothing method for the rendering of curved univariate primitives. When you set the curve approximation attribute's ASF to PEXBundled, the implementation uses the curve approximation method from the line bundle table.

PEXlib defines the following curve approximation methods (method) and the use of tolerance:

PEXApproxImpDep -
smooths the curve in an implementation-dependent way and ignores tolerance. (5.0)

PEXApproxConstantBetweenKnots -
segments the curve in equal parametric increments between successive pairs of knots. If there are no explicit knots, then the curve is treated as having a single knot. If the primitive is a circular or elliptical arc, then the circle or ellipse from which it is formed is considered to have a single knot. (5.0)

Tolerance controls the segmentation. If you specify a fraction for tolerance, then the implementation truncates it and only uses the integer portion. If you specify a tolerance that is less than or equal to zero, then the curve is evaluated only at the parameter limits and at the knots that are within the specified parameter range. If tolerance is greater than zero, then the curve is evaluated at the parameter limits, at the knots that are within the specified parameter range, and at the number of positions specified by tolerance between each pair of knots.

PEXApproxWCChordalSize -
segments the curve whereby the WC length of each segment (chord) is less than the tolerance (specified in world coordinates). (5.0)

PEXApproxNPCChordalSize -
segments the curve whereby the NPC length of each segment (chord) is less than the tolerance (specified in normalized projection coordinates). (5.0)

PEXApproxDCChordalSize -
segments the curve whereby the DC length of each segment (chord) is less than the tolerance (specified in device coordinates). (5.0)

PEXApproxWCChordalDev -
segments the curve whereby the deviation in WC's between the curve and its segmented representation does not exceed the tolerance (specified in world coordinates). (5.0)

PEXApproxNPCChordalDev -
segments the curve whereby the deviation in NPC's between the curve and its segmented representation does not exceed the tolerance (specified in normalized projection coordinates). (5.0)

PEXApproxDCChordalDev -
segments the curve whereby the deviation in DC's between the curve and its segmented representation does not exceed the tolerance (specified in device coordinates). (5.0)

PEXApproxWCRelative -
indicates, along with a tolerance value in the range [0.0, 1.0], a relative quality of rendering to be maintained independent of scaling in world coordinates (WC's). Specify a tolerance of 1.0 for the highest possible quality. (5.0)

PEXApproxNPCRelative -
indicates, along with a tolerance value in the range [0.0, 1.0], a relative quality of rendering to be maintained independent of scaling in normalized projection coordinates (NPC's). Specify a tolerance of 1.0 for the highest possible quality. (5.0)

PEXApproxDCRelative -
indicates, along with a tolerance value in the range [0.0, 1.0], a relative quality of rendering to be maintained independent of scaling in device coordinates (DC's). Specify a tolerance of 1.0 for the highest possible quality. (5.0)

If the implementation does not support the specified method, then the method defaults to PEXApproxImpDep. Inquire the supported values for the curve approximation by invoking the PEXGetEnumTypeInfo function.

Specify the tolerance argument to indicate the desired accuracy of the approximation. The curve approximation tolerance has different results depending on which method you specify. In general, specify a lower relative quality to smooth the curved univariate primitives at a higher speed. However, implementations may smooth the curves at a higher quality than you requested.

This function is a member of the curve attribute set and affects curved primitives.

Errors

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For an overview and for a list of output attribute functions, see Output Attribute Functions.