All Frameworks  Class Hierarchy  This Framework  Indexes

SPAkern Global Function api_distribute_state_to_streams


outcome api_distribute_state_to_streams(DELTA_STATE* pState,
StreamFinder* pStreamFinder,
logical clearDelta,
logical hideStates)
Distributes BULLETINs in a DELTA_STATE to one or more HISTORY_STREAM as directed by a StreamFinder.

Role: This API distributes the given ds to one or more HISTORY_STREAMs as directed by the given StreamFinder. In each stream distributed to, a new DELTA_STATE will be created to hold the BULLETIN. StreamFinder is a class with one pure virtual function, findStream, which must return the HISTORY_STREAM associated with the given ENTITY. The findStream function may be called more than once for each ENTITY. In a topology based search, the stream finder can cache data in at an early pass, that can be used in a later pass. This is necessary because POINT, CURVE, PCURVE, and SURFACE do not know their owners. When the stream is found for the the corresponding VERTEX, EDGE, COEDGE and FACE, the stream for the subordinate ENTITY can be saved and used in a later pass.

The base StreamFinder class provides functions for finding the stream based on an attached ATTRIB_HISTORY and for maintaining a mapping of entities to streams.

As an example, here is the StreamFinder used by the Part Management Component.
 class StreamFinderPM : public StreamFinder {
      // A StreamFinder for the PM_HUSK.
      // Implements a nested approach to
      // distribution in which bulletins go to
      // the most specific stream available.
      // Part streams are more specific than
      // the default stream. Body streams are more
      // specific than part streams.
 public:
      virtual HISTORY_STREAM* findStream( ENTITY* );
 };
 

HISTORY_STREAM * StreamFinderPM::findStream( ENTITY* pEntity ) { HISTORY_STREAM* pStream = NULL; // Look for a ATTRIB_HISTORY. If found add // the entity and associated geometry to // the stream map. pStream = findStreamFromAttribute(pEntity); if( !pStream ) { // Still no stream?. // Look for a stream on the part // the entity is in. PART* part = get_part(pEntity); if(part) { pStream = part->history_stream(); } } if( pStream ) { addToStreamMap(pEntity, pStream); } return pStream; }
The clearDelta argument tells how to handle BULLETIN objects for which a target stream could not be found. If TRUE they are deleted along with the input DELTA_STATE. If FALSE, they are left in the input state.

The hideStates argument tells whether or not to mark the resulting states as hidden in the target streams. api_pm_roll_n_states does not count hidden states. Hidden states are useful for operations that should appear read only to the user. For example, a pick or display operation may calculate boxes and create DELTA_STATEs. One can hide these states so they are not apparent to the user.

Errors: The pointer to ds is NULL.

Effect: System routine

Journal: Not Available

Parameters:
pState
delta state to be distributed.
pStreamFinder
used to direct distribution.
clearDelta
TRUE to delta undistributed bulletins.
hideStates
TRUE to mark new states as hidden.

This object is included in the file: kernapi.hxx

Copyright (c) 1989-2007 by Spatial Corp. All rights reserved.