Public Member Functions | Static Public Member Functions | List of all members
ElementAgenda Struct Reference

A bvector of EditElementHandle entries to be used for operating on groups of elements. More...

#include <ElementAgenda.h>

Inheritance diagram for ElementAgenda:
RefCounted< T_AgendumVector >

Public Member Functions

 ElementAgenda ()
 Construct a new, empty, ElementAgenda. More...
 
virtual ~ElementAgenda ()
 
void Draw (ViewportP viewport, DgnDrawMode drawMode, DrawPurpose drawPurpose, IRedrawOperationP redrawOp, ClipVectorCP clip, IRedrawAbortP abort)
 Draw all of the entries in this ElementAgenda in a single Viewport. More...
 
void DrawInAllViews (DgnDrawMode drawMode, DrawPurpose drawPurpose, IRedrawOperationP redrawOp, ClipVectorCP clip, IRedrawAbortP abort)
 Draw all of the entries in this ElementAgenda in all visible Viewports. More...
 
void Clear ()
 Empty this ElementAgenda. More...
 
void SetCapacity (int nEntries)
 Set the capacity for this ElementAgenda. More...
 
ModifyElementSource GetSource () const
 Get the source for this ElementAgenda, if applicable. More...
 
void SetSource (ModifyElementSource val)
 Set the source for this ElementAgenda. More...
 
EditElementHandleCP Find (ElementRefP elRef, DgnModelRefP modelRef, size_t startIndex=0, size_t endIndex=-1) const
 Attempt to find an ElementRefP/DgnModelRef pair in this ElementAgenda. More...
 
EditElementHandleP Insert (EditElementHandleR eeh, bool atHead=false)
 Insert an element into this ElementAgenda. More...
 
EditElementHandleP Insert (ElementRefP elRef, DgnModelRefP modelRef, bool atHead=false)
 Insert an ElementRefP/DgnModelRef pair into this ElementAgenda. More...
 
EditElementHandleP InsertPath (DisplayPathCP path, bool doGroups, bool allowLocked)
 Insert an ElementRefP/ModelRef pair from a DisplayPath into this ElementAgenda. More...
 
EditElementHandleP InsertPath (DisplayPathCP path, bool doGroups, bool groupLockState, bool allowLocked)
 Insert an ElementRefP/ModelRef pair from a DisplayPath into this ElementAgenda. More...
 
void Insert (ElemModelPairSet &pairSet)
 Add an ElemModelPairSet to this agenda. More...
 
StatusInt ModifyAgenda (IModifyElementP modifyOp, bool redraw)
 Perform a modification operation on all of the entries in this ElementAgenda. More...
 
StatusInt BuildFromElementSet (IElementSetP elementSet, ModifyElementSource source)
 Populate this ElementAgenda from a set of elements. More...
 
StatusInt BuildFromFence (DgnModelRefP fenceModel, DgnModelRefListP modelRefs, bool overlap, bool modifyOrig, bool allowLocked, bool callAsynchs)
 Populate this ElementAgenda from a Fence. More...
 
void BuildFromViewport (ViewportR viewPort)
 Populate this ElementAgenda from the elements visible in a Viewport. More...
 
void Hilite ()
 Mark all entries in this agenda as being hilited and then redraw the agenda so that fact is visible to the user. More...
 
void ClearHilite ()
 If entries in agenda are drawn in hilite by a previous call to Hilite, they are unhilited. More...
 
- Public Member Functions inherited from RefCounted< T_AgendumVector >
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 
UInt32 AddRef () const
 
UInt32 Release () const
 
 RefCounted ()
 
 RefCounted (RefCounted const &rhs)
 
RefCountedoperator= (RefCounted const &rhs)
 
UInt32 GetRefCount () const
 

Static Public Member Functions

static void AddListener (IElementAgendaEvents *agendaListener)
 Add an IElementAgendaEvents listener to the ElementAgenda manager. More...
 
static void DropListener (IElementAgendaEvents *agendaListener)
 Drop an IElementAgendaEvents listener from the ElementAgenda manager. More...
 

Additional Inherited Members

- Protected Member Functions inherited from RefCounted< T_AgendumVector >
virtual ~RefCounted ()
 

Detailed Description

A bvector of EditElementHandle entries to be used for operating on groups of elements.

