Entity Processors

Entity processors allow for arbitrary processing on all entity objects that have been inserted into the framework by entity providers. One example of an entity processor is to perform track correlation. For example, suppose that you have two entity providers processing data from multiple sources, but there is some overlap in the land area which they are tracking. You can write an entity processor to correlate the data from both sources to improve the fidelity of your display by removing duplicates. Another possible function for an entity processor, for example, is as a symbol tagger - which looks at every entity coming into the framework and evaluates it to determine what Symbology it should have; it then assigns a “Symbology” field in the meta-data which is persisted with the entity from then on.

Implementing your own entity processor plugin is even easier than writing an entity provider. You need to implement the IAgRtProcessEntities interfaces as well as optionally implementing IAgAttrConfig. It must also generate the events defined in IAgRtProcessEntitiesEvents. When your plugin is registered and activated, the ProcessEntity method on IAgRtProcessEntities is called every single time an entity is either updated or added to the framework.

Below is an example of an entity processor that performs correlation. The CorrelationStatus is a standard property on both point and polyline entities.  Implementation of IsCorrelatedPrimary and IsCorrelatedSecondary is left up to the user.

public void ProcessEntity(IAgEntity Entity)
{
    if(_bEnabled)
    {
        IAgPointEntity PointEntity = Entity as IAgPointEntity;
        IAgPolylineEntity PolyEntity = Entity as IAgPolylineEntity;

        AgEEntityCorrelationStatus corrStatus = AgEEntityCorrelationStatus.eEntityCorrelationStatusOperatorUnique;
        if(IsCorrelatedPrimary(Entity))
        {
            corrStatus =
AgEEntityCorrelationStatus.eEntityCorrelationStatusPrimary;
        }
        else if(IsCorrelatedSecondary(Entity))
        {
            corrStatus =
AgEEntityCorrelationStatus.eEntityCorrelationStatusSecondary;
        }

        if (PointEntity != null)
        {
            PointEntity.CorrelationStatus = corrStatus;
        }

        if (PolyEntity != null)
        {
            PolyEntity.CorrelationStatus = corrStatus;
        }
    }
}

A fully documented sample Entity Processor plugin is located in <STK install folder>Help/RT3/Samples. When you are ready to start testing and debugging your plugin, see Registering an RT3 Plugin. If you want to add a custom user interface, see Implementing a Custom User Interface for an RT3 Plugin.

STK Programming Interface 11.0.1