Locates a part of a geometry closest to a query point. Any located part must be within searchRadius units from the query point.
[Visual Basic 6.0] Function HitTest(
ByVal QueryPoint As IPoint, _
ByVal searchRadius As Double, _
ByVal geometryPart As esriGeometryHitPartType, _
ByVal hitPoint As IPoint, _
hitDistance As Double, _
hitPartIndex As Long, _
hitSegmentIndex As Long, _
bRightSide As Boolean _
) As Boolean
[Visual Basic .NET] Public Function HitTest ( _ ByVal QueryPoint As IPoint, _ ByVal searchRadius As Double, _ ByVal geometryPart As esriGeometryHitPartType, _ ByVal hitPoint As IPoint, _ ByRef hitDistance As Double, _ ByRef hitPartIndex As Integer, _ ByRef hitSegmentIndex As Integer, _ ByRef bRightSide As Boolean _ ) As Boolean
[C#] public bool HitTest ( IPoint QueryPoint, double searchRadius, esriGeometryHitPartType geometryPart, IPoint hitPoint, ref double hitDistance, ref int hitPartIndex, ref int hitSegmentIndex, ref bool bRightSide );
[Java] public Boolean hitTest ( IPoint QueryPoint, double searchRadius, esriGeometryHitPartType geometryPart, IPoint hitPoint, double hitDistance, int hitPartIndex, int hitSegmentIndex, Boolean bRightSide ) throws IOException, AutomationException
[C++] HRESULT HitTest( IPoint* QueryPoint, double searchRadius, esriGeometryHitPartType geometryPart, IPoint* hitPoint, double* hitDistance, long* hitPartIndex, long* hitSegmentIndex, VARIANT_BOOL* bRightSide, VARIANT_BOOL* bHit );
Parameters
QueryPoint
QueryPoint is a parameter of type IPoint
searchRadius
searchRadius is a parameter of type double
geometryPart
geometryPart is a parameter of type esriGeometryHitPartType
hitPoint
hitPoint is a parameter of type IPoint
hitDistance [in, out]
hitDistance is a parameter of type double
hitPartIndex [in, out]
hitPartIndex is a parameter of type long
hitSegmentIndex [in, out]
hitSegmentIndex is a parameter of type long
bRightSide [in, out]
bRightSide is a parameter of type VARIANT_BOOL
bHit [out, retval]
bHit is a parameter of type VARIANT_BOOL
The segment index returned has different meanings depending on the esriGeometryHitPartType used (Please see the example for more details).
EsriGeometryPartVertex: returns a vertex index
EsriGeometryPartBoundary, esriGeometryPartMidpoint and esriGeometryPartEndpoint: return a segment index
EsriGeometryPartCentroid: Always returns 0 for the part index and the segment index.
brightside: Indicates if the input point is on the right side of the input geometry
Note: The distance units use in this method are the units of the input geometry. No conversion is performed. esriGeometryHitPartType parameter cannot be a combination of several esriGeometryHitPartTypes.