Typically, ElementAgendas are created by MicroStation from sources that work on multiple elements such as the SelectionSet and Fences. However, as a general- purpose bvector of EditElemHandles, ElementAgendas can be created by applications for other purposes as well. ElementAgendas are themselves reference counted.

Collections and Iterators

ElementAgenda is a bvector of EditElementHandle. For example:

ag.Insert (ref1, model);
ag.Insert (ref2, model);
...
for each (ElementHandleCR eh in ag)
{
printf ("%llu\n", eh.GetElementId());
}

Constructor & Destructor Documentation

Construct a new, empty, ElementAgenda.

Remarks
Required library :DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
virtual ~ElementAgenda ( )
virtual
Remarks
Required library :DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib

Member Function Documentation

static void AddListener ( IElementAgendaEvents agendaListener)
static

Add an IElementAgendaEvents listener to the ElementAgenda manager.

Parameters
[in]agendaListenerThe listener to add. After this call, agendaListener will be notified by MstnElementSetTools when they modify their ElementAgendas.
StatusInt BuildFromElementSet ( IElementSetP  elementSet,
ModifyElementSource  source 
)

Populate this ElementAgenda from a set of elements.

The current contents of this agenda are cleared before it is loaded from the set.

Parameters
[in]elementSetThe collection of elements that are to be held by this agenda after this call.
[in]sourceThe value to be returned by GetSource after this call.
Returns
SUCCESS if at least one element was added to the agenda from elementSet.
Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
StatusInt BuildFromFence ( DgnModelRefP  fenceModel,
DgnModelRefListP  modelRefs,
bool  overlap,
bool  modifyOrig,
bool  allowLocked,
bool  callAsynchs 
)

Populate this ElementAgenda from a Fence.

The current contents of this agenda are cleared before the agenda is loaded from the fence.

Parameters
[in]fenceModelThe modelRef to use for the active fence.
[in]modelRefsA list of Reference DgnModelRefs that are to be considered eligible for the agenda. Must not be NULL.
[in]overlapIf true, any element that is even partially within the fence is added to the agenda. Otherwise the entire element must be contained by the fence to be eligible.
[in]modifyOrigIf true only allow modifiable entries that satisfy the fence criteria.
[in]allowLockedIf true, allow elements that have their locked flag on, even if modifyOrig is true.
[in]callAsynchsIf true, also call MDL "FenceAccept" asynchs to determine eligibility.
Returns
SUCCESS if the resultant ElementAgenda has at least one entry.
Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
void BuildFromViewport ( ViewportR  viewPort)

Populate this ElementAgenda from the elements visible in a Viewport.

Parameters
[in]viewPortall elements visible in this viewPort are considered eligible for the agenda.
Returns
SUCCESS if the resultant ElementAgenda has at least one entry.
Remarks
Required library :DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
void Clear ( )

Empty this ElementAgenda.

Does not free memory associated with the agenda. First calls ClearHilite.

Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
void ClearHilite ( )

If entries in agenda are drawn in hilite by a previous call to Hilite, they are unhilited.

Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
void Draw ( ViewportP  viewport,
DgnDrawMode  drawMode,
DrawPurpose  drawPurpose,
IRedrawOperationP  redrawOp,
ClipVectorCP  clip,
IRedrawAbortP  abort 
)

Draw all of the entries in this ElementAgenda in a single Viewport.

Technically, this is a "redraw" operation.

Parameters
[in]viewportThe viewport in which to draw the agenda
[in]drawModeThe drawmode for the draw. Generally only DRAW_MODE_Normal is useful.
[in]drawPurposeThe purpose argument to be passed to all ElementHandler to describe why this draw operation is taking place. Be as specific as possible, but if no values seem correct, use DrawPurpose::NotSpecified
[in]redrawOpThis object is notified at various times during the redraw operation. Can be NULL.
[in]clipA ClipDescr that clips the elements within the viewport. Can be NULL.
[in]abortAn object that is called periodically during the redraw operation to determine whether the operation is taking too long and should be aborted.
Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
void DrawInAllViews ( DgnDrawMode  drawMode,
DrawPurpose  drawPurpose,
IRedrawOperationP  redrawOp,
ClipVectorCP  clip,
IRedrawAbortP  abort 
)

Draw all of the entries in this ElementAgenda in all visible Viewports.

Technically, this is a "redraw" operation.

