Class that represents a polygon.
Inheritance Hierarchy
System MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro CogPolygon
Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.0.0.0
Syntax
The CogPolygon type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogPolygon | Constructs a new instance of this class. | |
| CogPolygon(IntPtr) | Constructs a new instance of this class using com pointer. | |
| CogPolygon(CogPolygon) | Constructs a new instance of this class as a deep copy of the given instance. |
Methods
| 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. | |
| Clone | 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 | |
| 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. | |
| CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
| CreateRLE | Create an RLE representation of this Region. | |
| Dispose | ||
| Dispose(Boolean) | ||
| 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 | (Inherited from Object.) | |
| Finalize | (Overrides Object Finalize .) | |
| 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. | |
| GetAttributes |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetClassName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetComponentName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetConverter |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultEvent |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultProperty |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEditor |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents( Attribute ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| GetObjectData | ||
| GetParentFromChildTransform | ||
| GetProperties |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetProperties( Attribute ) | (Overrides CogObjectBase GetProperties( Attribute ).) | |
| GetPropertyOwner |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetType | Gets the Type of the current instance. (Inherited from 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, vertex highlighting is disabled. | |
| HighlightRequest | Enables vertex highlighting by incrementing HighlightRequested. | |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| MakeShapeModel | 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. | |
| 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. | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) | |
| 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 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. | |
| 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 | 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 Changed event. May be called more than once, and a corresponding call to ResumeAndRaiseChangedEvent must be made for each call to SuspendChangedEvent. | |
| ToString | (Inherited from 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. |
Fields
| Name | Description | |
|---|---|---|
| SfArea | This bit will be set in the EventArgs of a Changed event every time the value returned by Area may have changed. | |
| SfChildren | This bit will be set in the EventArgs of a Changed event every time the value returned by Children may have changed. | |
| SfColor | This bit will be set in the EventArgs of a Changed event every time the value returned by Color may have changed. | |
| SfComplex | This bit will be set in the EventArgs of a Changed event every time the value returned by Complex may have changed. | |
| SfConvex | This bit will be set in the EventArgs of a Changed event every time the value returned by Convex may have changed. | |
| SfCreateRLE | This bit will be set in the EventArgs of a Changed event every time the value returned by CreateRLE may have changed. | |
| SfDragColor | This bit will be set in the EventArgs of a Changed event every time the value returned by DragColor may have changed. | |
| SfDragLineStyle | This bit will be set in the EventArgs of a Changed event every time the value returned by DragLineStyle may have changed. | |
| SfDragLineWidthInScreenPixels | This bit will be set in the EventArgs of a Changed event every time the value returned by DragLineWidthInScreenPixels may have changed. | |
| SfEnclosingRectangle | This bit will be set in the EventArgs of a Changed event every time the value returned by EnclosingRectangle may have changed. | |
| SfFillMode | This bit will be set in the EventArgs of a Changed event every time the value returned by FillMode may have changed. | |
| SfGetVertexAdornmentColor | This bit will be set in the EventArgs of a Changed event every time the value returned by GetVertexAdornmentColor may have changed. | |
| SfGetVertexX | This bit will be set in the EventArgs of a Changed event every time the value returned by GetVertexX may have changed. | |
| SfGetVertexY | This bit will be set in the EventArgs of a Changed event every time the value returned by GetVertexY may have changed. | |
| SfGraphicDOFEnable | This bit will be set in the EventArgs of a Changed event every time the value returned by GraphicDOFEnable may have changed. | |
| SfGraphicDOFEnableBase | This bit will be set in the EventArgs of a Changed event every time the value returned by GraphicDOFEnableBase may have changed. | |
| SfHighlightColor | This bit will be set in the EventArgs of a Changed event every time the value returned by HighlightColor may have changed. | |
| SfHighlightIndex | This bit will be set in the EventArgs of a Changed event every time the value returned by HighlightIndex may have changed. | |
| SfHighlightRequested | This bit will be set in the EventArgs of a Changed event every time the value returned by HighlightRequested may have changed. | |
| SfInteractive | This bit will be set in the EventArgs of a Changed event every time the value returned by Interactive may have changed. | |
| SfLineStyle | This bit will be set in the EventArgs of a Changed event every time the value returned by LineStyle may have changed. | |
| SfLineWidthInScreenPixels | This bit will be set in the EventArgs of a Changed event every time the value returned by LineWidthInScreenPixels may have changed. | |
| SfMouseCursor | This bit will be set in the EventArgs of a Changed event every time the value returned by MouseCursor may have changed. | |
| SfNumVertices | This bit will be set in the EventArgs of a Changed event every time the value returned by NumVertices may have changed. | |
| SfParent | This bit will be set in the EventArgs of a Changed event every time the value returned by Parent may have changed. | |
| SfPerimeter | This bit will be set in the EventArgs of a Changed event every time the value returned by Perimeter may have changed. | |
| SfSelected | This bit will be set in the EventArgs of a Changed event every time the value returned by Selected may have changed. | |
| SfSelectedColor | This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedColor may have changed. | |
| SfSelectedLineStyle | This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedLineStyle may have changed. | |
| SfSelectedLineWidthInScreenPixels | This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedLineWidthInScreenPixels may have changed. | |
| SfSelectedSpaceName | This bit will be set in the EventArgs of a Changed event every time the value returned by SelectedSpaceName may have changed. | |
| SfTipText | This bit will be set in the EventArgs of a Changed event every time the value returned by TipText may have changed. | |
| SfVertexAdornment | This bit will be set in the EventArgs of a Changed event every time the value returned by VertexAdornment may have changed. | |
| SfVertexCapacity | This bit will be set in the EventArgs of a Changed event every time the value returned by VertexCapacity may have changed. | |
| SfVisible | This bit will be set in the EventArgs of a Changed event every time the value returned by Visible may have changed. |
Properties
| Name | Description | |
|---|---|---|
| Area | Area of the enclosed region, in units consistent with the SelectedSpaceName. Zero if there are fewer than 3 vertices. | |
| ChangedEventSuspended | 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. | |
| 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 this graphic when dragged. | |
| DragLineWidthInScreenPixels | Line width of this graphic when dragged. | |
| FillMode | The algorithm to be used to distinguish inside from outside. | |
| GraphicDOFEnable | 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. | |
| HasChanged | If true, the serializable state of this object has changed since the last time it was serialized. | |
| HighlightColor | Get or set the color of the vertex highlight. | |
| HighlightIndex | Get or set the index of the vertex to be highlighted. If set to -1, no vertex highlighting will occur. | |
| HighlightRequested | If greater than zero, vertex 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 | Number of vertices in this polygon. | |
| Parent | Parent of this graphic. | |
| 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 | Coordinate space in which this shape is to be interpreted. | |
| TipText | Text to describe this graphic in a tool tip. | |
| VertexAdornment | 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. |
Events
| Name | Description | |
|---|---|---|
| BulkChanged | Occurs after a bulk change to the polygon, such as a call to SetVertices or loading from an archive. | |
| Changed | Occurs when one or more parts of the object's state may have changed. | |
| Dragging | Occurs when an interactive graphic is being dragged. | |
| DraggingStopped | Occurs 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. |
Remarks
Interface describing a polygon shape.
See Also