Functions

Functions

double mdlCnv_uorsToMasterUnits (double uors)
 Converts distance from units of resolution to master units of the active model. More...
 
double mdlCnv_masterUnitsToUors (double masterUnits)
 Converts distance from master units of the active model to units of resolution. More...
 
double mdlCnv_uorsToSubUnits (double uors)
 Converts distance from units of resolution to sub units of the active model. More...
 
double mdlCnv_subUnitsToUors (double subUnits)
 Converts distance from sub units of the active model to units of resolution. More...
 
void mdlCnv_DPointToIPoint (Point3d *iPointP, DPoint3dCP dPointP)
 PointConversions (mdlCnv_DPointToIPoint, mdlCnv_DPointTOIPointArray, mdlCnv_IPointToDPoint, mdlCnv_IPointToDPointArray) More...
 
void mdlCnv_DPointToIPointArray (Point3d *iPointsP, DPoint3dCP rPointsP, int numPoints)
 Converts an array of double point Bentley::DPoint3d's to integer point Bentley::Point3d's. More...
 
void mdlCnv_IPointToDPoint (DPoint3dP dPointP, Point3dCP iPointP)
 Converts an integer point Point3d to a double point DPoint3d. More...
 
void mdlCnv_IPointToDPointArray (DPoint3dP rPointsP, const Point3d *iPointsP, int numPoints)
 Converts an array of integer point Bentley::DPoint3d's to double point Bentley::Point3d's. More...
 
StatusInt mdlCnv_fRange3dToScanRange (ScanRangeP scanRangeP, FRange3dCP rangeP)
 Converts a ~tFRange3d to a ~tScanRange. More...
 
void mdlCnv_doubleToNativeFloat (float *outFloatP, const double *inDoubleP)
 Converts a double precision value to its C float representation. More...
 
void mdlCnv_nativeFloatToDouble (double *outDoubleP, const float *inFloatP)
 Converts a value in the the C float format to its double precision equivalent. More...
 
long mdlCnv_roundDoubleToLong (double inDouble)
 Converts a double precision value to a 32-bit signed integer. More...
 
unsigned long mdlCnv_roundDoubleToULong (double inDouble)
 Converts a double precision value to a 32-bit unsigned integer. More...
 
Int64 mdlCnv_roundDoubleToInt64 (double inDouble)
 Converts a double precision value to a 64-bit signed integer. More...
 
UInt64 mdlCnv_roundDoubleToUInt64 (double inDouble)
 Converts a double precision value to a 64-bit unsigned integer. More...
 
bool mdlCnv_toRational (double input, int *numeratorP, int *denominatorP)
 Converts a double value to a rational fraction, if feasible. More...
 
StatusInt mdlCnv_masterToUOR (double *uorsP, double masterUnits, DgnModelRefP modelRef)
 Converts distance from master units of a given modelRef to units of resolution. More...
 
StatusInt mdlCnv_UORToMaster (double *masterUnitsP, double UORs, DgnModelRefP modelRef)
 Converts distance from units of resolution of a given modelRef to master units. More...
 
int mdlCnv_convertUnicodeToMultibyte (const WChar *unicodeCharsP, int iUnicodeLength, char *multibyteCharsP, int iMultibyteLength)
 Converts a unicode character string to a multibyte character string. More...
 
int mdlCnv_convertMultibyteToUnicode (const char *multibyteCharsP, int iMultibyteLength, WChar *unicodeCharsP, int iUnicodeLength)
 Converts a multibyte character string to a unicode character string. More...
 
StatusInt mdlCnv_millisToString (WStringP timeStrP, WStringP dateStrP, double milliseconds)
 Converts the time, in milliseconds since 12:00 am January 1, 1970, to a time string and a date string. More...
 
Int64 mdlCnv_millisToNTFileTime (double milliseconds)
 Converts the time, in milliseconds since 12:00 am January 1, 1970, to an Int64 usable for an NT file time. More...
 