Parameters
[in]drawModeThe drawmode for the draw. Generally only DRAW_MODE_Normal is useful.
[in]drawPurposeThe purpose argument to be passed to all ElementHandler to describe why this draw operation is taking place. Be as specific as possible, but if no values seem correct, use DrawPurpose::NotSpecified
[in]redrawOpThis object is notified at various times during the redraw operation. Can be NULL.
[in]clipA ClipDescr that clips the elements within the viewport. Can be NULL.
[in]abortAn object that is called periodically during the redraw operation to determine whether the operation is taking too long and should be aborted.
Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
static void DropListener ( IElementAgendaEvents agendaListener)
static

Drop an IElementAgendaEvents listener from the ElementAgenda manager.

EditElementHandleCP Find ( ElementRefP  elRef,
DgnModelRefP  modelRef,
size_t  startIndex = 0,
size_t  endIndex = -1 
) const

Attempt to find an ElementRefP/DgnModelRef pair in this ElementAgenda.

Parameters
[in]elRefThe ElementRefP part of the pair.
[in]modelRefThe DgnModelRef part of the pair.
[in]startIndexThe index of the first entry to be considered for the Find operation.
[in]endIndexThe index of the last entry to be considered for the Find operation.
Returns
A pointer to the EditElementHandle holding the pair, or NULL if not found.
Remarks
Required library :DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
ModifyElementSource GetSource ( ) const

Get the source for this ElementAgenda, if applicable.

The "source" is merely an indication of what the collection of elements in this agenda means. Also, if the source is ModifyElementSource::SelectionSet, MicroStation internally attempts to keep the Selection Set current with changes to the agenda.

void Hilite ( )

Mark all entries in this agenda as being hilited and then redraw the agenda so that fact is visible to the user.

The agenda itself also holds a flag indicating whether its entries are all in the hilite state so that calls to ClearHilite can reverse that.

Note
Any calls to one of the Insert methods clears to hilite flag on the ElementAgenda, so that ClearHilite will not do anything.
Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
EditElementHandleP Insert ( EditElementHandleR  eeh,
bool  atHead = false 
)

Insert an element into this ElementAgenda.

