| Customize Help
| Save Settings

MgraArcAngle



Function Map
Synopsis
Draw an arc or sector in an image, with optional rotation and fill color, or add it to a 2D graphics list.
Syntax
void MgraArcAngle(
MIL_ID ContextGraId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_DOUBLE XCenter, //in
MIL_DOUBLE YCenter, //in
MIL_DOUBLE XRad, //in
MIL_DOUBLE YRad, //in
MIL_DOUBLE StartAngle, //in
MIL_DOUBLE EndAngle, //in
MIL_DOUBLE XAxisAngle, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws an arc or sector destructively (raster-based) in the specified image. Alternatively, this function can add a vector-based version of an arc or sector to the specified 2D graphics list, allowing you to, for example, non-destructively annotate a display without pixelation effects upon scaling.

The arc or sector graphic is based on an ellipse centered at XCenter and YCenter, with radii XRad and YRad. The arc is the curve of the ellipse between the start angle (StartAngle) and the end angle (EndAngle), with an orientation along the X-axis (XAxisAngle). The arc or sector inherits all the relevant settings of the specified 2D graphics context, such as the foreground color (MgraControl() with M_COLOR). If part of the arc or sector falls outside of the specified area (image or display), that part is clipped off. The following image shows how the parameters are used to define the arc:

The center position, radii, and angle values are interpreted with respect to the input coordinate system, specified using MgraControl() or MgraControlList() with M_INPUT_UNITS. An angle interpreted with respect to the pixel coordinate system is always measured counter-clockwise. For information on the angle's direction of rotation when interpreting the angle with respect to the relative coordinate system, see the Angle convention in MIL subsection of the Working with real-world units section of Chapter 26: Calibrating your camera setup. Note that if you set your input coordinate system to M_WORLD and you pass MgraArcAngle() an uncalibrated image or the drawing target of the 2D graphics list is uncalibrated, the function will generate an error.

By default, only the arc is drawn in the image (M_CONTOUR). With the ControlFlag parameter, you can change this behavior to draw a sector of the ellipse (M_SECTOR) instead, with lines extending from the center of the ellipse to the start and end points of the arc. However, you can choose to draw it filled with the specified foreground color by specifying the M_FILLED combination constant.

To modify or inquire 2D graphics context settings, use MgraControl() or MgraInquire(). To modify or inquire 2D graphics list settings, use MgraControlList() or MgraInquireList().

To create a filled arc (sector) that is not rotated, you can also use MgraArcFill(). To create an arc that is not rotated or filled, you can also use MgraArc().

Unlike most other functions that modify a MIL object, you can call this function concurrently from multiple threads on the same MIL 2D graphics list (DstImageBufOrListGraId) without using an M_MUTEX object, as long as all the other parameters of the concurrent calls do not also share data.

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, MgraArcAngle() internally calls the MIL_DOUBLE version of this function (MgraArcAngleDouble()). If you need to pass integer values, call the MIL_INT64 version of this function (MgraArcAngleInt64()).
Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ContextGraId

Specifies the identifier of the 2D graphics context. This parameter must be set to one of the following values:

function map For specifying the 2D graphics context
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies that the default 2D graphics context of the current MIL application is used.

Note that there is a different default 2D graphics context for each thread.

(summarize)
Click to summarize MIL 2D graphics context identifier

Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc().

DstImageBufOrListGraId

Specifies the identifier of a valid image buffer in which to draw the arc or sector, or the identifier of a valid 2D graphics list in which to add the arc or sector. You must have allocated the image buffer or the 2D graphics list using MbufAlloc...() or MgraAllocList(), respectively.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

XCenter INQ

Specifies the X-coordinate of the center of the ellipse from which the arc or sector is defined, in the input coordinate system.

YCenter INQ

Specifies the Y-coordinate of the center of the ellipse from which the arc or sector is defined, in the input coordinate system.

XRad INQ

Specifies the radius of the ellipse from which the arc or sector is defined, along the X-axis in the input coordinate system. The radius must be greater than 0.

YRad INQ

Specifies the radius of the ellipse from which the arc or sector is defined, along the Y-axis in the input coordinate system. The radius must be greater than 0.

StartAngle INQ

Specifies the angle at which to start drawing the arc or sector, in degrees, relative to the input coordinate system.

EndAngle INQ

Specifies the angle at which to end drawing the arc or sector, in degrees, relative to the input coordinate system.

XAxisAngle INQ

Specifies the amount to rotate the ellipse used to define the arc or sector, in degrees, relative to the input coordinate system.

ControlFlag INQ

Specifies whether to draw an arc or sector. This parameter must be set to one of the following values:

function map To specify whether to draw an arc or sector
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_CONTOUR.

Click to summarize M_CONTOUR +

Specifies that the arc (the curve between the specified start and end angles) is drawn without lines extending from the center of the ellipse to the start and end points of the arc.

(summarize)
Click to summarize M_SECTOR +

Specifies that a sector is drawn with lines extending from the center of the ellipse to the start and end points of the arc, unless the specified start and end angles form a closed curve.

(summarize)
Combination value for any of the possible values of the ControlFlag parameter.

You can add the following value to the above-mentioned values to set whether the shape is filled.

function map For specifying whether the shape is filled
Click to summarizeCombination value Description
Click to summarize M_FILLED

Specifies that the shape is filled with specified foreground color (MgraControl() or MgraControlList() with M_COLOR), resulting in a filled sector.

Type-specific versions of the function when using a C compiler under 64-bit
void MgraArcAngleDouble (MIL_ID ContextGraId, MIL_ID DstImageBufOrListGraId, MIL_DOUBLE XCenter, MIL_DOUBLE YCenter, MIL_DOUBLE XRad, MIL_DOUBLE YRad, MIL_DOUBLE StartAngle, MIL_DOUBLE EndAngle, MIL_DOUBLE XAxisAngle, MIL_INT64 ControlFlag)
Parameters

ContextGraId

See ContextGraId of the main function for a description.

DstImageBufOrListGraId

See DstImageBufOrListGraId of the main function for a description.

XCenter

See XCenter of the main function for a description.

YCenter

See YCenter of the main function for a description.

XRad

See XRad of the main function for a description.

YRad

See YRad of the main function for a description.

StartAngle

See StartAngle of the main function for a description.

EndAngle

See EndAngle of the main function for a description.

XAxisAngle

See XAxisAngle of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

void MgraArcAngleInt64 (MIL_ID ContextGraId, MIL_ID DstImageBufOrListGraId, MIL_INT64 XCenter, MIL_INT64 YCenter, MIL_INT64 XRad, MIL_INT64 YRad, MIL_DOUBLE StartAngle, MIL_DOUBLE EndAngle, MIL_DOUBLE XAxisAngle, MIL_INT64 ControlFlag)
Parameters

ContextGraId

See ContextGraId of the main function for a description.

DstImageBufOrListGraId

See DstImageBufOrListGraId of the main function for a description.

XCenter

See XCenter of the main function for a description.

YCenter

See YCenter of the main function for a description.

XRad

See XRad of the main function for a description.

YRad

See YRad of the main function for a description.

StartAngle

See StartAngle of the main function for a description.

EndAngle

See EndAngle of the main function for a description.

XAxisAngle

See XAxisAngle of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT NONE DEFAULT CONTOUR SECTOR FILLED