#include "ltwrappr.h"
L_INT LImageViewerCell::AddCobbAngle(nSubCellIndex, hFirstLine, hSecondLine)
L_INT nSubCellIndex; |
index into the image list attached to the cell |
HANNOBJECT hFirstLine; |
the first line of the c obb-angle structure |
HANNOBJECT hSecondLine; |
the second line of the c obb-angle structure |
Creates a cobb-angle, which is a text display the angle between two lines, using the specified annotation lines (hFirstLine, hSecondLine).
Parameter | Description | |
nSubCellIndex | 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. | |
hFirstLine | Handle of the first annotation line that is used to create the cobb-angle. | |
hSecondLine | Handle to the second annotation line that is used to creat the cobb-angle. |
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.
Required DLLs and Libraries
LTIVW For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
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;
}