PEXOCCSetPatternAttributes - Set Pattern Interior Style Attributes (5.0)


Synopsis

 
   void PEXOCCSetPatternAttributes(
        PEXOCC context,
        PEXCoord *ref_point,
        PEXVector *vector1,
        PEXVector *vector2
   )
 

 
   void PEXSetPatternAttributes(
        Display *display,
        XID resource_id,
        PEXOCRequestType req_type,
        PEXCoord *ref_point,
        PEXVector *vector1,
        PEXVector *vector2
   )
 

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

ref_point
The pattern reference point.

vector1
The first pattern reference vector.

vector2
The second pattern reference vector.

Returns

None.

Description

Invoke PEXOCCSetPatternAttributes to create an attribute output command which sets the pattern reference point and both pattern reference vectors attributes, in modeling coordinates, in the renderer's pipeline state.

To determine if your implementation supports PEXInteriorStylePattern, invoke the PEXGetEnumTypeInfo request. If the style is supported, then the pipeline state's interior style index selects an entry of the renderer's pattern table and applies it to fill area primitives of interior style PEXInteriorStylePattern.

When applying interior style PEXInteriorStylePattern to a fill area primitive, the reference point and vectors are projected along a normal vector onto the plane of each facet of the primitive. A parallelogram is formed with is origin defined by the projected reference point. A vector (vector1) defines one side of the parallelogram. This vector's direction is parallel to the first projected reference vector and has a length that is equal to the absolute value of the x-component of the pattern size (see PEXOCCSetPatternSize). The adjacent side of the parallelogram is defined similarly by the second projected reference vector (vector2) and the absolute value of the y-component of the pattern size. The pattern, a list of m x n equally-sized color cells, is applied across the parallelogram such that the first cell has the parallelogram origin in one corner. The first m colors in the pattern correspond to the row of cells nearest to and along the first projected reference vector (vector1). The pattern is mapped onto the facet by replicating the pattern parallelogram in directions parallel to the parallelogram's sides until the entire facet is covered.

If you specify a surface interior style of PEXInteriorStylePattern, then the implementation uses the pattern reference point and the pattern reference vectors to position and scale the pattern on the surface. If you specify either of the pattern reference vectors as zero length or if the vectors are parallel, then the implementation ignores this output command and the pattern entries of the pipeline state are not updated.

This function is a member of the styled and shaded surface attribute set.

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 all output attribute functions, see Output Attribute Functions.