Polygon ClassCognex VisionPro 9.20

Class that represents a polygon.

Inheritance Hierarchy

System Object
  Cognex.Vision ShareableBase
    Cognex.Vision ChangedEventShareableBase
      Cognex.Vision GraphicInteractiveBase
        Cognex.Vision Polygon

Namespace: Cognex.Vision
Assembly: Cognex.Vision.Core.Net (in Cognex.Vision.Core.Net.dll) Version: 9.10.0.0
Syntax

public sealed class Polygon : GraphicInteractiveBase, 
	IRegion, IShape, IChangedEvent, IObject, IDiamondGraphicShape, 
	IGraphicHighlight, IHaveFakePropertyMeta

The Polygon type exposes the following members.

Constructors

  NameDescription
Public methodPolygon

Constructs a new instance of this class.

Top
Methods

  NameDescription
Public methodAddVertex

Add a vertex to the polygon. If the default index -1 is used, the new vertex will be added to the end of any existing vertices. Otherwise Index must be >= 0 and <= NumVertices.

Public methodArcCenter

Compute the center of mass of this polygon as if the mass were uniformly distributed along the perimeter. Generates an error if there are less than two vertices.

Public methodArcMoments1

Compute the zeroth and first moments of this polygon as if the mass were uniformly distributed along the perimeter. Results will be zero if there are fewer than two vertices.

Public methodArcMoments2

Compute the zeroth, first, and second moments of this polygon as if the mass were uniformly distributed along the perimeter. Results will be zero if there are fewer than two vertices.

Public methodAreaCenter

Compute the centroid of this polygon. Generates an error if there are fewer than 3 vertices.

Public methodAreaMoments1

Compute the zeroth and first moments of area of this polygon. Results will be zero if there are fewer than 3 vertices.

Public methodAreaMoments2

Compute the zeroth, first, and second moments of area of this polygon. Results will be zero if there are fewer than 3 vertices.

Public methodConvexHull

Compute and return a CogPolygon that is the convex hull of these vertices.

Public methodCopy

Create a new polygon that replicates the specified properties.

Public methodCopyBase

Copy a graphic and its derived parameters.

(Overrides GraphicInteractiveBase CopyBase(CopyShapeConstants).)
Public methodDistanceToPoint

Shortest distance from a boundary of this shape to the given point. Points within closed shapes return a distance less than zero.

Public methodEnclosingRectangle

Minimum enclosing rectangle of this shape.

Public methodEquals
Compares the equality of this object with another.
(Overrides GraphicInteractiveBase Equals(Object).)
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.

Public methodGetHashCode
Returns the hash code of this object.
(Overrides GraphicInteractiveBase GetHashCode .)
Public methodGetParentFromChildTransform

Gets the parent transform from the child transform.

(Overrides GraphicInteractiveBase GetParentFromChildTransform .)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetTypeMeta

Get the TypeMeta that describes the type of this object.

(Overrides ShareableBase GetTypeMeta .)
Public methodGetVertex

Get the coordinates of the vertex at the specified index. Index must be >= 0 and < NumVertices.

Public methodGetVertexAdornmentColor

The adornment color for the vertex with the given index.

Public methodGetVertexX

The X-coordinate of the vertex with the given index.

Public methodGetVertexY

The Y-coordinate of the vertex with the given index.

Public methodGetVertices

The X,Y coordinates of all vertices, returned as a two-dimensional array. The size of this array is automatically set to match the number of vertices.

Public methodHighlightRelinquish

Decrement the HighlightRequested reference count, unless it is already zero. If HighlightRequested reaches zero, highlighting is disabled.

Public methodHighlightRequest

Enables highlighting by incrementing HighlightRequested.

Public methodMap

Maps this shape through the given transform.

Public methodMapLinear

Create a new polygon by mapping this one through the given transform.

Public methodMeanVertex

Return the average X and Y coordinates of all the vertices. Generates an error if there are no vertices.

Public methodNearestVertex

Return the index number of the vertex nearest to the supplied X,Y coordinates. Generates an error if there are no vertices.

Public methodRemoveVertex

Remove the specified vertex from the polygon. Index must be >= 0 and < NumVertices.

Public methodResumeAndRaiseChangedEvent

Re-enables raising of the ChangedEvent after SuspendChangedEvent has been called, and raises the ChangedEvent 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.

(Overrides ChangedEventShareableBase ResumeAndRaiseChangedEvent .)
Public methodSetVertex

Set the coordinates of the vertex at the specified index. Index must be >= 0 and < NumVertices.

Public methodSetVertexAdornmentColor

The adornment color for the vertex with the given index.

Public methodSetVertexX

Set the X-coordinate of the vertex with the given index.

Public methodSetVertexY

The Y-coordinate of the vertex with the given index.

Public methodSetVertices

Modify the coordinates of the vertices to match the supplied values. If there are more supplied values than vertices, append sufficient vertices. If there are fewer supplied values than vertices, discard vertices at the end.

Public methodSuspendChangedEvent

Temporarily suspends the raising of the ChangedEvent. May be called more than once, and a corresponding call to ResumeAndRaiseChangedEvent must be made for each call to SuspendChangedEvent.

(Overrides ChangedEventShareableBase SuspendChangedEvent .)
Public methodToString

Returns a human readable string that represents the object.

(Overrides Object ToString .)
Public methodVertexReserve

If the supplied value is less than or equal to the current VertexCapacity, there will be no change. Otherwise, ensure that VertexCapacity is greater than or equal to the supplied value.

