Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS Vector C++ Class Library Help

LVectorBase::IsObjectInsideParallelogram

Show in webframe

#include "ltwrappr.h"

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

const pVECTORPOINT pLeftTop;

/* pointer to a vector point */

const pVECTORPOINT pRightBottom;

/* pointer to a vector point */

L_BOOL *bInside;

/* pointer to a variable */

L_UINT32 dwFlags;

/* flags */

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

Parameter

Description

pLeftTop

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

pRightBottom

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

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.

 

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

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

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LVectorBase::IsObjectInsideRect, LVectorBase::GetObjectParallelogram, LVectorBase::GetObjectRect, LVectorObject::IsObjectInsideParallelogram

Topics:

Manipulating Objects or Vertices within a Vector Image

 

Vector Images: Obtaining Object Information

Example

This example displays tests if all vector objects are inside a parallelogram.

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
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;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.