L_VecIsObjectInsideRect

Summary

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

Syntax

#include "ltvkrn.h"

L_LVKRN_API L_BOOL L_VecIsObjectInsideRect(pVector, pObject, pRect, dwFlags)

Parameters

const pVECTORHANDLE pVector

Pointer to a vector handle.

const pVECTOROBJECT pObject

Pointer to a VECTOROBJECT structure that contains information about a specific object. If this parameter is NULL, the object(s) to test is(are) determined by dwFlags.

const L_RECT * pRect

Pointer to a RECT structure that contains information about a bounding rectangle.

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
TRUE The specified object(s) is(are) within the specified rectangle.
FALSE The specified object(s) is(are) not within the specified rectangle or the specified object is not valid.

Comments

The rectangle is given in screen (physical) coordinates.

The current view port, pan position, camera, scale, translation and rotation values are all considered when determining whether the object is within the rectangle.

Required DLLs and Libraries

See Also

Functions

Example

This example will select all objects inside a given rectangle.

L_INT EXT_CALLBACK VecIsObjectInsideRectCB( 
   pVECTORHANDLE pVector, 
   pVECTOROBJECT pObject, 
   L_VOID* pData) 
{ 
   L_INT nRet = SUCCESS; 
   VECTOROBJECT   ObjectDesc; 
   RECT*          pRect = (RECT *) pData; 
 
   /* Check if object is inside the rectangle */ 
   if( L_VecIsObjectInsideRect( pVector, pObject, pRect, 0L ) ) 
   { 
      nRet = L_VecGetObject( pVector, pObject, VECTOR_OBJECT, &ObjectDesc); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      ObjectDesc.dwFlags |= VECTOR_OBJECT_SELECTED; 
      nRet = L_VecSetObject(pVector, pObject, VECTOR_OBJECT, &ObjectDesc); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      nRet = L_VecFreeObject(VECTOR_OBJECT, &ObjectDesc); 
   } 
 
   /* Continue the enumeration */ 
   return nRet; 
} 
 
L_LTVKRNTEX_API L_INT VecIsObjectInsideRectCBExample(pVECTORHANDLE pVector, RECT *pRect) 
{ 
   /* Enumerate all objects in the drawing */ 
   return L_VecEnumObjects( pVector, (pVECTORENUMOBJECTSPROC)VecIsObjectInsideRectCB, pRect, 0 ); 
} 

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

LEADTOOLS Vector C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.