PEXOCCPolyline - Polyline Primitive (5.0)


Synopsis

 
     void PEXOCCPolyline(
          PEXOCC context,
          unsigned int count,
          PEXPointer occ_points
     )
 

 
   void PEXPolyline(
        Display *display,
        XID resource_id,
        PEXOCRequestType req_type,
        unsigned int count,
        PEXCoord *points
   )
 

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

line_vertex_attributes (OCC)
A mask indicating the vertex attributes provided (PEXGANone(5.0), PEXGAColor(5.0), PEXGAEdges(5.2), PEXGA2D(5.0), or PEXGAFloatData(5.2)).

line_vertex_fp_data_count (OCC)
The number of optional floating-point numbers for each vertex.

color_type (OCC)
The type of color data provided (PEXColorTypeIndexed, PEXColorTypeRGB, PEXColorTypeCIE, PEXColorTypeHSV, PEXColorTypeHLS, PEXColorTypeRGB8, PEXColorTypeRGB16, PEXColorTypeRGBA, PEXColorTypeRGBA8, or PEXColorTypeRGBA16).

count
The number of vertices.

occ_points
A pointer to the vertex data defining the polyline. See Facet / Vertex Data Formats.

points
The array of vertices defining the polyline.

data_model (OCC)
Specifies the data model used to represent the geometric data.

data_model_specs (OCC)
Offset and size data for the PEXDataStride or PEXDataUnpacked data models.

Returns

None.

Description

Invoke PEXOCCPolyline to create a primitive output command that defines a single polyline with optional color, move/draw flags, 2D coordinates, or floating-point data. Depending on the attributes you supply, this function generates a PEXOCPolyline, PEXOCPolyline2D, or PEXOCPolylineSetWithDataFP output command. You cannot use the PEXPolyline function to specify move/draw flags, 2D coords, color data, or floating-point data. If a PEXOCPolylineSetWithDataFP OC is needed and the display is a connection to PEX 5.1 server or the Alternate Protocol Level is 5.1, this function generates a PEXOCPolylineSetWithData output command instead of a PEXOCPolylineSetWithDataFP output command.

If your application sets the PEXGAColor vertex attribute, then the vertex colors are of the type specified by color_type. Otherwise the implementation ignores color_type.

If colors are passed for each vertex, they are used instead of the line color attribute. Depending on the setting of the polyline source flag, this function obtains polyline interpolation method attributes either directly from the current polyline interpolation attribute or from the line bundle lookup table entry specified by the current line bundle index attribute. This controls how the polylines are shaded.

If your application sets the PEXGAEdges vertex attribute, then a move/draw control flag is specified in the first bit of the edge bitmask of each vertex. Using move/draw control flags allows a single polyline to have disjoint components. Therefore, the same disjoint lines can be defined with this function by using multiple polylines without move/draw control flags or by using a single polyline with move/draw control flags. If the move/draw control flag is set to 1 for vertex i, a line is drawn between vertex i-1 and vertex i. If the move/draw control flag is not set, then vertex i is the first vertex of the next line. The implementation ignores the move/draw control flag of the first vertex of each polyline. Instead the implementation assumes it is not set.

Note that you are able to specify a disjoint polyline in one of two ways. Use the PEXOCCPolyline function with the optional move/draw flags with a single list of vertices, or use the PEXOCCPolylines function without move/draw flags and multiple lists of vertices. Note that you are able to draw a list of disjoint polylines by using the PEXOCCPolylines function with both move/draw flags and multiple lists of vertices.

If your application sets the PEXGAFloatData bit in the vertex attribute bitmask, then you must supply extended floating-point data with each vertex. The line_vert_fp_count indicates the number of floating-point values for each vertex. If the PEXGAFloatData bit is not set, then line_vertex_fp_data_count is ignored.

The vertices, specified in modeling coordinates, are joined together by line segments. The first vertex is joined to the second, the second to the third, and so on. PEXlib does not connect the last vertex to the first.

Only depth-cueing affects the polyline colors and maps the polyline colors to device colors. The implementation does not display polylines outside of the currently defined clipping volume. Polylines crossing the clipping volume are clipped, and only the portions inside the clipping volume are displayed.

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

Defining a polyline with fewer than two vertices creates a degenerate polyline. The implementation stores the polyline in a structure, but when the polyline is rendered, there is no visual effect. The implementation ignores the primitive.

Errors

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For primitives similar to this one, see: PEXOCCPolylines

For PEXlib 5.1 compatibility primitives similar to this one see:

For attributes that affect this primitive, see:

For an overview, see Output Command Functions.