Creates a cobb-angle, which is a text display the angle between two lines, using the specified annotation lines (hFirstLine, hSecondLine).
#include "ltwrappr.h"
L_INT LImageViewerCell::AddCobbAngle(nSubCellIndex, hFirstLine, hSecondLine)
A zero-based index into the image list attached to the cell. This sub-cell contains the image that contains the annotation container. Pass -2 to refer to the selected sub-cell.
Handle of the first annotation line that is used to create the cobb-angle.
Handle to the second annotation line that is used to creat the cobb-angle.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To retrieve the cobb angle value, use the function LImageViewerCell::GetCobbAngleValue.
To delete a cobb angle, use the function LImageViewerCell::RemoveCobbAngle.
This example creates a cobb angle out of the first two annotation lines in the annotation container.
L_INT nCounter;
L_INT CALLBACK FindLine(HANNOBJECT hObject, L_VOID * pUserData)
{
pHANNOBJECT hLinesObjects = (pHANNOBJECT)pUserData;
L_UINT uType;
L_AnnGetType(hObject, &uType);
if (uType == ANNOBJECT_LINE)
{
hLinesObjects[nCounter] = hObject;
nCounter++;
}
return SUCCESS;
}
L_DOUBLE LImageViewerCell_GetCobbAngleValueExample(LImageViewerCell& ImageViewerCell)
{
HANNOBJECT hAnnContainer;
ImageViewerCell.GetAnnotationContainer(-2, &hAnnContainer, 0);
HANNOBJECT hLinesObjects[256];
memset(hLinesObjects, 0, sizeof(HANNOBJECT) * 256);
nCounter = 0;
L_AnnEnumerate(hAnnContainer, FindLine, hLinesObjects, ANNFLAG_RECURSE, NULL);
if (nCounter < 2)
{
MessageBox(NULL, TEXT("You have to have two lines on the cell to create the cobb angle"), TEXT("Error"), MB_OK);
return 0;
}
ImageViewerCell.AddCobbAngle(0, hLinesObjects[nCounter - 1], hLinesObjects[nCounter - 2]);
L_DOUBLE pnAngle;
ImageViewerCell.GetCobbAngleValue(0, hLinesObjects[nCounter - 1], &pnAngle);
return pnAngle;
}