CogGeneralContour ClassCognex VisionPro 9.5
A general contour is a shape made up of a series of directed line and arc segments followed in order to go from 'start' to 'end' of the contour. You build the shape by adding segments, giving the geometry and start/end connectivity of each one.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro CogGeneralContour

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

[SerializableAttribute]
public class CogGeneralContour : CogObjectBase, 
	ICogNetInternal, IDisposable, ICloneable, ISerializable, ICogHasChanged, 
	ICogChangedEvent, ICogShape, ICogGraphic, ICogGraphicInteractive, ICogGraphicParentChild, 
	ICogGraphicHighlight

The CogGeneralContour type exposes the following members.

Constructors

  NameDescription
Public methodCogGeneralContour 
Constructs a new instance of this class.
Public methodCogGeneralContour(IntPtr)
Constructs a new instance of this class using com pointer.
Public methodCogGeneralContour(CogGeneralContour)
Constructs a new instance of this class as a deep copy of the given instance.
Top
Methods

  NameDescription
Public methodAddEllipticalArcSegment
Adds an elliptical arc segment before NextSegment. If NextSegment is Nothing, the new segment is added at the end of the contour. If StartFlags has the 'connected' bit set, then StartX and StartY are ignored. This also applies to EndFlags.
Public methodAddLineSegment
Adds a new line segment before NextSegment. If NextSegment is Nothing, the new segment is added at the end of the contour. If StartFlags has the 'connected' bit set, then StartX and StartY are ignored. This also applies to EndFlags.
Protected methodClone
Returns a deep copy of this class instance. Derived classes that implement Clone should override this method; other clients who wish to clone this instance should call ICloneable.Clone. See also CogSerializer.DeepCopyObject
Public methodCopy
Creates and returns a new general contour, copying the specified parameters of this one.
Public methodCopyBase
Copy a graphic and its derived parameters.
Public methodCreateContourFromConnectedSegments
Returns a new contour, copying all segments in the connected segment chain that includes ContourSegment, into it.
Public methodCreateContourFromSegments
Returns a new contour, copying segments from StartSegment up to, but not including, EndSegment, into it. If EndSegment is Nothing, segments are copied from StartSegment to the end of this contour.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodCreateSegmentIterator
Creates an iterator to iterate over the segments in the contour. InitialSegmentIndex is the index of the segment pointed at by the iterator on return. A value of -1 is interpreted as SegmentCount, and will return the 'End' iterator.
Public methodDispose 
Protected methodDispose(Boolean)
Public methodDistanceToPoint
Shortest distance from this shape to the given point.
Public methodEnclosingRectangle
Minimum enclosing rectangle of this shape.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Overrides Object Finalize .)
Public methodFitToBoundingBox
Adjust the shape's geometric properties so that the shape fits inside passed in rectangle.
Public methodFitToImage
Adjust the shape's geometric properties such that its default size is based on the image and its SelectedSpaceName. XScale and YScale are multipliers where 1.0 designates 100% scaling.
Protected methodGetAttributes
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetClassName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetComponentName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetConverter
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultEvent
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultProperty
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEditor
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetObjectData
Public methodGetParentFromChildTransform
Protected methodGetProperties 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetProperties( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetPropertyOwner
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHighlightRelinquish
Decrement the HighlightRequested reference count, unless it is already zero. If HighlightRequested reaches zero, segment highlighting is disabled.
Public methodHighlightRequest
Enables segment highlighting by incrementing HighlightRequested.
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodMakeShapeModel
Returns a newly created shape model with the given weight and polarity. The 'Shape' property of the returned shape model will refer to this shape, or a copy of this shape, as specified by the CopyShape argument.
Public methodMap
Maps this shape through the given transform.
Public methodMapLinear
Creates a gcnew CogGeneralContour (copying the specified parameters) by mapping this one through the given linear transform.
Protected methodMemberwiseClone 
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Public methodMergeContours
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.
Public methodNearestSegment
Returns the segment closest to the given point.
Public methodPathLengthCenterOfMass
Computes the center of mass of the contour as if the mass were uniformly distributed along the segments.
Public methodRemoveSegment
Remove the given ContourSegment, disconnecting any neighboring segments it may be connected to. Returns a new iterator positioned at the segment immediately following the removed one (ContourSegment).
Public methodRemoveSegments
Removes all segments from StartSegment up to, but not including EndSegment, possibly disconnecting at StartSegment's start point, and/or EndSegment's start point. If EndSegment is Nothing, segments are removed from StartSegment to the end.
Public methodReplaceSegmentWithEllipticalArcSegment
Replaces ReplaceSegment with a new elliptical arc segment. If StartFlags has the 'connected' bit set, then StartX and StartY are ignored. This also applies to EndFlags.
Public methodReplaceSegmentWithLineSegment
Replaces ReplaceSegment with a new line segment. If StartFlags has the 'connected' bit set, then StartX and StartY are ignored. This also applies to EndFlags.
Public methodResumeAndRaiseChangedEvent
Re-enables raising of the Changed event after SuspendChangedEvent has been called. Also raises the Changed event if the ChangedEventSuspended count is reduced to zero and any changes were made while events were suspended. Must be called once for each call to SuspendChangedEvent.
Public methodSuspendChangedEvent
Temporarily suspends the raising of the Changed event. May be called more than once, and a corresponding call to ResumeAndRaiseChangedEvent must be made for each call to SuspendChangedEvent.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Fields

  NameDescription
Public fieldStatic memberSfChildren
This bit will be set in the EventArgs of a Changed event every time the value returned by Children may have changed.
Public fieldStatic memberSfClosed
This bit will be set in the EventArgs of a Changed event every time the value returned by Closed may have changed.
Public fieldStatic memberSfColor
This bit will be set in the EventArgs of a Changed event every time the value returned by Color may have changed.
Public fieldStatic memberSfDirectionAdornment
This bit will be set in the EventArgs of a Changed event every time the value returned by DirectionAdornment may have changed.
Public fieldStatic memberSfDragColor
This bit will be set in the EventArgs of a Changed event every time the value returned by DragColor may have changed.
Public fieldStatic memberSfDragLineStyle
This bit will be set in the EventArgs of a Changed event every time the value returned by DragLineStyle may have changed.
Public fieldStatic memberSfDragLineWidthInScreenPixels
This bit will be set in the EventArgs of a Changed event every time the value returned by DragLineWidthInScreenPixels may have changed.
Public fieldStatic memberSfEnclosingRectangle
This bit will be set in the EventArgs of a Changed event every time the value returned by EnclosingRectangle may have changed.
Public fieldStatic memberSfGetPenKey
This bit will be set in the EventArgs of a Changed event every time the value returned by GetPenKey may have changed.
Public fieldStatic memberSfGetPenType
This bit will be set in the EventArgs of a Changed event every time the value returned by GetPenType may have changed.
Public fieldStatic memberSfGraphicDOFEnable
This bit will be set in the EventArgs of a Changed event every time the value returned by GraphicDOFEnable may have changed.
Public fieldStatic memberSfGraphicDOFEnableBase
This bit will be set in the EventArgs of a Changed event every time the value returned by GraphicDOFEnableBase may have changed.
Public fieldStatic memberSfHighlightColor
This bit will be set in the EventArgs of a Changed event every time the value returned by HighlightColor may have changed.
Public fieldStatic memberSfHighlightIndex
This bit will be set in the EventArgs of a Changed event every time the value returned by HighlightIndex may have changed.
Public fieldStatic memberSfHighlightRequested
This bit will be set in the EventArgs of a Changed event every time the value returned by HighlightRequested may have changed.
Public fieldStatic memberSfInteractive
This bit will be set in the EventArgs of a Changed event every time the value returned by Interactive may have changed.
Public fieldStatic memberSfLength
This bit will be set in the EventArgs of a Changed event every time the value returned by Length may have changed.
Public fieldStatic memberSfLineStyle
This bit will be set in the EventArgs of a Changed event every time the value returned by LineStyle may have changed.
Public fieldStatic memberSfLineWidthInScreenPixels
This bit will be set in the EventArgs of a Changed event every time the value returned by LineWidthInScreenPixels may have changed.
Public fieldStatic memberSfMouseCursor
This bit will be set in the EventArgs of a Changed event every time the value returned by MouseCursor may have changed.
Public fieldStatic memberSfParent
This bit will be set in the EventArgs of a Changed event every time the value returned by Parent may have changed.
Public fieldStatic memberSfPenCount
This bit will be set in the EventArgs of a Changed event every time the value returned by PenCount may have changed.
Public fieldStatic memberSfSegmentCount
This bit will be set in the EventArgs of a Changed event every time the value returned by SegmentCount may have changed.
Public fieldStatic memberSfSelected
This bit will be set in the EventArgs of a Changed event every time the value returned by Selected may have changed.
Public fieldStatic memberSfSelectedColor
This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedColor may have changed.
Public fieldStatic memberSfSelectedLineStyle
This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedLineStyle may have changed.
Public fieldStatic memberSfSelectedLineWidthInScreenPixels
This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedLineWidthInScreenPixels may have changed.
Public fieldStatic memberSfSelectedSpaceName
This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedSpaceName may have changed.
Public fieldStatic memberSfTipText
This bit will be set in the EventArgs of a Changed event every time the value returned by TipText may have changed.
Public fieldStatic memberSfVertexAdornment
This bit will be set in the EventArgs of a Changed event every time the value returned by VertexAdornment may have changed.
Public fieldStatic memberSfVisible
This bit will be set in the EventArgs of a Changed event every time the value returned by Visible may have changed.
Top
Properties

  NameDescription
Public propertyChangedEventSuspended
If nonzero, indicates that the raising of the Changed event has been suspended. This value is incremented when SuspendChangedEvent is called and decremented when ResumeAndRaiseChangedEvent is called.
Public propertyChildren
Children of this graphic.
Public propertyClosed
True if the contour contains a single connected chain of segments that is closed, otherwise False.
Public propertyColor
Color of this graphic. Can be any OLE_COLOR.
Public propertyDirectionAdornment
Returns/sets the adornment used to indicate the direction of the contour.
Public propertyDragColor
Color of this graphic when dragged.
Public propertyDragLineStyle
Line style of this graphic when dragged.
Public propertyDragLineWidthInScreenPixels
Line width of this graphic when dragged.
Public propertyGraphicDOFEnable
Interactive Degree of freedom for this graphic object. Provides the ability to govern interactive manipulation of an object; for example could be used to prevent an object from being resized.
Public propertyGraphicDOFEnableBase
Interactive Degree of freedom for a graphic object. Allows access to each graphic's GraphicDOFEnable property without knowing the specific graphic type.
Public propertyHasChanged
If true, the serializable state of this object has changed since the last time it was serialized.
Public propertyHighlightColor
Get or set the color of the segment highlight.
Public propertyHighlightIndex
Get or set the index of the segment to be highlighted. If set to -1, no segment highlighting will occur.
Public propertyHighlightRequested
If greater than zero, segment highlighting is enabled.
Public propertyInteractive
Interactive property allow this graphic object to be selected. See GraphicDOFEnable for information on governing interactive manipulation of an object.
Public propertyLength
Computes the sum of the lengths of all segments of the contour.
Public propertyLineStyle
Line style of this graphic.
Public propertyLineWidthInScreenPixels
Line width (in screen pixels) of this graphic.
Public propertyMouseCursor
Mouse cursor to be displayed when the mouse is over the graphic. The cursor will be visible only if the graphic is interactive.
Public propertyOwnedCustomPens
Gets the set of custom pens used when drawing this contour. The pens are owned by this contour object, but are conveniently grouped together inside the returned interface.
Public propertyParent
Parent of this graphic.
Public propertySegmentCount
Returns the number of segments in this contour.
Public propertySelected
True when the shape is selected in a display.
Public propertySelectedColor
Color of this graphic when selected.
Public propertySelectedLineStyle
Line style of this graphic when selected.
Public propertySelectedLineWidthInScreenPixels
Line width of this graphic when selected.
Public propertySelectedSpaceName
Coordinate space in which this shape is to be interpreted.
Public propertyTipText
Text to describe this graphic in a tool tip.
Public propertyVertexAdornment
Returns/sets the adornment drawn at the vertices of the contour.
Public propertyVisible
Visible property of this graphic.
Top
Events

  NameDescription
Public eventChanged
Occurs when one or more parts of the object's state may have changed.
Public eventDragging
Occurs when an interactive graphic is being dragged.
Public eventDraggingStopped
Occurs after the drag operation of an interactive graphic is complete.
Public eventSegmentAdded
Occurs after a segment is added to the general contour.
Public eventSegmentsChanged
Occurs after a geometric property of one or more segments is changed in the general contour.
Public eventSegmentsRemoved
Occurs after one or more segments are deleted from the general contour.
Top
Remarks

A general contour is a shape made up of a series of directed line and arc segments followed in order to go from the start to the end of the contour. You build the shape by adding segments, giving the geometry and start point and end point connectivity of each one.

For information about manipulating a general contour interactively, see the discussion of general contour shape models.

See Also