Top
Operators

  NameDescription
Public operatorStatic memberEquality
Compares the equality of two Polygon objects.
Public operatorStatic memberInequality
Compares the inequality of two Polygon objects.
Top
Fields

  NameDescription
Public fieldStatic memberSfArea
Public fieldStatic memberSfComplex
Public fieldStatic memberSfConvex
Public fieldStatic memberSfFillMode
Public fieldStatic memberSfGetVertexAdornmentColor
Public fieldStatic memberSfGetVertexX
Public fieldStatic memberSfGetVertexY
Public fieldStatic memberSfHighlightColor
Public fieldStatic memberSfHighlightIndex
Public fieldStatic memberSfHighlightRequested
Public fieldStatic memberSfNumVertices
Public fieldStatic memberSfPerimeter
Public fieldStatic memberSfVertexAdornment
Public fieldStatic memberSfVertexCapacity
Top
Properties

  NameDescription
Public propertyArea

Area of the enclosed region, in units consistent with the SelectedSpaceName. Zero if there are fewer than 3 vertices.

Public propertyChangedEventSuspended

Indicates if raising the ChangedEvent has been suspended.

(Overrides ChangedEventShareableBase ChangedEventSuspended.)
Public propertyChildren

Children of this graphic.

(Overrides GraphicInteractiveBase Children.)
Public propertyColor

Color of this graphic. Can be any OLE_COLOR.

(Overrides GraphicInteractiveBase Color.)
Public propertyComplex

True if any segments are intersecting, otherwise False.

Public propertyConvex

True if the polygon is identical to the convex hull of its vertices, otherwise False.

Public propertyDragColor

Color of this graphic when dragged.

(Overrides GraphicInteractiveBase DragColor.)
Public propertyDragLineStyle

Line style of the graphic when dragged.

(Overrides GraphicInteractiveBase DragLineStyle.)
Public propertyDragLineWidthInScreenPixels

Line width of this graphic when dragged.

(Overrides GraphicInteractiveBase DragLineWidthInScreenPixels.)
Public propertyFillColor

The fill color of this graphic.

(Overrides GraphicInteractiveBase FillColor.)
Public propertyFillMode
Get

The algorithm to be used to distinguish inside from outside.

Public propertyGraphicDOFEnable
Get

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.

(Overrides GraphicInteractiveBase GraphicDOFEnableBase.)
Public propertyHandle (Overrides GraphicInteractiveBase Handle.)
Public propertyHighlightColor
Get

Get the color of the highlighted feature.

Public propertyHighlightIndex
Get

Get the index of the feature to be highlighted. If set to -1, no highlighting will occur.

Public propertyHighlightRequested

If greater than zero, 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.

(Overrides GraphicInteractiveBase Interactive.)
Public propertyLineStyle

Line style of this graphic.

(Overrides GraphicInteractiveBase LineStyle.)
Public propertyLineWidthInScreenPixels

Line width (in screen pixels) of this graphic.

(Overrides GraphicInteractiveBase LineWidthInScreenPixels.)
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.

(Overrides GraphicInteractiveBase MouseCursor.)
Public propertyNumVertices
Get

Number of vertices in this polygon.

Public propertyParent

Return a reference to the containing tracking collection. May be null.

(Overrides GraphicInteractiveBase Parent.)
Public propertyPerimeter

Perimeter of the polygon, in units consistent with the SelectedSpaceName. Zero if there are fewer than 2 vertices.

Public propertySelected

True when the shape is selected in a display.

(Overrides GraphicInteractiveBase Selected.)
Public propertySelectedColor

Color of this graphic when selected.

(Overrides GraphicInteractiveBase SelectedColor.)
Public propertySelectedLineStyle

Line style of this graphic when selected.

(Overrides GraphicInteractiveBase SelectedLineStyle.)
Public propertySelectedLineWidthInScreenPixels

Line width of this graphic when selected.

(Overrides GraphicInteractiveBase SelectedLineWidthInScreenPixels.)
Public propertySelectedSpaceName
Get

Coordinate space in which this shape is to be interpreted.

(Overrides GraphicInteractiveBase SelectedSpaceName.)
Public propertyTipText

Text to describe this graphic in a tool tip. Newline characters can be used to create multi-line tip text.

(Overrides GraphicInteractiveBase TipText.)
Public propertyVertexAdornment
Get

The adornment shape to be rendered for each vertex.

Public propertyVertexCapacity

The maximum number of vertices that may be held by this polygon without reallocating storage.

Public propertyVisible

Visible property of this graphic.

(Overrides GraphicInteractiveBase Visible.)
Top
Events

  NameDescription
Public eventBulkChanged

Occurs after a bulk change to the polygon, such as a call to SetVertices.

Public eventChanged

The actual event.

(Overrides ChangedEventShareableBase Changed.)
Public eventDragging

Raised when an interactive graphic is being dragged.

(Overrides GraphicInteractiveBase Dragging.)
Public eventDraggingStopped

Raised after the drag operation of an interactive graphic is complete.

(Overrides GraphicInteractiveBase DraggingStopped.)
Public eventVertexAdded

Occurs after one or more vertices are added to the polygon.

Public eventVertexChanged

Occurs after the x or y coordinate of a single vertex is changed in the polygon.

Public eventVertexRemoved

Occurs after one or more vertices are deleted from the polygon.

Top
Remarks

Interface describing a polygon shape.

See Also