| Customize Help
| Save Settings

MgraCopy



Function Map
Synopsis
Copy one or more graphics from one 2D graphics list to another.
Syntax
void MgraCopy(
MIL_ID SrcListGraId, //in
MIL_ID DstListGraId, //in
MIL_INT64 Operation, //in
MIL_INT InsertLocation, //in
MIL_INT NumGraphics, //in
const MIL_INT *SrcIndexOrLabelArrayPtr, //in
MIL_INT *DstLabelArrayPtr, //out
MIL_INT64 ControlFlag //in
)
Description

This function copies or moves one or more graphics from a source 2D graphics list to a destination 2D graphics list. When moved, the graphics are erased from the source 2D graphics list. You can specify the location in the destination 2D graphics list at which to insert the copied graphics, which offers some control on the drawing order.

Note that if you want to replace all existing elements of the destination 2D graphics list, you must clear it first using MgraClear().

This function supports in-place processing: the source and destination 2D graphics list identifiers can refer to the same 2D graphics list. In the case of an in-place move operation (M_MOVE), the graphic referred to by the InsertLocation parameter must not be one of the graphics being moved (SrcIndexOrLabelArrayPtr).

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 (DstListGraId) without using an M_MUTEX object, as long as all the other parameters of the concurrent calls do not also share data.

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
SrcListGraId

Specifies the identifier of a valid 2D graphics list from which to copy or move the graphics. You must have allocated the 2D graphics list using MgraAllocList().

DstListGraId

Specifies the identifier of a valid 2D graphics list in which to copy or move the graphics. You must have allocated the 2D graphics list using MgraAllocList(). In-place processing is supported; DstListGraId can refer to the same 2D graphics list as SrcListGraId.

Operation

Specifies the type of copy operation to perform. This parameter should be set to one of the following values:

function map For specifying the type of copy operation to perform
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_COPY + M_LABEL_VALUE.

Click to summarize M_COPY +

Specifies graphics from the source 2D graphics list are copied to the destination 2D graphics list. The graphics are not deleted from the source 2D graphics list.

(summarize)
Click to summarize M_MOVE +

Specifies graphics from the source 2D graphics list are moved to the destination 2D graphics list. The graphics are deleted from the source 2D graphics list.

(summarize)
Combination values for the values listed in For specifying the type of copy operation to perform.

You can add one of the following values to the above-mentioned values to specify whether indices or labels are given to the SrcIndexOrLabelArrayPtr parameter.

function map For specifying whether to use indices or labels
Click to summarizeCombination value Description
Click to summarize M_INDEX_VALUE

Specifies index values are given to the SrcIndexOrLabelArrayPtr parameter.

Click to summarize M_LABEL_VALUE

Specifies labels are given to the SrcIndexOrLabelArrayPtr parameter.

This is the default value.

(summarize)
InsertLocation

Specifies the location inside the destination 2D graphics list at which to insert the graphics. Note that the indices or labels passed to this parameter must refer to valid graphics. Otherwise, an error is generated.

function map For specifying the insert location in the destination 2D graphics list
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_END_OF_LIST.

Click to summarize

Specifies that the graphics will be inserted before the graphic with the specified index in the destination 2D graphics list.

(summarize)
Parameters

Specifies the index. The index is from 0 (inclusive) to the total number of graphics in the list minus 1. If the given index value is not in that range, an error is generated. You can get the number graphics in the list using MgraInquireList() with M_NUMBER_OF_GRAPHICS. You can get the index corresponding to the label of a graphic using MgraInquireList() with M_INDEX_VALUE.

Click to summarize

Specifies that the graphics will be inserted before the graphic with the specified label in the destination 2D graphics list.

(summarize)
Parameters

Specifies the label. The label must be greater than 0. If the label does not exist in the destination 2D graphics list, an error is generated. You can get the label of the last graphic added to the list using MgraInquireList() with M_LAST_LABEL. You can get the label corresponding to the index of a graphic using MgraInquireList() with M_LABEL_VALUE.

Click to summarize M_END_OF_LIST

Specifies that the graphics are appended to the end of the destination 2D graphics list.

NumGraphics

Specifies the number of graphics to copy or move.

When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the SrcIndexOrLabelArrayPtr parameter.

function map For specifying the number of graphics to copy or move
Click to summarizeValue Description
Click to summarize M_ALL

Specifies that all the graphics from the source 2D graphics list must be copied or moved.

Click to summarize Value > 0

Specifies the number of graphics from the source 2D graphics list to be copied or moved.

SrcIndexOrLabelArrayPtr
Accepts the address of one of the following:
  • array of type MIL_INT [optionally, in C++: a reference to a constant std::vector<MIL_INT> ] (and a maximum array rank for C# of 1)
    Required array size:(NumGraphics)
  • M_NULL

Specifies the address of the array containing the indices or labels of the graphics to copy from the source 2D graphics list. If the M_INDEX_VALUE combination constant is used with the Operation parameter, MIL expects the array to contain graphics indices. Otherwise, MIL expects it to contain graphics labels.

The array must contain at least NumGraphics indices or labels. If NumGraphics is set to M_ALL, you must set this parameter to M_NULL.

Note that the indices or labels passed to this parameter must refer to valid graphics. Otherwise, an error is generated.

DstLabelArrayPtr
Accepts the address of one of the following:
  • array of type MIL_INT [optionally, in C++: a reference to a std::vector<MIL_INT> ] (and a maximum array rank for C# of 1)
    Required array size:(NumGraphics)
  • array of type MIL_INT [optionally, in C++: a reference to a std::vector<MIL_INT> ] (and a maximum array rank for C# of 1)
    Required array size: MgraInquireList ( M_NUMBER_OF_GRAPHICS )

Specifies the address of the array in which to write the labels that have been automatically given to the copied or moved graphics in the destination 2D graphics list. The labels are written in the same order as the graphics are specified in the SrcIndexOrLabelArrayPtr parameter. If NumGraphics is set to M_ALL, the labels are written in index order.

The array must be at least as large as the number of graphics being moved or copied (NumGraphics). If NumGraphics is set to M_ALL, determine the required size of the array using MgraInquireList() with M_NUMBER_OF_GRAPHICS.

If you do not need the labels of the copied or moved graphics, this parameter can be set to M_NULL.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT COPY MOVE INDEX VALUE LABEL VALUE DEFAULT NUMBER OF GRAPHICS END OF LIST ALL ALL ALL