Alters the position of a specified vertex of the polyline.
HRESULT ModifyVertex(
[in] int Index,
[in] double X,
[in] double Height,
[in] double Y,
[in, defaultvalue(0)] long Flags)
Parameters:
Index – Indicates which vertex you intend to modify, within the polyline (this must be a value between 0 and NumOfVertices-1).
X – The West-East coordinate of the vertex. 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.
Height – The height of the vertex in meters.
Y – The North-South coordinate of the vertex. 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.
Flags – Determine precisely how the new vertex is positioned. It can, for example, be positioned relative to the previous vertex. Below are the valid flags (from which you can form different combinations) for this method.
NEW_ELEVATION_RELATIVE_TO_CURRENT_ELEVATION = 64
The height of this vertex is the value of the Height parameter plus
the height of the previous vertex.
Note: This flag must never be used for the first vertex of the
polyline.
NEW_POS_RELATIVE_TO_CURRENT_POS =
128
The coordinates of this vertex are determined by adding the values
of the coordinates of the previous vertex to the values of the X
and Y parameters.
DONT_REDRAW = 512
When modifying several vertices in a row, it is more efficient
(performance-wise) to redraw the polyline only after the last
vertex has been modified. In this case, all of the ModifyVertex()
calls except for the last, should have this flag set.
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. |