Translates all or part of the specified vectored image.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecSetTranslation(pVector, pTranslation, pObject, dwFlags)
Pointer to a vector handle.
Pointer to a VECTORPOINT structure that contains the translation values for each axis. The translation values are in logical units.
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.
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. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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 do not your changes will not be saved.
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;
}