Returns the position and orientation of the object. This method, which is an extension of the GetPosition() method, gives more control over the altitude type that is returned in the doubleElevation parameter. It also allows you to determine the default altitude type used by the object.
HRESULT GetPositionEx(
[out] VARIANT* doubleX,
[out] VARIANT* doubleY,
[out] VARIANT* doubleElevation,
[out] VARIANT* doubleYaw,
[out] VARIANT* doublePitch,
[out] VARIANT* doubleRoll,
[out] VARIANT* longFlags)
Parameters:
doubleX – The West-East coordinate of the waypoint in MPT units. You can use the ITerrain interface to retrieve information about the MPT units. If you are working in Lat-Long format, the Lat-Long values are in decimal Lat-Long.
doubleY – The North-South coordinate of the waypoint in MPT units. You can use the ITerrain interface to retrieve information about the MPT units. If you are working in Lat-Long format, the Lat-Long values are in decimal Lat-Long.
doubleElevation – The altitude of the object, in meters. The interpretation of this parameter depends on the longFlags parameter.
doubleYaw – The Yaw angle of the object. See: “Yaw, Pitch and Roll Angles”.
doublePitch – The Pitch angle of the object. See: “Yaw, Pitch and Roll Angles”.
doubleRoll – The Roll angle of the object. See: “Yaw, Pitch and Roll Angles”.
longFlags – When this
method is called, the client should indicate to TerraExplorer what
the required height type of the object is. This parameter should be
one of the following:
0 – The default altitude type of the object is being
returned.
HEIGHT_AGL – The altitude of the object above the
ground is required.
HEIGHT_ABSOLUTE – The absolute altitude of the object
is required.
If the default height of the object differs from the one requested
by the client, a conversion is applied using the least accurate
method to avoid performance issues.
When this method returns, this flag contains the default altitude
type of the object, which can be either HEIGHT_AGL or
HEIGHT_ABSOLUTE. If the client needs to convert the altitude type
using the most accurate conversion (at the expense of performance),
it should call this method with this flag set to 0, and then use
the ITerrain3::GetGroundHeightEx() method to do the conversion.
Return Values:
The return value obtained from the returned HRESULT can be one of the following:
Return value |
Meaning |
S_OK |
Success. |
E_FAIL |
Catastrophic failure. |
TE_E_TEOBJECT_NOLONGEREXIST |
The object you are trying to access no longer exists. This may have occurred because, while keeping an interface to the object, the user deleted it from TerraExplorer (via the TE user interface). Without the object, the interface cannot be used. Therefore, you should release the interface. |
TE_E_INTERNAL |
TerraExplorer was unable to create the object. To get more information about this error use the IErrorInfo Interface. |