Click or drag to resize

IMcLinesDistanceToFeaturePoint Method

Finds the distance to a point along a feature line or boundary.

Namespace:  MediaCy.IQL.Features
Assembly:  MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
Syntax
VB
Function DistanceToFeaturePoint ( 
	TargetX As Single,
	TargetY As Single,
	Optional FeatureIndex As Integer = 0,
	Optional VertexIndex As Integer = 0,
	Optional CalibratedDistance As Boolean = true
) As Double

Parameters

TargetX
Type: SystemSingle
Given target X pixel coordinate.
TargetY
Type: SystemSingle
Given target Y pixel coordinate
FeatureIndex (Optional)
Type: SystemInt32
Which feature the distance is to be computed for (zero by default). This would be the return value from the PointClosestToPoint call if that method's ClosestPoint result is used to get the target point.
VertexIndex (Optional)
Type: SystemInt32
The vertex from which the target point is assumed to be extended (zero by default). This would be the returned ClosestVertexIndex from the PointClosestToPoint call if that method's ClosestPoint result is used to get the target point. For McPoints, this must be zero.
CalibratedDistance (Optional)
Type: SystemBoolean
If True (the default) and the SpatialCalibration property is not Nothing, then the computed distance is calibrated. Note that for a calibration with a McSpatialCalib.AspectRatio of other than 1, the calibrated distance will depend on feature orientation as well as its shape. If False, then the computed distance is given in pixel units. Note that the TargetX and TargetY arguments are always given in pixel coordinates, irrespective of the state of this argument.

Return Value

Type: Double
The cumulative distance from the start of the feature to the VertexIndex vertex, plus the distance from that vertex to the target point. This distance will be in calibrated units if CalibratedDistance is True and the SpatialCalibration property is not Nothing.

Implements

IMcFeaturesDistanceToFeaturePoint(Single, Single, Int32, Int32, Boolean)
Remarks
This method determines the distance from the start of a given McLines feature line or the start of a given McRegions feature boundary up to a given vertex and then beyond that to a given point. The distance that the DistanceToFeaturePoint method computes is needed as an argument for the McProfileEdges.AddEdges method. The reciprocal computation (that is computing the vertex and point at a given a distance along a line or boundary) is done by the FeaturePointAtDistanceFromStart method. However usually, the FeatureIndex of the line or boundary feature, the vertex index up to which the distance is summed, and the point beyond that vertex will all have been computed by a call to the PointClosestToPoint method. See PointClosestToPoint for an example using FeaturePointAtDistanceFromStart.
See Also