void PEXOCCArcs( PEXOCC context, PEXArcType arc_type, unsigned int count, PEXPointer arcs )
None.
Invoke PEXOCCArcs to create an arc-based line primitive output command (PEXOCArcSetWithData). The implementation applies the Line, Shaded Line, and Curve attribute sets, and line clipping to this primitive.
You can only define one type of arc per function call. PEXlib defines the following arc-based lines:
where:
M = <radius, 0, 0>,
m = <0, radius, 0>
If
|then-
| > 2
,
=
+ 2
.
If
then<
,
=
+ 2
![]()
You leave the arc open by specifying the PEXArcCircularArc arc type or close it with a chordal segment (PEXArcCircularClosedChordArc) or by connecting each endpoint to the center vertex (PEXArcCircularClosedPieArc). If your application defines a three-dimensional circular closed arc, then the implementation ignores the z value. If the radius of the circular closed arc is less than or equal to zero, then the arc degrades to a dot at the center vertex.
If
|then-
| > 2
,
=
+ 2
.
If
then<
,
=
+ 2
.
You leave the arc open by specifying the PEXArcEllipticalArc arc type or close it with a segment between the two endpoints (PEXArcEllipticalClosedChordArc) or connect each endpoint with a segment to the center vertex (PEXArcEllipticalClosedPieArc). If the length of both of the axes is equal to zero, then the arc degrades to a dot at the center vertex. If the length of just one of the axes is equal to zero or if the axes have non-zero lengths and are parallel, then the arc degrades in an implementation-dependent way.
This primitive only supports the optional vertex_attributes: PEXGAColor, PEXGAFloatData, and PEXGA2D.
Although there is no non-OCC form of this function, you may use the PEXDataPacked, PEXDataStride, or the PEXDataPacked data models to supply the arc data via the arcs parameter in modeling coordinates.
Each arc type has its own set of required vertex data, where each vertex is used to describe a complete arc.
----------------------------------------------------- Arc Type Required Vertex Data ----------------------------------------------------- PEXArcCircle coord, radius PEXArcCircularArc coord, radius, angles PEXArcCircularClosedChordArc coord, radius, angles PEXArcCircularClosedPieArc coord, radius, angles PEXArcEllipse coord, axes PEXArcEllipticalArc coord, axes, angles PEXArcEllipticalClosedChordArc coord, axes, angles PEXArcEllipticalClosedPieArc coord, axes, angles -----------------------------------------------------
PEXlib ignores the PEXGARadius flag since the presence of a radius is implicit with the arc type.
PEXlib does not supply a set of type definitions for arc set vertex data due to the large number of combinations of vertex data possible when considering both the required and optional vertex data. Therefore, you may find it convenient to design your own data structure to pass in the arcs parameter when using the PEXDataPacked data model. You need to design the data structure with the following ordering rules in mind:
For the four circular arc types, the required order is:
PEXCoord (or PEXCoord2D) center PEXColor* one of the PEXlib color types, if provided float radius float start angle, if an arc float end angle, if an arc float[n] floating point data, if provided
For the four elliptical arc area types, the required order is:
PEXCoord (or PEXCoord2D) center PEXColor* one of the PEXlib color types, if provided PEXCoord (or PEXCoord2D) major axis PEXCoord (or PEXCoord2D) minor axis float start angle, if an arc float end angle, if an arc float[n] floating point data, if provided
As an example, if you wish to supply data for Closed Circular Arcs using 3D coordinates, RGB floating-point colors and three floating-point numbers (for texture data), you would create a structure like this:
typedef struct { PEXCoord center; PEXColorRGB rgb; float radius; float start_angle; float stop_angle; float texture_data[3]; } MY_PEXRGBCircularClosedArc;
Remember to set the correct line vertex attributes in the OCC. In this case you would make sure that the PEXGA2D flag is off, the PEXGAColor is on and the PEXGAFloatData flag is on. You set the color_type field in the OCC to PEXColorTypeRGB and the number of floats in the OCC to three.
If you are using the PEXDataStride data model, then you set the stride and offset members in the OC Context to reflect the way the data is stored in your structured array. Pass a pointer to the start of the structured array in the arcs parameter of the function call. Be sure that there is a valid offset for each vertex attribute that is present.
If you are using the PEXDataUnpacked data model, then you would set size members in the OCC to the appropriate values and point to each of the data lists with the PEXUnpackedVertexData data structure. Again, be careful to set a size and pointer for every attribute you indicate as present in the vertex attributes.
For primitives similar to this one, see: PEXOCCArcAreas.
There are no PEXlib 5.1 compatibility primitives similar to this one.
For attributes that affect this primitive, see:
For an overview, see Output Command Functions.