CogGeneralContour MergeContours Method Cognex VisionPro 9.8
Returns a new contour that is the result of merging OtherContour into this before NextSegment. StartFlags and EndFlags control how OtherContour's start and end segments connect to this contour's segments in the merged contour.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.1.0.0
Syntax

public CogGeneralContour MergeContours(
	CogGeneralContourSegmentIterator nextSegment,
	CogGeneralContour otherContour,
	CogGeneralContourVertexConstants startFlags,
	CogGeneralContourVertexConstants endFlags,
	CogCopyShapeConstants copyFlags
)

Parameters

nextSegment
Type: Cognex.VisionPro CogGeneralContourSegmentIterator

The segment before which otherContour is merged into this contour.

otherContour
Type: Cognex.VisionPro CogGeneralContour

The contour to merge into this contour.

startFlags
Type: Cognex.VisionPro CogGeneralContourVertexConstants

Flags that specify how the otherContour's start point is treated with respect to the segments in this contour.

endFlags
Type: Cognex.VisionPro CogGeneralContourVertexConstants

Flags that specify how the otherContour's end point is treated with respect to the segments in this contour.

copyFlags
Type: Cognex.VisionPro CogCopyShapeConstants

Specify which attributes of the contour to copy to the new contour.

Return Value

Type: CogGeneralContour

The new contour.

Exceptions

ExceptionCondition
ArgumentException

otherContour is Nothing.

CogIteratorInvalidIteratorException

nextSegment is invalid and not the end segment.

ArgumentException

startFlags or endFlags include bits that are not defined in CogGeneralContourVertexConstants.

CogShapeBadContourChainClosureException

endFlags include Closed but startFlags do not include Connected ; or startFlags include Closed but endFlags do not include Connected. This error may also occur if the startFlags and endFlags are set properly but closing the chain would create a contour with only two segments.

Remarks

Returns a new contour that is the result of merging otherContour into this contour before nextSegment. If nextSegment is Nothing, the segments from otherContour are copied onto the end of this contour. startFlags and endFlags control how otherContour's start and end segments connect to this contour's segments in the merged contour.

See Also