The feature iterator iterates all the features in a shape model, and allows reading and writing of the Weight and Polarity properties.
Namespace: Cognex.VisionProAssembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 65.1.0.0
Syntax
The ICogModelFeatureIterator type exposes the following members.
Methods
| Name | Description | |
|---|---|---|
| Copy | Makes a copy of this iterator. The copy will be positioned at the same item as this plus the given IndexOffset. For example, if IndexOffset is +1 the copy will be positioned at the next item, if IndexOffset is -1, the copy will be at the previous item. | |
| GetEffectivePolarity | If this feature has no ParentFeature, then its effective polarity is the value of the Polarity property. If this feature has a ParentFeature, then the effective polarity is the Polarity times the effective polarity of the ParentFeature. (Inherited from ICogModelFeature.) | |
| GetEffectiveWeight | If this feature has no ParentFeature, then its effective weight is the value of the Weight property. If this feature has a ParentFeature, then the effective weight is the Weight times the effective weight of the ParentFeature. (Inherited from ICogModelFeature.) | |
| MoveToNext | Moves the iterator to the next position, loading that item's properties into this iterator. If the iterator is at the end position, an error is returned. To avoid getting errors, you may wish to check IsEnd. | |
| MoveToPosition | Moves the iterator to the specified position in the sequence, loading that item's properties into this iterator. | |
| MoveToPrevious | Moves the iterator to the previous position, loading that item's properties into this iterator. If there are no items before this, an error is returned. To avoid getting errors, you may wish to check IsFirst. |
Properties
| Name | Description | |
|---|---|---|
| Attributes | Returns property bits describing which iterator methods can be called at the current position of the iterator. | |
| Container | Returns a reference to the container object being iterated. This can be used for identifying the iterator's container. | |
| IsEnd | Returns True if this iterator is positioned past the last item of the sequence. If True, calling MoveToNext will return an error, and attempting to read item properties will produce an error. Moving the iterator to a valid item will validate it. | |
| IsFirst | Returns True if this is the first item. If True, a call to MoveToPrevious would return an error. | |
| IsInvalid | Returns True if this iterator is not positioned at a valid item. If True, reading or writing any item properties will produce errors. | |
| ParentFeature | If this feature has a ParentFeature, then Weight and Polarity are defined with respect to the parent. The effective weight (or polarity) of this feature is its Weight (or Polarity) times the parent's effective weight (or polarity). (Inherited from ICogModelFeature.) | |
| Polarity | Returns/sets the polarity of this feature. The polarity of a given feature may be -1, 0(undefined), or +1. Polarities of +1 or -1 define where to find brighter pixels relative to the feature geometry, and 0 means undefined. (Inherited from ICogModelFeature.) | |
| Position | Returns the position of the iterator in the container. | |
| Weight | Returns/sets the weight of this feature. The weight of a feature determines its relative importance compared to other features of the model. The weight defaults to 1.0. (Inherited from ICogModelFeature.) |
Remarks
ICogModelFeatureIterator iterates over all the features in a shape model and allows setting and getting the Weight and Polarity properties.
See Also