LVectorBase::IsObjectInsideParallelogram

#include "ltwrappr.h"

virtual L_INT LVectorBase::IsObjectInsideParallelogram(pLeftTop, pRightBottom, bInside, dwFlags=0)

Determines whether the specified object(s) is(are) within the specified parallelogram.

Parameters

const pVECTORPOINT pLeftTop

Pointer to a VECTORPOINT structure that contains the top left point of a parallelogram.

const pVECTORPOINT pRightBottom

Pointer to a VECTORPOINT structure that contains the bottom right point of a parallelogram.

L_BOOL *bInside

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.

 

L_UINT32 dwFlags

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.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

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.

Required DLLs and Libraries

See Also

Functions

Topics

Example

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; 
} 

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C++ Class Library Help