L_VecSetTranslation

#include "lvkrn.h"

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

Translates all or part of the specified vectored image.

Parameters

pVECTORHANDLE pVector

Pointer to a vector handle.

const pVECTORPOINT pTranslation

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

pVECTOROBJECT 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.

L_UINT32 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

Value Meaning
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 do not your changes will not be saved.

Required DLLs and Libraries

See Also

Functions

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; 
} 

Help Version 20.0.2020.6.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C API Help