ClassesClassesClassesClasses | | | | Operators

distance_contours_xlddistance_contours_xldDistanceContoursXlddistance_contours_xldDistanceContoursXldDistanceContoursXld (Operator)

Name

distance_contours_xlddistance_contours_xldDistanceContoursXlddistance_contours_xldDistanceContoursXldDistanceContoursXld — Calculate the pointwise distance from one contour to another.

Signature

distance_contours_xld(ContourFrom, ContourTo : ContourOut : Mode : )

Herror distance_contours_xld(const Hobject ContourFrom, const Hobject ContourTo, Hobject* ContourOut, const char* Mode)

Herror T_distance_contours_xld(const Hobject ContourFrom, const Hobject ContourTo, Hobject* ContourOut, const Htuple Mode)

Herror distance_contours_xld(Hobject ContourFrom, Hobject ContourTo, Hobject* ContourOut, const HTuple& Mode)

HXLDCont HXLDCont::DistanceContoursXld(const HXLDCont& ContourTo, const HTuple& Mode) const

HXLDContArray HXLDContArray::DistanceContoursXld(const HXLDContArray& ContourTo, const HTuple& Mode) const

void DistanceContoursXld(const HObject& ContourFrom, const HObject& ContourTo, HObject* ContourOut, const HTuple& Mode)

HXLDCont HXLDCont::DistanceContoursXld(const HXLDCont& ContourTo, const HString& Mode) const

HXLDCont HXLDCont::DistanceContoursXld(const HXLDCont& ContourTo, const char* Mode) const

void HOperatorSetX.DistanceContoursXld(
[in] IHUntypedObjectX* ContourFrom, [in] IHUntypedObjectX* ContourTo, [out] IHUntypedObjectX*ContourOut, [in] VARIANT Mode)

IHXLDContX* HXLDContX.DistanceContoursXld(
[in] IHXLDContX* ContourTo, [in] BSTR Mode)

static void HOperatorSet.DistanceContoursXld(HObject contourFrom, HObject contourTo, out HObject contourOut, HTuple mode)

HXLDCont HXLDCont.DistanceContoursXld(HXLDCont contourTo, string mode)

Description

The operator distance_contours_xlddistance_contours_xldDistanceContoursXlddistance_contours_xldDistanceContoursXldDistanceContoursXld calculates for each point in ContourFromContourFromContourFromContourFromContourFromcontourFrom the minimal distance to the contours in ContourToContourToContourToContourToContourTocontourTo. The operator returns the contour ContourOutContourOutContourOutContourOutContourOutcontourOut which consists of ContourFromContourFromContourFromContourFromContourFromcontourFrom containing the computed distances in the attribute 'distance'"distance""distance""distance""distance""distance". The distances can be accessed by querying the attribute 'distance'"distance""distance""distance""distance""distance" with the operator get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldget_contour_attrib_xldGetContourAttribXldGetContourAttribXld.

The parameter ModeModeModeModeModemode determines which distances are calculated for each point in ContourFromContourFromContourFromContourFromContourFromcontourFrom: 'point_to_point'"point_to_point""point_to_point""point_to_point""point_to_point""point_to_point" calculates the minimal distance to the base points of ContourToContourToContourToContourToContourTocontourTo. In contrast, 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment""point_to_segment" calculates the minimum distance to the contour segments in ContourToContourToContourToContourToContourTocontourTo (see the figure below).

The dashed lines illustrate the calculated distances starting from a point of ContourFromContourFromContourFromContourFromContourFromcontourFrom on the left. The distance corresponds to the 'point_to_point'"point_to_point""point_to_point""point_to_point""point_to_point""point_to_point" mode, whereas the distance corresponds to the 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment""point_to_segment" mode.

Note that in many applications the mode 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment""point_to_segment" suggests itself for an accurate result, whereas 'point_to_point'"point_to_point""point_to_point""point_to_point""point_to_point""point_to_point" is considerably faster. If m is the number of points in ContourFromContourFromContourFromContourFromContourFromcontourFrom, and n the number of points in ContourToContourToContourToContourToContourTocontourTo, then distance_contours_xlddistance_contours_xldDistanceContoursXlddistance_contours_xldDistanceContoursXldDistanceContoursXld has complexity O(mlog(n)) for 'point_to_point'"point_to_point""point_to_point""point_to_point""point_to_point""point_to_point", and O(mn) for 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment""point_to_segment". In case the template contour ContourToContourToContourToContourToContourTocontourTo is repeatedly used, the operators create_distance_transform_xldcreate_distance_transform_xldCreateDistanceTransformXldcreate_distance_transform_xldCreateDistanceTransformXldCreateDistanceTransformXld and apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXld can be used as an alternative to distance_contours_xlddistance_contours_xldDistanceContoursXlddistance_contours_xldDistanceContoursXldDistanceContoursXld. For further details, please refer to the documentation of create_distance_transform_xldcreate_distance_transform_xldCreateDistanceTransformXldcreate_distance_transform_xldCreateDistanceTransformXldCreateDistanceTransformXld.

Parallelization

Parameters

ContourFromContourFromContourFromContourFromContourFromcontourFrom (input_object)  xld_cont(-array) objectHXLDContHXLDContHXLDContHXLDContXHobject

Contours for whose points the distances are calculated.

ContourToContourToContourToContourToContourTocontourTo (input_object)  xld_cont(-array) objectHXLDContHXLDContHXLDContHXLDContXHobject

Contours to which the distances are calculated to.

ContourOutContourOutContourOutContourOutContourOutcontourOut (output_object)  xld_cont(-array) objectHXLDContHXLDContHXLDContHXLDContXHobject *

Copy of ContourFromContourFromContourFromContourFromContourFromcontourFrom containing the distances as an attribute.

ModeModeModeModeModemode (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Compute the distance to points ('point_to_point') or to entire segments ('point_to_segment').

Default value: 'point_to_point' "point_to_point" "point_to_point" "point_to_point" "point_to_point" "point_to_point"

List of values: 'point_to_point'"point_to_point""point_to_point""point_to_point""point_to_point""point_to_point", 'point_to_segment'"point_to_segment""point_to_segment""point_to_segment""point_to_segment""point_to_segment"

Result

If all parameters are correct, the operator returns the value 2 (H_MSG_TRUE). Otherwise, an exception is raised.

Possible Successors

get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldget_contour_attrib_xldGetContourAttribXldGetContourAttribXld, segment_contour_attrib_xldsegment_contour_attrib_xldSegmentContourAttribXldsegment_contour_attrib_xldSegmentContourAttribXldSegmentContourAttribXld

Alternatives

apply_distance_transform_xldapply_distance_transform_xldApplyDistanceTransformXldapply_distance_transform_xldApplyDistanceTransformXldApplyDistanceTransformXld, distance_ccdistance_ccDistanceCcdistance_ccDistanceCcDistanceCc, distance_cc_mindistance_cc_minDistanceCcMindistance_cc_minDistanceCcMinDistanceCcMin

Module

Foundation


ClassesClassesClassesClasses | | | | Operators