Image Label Operations

xInsert2DImageLabel

Creates an image label (relative to screen dimension) fits into the rectangle specified by the normalized coordinates (xMin, yMin) and (xMax, yMax).

(xMin, yMin) refers to top-left of the rectangle and (xMax, yMax) refers to bottom-right of the rectangle. It allows user to pass multi line text to be added.

size_t xInsert2DImageLabel(String sImageFile, float xMin, float yMin,float xMax,float yMax, String sText);

return

Returns unique ID (temporary) of image label created. This can be used to modify the image label attributes later.

Returns 0 if failed.

sImageFile

Image file path.

xMin,yMin

Ttop-left coordinates of the rectangle, where image to be fit.

xMax, yMax

Bottom-right coordinates of the rectangle, where image to be fit.

sText

Multi line text. Add ‘n’ character to split the text into multi lines.

xInsert3DImageLabel

This function creates an image label and attach it to the given Node, specified by ID, part and model.

size_t xInsert3DImageLabel(String sImageFile, String sText, String sModel, String sPart, int iNodeID);

return

Returns unique ID (temporary) of image label created. This can be used to modify the image label attributes later.

Returns 0 if failed.

sImageFile

Image file path.

sText

Multi line text. Add ‘n’ character to split the text into multi lines.

sModel

Name of the CAE model.

sPart

Name of the CAE part.

iNodeID

Node number to which image label to be attached.

xSetImageLabelDimension

Sets width and height to the image label specified by its unique label ID.

bool xSetImageLabelDimension(size_t labelID, float fWidth, float fHeight);

return

Returns True if succeeds.Returns False otherwise

labelID

Unique label ID

fWidth

Width of the image label in normalized length (0 to 1).

fHeight

Height of the image label in normalized length (0 to 1).

pxGetImageLabelDimension

Sets width and height to the image label specified by its unique label ID.

List<float> pxGetImageLabelDimension(size_t labelID, bool bAbsolute);

return

Returns an array of size 2 if succeeds

Returns an empty array otherwise

labelID

unique label ID

bAbsolute

True - returns actual width and height.

False - returns normalized width and height.

xSetImageLabel2DPosition

Sets 2D screen position (fX,fY) normalized coordinates to the image label specified by its unique label ID.

bool xSetImageLabel2DPosition(size_t labelID, float fX, float fY);

return

Returns True if succeeds

Returns False otherwise

labelID

unique label ID

fX,fY

normalized left-top coordinates

pxGetImageLabel2DPosition

Gets 2D position of the image label specified by its unique label ID.

List<float> pxGetImageLabelDimension(size_t labelID, bool bAbsolute)

return

Returns an array of size 2 if succeeds

Returns an empty array otherwise

labelID

unique label ID

bAbsolute

True - returns actual position (left,top)

False - returns normalized position (left,top)

xSetImageLabelColor

Sets background/border/text color to the image label specified by its unique label ID.

bool xSetImageLabelColor(size_t labelID, float fR, float fG, float fB, int iColorType)

return

Returns True if succeeds

Returns False otherwise

labelID

unique label ID

fR,fG,fB

RGB color components in range of (0,1)

iColorType

0 -Text color

1 - Background color.

2 - Border color

pxGetImageLabelColor

Gets text/background/ border color of the image label specified by its unique label ID and colorType.

List<float> pxGetImageLabelColor(size_t labelID, int iColorType)

return

Returns an array of size 3 (RGB components) if succeeds

Returns an empty array otherwise

labelID

unique label ID

iColorType

0 - Text color

1 - Background color.

2 - Border color

xSetImageLabelflag

Sets or Removes background/border of the image label specified by its unique label ID.

bool xSetImageLabelflag(size_t labelID, bool bAttrib, int iFlagType)

return

Returns True if succeeds

Returns False otherwise

labelID

unique label ID

fR,fG,fB

RGB color components in range of (0,1)

bAttrib

True - turn ON the attribute.

False - turn OFF the attribute.

iFlagType

0 - Background

1 - Border.

xGetImageLabelflag

