This class is a general purpose container of vision data. Each
element in this container has both a string key and a value of type
ICogVisionData. This container maintains an ordered list of these key
value pairs. A particular ICogVisionData value may be referenced by
integer index as in a list, or by string key as in a dictionary. The
keys must all be unique, non-null, non-empty strings. In addition,
this class implements the ICogVisionData interface.
Inheritance Hierarchy
System MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro.Implementation CogSerializableObjectBase
Cognex.VisionPro.Implementation CogSerializableChangedEventBase
Cognex.VisionPro CogVisionDataContainer
Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.CorePlus (in Cognex.VisionPro.CorePlus.dll) Version: 83.0.0.0
Syntax
[SerializableAttribute] public class CogVisionDataContainer : CogSerializableChangedEventBase, IList<KeyValuePair<string, ICogVisionData>>, IDictionary<string, ICogVisionData>, ICogCollectionEvents, IDeserializationCallback, ICogVisionData, ICogVisionData, ICogVisionDataContainerLegacy
The CogVisionDataContainer type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogVisionDataContainer |
Default construct a CogVisionDataContainer.
| |
| CogVisionDataContainer(CogVisionDataContainer) |
Copy construct a CogVisionDataContainer from the
supplied container. This is a shallow copy: the values are
copied not cloned.
| |
| CogVisionDataContainer(SerializationInfo, StreamingContext) |
Serialization construct a CogVisionDataContainer.
|
Methods
| Name | Description | |
|---|---|---|
| Add(KeyValuePair String, ICogVisionData ) |
Adds the supplied key value pair to the end of the container.
| |
| Add(String, ICogVisionData) |
Adds to the end of the container a key value pair
using the supplied key string and ICogVisionData value.
| |
| Clear |
Removes all key value pairs from the container.
| |
| Contains(KeyValuePair String, ICogVisionData ) |
Returns true if the supplied key value pair is found,
otherwise returns false.
| |
| Contains(String) |
Returns true if the supplied key is found,
otherwise returns false.
| |
| Contains(ICogVisionData) |
Returns true if the supplied value is found,
otherwise returns false.
| |
| ContainsKey |
Returns true if the specified key is found in this container,
otherwise returns false.
| |
| ContainsValue |
Returns true if the specified value is found in this container,
otherwise returns false.
| |
| CopyTo |
Copies the entire collection to a one-dimensional array
of key value pairs, starting at the specified
index of the target array.
| |
| 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.) | |
| Equals | (Inherited from Object.) | |
| Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
| 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.) | |
| GetEnumerator |
Get an enumerator for this conllection of
key value pairs.
| |
| 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.) | |
| GetKey |
Returns the key string associated with the
specified index.
| |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| GetObjectData |
Implements the GetObjectData method of the ISerializable interface.
(Inherited from CogSerializableObjectBase.) | |
| 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 ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetPropertyOwner |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetRangeGreyImagePairs( CogImage16Range , CogImage16Grey ) | ||
| GetRangeGreyImagePairs( CogImage16Range , CogImage16Grey , String ) |
This method steps through the top level elements in the
container. For every element that is itself a container
holding exactly one CogImage16Range and exactly one
CogImage16Grey (and possibly some other objects), copy a
reference to that range image into the output array of
CogImage16Range references. And copy a reference to the
grey image into the output array of CogImage16Grey. And
copy the associated top level dictionary key string into
the output array of string references. The output arrays
may be empty. This method ignores top level elements that
are not of type CogVisionDataContainer. This method ignores
top level elements that contain more than one CogImage16Range
or more than one CogImage16Grey.
| |
| GetRangeImages( CogImage16Range ) | ||
| GetRangeImages( CogImage16Range , String ) |
This method steps through the top level elements in this
container and copies a reference to every CogImage16Range
that it finds into an output array of CogImage16Range references.
For every range image so identified, the associated dictionary
key string is copied into an output array of string references.
The resultant output arrays may be empty. This method ignores
top level elements that are not of type CogImage16Range.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| IndexOf(KeyValuePair String, ICogVisionData ) |
Searches the container for the specified key value pair and
returns the zero-based index of the first occurrence.
| |
| IndexOf(String) |
Searches the container for the key value pair with the
specified key and returns its zero-based index.
| |
| IndexOf(ICogVisionData) |
Searches the container for the key value pair with the
specified value and returns its zero-based index.
| |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| Insert(Int32, KeyValuePair String, ICogVisionData ) |
Inserts the supplied key value pair at the specified index.
| |
| Insert(Int32, String, ICogVisionData) |
Inserts a key value pair with the supplied
string key and ICogVisionData value at the
specified index.
| |
| 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.) | |
| Move |
Moves a key value pair from one position to another.
| |
| OnChanged(Int64) |
This method should be called internally whenever the object's state may
have changed.
(Inherited from CogSerializableChangedEventBase.) | |
| OnChanged(CogChangedEventArgs) |
This method may be called internally whenever a derived object's state
may have changed and the derived object expresses this change via a
derived CogChangedEventArgs class.
(Inherited from CogSerializableChangedEventBase.) | |
| OnCleared |
Raises the Cleared event and the Changed event.
| |
| OnClearing |
Raises the Clearing event.
| |
| OnDeserialization |
Perform post-deserialization tasks.
| |
| OnInsertedItem |
Raises the InsertedItem event and the Changed event.
| |
| OnInsertingItem |
Raises the InsertingItem event.
| |
| OnMovedItem |
Raises the MovedItem event and the Changed event.
| |
| OnMovingItem |
Raises the MovingItem event.
| |
| OnRemovedItem |
Raises the RemovedItem event and the Changed event.
| |
| OnRemovingItem |
Raises the RemovingItem event.
| |
| OnReplacedItem |
Raises the ReplacedItem event and the Changed event.
| |
| OnReplacingItem |
Raises the ReplacingItem event.
| |
| Remove(KeyValuePair String, ICogVisionData ) |
Removes the supplied key value pair from this container.
Does nothing if the supplied key value pair is not found.
| |
| Remove(String) |
Removes from this container the key value pair with the
specified key. Does nothing if this key is not found.
| |
| Remove(ICogVisionData) |
Removes from this container the key value pair with the
specified value. Does nothing if this value is not found.
| |
| RemoveAt |
Removes the key value pair at the specified index.
| |
| ResumeAndRaiseChangedEvent |
Re-enables raising of the Changed event after SuspendChangedEvent
has been called, and 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.
(Inherited from CogSerializableChangedEventBase.) | |
| 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.
(Inherited from CogSerializableChangedEventBase.) | |
| ToString | (Inherited from Object.) | |
| TryGetValue |
If this container holds the specified key,
output the associated ICogVisionData value.
Return true if the key was found, otherwise
return false.
|
Fields
| Name | Description | |
|---|---|---|
| SfCount |
State flag for the Count property.
| |
| SfItem |
State flag for the Item (indexer) property.
| |
| SfNextSf |
Next state flag to be used in derived classes.
|
Properties
| Name | Description | |
|---|---|---|
| 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.
(Inherited from CogSerializableChangedEventBase.) | |
| ContainsRangeGreyImagePairsOnly |
Returns true only if this collection is non-empty and all of its
contained elements are Range/Grey image pairs. Otherwise, returns
false. An element is a Range/Grey image pair if it is itself a
CogVisionDataContainer that contains exactly one CogImage16Range and
one CogImage16Grey, nothing else.
| |
| ContainsRangeImagesOnly |
Returns true if:
| |
| Count |
Gets the number of elements in this container.
| |
| HasChanged | (Inherited from CogSerializableChangedEventBase.) | |
| IsRangeGreyImagePair |
Returns true if this object is a Range/Grey image pair. Otherwise,
returns false. A CogVisionDataContainer is a Range/Grey image pair
if contains exactly one CogImage16Range and one CogImage16Grey,
nothing else.
| |
| IsReadOnly |
Returns true if this collection is ReadOnly
| |
| Item Int32 | ||
| Item String | ||
| Keys |
Gets a collection of all key strings in this container.
| |
| PairIndexer |
Gets or sets the key value pair at the specified index.
The key is a string and the value is an
ICogVisionData reference.
| |
| StateFlags |
Returns the complete set of state flags supported on this object. The
flags may be indexed by name as shown in the following C# code snippet:
if (changedObject.StateFlags["Color"] & eventArgs.StateFlags) { ... }
(Inherited from CogSerializableChangedEventBase.) | |
| Values |
Gets a collection of all ICogVisionData values in this container.
|
Events
| Name | Description | |
|---|---|---|
| Changed |
This event is raised when one or more parts of the object's state may
have changed.
(Inherited from CogSerializableChangedEventBase.) | |
| Cleared |
Raised after the container is cleared.
| |
| Clearing |
Raised before the container is cleared.
| |
| InsertedItem |
Raised after an item is inserted.
| |
| InsertingItem |
Raised before an item is inserted.
| |
| MovedItem |
Raised after an item is moved to a new index.
| |
| MovingItem |
Raised before an item is moved to a new index.
| |
| RemovedItem |
Raised after an item is removed.
| |
| RemovingItem |
Raised before an item is removed.
| |
| ReplacedItem |
Raised after an item is replaced.
| |
| ReplacingItem |
Raised before an item is replaced.
|
See Also