#include "ltwrappr.h"
L_INT LAnnLine::GetPoints(pPoints)
pANNPOINT pPoints; |
pointer to an array |
Fills the specified array of ANNPOINT structures with the vertices of the annotation object.
Parameter |
Description |
pPoints |
Pointer to the array to be filled with the vertices of the object. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
You can use the LAnnLine::GetPointCount function to determine the required size of the array before calling this function.
The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.
Coordinates of an object's points are relative to its container object. The coordinates are interpreted using the container's scaling factors and offsets, which are described in Low-Level Coordinate System for Annotations.
Note: You can not create a line of two points which they are the same.
Required DLLs and Libraries
LTANN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Win32, x64.
Functions: |
|
Topics: |
Annotation Functions: Getting and Setting Geometric Properties |
|
Annotation Functions: Using Window Coordinates to Define an Object |
This example gets the points for an object, shrinks the object by 1/2 and then puts the points back to the object.
L_INT LAnnLine_GetPointsExample(HWND hwnd, LAnnContainer& LeadContainer,L_BOOL fDoubleClick, L_INT x, L_INT y, L_UINT keyFlags){UNREFERENCED_PARAMETER(keyFlags);UNREFERENCED_PARAMETER(fDoubleClick);UNREFERENCED_PARAMETER(hwnd);L_INT nRet;HANNOBJECT hObject; // Local variable for the annotation objectPOINT PointToTest; // The point in the window's client area to testL_UINT TestResult; // Result of the testpANNPOINT pPoints; // Pointer to the points in the objectL_UINT uCount; // Number of points in the objectL_INT i;ANNRECT rcDefine;// Defining rectangle for the objectL_DOUBLE cx; // Center x pointL_DOUBLE cy; // Center y pointLBuffer LeadBuffer ;ANNHITTESTINFO HitTestInfo;memset(&HitTestInfo, 0, sizeof(ANNHITTESTINFO));HitTestInfo.uStructSize = sizeof(ANNHITTESTINFO);// Did we hit an object?// Use incoming coordinates to specify the point to testPointToTest.x = x;PointToTest.y = y;// Get the object at the specified pointnRet = LeadContainer.HitTest ( &PointToTest, &TestResult, &hObject, &HitTestInfo, sizeof(ANNHITTESTINFO));if(nRet != SUCCESS)return nRet;if ( TestResult == ANNHIT_BODY ){LAnnLine LeadLine(hObject) ;// first, get the # of points in the objectuCount = LeadLine.GetPointCount();LeadBuffer.Reallocate(sizeof(ANNPOINT) * uCount);pPoints = (pANNPOINT)LeadBuffer.Lock() ;// Now, get the pointsnRet = LeadLine.GetPoints(pPoints);if(nRet != SUCCESS)return nRet;// Get the defining rect, and find the center pointnRet = LeadLine.GetRect ( &rcDefine );if(nRet != SUCCESS)return nRet;cx = (rcDefine.right + rcDefine.left) / 2;cy = (rcDefine.bottom + rcDefine.top) / 2;for (i=0; i<(L_INT)uCount; i++){pPoints[i].x += (cx - pPoints[i].x) / 2;pPoints[i].y += (cy - pPoints[i].y) / 2;}// Put the new points back into the objectnRet = LeadLine.SetPoints ( pPoints, uCount);if(nRet != SUCCESS)return nRet;LeadBuffer.Unlock() ;}return SUCCESS;}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