StatusInt mdlCnv_validateDoubleAndClampToRange (double *testValueP, double hiLimit, double loLimit, double hiReplace, double loReplace)
 Validates that the memory address specified contains a valid double within a specified range. More...
 
MSTNTOOLS_EXPORT void mdlCnv_fromAsciiToR50 (size_t length, CharCP input, void *output)
 Convert ascii string to a radix 50 string. More...
 
MSTNTOOLS_EXPORT void mdlCnv_fromR50ToAscii (size_t length, const void *input, CharP output)
 Convert radix 50 string to an ascii string. More...
 
MSTNTOOLS_EXPORT void mdlCnv_fromWideToR50 (size_t length, WCharCP inputP, void *output)
 Convert wide char string to radix 50 string. More...
 
MSTNTOOLS_EXPORT void mdlCnv_fromR50ToWide (size_t length, const void *inputP, WCharP output)
 Convert radix 50 string to an ascii string. More...
 

Detailed Description

Function Documentation

int mdlCnv_convertMultibyteToUnicode ( const char *  multibyteCharsP,
int  iMultibyteLength,
WChar *  unicodeCharsP,
int  iUnicodeLength 
)

Converts a multibyte character string to a unicode character string.

Parameters
[in]multibyteCharsPthe multibyte string to be converted.
[in]iMultibyteLengththe number of bytes in the multibyte string to be converted. If the string is NULL terminated, pass -1 for this length.
[out]unicodeCharsPbuffer to hold the output unicode string.
[in]iUnicodeLengththe size, in WChar's, of unicodeCharsP.
Returns
the number of characters converted.
Remarks
If iUnicodeLength is 0, unicodCharsP can be NULL, and the function returns the number of MSWChars needed in the output buffer.
See also
mdlCnv_convertUnicodeToMultibyte
Remarks
Required Library: mdlbltin.lib
int mdlCnv_convertUnicodeToMultibyte ( const WChar *  unicodeCharsP,
int  iUnicodeLength,
char *  multibyteCharsP,
int  iMultibyteLength 
)

Converts a unicode character string to a multibyte character string.

Parameters
[in]unicodeCharsPthe unicode string to be converted.
[in]iUnicodeLengththe number of characters in the unicode string to be converted. If the string is NULL terminated, pass -1 for this length.
[out]multibyteCharsPbuffer to hold the output multibyte string.
[in]iMultibyteLengththe size, in bytes, of multibyteCharsP.
Returns
the number of characters converted.
Remarks
If iMultibyteLength is 0, multibyteCharsP can be NULL, and the function returns the size of the buffer needed for the output.
See also
mdlCnv_convertMultibyteToUnicode
Remarks
Required Library: mdlbltin.lib
void mdlCnv_doubleToNativeFloat ( float *  outFloatP,
const double *  inDoubleP 
)

Converts a double precision value to its C float representation.

MDL does not support the float C data type. Thus, MDL programs that read or write external files that contain binary float types might need this function.

Parameters
[out]outFloatPthe float value of *inDoubleP.
[in]inDoublePthe double to convert.
Remarks
Whenever there is a variable declared as float in MDL, it is actually stored internally as a double. The programmer working with external files containing binary float types must be aware of this.
This function performs the cast from double to float in native code.
Required Library: mdlbltin.lib
See also
mdlCnv_nativeFloatToDouble
void mdlCnv_DPointToIPoint ( Point3d *  iPointP,
DPoint3dCP  dPointP 
)

PointConversions (mdlCnv_DPointToIPoint, mdlCnv_DPointTOIPointArray, mdlCnv_IPointToDPoint, mdlCnv_IPointToDPointArray)

Converts a double point Bentley::DPoint3d to an integer point Bentley::Point3d

Parameters
[out]iPointPthe integer point.
[in]dPointPthe double point.
Remarks
uses mdlCnv_roundDoubleToLong to convert each coordinate.
Required Library: mdlbltin.lib

