Determines whether the specified object(s) is(are) within the specified parallelogram.
#include "ltwrappr.h"
virtual L_INT LVectorBase::IsObjectInsideParallelogram(pLeftTop, pRightBottom, bInside, dwFlags=0)
Pointer to a VECTORPOINT structure that contains the top left point of a parallelogram.
Pointer to a VECTORPOINT structure that contains the bottom right point of a parallelogram.
Pointer to a variable to be updated with a value that indicates whether the object is inside the specified parallelogram. Possible values are:
Value | Meaning |
---|---|
TRUE | The specified object is within the specified parallelogram. |
FALSE | The specified object is not within the specified parallelogram. |
Flag that indicates which object(s) to test. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
Value | Meaning |
---|---|
0 | Test all objects in the vector handle to determine whether they are in the specified parallelogram. |
VECTOR_FLAGS_SELECTED_ONLY | Test only the selected objects within the vector handle. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function determines whether the specified object(s) exists within the parallelogram specified by pLeftTop and pRightBottom. The parallelogram is given in logical units.
For this function, the current view port, pan position, camera, rotation, translation and scale do not effect the actual image position in 3D space.
Not supported in DirectX.
This example displays tests if all vector objects are inside a parallelogram.
L_INT LVectorBase__IsObjectInsideParallelogramExample(HWND hWnd, LVectorBase *pVector)
{
UNREFERENCED_PARAMETER(pVector);
L_INT nRet;
LVectorBase Vector;
VECTORPOINT min, max;
L_BOOL bInside;
nRet = Vector.Load(MAKE_IMAGE_PATH(TEXT("random.dxf")));
if(nRet != SUCCESS)
return nRet;
nRet = Vector.GetParallelogram(&min, &max);
if(nRet != SUCCESS)
return nRet;
//The vector should be inside of the parallelogram
nRet = Vector.IsObjectInsideParallelogram(&min, &max, &bInside);
if(nRet != SUCCESS)
return nRet;
if (bInside)
MessageBox(hWnd, TEXT("IsObjectInsideParallelogram() returns TRUE"), TEXT(""), MB_OK);
else
MessageBox(hWnd, TEXT("IsObjectInsideParallelogram() returns FALSE"), TEXT(""), MB_OK);
//Now reduce the size of the parallelogram--the vector is no longer inside
max.x = (max.x - min.x) / 2;
nRet = Vector.IsObjectInsideParallelogram(&min, &max, &bInside);
if(nRet != SUCCESS)
return nRet;
if (bInside)
MessageBox(hWnd, TEXT("IsObjectInsideParallelogram() returns TRUE"), TEXT(""), MB_OK);
else
MessageBox(hWnd, TEXT("IsObjectInsideParallelogram() returns FALSE"), TEXT(""), MB_OK);
return SUCCESS;
}