L_VecSetTranslation

#include "lvkrn.h"

L_LVKRN_API L_INT L_VecSetTranslation(pVector, pTranslation, pObject, dwFlags)

pVECTORHANDLE pVector;

/* pointer to a vector handle */

const pVECTORPOINT pTranslation;

/* pointer to a vector point */

pVECTOROBJECT pObject;

/* pointer to a vector object */

L_UINT32 dwFlags;

/* flags that indicate which objects to translate */

Translates all or part of the specified vectored image.

Parameter

Description

pVector

Pointer to a vector handle.

pTranslation

Pointer to a VECTORPOINT structure that contains the translation values for each axis. The translation values are in logical units.

pObject

Pointer to a VECTOROBJECT structure that references the object to translate. If this parameter is not NULL, only the specified object will be translated. If this parameter is NULL, the objects to translate are determined by dwFlags.

dwFlags

Flag that indicates which objects to translate. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:

 

Value

Meaning

 

0

Translate all objects.

 

VECTOR_FLAGS_SELECTED_ONLY

Translate only the currently selected objects within the vector handle.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Translates all or part of the specified vectored image based on the translation values in pTranslation.

The translation values may be retrieved using L_VecGetTranslation.

Note:

When you translate a certain object, it may or may not effect other unselected objects sharing vertices with the selected object. This depends on the current bind-vertices mode set by L_VecSetBindVerticesMode.

You should call L_VecApplyTransformation to make the translation part of the vector image, if you dont your changes will not be saved.

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_VecGetTranslation, L_VecSetScale, L_VecGetScale, L_VecSetRotation, L_VecGetRotation, L_VecSetBindVerticesMode, L_VecGetBindVerticesMode, L_VecApplyTransformation

Example

This example will translate all objects in a vector handle by 30 logical units along the x-axis, -20 along the y-axis and +50 along the z-axis.

L_INT VecSetTranslationExample(pVECTORHANDLE pVector)
{
   L_INT nRet;
   VECTORPOINT translation;
   /* Get current translation values */
   nRet = L_VecGetTranslation( pVector, &translation );
   if(nRet != SUCCESS)
      return nRet;
   /* +30 along the x-axis */
   translation.x += 30.0;
   /* -20 along the y-axis */
   translation.y -= 20.0;
   /* +50 along the z-axis */
   translation.z += 50.0;
   /* Set new translation values */
   nRet = L_VecSetTranslation( pVector, &translation, NULL, 0L );
   return nRet;
}