PointConversions

void mdlCnv_DPointToIPointArray ( Point3d *  iPointsP,
DPoint3dCP  rPointsP,
int  numPoints 
)

Converts an array of double point Bentley::DPoint3d's to integer point Bentley::Point3d's.

Parameters
[out]iPointsParray of integer points, sized at least numPoints.
[in]rPointsParray of double points, sized numPoints.
[in]numPointsnumber of points to convert
Remarks
uses mdlCnv_roundDoubleToLong to convert each coordinate.
Required Library: mdlbltin.lib

PointConversions

StatusInt mdlCnv_fRange3dToScanRange ( ScanRangeP  scanRangeP,
FRange3dCP  rangeP 
)

Converts a ~tFRange3d to a ~tScanRange.

Parameters
[out]scanRangePthe scan range representation of the input vecRangeP
[in]rangePthe FRange3d to convert
Returns
always returns SUCCESS
Remarks
Required Library: mdlbltin.lib ""
MSTNTOOLS_EXPORT void mdlCnv_fromAsciiToR50 ( size_t  length,
CharCP  input,
void *  output 
)

Convert ascii string to a radix 50 string.

Parameters
lengthIN length of input string to be converted
inputIN ascii string to be converted
outputOUT buffer to contain radix 50 string
Remarks
Required Library: mstntoolsubs.lib ""
MSTNTOOLS_EXPORT void mdlCnv_fromR50ToAscii ( size_t  length,
const void *  input,
CharP  output 
)

Convert radix 50 string to an ascii string.

Parameters
lengthIN length of output string (excluding terminator). Should be multiple of 3
inputIN radix 50 string to be converted
outputOUT buffer to contain ascii string
Remarks
Required Library: mstntoolsubs.lib ""
MSTNTOOLS_EXPORT void mdlCnv_fromR50ToWide ( size_t  length,
const void *  inputP,
WCharP  output 
)

Convert radix 50 string to an ascii string.

Parameters
lengthIN maximum length of output string (excluding terminator). Should be multiple of 3
inputPIN radix 50 string to be converted
outputOUT buffer to contain wide char string
Remarks
Required Library: mstntoolsubs.lib ""
MSTNTOOLS_EXPORT void mdlCnv_fromWideToR50 ( size_t  length,
WCharCP  inputP,
void *  output 
)

Convert wide char string to radix 50 string.

Parameters
lengthIN length of input string to be converted
inputPIN wide char string to be converted
outputOUT buffer to contain radix 50 string
Remarks
Required Library: mstntoolsubs.lib ""
void mdlCnv_IPointToDPoint ( DPoint3dP  dPointP,
Point3dCP  iPointP 
)

Converts an integer point Point3d to a double point DPoint3d.

Parameters
dPointPOUT the double point.
iPointPIN the integer point. ""
Remarks
Required Library: mdlbltin.lib PointConversions
void mdlCnv_IPointToDPointArray ( DPoint3dP  rPointsP,
const Point3d *  iPointsP,
int  numPoints 
)

Converts an array of integer point Bentley::DPoint3d's to double point Bentley::Point3d's.

Parameters
[out]rPointsParray of double points, sized at least numPoints.
[in]iPointsParray of integer points, sized numPoints.
[in]numPointsnumber of points to convert
Remarks
Required Library: mdlbltin.lib

PointConversions

StatusInt mdlCnv_masterToUOR ( double *  uorsP,
double  masterUnits,
DgnModelRefP  modelRef 
)

Converts distance from master units of a given modelRef to units of resolution.

Parameters
[out]uorsPthe distance in units of resolution of modelRef
[in]masterUnitsthe distance in master units of modelRef
[in]modelRefthe modelRef that the distance applies to.
Returns
If modelRef is not a valid DgnModelRefP, returns ERROR, otherwise SUCCESS.
Remarks
Required Library: mdlbltin.lib
See also
mdlCnv_UORToMaster
double mdlCnv_masterUnitsToUors ( double  masterUnits)

