This document is archived and information here might be outdated.  Recommended version.


ITopologyGraph.HitTestSelection Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoDatabase)  

ITopologyGraph.HitTestSelection Method

Locates an element of the graph's selection nearest to the query point that is also within searchRadius units of it; whichElements is a bitwise combination of esriTopologyElement values.

[Visual Basic .NET]
Public Function HitTestSelection ( _
    ByVal whichElements As Integer, _
    ByVal QueryPoint As IPoint, _
    ByVal searchRadius As Double, _
    ByVal hitPoint As IPoint, _
    ByRef hitDistance As Double, _
    ByRef hitElement As ITopologyElement _
) As Boolean
[C#]
public bool HitTestSelection (
    int whichElements,
    IPoint QueryPoint,
    double searchRadius,
    IPoint hitPoint,
    ref double hitDistance,
    ref ITopologyElement hitElement
);
[C++]
HRESULT HitTestSelection(
  long whichElements,
  IPoint* QueryPoint,
  double searchRadius,
  IPoint* hitPoint,
  double* hitDistance,
  ITopologyElement** hitElement,
  VARIANT_BOOL* hit
);
[C++]

Parameters whichElements [in] whichElements is a parameter of type long QueryPoint [in]
QueryPoint is a parameter of type IPoint searchRadius [in] searchRadius is a parameter of type double hitPoint [in]
hitPoint is a parameter of type IPoint hitDistance [out] hitDistance is a parameter of type double hitElement [out]
hitElement is a parameter of type ITopologyElement hit [out, retval] hit is a parameter of type VARIANT_BOOL

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The ITopologyGraph::HitTestSelection method allows to retrieve the nearest TopologyElement (TopologyNode or TopologyEdge) part of the TopologyGraph selection located within a distance from an input point. This could be used to get a TopologyElement based on a user mouse click. It returns a reference to the nearest TopologyElement object, the point where the TopologyElement was hit and the distance from the hit point to the input point. The search radius distance must use the same distance units as the Topology or MapTopology units no conversion is performed if they are not the same.

Remarks

For more information about how to use this method, such as an example and how to retrieve a hit point, see the HitTest method.

Note: whichElements is a bitwise combination of esriTopologyElement values.

See Also

ITopologyGraph Interface