LContainer::SetScalar
#include "Ltwrappr.h"
L_INT LContainer::SetScalar (pvptScalarNum, pvptScalarDen)
pVECTORPOINT pvptScalarNum; |
/* numerator scaling values */ |
pVECTORPOINT pvptScalarDen; |
/* denominator scaling values */ |
Sets the container scaling values that will be used to adjust the coordinates values.
Parameter |
Description |
pvptScalarNum |
Pointer to structure of type VECTORPOINT that contains the numerator to scale the coordinates in the X,Y and Z directions. |
pvptScalarDen |
Pointer to structure of type VECTORPOINT that contains the denominator to scale the coordinates in the X,Y and Z directions. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
When assigning an external representation to the container every point (Xa, Ya) in the an external representation is transformed by the container to the point (Xc, Yc) by using the following steps:
1. |
Add offsets: |
Xb = Xa + nXOffset
Yb = Ya + nYOffset
2. |
Multiply by scalars: |
Xc = (Xb * nXScalarNum) / nXScalarDen
Yc = (Yb * nYScalarNum) / nYScalarDen
The default scalar values are:
ScalarNum.x = 1
ScalarNum.y = 1
ScalarNum.z = 1
ScalarDen.x = 1
ScalarDen.y = 1
ScalarDen.z = 1
Required DLLs and Libraries
LTCON 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: |
|
Topics: |
Example
This example shows how to set the container coordinates scaling factors.
L_INT LContainer_SetScalarExample(LContainer & lcont) { L_INT nRet; nRet = lcont.IsValid (); if ( nRet == SUCCESS ) /* check the validity of container handle */ { VECTORPOINT vptScalarNum, vptScalarDen ; /* Set the horizontal scaling factor to 5:1 factor */ vptScalarNum.x = 5 ; vptScalarDen.x = 1 ; /* Set the vertical scaling factor to 5:1 factor */ vptScalarNum.y = 5 ; vptScalarDen.y = 1 ; /* Set the z scaling factor to 1:1 factor */ vptScalarNum.z = 1 ; vptScalarDen.z = 1 ; nRet = lcont.SetScalar (&vptScalarNum, &vptScalarDen ) ; if(nRet != SUCCESS) return nRet; } else { return nRet ; } return SUCCESS ; }