Converts distance from master units of the active model to units of resolution.

Parameters
[in]masterUnitsthe distance to convert to units of resolution.
Returns
the input distance in units of resolution.
See also
mdlCnv_uorsToMasterUnits mdlCnv_uorsToSubUnits mdlCnv_subUnitsToUors
Int64 mdlCnv_millisToNTFileTime ( double  milliseconds)

Converts the time, in milliseconds since 12:00 am January 1, 1970, to an Int64 usable for an NT file time.

Parameters
[in]millisecondsthe milliseconds value to convert.
Returns
64-bit integer representation of milliseconds in the NT file time space.
Remarks
Required Library: mdlbltin.lib
StatusInt mdlCnv_millisToString ( WStringP  timeStrP,
WStringP  dateStrP,
double  milliseconds 
)

Converts the time, in milliseconds since 12:00 am January 1, 1970, to a time string and a date string.

Parameters
[out]timeStrPbuffer that holds the time string.
[out]dateStrPbuffer that holds the date string.
[in]millisecondsthe milliseconds value to convert.
Returns
SUCCESS if millseconds is a value that can be converted, ERROR otherwise.
Remarks
Required Library: mdlbltin.lib
void mdlCnv_nativeFloatToDouble ( double *  outDoubleP,
const float *  inFloatP 
)

Converts a value in the the C float format to its double precision equivalent.

MDL does not support the float C data type. Thus, MDL programs that read or write external files that contain binary float types might need this function.

Parameters
[out]outDoublePthe double value of *inDoubleP.
[in]inFloatPthe float to convert.
Remarks
Whenever there is a variable declared as float in MDL, it is actually stored internally as a double. The programmer working with external files containing binary float types must be aware of this.
This function performs the cast from float to doule in native code.
Required Library: mdlbltin.lib
See also
mdlCnv_doubleToNativeFloat
Int64 mdlCnv_roundDoubleToInt64 ( double  inDouble)

Converts a double precision value to a 64-bit signed integer.

Parameters
[in]inDoublethe double to convert.
Returns
the 64-bit signed integer closest to inDouble
Remarks
If inDouble is greater than the maximum 64-bit signed integer (2^63), the function returns the maximum.
If inDouble is less than the minimum 64-bit signed integer (-2^63), the function returns the minimum.
This function rounds to the closest integer, rather than truncating as a C-style cast does.
Required Library: mdlbltin.lib
See also
mdlCnv_roundDoubleToLong mdlCnv_roundDoubleToULong mdlCnv_roundDoubleToUInt64
long mdlCnv_roundDoubleToLong ( double  inDouble)

Converts a double precision value to a 32-bit signed integer.

Parameters
inDoubleIN the double to convert.
Returns
the 32-bit signed integer closest to inDouble
Remarks
If inDouble is greater than the maximum 32-bit signed integer (2147483647), the function returns 2147483648.
If inDouble is less than the minimum 32-bit signed integer (-2147483648), the function return -2147483648.
This function rounds to the closest integer, rather than truncating as a C-style cast does.
Required Library: mdlbltin.lib ""
See also
usmthmdlCnv_roundDoubleToULongC
UInt64 mdlCnv_roundDoubleToUInt64 ( double  inDouble)

Converts a double precision value to a 64-bit unsigned integer.

Parameters
[in]inDoublethe double to convert.
Returns
the 64-bit unsigned integer closest to inDouble
Remarks
If inDouble is greater than the maximum 64-bit unsigned integer (2^64), the function returns the maximum.
This function rounds to the closest integer, rather than truncating as a C-style cast does.
Required Library: mdlbltin.lib
See also
mdlCnv_roundDoubleToLong mdlCnv_roundDoubleToULong mdlCnv_roundDoubleToInt64
unsigned long mdlCnv_roundDoubleToULong ( double  inDouble)

