L_VecGetObjectParallelogram

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetObjectParallelogram(pVector, pObject, pMin, pMax, dwFlags)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

const pVECTOROBJECT pObject;

/* pointer to a vector object */

pVECTORPOINT pMin;

/* pointer to a VECTORPOINT structure */

pVECTORPOINT pMax;

/* pointer to a VECTORPOINT structure */

L_UINT32 dwFlags;

/* flag */

Gets the parallelogram that contains the specified object(s).

Parameter

Description

pVector

Pointer to a vector handle.

pObject

Pointer to a VECTOROBJECT structure that references an object. If this parameter is not NULL, the top left point of this object’s bounding parallelogram will be copied into pLeftTop and the bottom right point of the parallelogram will be copied into pRightBottom.

 

If this parameter is NULL, dwFlags will control which object’s parallelogram to copy into pLeftTop and pRightBottom.

pMin

Pointer to a VECTORPOINT structure to be updated with the minimum point of the bounding parallelogram of the specified object.

pMax

Pointer to a VECTORPOINT structure to be updated with the maximum point of the bounding parallelogram of the specified object.

dwFlags

Flag that indicates which parallelogram to use when updating the pLeftTop and pRightBottom parameters. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:

 

Value

Meaning

 

0

pMin and pMax will be updated with the parallelogram containing all objects within the vector handle.

 

VECTOR_FLAGS_SELECTED_ONLY

pMin and pMax will be updated with the parallelogram containing all selected objects within the vector handle.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Obtains the bounding parallelogram of a single object, several selected objects, or all objects within the specified vector handle.

This function is not supported in the OpenGL and DirectX engines.

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:

L_VecSelectObject, L_VecIsObjectSelected, L_VecGetObjectRect

Example

/* This example will show the logical extent of the drawing, in a message box */

void ShowExtent( pVECTORHANDLE pVector )
{
   VECTORPOINT Min;          /* Left-top point */
   VECTORPOINT Max;      /* Right-bottom point */
   L_TCHAR      szBuffer[ 80 ];   /* Buffer */

   /* Get the parallelogram of all objects */
   L_VecGetObjectParallelogram( pVector, NULL, &Min, &Max, 0L );

   /* Format into a buffer */
   wsprintf( szBuffer, TEXT("%.3f, %.3f, %.3f - %.3f, %.3f, %.3f"),
             Min.x, Min.y, Min.z,
             Max.x, Max.y, Max.z );

   /* Show in a message box */
   MessageBox( NULL, szBuffer, TEXT("Drawing extent"), 0 );
}