E57 Foundation API v1.1.312  Aug. 10, 2011
ScaledIntegerNode ( ImageFile  destImageFile,
double  scaledValue,
double  scaledMinimum,
double  scaledMaximum,
double  scale = 1.0,
double  offset = 0.0 
) [explicit]

This second constructor create an E57 element for storing a fixed point number but does the scaling for you.

Parameters:
[in]destImageFileThe ImageFile where the new node will eventually be stored.
[in]scaledValueThe scaled integer value of the element.
[in]scaledMinimumThe smallest scaledValue that the element may take.
[in]scaledMaximumThe largest scaledValue that the element may take.
[in]scaleThe scaling factor used to compute scaledValue from rawValue.
[in]offsetThe offset factor used to compute scaledValue from rawValue.

An ScaledIntegerNode stores an integer value, a lower and upper bound, and two conversion factors. This ScaledIntegerNode constructor calculates the rawValue, minimum, and maximum by doing the floor((scaledValue - offset)/scale + .5) on each scaled parameters. Warning: it is an error to give an rawValue outside the minimum / maximum bounds, even if the ScaledIntegerNode is destined to be used in a CompressedVectorNode prototype (where the rawValue will be ignored). If the ScaledIntegerNode is to be used in a prototype, it is recommended to specify a rawValue = 0 if 0 is within bounds, or a rawValue = minimum if 0 is not within bounds.

Precondition:
The destImageFile must be open (i.e. destImageFile.isOpen() must be true).
The destImageFile must have been opened in write mode (i.e. destImageFile.isWritable() must be true).
scaledMinimum <= scaledValue <= scaledMaximum
scale != 0
Returns:
A smart ScaledIntegerNode handle referencing the underlying object.
Exceptions:
E57_ERROR_BAD_API_ARGUMENT
E57_ERROR_IMAGEFILE_NOT_OPEN
E57_ERROR_FILE_IS_READ_ONLY
E57_ERROR_VALUE_OUT_OF_BOUNDS
E57_ERROR_INTERNALAll objects in undocumented state
See also:
ScaledIntegerCreate.cpp example, ScaledIntegerNode::scaledValue, Node, CompressedVectorNode, CompressedVectorNode::prototype
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines