Class that represents a polygon.
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
The Polygon type exposes the following members.
| Name | Description | |
|---|---|---|
| Polygon | Constructs a new instance of this class. |
| Name | Description | |
|---|---|---|
| AddVertex | 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. | |
| ArcCenter | 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. | |
| ArcMoments1 | 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. | |
| ArcMoments2 | 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. | |
| AreaCenter | Compute the centroid of this polygon. Generates an error if there are fewer than 3 vertices. | |
| AreaMoments1 | Compute the zeroth and first moments of area of this polygon. Results will be zero if there are fewer than 3 vertices. | |
| AreaMoments2 | Compute the zeroth, first, and second moments of area of this polygon. Results will be zero if there are fewer than 3 vertices. | |
| ConvexHull | Compute and return a CogPolygon that is the convex hull of these vertices. | |
| Copy | Create a new polygon that replicates the specified properties. | |
| CopyBase | Copy a graphic and its derived parameters. | |
| DistanceToPoint | Shortest distance from a boundary of this shape to the given point. Points within closed shapes return a distance less than zero. | |
| EnclosingRectangle | Minimum enclosing rectangle of this shape. | |
| Equals | Compares the equality of this object with another. (Overrides GraphicInteractiveBase Equals(Object).) | |
| FitToBoundingBox | Adjust the shape's geometric properties so that the shape fits inside passed in rectangle. | |
| FitToImage | 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. | |
| GetHashCode | Returns the hash code of this object. (Overrides GraphicInteractiveBase GetHashCode .) | |
| GetParentFromChildTransform | Gets the parent transform from the child transform. | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| GetTypeMeta | Get the TypeMeta that describes the type of this object. | |
| GetVertex | Get the coordinates of the vertex at the specified index. Index must be >= 0 and < NumVertices. | |
| GetVertexAdornmentColor | The adornment color for the vertex with the given index. | |
| GetVertexX | The X-coordinate of the vertex with the given index. | |
| GetVertexY | The Y-coordinate of the vertex with the given index. | |
| GetVertices | 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. | |
| HighlightRelinquish | Decrement the HighlightRequested reference count, unless it is already zero. If HighlightRequested reaches zero, highlighting is disabled. | |
| HighlightRequest | Enables highlighting by incrementing HighlightRequested. | |
| Map | Maps this shape through the given transform. | |
| MapLinear | Create a new polygon by mapping this one through the given transform. | |
| MeanVertex | Return the average X and Y coordinates of all the vertices. Generates an error if there are no vertices. | |
| NearestVertex | Return the index number of the vertex nearest to the supplied X,Y coordinates. Generates an error if there are no vertices. | |
| RemoveVertex | Remove the specified vertex from the polygon. Index must be >= 0 and < NumVertices. | |
| ResumeAndRaiseChangedEvent | 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. | |
| SetVertex | Set the coordinates of the vertex at the specified index. Index must be >= 0 and < NumVertices. | |
| SetVertexAdornmentColor | The adornment color for the vertex with the given index. | |
| SetVertexX | Set the X-coordinate of the vertex with the given index. | |
| SetVertexY | The Y-coordinate of the vertex with the given index. | |
| SetVertices | 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. | |
| SuspendChangedEvent | 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. | |
| ToString | Returns a human readable string that represents the object. | |
| VertexReserve | 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. |
| Name | Description | |
|---|---|---|
| Equality | Compares the equality of two Polygon objects. | |
| Inequality | Compares the inequality of two Polygon objects. |
| Name | Description | |
|---|---|---|
| Area | Area of the enclosed region, in units consistent with the SelectedSpaceName. Zero if there are fewer than 3 vertices. | |
| ChangedEventSuspended | Indicates if raising the ChangedEvent has been suspended. | |
| Children | Children of this graphic. | |
| Color | Color of this graphic. Can be any OLE_COLOR. | |
| Complex | True if any segments are intersecting, otherwise False. | |
| Convex | True if the polygon is identical to the convex hull of its vertices, otherwise False. | |
| DragColor | Color of this graphic when dragged. | |
| DragLineStyle | Line style of the graphic when dragged. | |
| DragLineWidthInScreenPixels | Line width of this graphic when dragged. | |
| FillColor | The fill color of this graphic. | |
| FillMode | Get The algorithm to be used to distinguish inside from outside. | |
| GraphicDOFEnable | 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. | |
| GraphicDOFEnableBase | Interactive Degree of freedom for a graphic object. Allows access to each graphic's GraphicDOFEnable property without knowing the specific graphic type. | |
| Handle | (Overrides GraphicInteractiveBase Handle.) | |
| HighlightColor | Get Get the color of the highlighted feature. | |
| HighlightIndex | Get Get the index of the feature to be highlighted. If set to -1, no highlighting will occur. | |
| HighlightRequested | If greater than zero, highlighting is enabled. | |
| Interactive | Interactive property allow this graphic object to be selected. See GraphicDOFEnable for information on governing interactive manipulation of an object. | |
| LineStyle | Line style of this graphic. | |
| LineWidthInScreenPixels | Line width (in screen pixels) of this graphic. | |
| MouseCursor | Mouse cursor to be displayed when the mouse is over the graphic. The cursor will be visible only if the graphic is interactive. | |
| NumVertices | Get Number of vertices in this polygon. | |
| Parent | Return a reference to the containing tracking collection. May be null. | |
| Perimeter | Perimeter of the polygon, in units consistent with the SelectedSpaceName. Zero if there are fewer than 2 vertices. | |
| Selected | True when the shape is selected in a display. | |
| SelectedColor | Color of this graphic when selected. | |
| SelectedLineStyle | Line style of this graphic when selected. | |
| SelectedLineWidthInScreenPixels | Line width of this graphic when selected. | |
| SelectedSpaceName | Get (Overrides GraphicInteractiveBase SelectedSpaceName.)Coordinate space in which this shape is to be interpreted. | |
| TipText | Text to describe this graphic in a tool tip. Newline characters can be used to create multi-line tip text. | |
| VertexAdornment | Get The adornment shape to be rendered for each vertex. | |
| VertexCapacity | The maximum number of vertices that may be held by this polygon without reallocating storage. | |
| Visible | Visible property of this graphic. |
| Name | Description | |
|---|---|---|
| BulkChanged | Occurs after a bulk change to the polygon, such as a call to SetVertices. | |
| Changed | The actual event. | |
| Dragging | Raised when an interactive graphic is being dragged. | |
| DraggingStopped | Raised after the drag operation of an interactive graphic is complete. | |
| VertexAdded | Occurs after one or more vertices are added to the polygon. | |
| VertexChanged | Occurs after the x or y coordinate of a single vertex is changed in the polygon. | |
| VertexRemoved | Occurs after one or more vertices are deleted from the polygon. |
Interface describing a polygon shape.