PEXOCCNURBCurve - Non-Uniform Rational B-spline Curve Primitive (5.0)


Synopsis

 
     void PEXOCCNURBCurve(
          PEXOCC context,
          unsigned int shape,
          PEXCurveGeometrySpline *curve,
          PEXCurveColorSpline *color_spline
     )
 

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).

shape
Hint indicating the geometrical shape of the curve.

curve
A pointer to a geometry spline data structure.

color_spline
A pointer to an optional color spline data structure.

Returns

None.

Description

Invoke PEXOCCNURBCurve to create a non-uniform B-spline curve primitive output command with or without an optional color spline. Depending on the attributes you supply, this function generates a PEXOCNURBCurve or PEXOCNURBCurveWithColor output command. Note that the PEXDataStride and PEXDataUnpacked data models are not supported in this function. You must specify all coordinate, knot and color data in contiguous lists.

Shape is a hint indicating the geometrical shape of the curve. PEXlib defines the following shape values: PEXNURBSHintUnknown which indicates that nothing is known about the shape of the curve. The implementation determines the hint itself. In addition, PEXlib defines PEXNURBSHintLine, PEXNURBSHintCircle, PEXNURBSHintCircularArc, PEXNURBSHintEllipse, PEXNURBSHintEllipticalArc, PEXNURBSHintParabolicArc, and PEXNURBSHintHyperbolicArc. If the specified shape does not match the curve, then the result is implementation-dependent.

Specify the curve itself with the PEXCurveGeometrySpline data structure. Specify the curve order as a positive number. Invoke the PEXGetImpDepConstants function to determine the largest supported value for curve order. Specify the spline shape by using a list of knots in the parametric coordinate space and a list of control points in modeling coordinates. The number of control points must be at least as large as the order. The number of knots is the sum of the curve order plus the number of control points. The sequence of knots must be non-decreasing, i.e. t(0) <= t(1) <=... <= t(k-1) where k is the number of knots.

If the rationality member is PEXRational, then your application must specify the control points in homogeneous (4D) modeling coordinates. PEXlib assumes that 4D modeling coordinates (x,y,z) have already been multiplied by the homogeneous coordinate (w). If rationality is PEXNonRational, then your application must specify the control points in non-homogeneous (3D) modeling coordinates.

Evaluation of the spline is restricted to a specific region in the parametric coordinate space. The parametric limits, tmin and tmax, specify the region in the parametric coordinate space over which the spline is to be evaluated (tmin must be less than tmax). The parametric bounds must also satisfy the restriction tmin >= t(order), tmax <= t(k+1-order).

If your implementation does not support the specified curve order, then the implementation stores the output primitive in a structure, but when rendering this primitive, there is no visual effect. The implementation ignores this primitive.

Also, the curve order must not be less than one.

If you do not supply a color spline, set the argument color_spline to NULL. Otherwise, supply a pointer to a PEXCurveColorSpline data structure to define the color distribution of the primitive's geometry. The color of any point on the primitive's geometry is determined by evaluating the color spline at the corresponding parametric value. The color spline does not have to have the same order, rationality, or knot sequence as the geometric curve. The parameter range of the color spline must wholly include the bound parameter range of the geometric spline. Each control point's components correspond to a direct color. If the color spline is rational, then the direct color components include a homogeneous coordinate. The color components may be outside the range normally associated with the color type. The number of color spline control points must be at least as large as the color spline's order. The number of knots must be equal to the number of control points plus the order. The knot values sequence must be non-decreasing. If an implementation indicates support for a non-homogeneous color type via the PEXColorType enumerated type, then it also supports the homogeneous form of the same color type in the color spline, except for PEXColorTypeIndexed.

Depending on the setting of the polyline source flag, this primitive obtains the attributes: line color, line type, line width and curve approximation either directly from the current line attributes or from the line bundle lookup table entry specified by the current line bundle index attribute.

Errors

BadPEXOutputCommand
The output command contains an invalid value.

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For PEXlib 5.1 compatibility primitives similar to this one see PEXNURBCurve.

For attributes that affect this primitive, see

For an overview, see Output Command Functions.