Converts a double precision value to a 32-bit unsigned integer.

Parameters
inDoubleIN the double to convert.
Returns
the 32-bit unsigned integer closest to inDouble
Remarks
If inDouble is greater than the maximum 32-bit unsigned integer (4294967295), the function returns 4294967295.
If inDouble is less than 0, the function return 0.
This function rounds to the closest integer, rather than truncating as a C-style cast does.
Required Library: mdlbltin.lib ""
See also
usmthmdlCnv_roundDoubleToLongC
double mdlCnv_subUnitsToUors ( double  subUnits)

Converts distance from sub units of the active model to units of resolution.

Parameters
[in]subUnitsthe distance to convert to units of resolution.
Returns
the input distance in sub units
Remarks
Required Library: mdllib.dll
See also
mdlCnv_uorsToSubUnits mdlCnv_uorsToMasterUnits mdlCnv_masterUnitsToUors
bool mdlCnv_toRational ( double  input,
int *  numeratorP,
int *  denominatorP 
)

Converts a double value to a rational fraction, if feasible.

Parameters
[in]inputthe double to convert.
[out]numeratorPnumerator of the rational fraction
[out]denominatorPdenominator of the rational fraction
Returns
true if the input was successfully converted to a rational fraction, false otherwise.
Remarks
If the function returns false, *numeratorP and *denominatorP are meaningless.
If the input is less than 0.2 or greater than 5.0, the function does not attempt conversion and always returns false.
If input is less than 1.0, the routine looks for denominators with values 2,3,4,5,6,8,10, or 12.
The algorithm is designed for numbers less than 1.0, but if input is greater than 1.0, the routine, the input is divided in 1.0, the algorithm applied, and the numerator and denominator switched on output.
Required Library: mdlbltin.lib
double mdlCnv_uorsToMasterUnits ( double  uors)

Converts distance from units of resolution to master units of the active model.

Parameters
[in]uorsthe distance to convert to master units
Returns
the input distance in master units
Remarks
Required Library: mdllib.dll
See also
mdlCnv_masterUnitsToUors mdlCnv_uorsToSubUnits mdlCnv_subUnitsToUors
double mdlCnv_uorsToSubUnits ( double  uors)

Converts distance from units of resolution to sub units of the active model.

Parameters
[in]uorsthe distance to convert to sub units.
Returns
the input distance in sub units.
Remarks
Required Library: mdllib.dll
See also
mdlCnv_subUnitsToUors mdlCnv_uorsToMasterUnits mdlCnv_masterUnitsToUors
StatusInt mdlCnv_UORToMaster ( double *  masterUnitsP,
double  UORs,
DgnModelRefP  modelRef 
)

Converts distance from units of resolution of a given modelRef to master units.

Parameters
[out]masterUnitsPthe distance in master units of modelRef
[in]UORsthe distance in units of resolution of modelRef
[in]modelRefthe modelRef that the distance applies to.
Returns
If modelRef is not a valid DgnModelRefP, returns ERROR, otherwise SUCCESS.
Remarks
Required Library: mdlbltin.lib
See also
mdlCnv_UORToMaster
StatusInt mdlCnv_validateDoubleAndClampToRange ( double *  testValueP,
double  hiLimit,
double  loLimit,
double  hiReplace,
double  loReplace 
)

Validates that the memory address specified contains a valid double within a specified range.

Parameters
testValuePIN OUT pointer to a double to be validated.
hiLimitIN the highest value that test value is allowed to have.
loLimitIN the lowest value that the test value is allowed to have.
hiReplaceIN the value that *testValueP is set to if the original value exceeds hiLimit.
loReplaceIN the value that *testValueP is set to if the original value is less than loLimit.
Returns
0 if *testValueP is a valid double within range, 1 if it is replaced by hiReplace, and 2 if it is replaced by loReplace.
Remarks
Required Library: mdlbltin.lib ""

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.