Parameters
[in]eehThe EditElementHandle that is to be inserted into this agenda; if it has a descriptor, it will be extracted and used; otherwise an element ref will be used. If neither are present, nothing is added.
[in]atHeadIf true, put this in at the head (front) of the agenda, otherwise put it at the end. Passing false is more efficient.
Returns
A pointer to the EditElementHandle within the ElementAgenda holding elDscr.
Note
If the EditElementHandle you provide has a descriptor, this will extract and then own the descriptor; you can thus not use the EditElementHandle; use this method's return value instead.
For performance reasons, no attempt is made to enforce uniqueness of the entries (i.e. this method will allow duplicate entries for the same element, even though that's generally undesirable.) If you're unsure whether the entry you're adding may already be in the agenda, call Find. Also, see Insert(ElemModelPairSet&) for more efficient technique to enforce uniqueness for large sets.
Remarks
Required library :DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
EditElementHandleP Insert ( ElementRefP  elRef,
DgnModelRefP  modelRef,
bool  atHead = false 
)

Insert an ElementRefP/DgnModelRef pair into this ElementAgenda.

Parameters
[in]elRefThe ElementRefP part of the pair.
[in]modelRefThe DgnModelRef part of the pair.
[in]atHeadIf true, put this in at the head (front) of the agenda, otherwise put it at the end. Passing false is more efficient.
Returns
A pointer to the EditElementHandle within the ElementAgenda holding the newly inserted entry.
Note
For performance reasons, no attempt is made to enforce uniqueness of the entries (i.e. this method will allow duplicate entries for the same element, even though that's generally undesirable.) If you're unsure whether the entry you're adding may already be in the agenda, call Find. Also, see Insert(ElemModelPairSet&) for more efficient technique to enforce uniqueness for large sets.
Remarks
Required library :DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
void Insert ( ElemModelPairSet pairSet)

Add an ElemModelPairSet to this agenda.

This call guarantees uniqueness of the entries in the ElementAgenda (presuming the existing entries are unique before this call.)

Parameters
[in,out]pairSetOn input, the set of unique ElementRefP/DgnModelRef entries to add to this ElementAgenda. On output, the set of entries actually added to this agenda.
Remarks
This function modifies pairSet by removing entries that are already in this agenda.
Note
If this ElementAgenda is not empty before this call, all of the existing entries are compared for uniqueness against the entries in pairSet so that the resultant ElementAgenda is also a unique set. For example, if you were to call this method twice with the same pairSet, the second call would do nothing.
Remarks
Required library :DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
EditElementHandleP InsertPath ( DisplayPathCP  path,
bool  doGroups,
bool  allowLocked 
)

Insert an ElementRefP/ModelRef pair from a DisplayPath into this ElementAgenda.

Optionally, add all of the other members of graphic groups or named groups containing the element.

Parameters
[in]pathThe path to insert into this ElementAgenda. The ElementRefP is taken from the HeadElem and the DgnModelRef is taken from the PathRoot.
[in]doGroupsIf true add all other members of graphic or named groups containing the element.
[in]allowLockedIf doGroups is true, allow members of groups that are locked to be inserted into the ElementAgenda. Generally ElementAgendas are used for performing modification and locked elements are ineligible.
Returns
A pointer to the EditElementHandle within the ElementAgenda holding the newly inserted entry. In the case where doGroups is true and more than one element is added to this agenda, the return is the entry for the original element from path.
Note
For performance reasons, no attempt is made to enforce uniqueness of the entries (i.e. this method will allow duplicate entries for the same element, even though that's generally undesirable.) If you're unsure whether the entry you're adding may already be in the agenda, call Find. Also, see Insert(ElemModelPairSet&) for more efficient technique to enforce uniqueness for large sets.
Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
EditElementHandleP InsertPath ( DisplayPathCP  path,
bool  doGroups,
bool  groupLockState,
bool  allowLocked 
)

Insert an ElementRefP/ModelRef pair from a DisplayPath into this ElementAgenda.

Optionally, add all of the other members of graphic groups or named groups containing the element.

Parameters
[in]pathThe path to insert into this ElementAgenda. The ElementRefP is taken from the HeadElem and the DgnModelRef is taken from the PathRoot.
[in]doGroupsIf true add all other members of graphic or named groups containing the element.
[in]groupLockStateInterpret group traversal rules according to this state of group lock. See NamedGroup class.
[in]allowLockedIf doGroups is true, allow members of groups that are locked to be inserted into the ElementAgenda. Generally ElementAgendas are used for performing modification and locked elements are ineligible.
Returns
A pointer to the EditElementHandle within the ElementAgenda holding the newly inserted entry. In the case where doGroups is true and more than one element is added to this agenda, the return is the entry for the original element from path.
Note
For performance reasons, no attempt is made to enforce uniqueness of the entries (i.e. this method will allow duplicate entries for the same element, even though that's generally undesirable.) If you're unsure whether the entry you're adding may already be in the agenda, call Find. Also, see Insert(ElemModelPairSet&) for more efficient technique to enforce uniqueness for large sets.
Remarks
Required library :DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
StatusInt ModifyAgenda ( IModifyElementP  modifyOp,
bool  redraw 
)

Perform a modification operation on all of the entries in this ElementAgenda.

Parameters
[in]modifyOpThe operation to be performed on the agenda. The implementation determine what happens to the elements in the ElementAgenda. Must not be NULL.
[in]redrawIf true, redraw the result of the operation immediately. Otherwise it will appear at the end of the transaction. If the operation has a visible effect it is best to pass true for this so the user is presented with feedback when processing large groups. The tradeoff is that redrawing immediately can make the total time to complete the operation longer.
Returns
SUCCESS if this ElementAgenda was not empty and modifyOp was called.
Note
If modifyOp changes the elements as they are processed, this ElementAgenda can, and most likely will, be different after the call. For example, if modifyOp deletes elements, they are removed from the agenda.
Remarks
Required library :DgnView<ApiNumber>.lib i.e. DgnView2.lib
void SetCapacity ( int  nEntries)

Set the capacity for this ElementAgenda.

If you expect to add a large number of entries to the agenda, and if you know how many there will be, then calling this method first can improve performance.

Parameters
[in]nEntriesSet the array hold at least this number of entries.
void SetSource ( ModifyElementSource  val)

Set the source for this ElementAgenda.

See also
GetSource

The documentation for this struct was generated from the following file:

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.