Gets text/background/ border color of the image label specified by its unique label ID and colorType.

int xGetImageLabelflag(size_t labelID, int iFlagType)

return

Returns 1 if the iFlagType is turned ON.

Returns 0 if the iFlagType is turned OFF.

labelID

unique label ID

iFlagType

0 - Background

1 - Border.

xSetImageLabelFile

Allows user to modify the label’s existing image with new one.

bool xSetImageLabelFile(size_t labelID, String sImageFile)

return

Returns True if succeeds.

Returns False if failed.

labelID

unique label ID

sImageFile

new Image File name.

xGetImageLabelFile

Gets image file associated with the given labelID.

String xGetImageLabelFile(size_t labelID)

return

Returns valid image file path if succeeds.

Returns empty string if failed.

labelID

Unique label ID

xSetImageLabelAttribute

Allows user to edit the label’s existing attributes.

bool xSetImageLabelAttribute(size_t labelID, int iAttribute, int iAttribType)

return

Returns True if succeeds.

Returns False if failed.

labelID

unique label ID

iAttribute

Texture Mode (0-Center, 1- Stretch, 2-Fit View, 3 - Actual)

Text Position (0- Bottom, 1 - Top)

Text Alignment(0-Left, 1- Middle, 2, Right)

iAttribType

0-Texture Mode

1-Text Position

2-Text Alignment

xGetImageLabelAttribute

Gets the image label attribute. Texture Mode/Text position/Text Alignment

int xGetImageLabelAttribute(size_t labelID, int iAttribType)

return

Returns a non-negative value if succeeds.

Returns false otherwise.

labelID

unique label ID

iAttribType

0-Texture Mode

1-Text Position

2-Text Alignment

xGetHitImageLabel

Allows users to get the last hit Image Label ID.

size_t xGetHitImageLabel()

return

Returns non-zero Label ID if succeeds. Returns 0 otherwise.

xGetImageLabelImagePath

Gets the image label file path associated with the given label ID.

String xGetImageLabelImagePath(size_t pImageLabel)

return

Returns the file path if it succeeds.Returns empty string otherwise.

pImageLabel

Label ID.

xSetImageLabelBackground

Allows user to set background information to the given image label ID.

bool xSetImageLabelBackground(size_t pImageLabel, float r, float g, float b, bool bBackground)

return

Returns True if it succeeds.Returns False otherwise.

pImageLabel

Image Label ID

r,g,b

red ,green, blue component values. Range 0 to 1

bBackground

Set True to enable backgound.

pxGetImageLabelBackground

Gets Image Label Background data for the given image label ID.

List<float> pxGetImageLabelBackground(size_t pImageLabel)

return

Returns an array of size 4.

Array[0] - On/Off switch (boolean)

Array[1] - red component value (0-1)

Array[2] - green component value (0-1)

Array[3] - blue component value (0-1)

pImageLabel

Label ID.

xSetImageLabelBorder

Allows user to set the border data to the given image label ID.

bool xSetImageLabelBorder(size_t pImageLabel, float r, float g, float b, bool bBorder)

return

Returns True if it succeeds. Returns False otherwise.

pImageLabel

Image Label ID

r,g,b

Red, green and blue color components. Range (0-1)

bBorder

On/Off switch flag.

pxGetImageLabelBorder

Gets Image label border data for the given Image Label ID.

List<float> pxGetImageLabelBorder(size_t pImageLabel)

return

Returns an array of size 4 if it succeeds.Returns an empty array otherwise.

pImageLabel

Image Label ID.

xClearImageCropAttribs

Clears Image cropping attributes used in Export Image Region.

bool xClearImageCropAttribs()

return

Returns True if it succeeds.Returns False otherwise.

xIsValid2DImageLabelID

Validates 2D image label ID.

bool xIsValid2DImageLabelID(size_t iLabelID)

return

Returns True is it’s a valid 2D image label

iLabelID

Label ID

xIsValid3DImageLabelID

Validates 3D image label ID.

bool xIsValid3DImageLabelID(size_t iLabelID)

return

Returns True is it’s a valid 3D image label

iLabelID

Label ID