Determines whether the class object is within the specified parallelogram.
#include "ltwrappr.h"
L_INT LVectorObject::IsObjectInsideParallelogram(pLeftTop, pRightBottom, bInside)
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 class object is inside the specified parallelogram. Possible values are:
Value | Meaning |
---|---|
TRUE | The class object is within the specified parallelogram. |
FALSE | The class object is not within the specified parallelogram. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function determines whether the class object 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 selects all vertices inside a given parallelogram.
class LMyVectorBase: public LVectorBase
{
public:
L_INT m_nObjectCount ;
VECTORPOINT m_LeftTop, m_RightBottom;
public:
LMyVectorBase();
virtual ~LMyVectorBase() ;
virtual L_INT EnumObjectsCallBack(pVECTORHANDLE pVector, pVECTOROBJECT pObject);
};
LMyVectorBase::LMyVectorBase()
{
m_nObjectCount = 0 ;
}
LMyVectorBase::~LMyVectorBase()
{
}
L_INT LMyVectorBase::EnumObjectsCallBack(pVECTORHANDLE pVector, pVECTOROBJECT pObject)
{
L_BOOL bInside;
LVectorBase VectorBase(pVector);
LVectorObject VectorObject(pObject, &VectorBase);
//Select object if inside parallelogram
VectorObject.IsObjectInsideParallelogram(&m_LeftTop,&m_RightBottom,&bInside);
if (bInside)
VectorObject.SelectObject();
return SUCCESS ;
}
L_INT LVectorObject__IsObjectInsideParallelogramExample(HWND hWnd)
{
UNREFERENCED_PARAMETER(hWnd);
L_INT nRet;
LMyVectorBase Vector;
nRet = Vector.Load(MAKE_IMAGE_PATH(TEXT("random.dxf")));
if(nRet != SUCCESS)
return nRet;
//Define a 3D parallelogram
Vector.m_LeftTop.x=0;
Vector.m_LeftTop.y=0;
Vector.m_LeftTop.z=0;
Vector.m_RightBottom.x=50;
Vector.m_RightBottom.y=50;
Vector.m_RightBottom.z=50;
return SUCCESS;
}