Public Types | Public Member Functions | Protected Member Functions | List of all members
DgnRegionElementTool Struct Referenceabstract

#include <DgnRegionElementTool.h>

Inheritance diagram for DgnRegionElementTool:
DgnElementSetTool IViewTransients DgnPrimitiveTool IRedrawOperation ModifyOp DgnTool IModifyElement RefCountedBase RefCounted< IRefCounted > IRefCounted

Public Types

enum  RegionCreateMode { REGION_CREATE_Elements, REGION_CREATE_ByParams, REGION_CREATE_Points, REGION_CREATE_Fence }
 
enum  RegionToolPhase { REGION_PHASE_SelectBoundaries, REGION_PHASE_CreateRegion, REGION_PHASE_ProcessOriginals }
 
- Public Types inherited from DgnElementSetTool
enum  ElemSource { SOURCE_Pick, SOURCE_Fence, SOURCE_SelectionSet }
 The requested source for the elements to modify. More...
 
enum  UsesFence { USES_FENCE_Check, USES_FENCE_Required, USES_FENCE_None }
 Should the active fence be used, required, or ignored as a possible ElemSource. More...
 
enum  UsesSelection { USES_SS_Check, USES_SS_Required, USES_SS_None }
 Should the active selection set be used, required, or ignored as a possible ElemSource. More...
 
enum  UsesDragSelect { USES_DRAGSELECT_Box, USES_DRAGSELECT_Line, USES_DRAGSELECT_None }
 Should SOURCE_Pick allow a drag select to identify elements. More...
 
enum  ClipResult { CLIP_RESULT_NotSupported, CLIP_RESULT_NewElements, CLIP_RESULT_OriginalElements }
 Helps determine the action ModifyAgenda will take on the agenda elements after calling DoFenceClip. More...
 
enum  RefLocateOption { REF_LOCATE_Normal = (0), REF_LOCATE_SelfAttachment = (1<<0), REF_LOCATE_Editable = (1<<1), REF_LOCATE_TreatAsElement = (1<<2) }
 Used to setup special reference locate criteria. More...
 
enum  ErrorNums {
  ERROR_NUM_NoFence = 68, ERROR_NUM_NoFenceElems = 122, ERROR_NUM_NoFenceElemsOutside = 250, ERROR_NUM_NoSSElems = 85,
  ERROR_NUM_NotSuportedElmType = 609
}
 ElemSource specific failures. More...
 

Public Member Functions

 DgnRegionElementTool ()
 Default constructor for DgnRegionElementTool. Can only create an instance of a sub-class that implements the required pure-virtual methods. More...
 
- Public Member Functions inherited from DgnElementSetTool
 DgnElementSetTool (int toolId)
 DgnElementSetTool constructor where you can supply the tool id directly instead of making a separate call to SetToolId. More...
 
 DgnElementSetTool ()
 
 ~DgnElementSetTool ()
 
- Public Member Functions inherited from DgnPrimitiveTool
 DgnPrimitiveTool (int toolId, int toolPrompt)
 
void CallOnRestartTool ()
 Can be called to force restart of active tool in response to an external event. More...
 
- Public Member Functions inherited from DgnTool
 DgnTool (int toolId, int toolPrompt)
 
StatusInt InstallTool ()
 Call to make this tool instance the current active command. More...
 
MdlDescGetMdlDesc ()
 Call to get the MDL descriptor of the application that started this tool. More...
 
void GetCurrentDgnButtonEvent (DgnButtonEventR ev)
 Call to get a button event representing the current cursor location. More...
 
void SetAdjustedDataPoint (DgnButtonEventCR ev)
 Call to set an adjusted point as the last datapoint location. More...
 
void SetToolId (int id)
 Set the Id for this tool. More...
 
void SetToolPrompt (int prompt)
 Set the prompt number for this tool. More...
 
int GetToolId ()
 Get the Id for this tool. More...
 
int GetToolPrompt ()
 Get the prompt number for this tool. More...
 
- Public Member Functions inherited from RefCounted< IRefCounted >
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
 
- Public Member Functions inherited from ModifyOp
 ModifyOp ()
 
virtual ~ModifyOp ()
 
- Public Member Functions inherited from IViewTransients
DGNPLATFORM_EXPORT StatusInt ComputeRange (DRange3d &range, ViewportP vp)
 Computes the range of the transients by drawing them. More...
 

Protected Member Functions

RegionGraphicsContextGetRegionContext ()
 Get the current RegionGraphicsContext used by the tool. More...
 
RegionToolPhase GetCurrentToolPhase ()
 Get the current tool phase. More...
 
bool IsFloodRegionSelected ()
 Returns true if there is a valid flood region result preview. More...
 
virtual
DgnPlatform::RegionParams
const & 
_GetRegionParams ()=0
 Return RegionParams to use for REGION_CREATE_ByParams. More...
 
virtual RegionCreateMode _GetRegionCreateMode ()=0
 Return the desired RegionCreateMode. More...
 
virtual BentleyStatus _OnProcessRegionResult (EditElementHandleR elHandle)=0
 Called with region result. The tool is responsible for setting symbology and adding to a DgnModel as needed. More...
 
virtual StatusInt _DoComputeRegionResult (ElementAgendaR result, DgnButtonEventCR ev)
 Create the new region elements that are a result of the given region creation parameters and options. More...
 
virtual void _GetRegionPreviewSymbology (UInt32 &lineColorTBGR, UInt32 &fillColorTBGR, UInt32 &lineWeight, UInt32 &lineStyle, ViewportR, DgnDrawMode)
 Provided to allow sub-classes to override the default symbology used to for region preview and flood dynamic area. More...
 
virtual WCharCP _GetAssociativeRegionName ()
 Default cell name used when creating an Associative Region element. More...
 
virtual StatusInt _OnElementModify (EditElementHandleR eeh)
 Called only if _WantProcessOriginals returns true. Invalidate eeh and return SUCCESS to delete element. More...
 
virtual bool _WantProcessOriginals ()
 Return true if the tool wants to process the original elements that were directly involved in creating the result region. More...
 
virtual bool _WantFloodDynamicArea ()
 Return true if the tool wants region flood dynamics using the current cursor location as the flood seed point. More...
 
virtual bool _AllowPhysicallyClosed ()
 Return true to allow physically closed open paths as boundary candidates. More...
 
virtual bool _AcceptClosedElement (ElementHandleCR eh, WStringR cantAcceptReason)
 Called from _OnPostLocate and _FilterAgendaEntries to reject invalid boundary candidates. More...
 
virtual bool _IsModifyOriginal () override
 Don't copy the originals. More...
 
virtual bool _DoGroups () override
 Whether to allow named and graphic groups. More...
 
virtual bool _WantDynamics () override
 Whether to start tool dynamics. More...
 
virtual bool _WantAccuSnap () override
 Whether to enable AccuSnap. More...
 
virtual bool _WantAdditionalLocate (DgnButtonEventCP ev) override
 Require a minimum number of selected elements/areas, checks for control key to allow additional selection. More...
 
virtual bool _NeedAcceptPoint () override
 Whether an explicit data point is requires to accept the region result. More...
 
virtual bool _AcceptIdentifiesNext () override
 Whether data point to accept can also identify new element/area. More...
 
virtual UsesDragSelect _AllowDragSelect () override
 Whether to allow elements to be selected by crossing line (Allowed for element/boolean modes). More...
 
virtual bool _CheckStop () override
 Allow abort of region creation using reset. More...
 
virtual void _ResetStop () override
 Initialize abort processing. More...
 
virtual void _DrawTransients (ViewContextR context, bool isPreUpdate) override
 Use to preview the region result that will be accepted. More...
 
virtual void _DecorateScreen (ViewportR vp) override
 Used to show dynamic region result under the cursor. More...
 
virtual StatusInt _ProcessAgenda (DgnButtonEventCR ev) override
 
virtual void _HiliteAgendaEntries (bool changed) override
 Show boolean region result preview (IViewTransients). More...
 
virtual void _UnHiliteAgendaEntries (bool empty) override
 Clear boolean region result preview (IViewTransients). More...
 
virtual bool _OnPostLocate (HitPathCP path, WStringR cantAcceptReason) override
 Check for valid boundary candidates. More...
 
virtual bool _FilterAgendaEntries () override
 Check for valid boundary candidates when creating region from a selection set. More...
 
virtual void _SetLocateCriteria () override
 Setup search modelRef list. More...
 
virtual void _SetupAndPromptForNextAction () override
 Output default prompts, enable/disable AccuSnap and AutoLocate. More...
 
virtual void _OnDynamicFrame (DgnButtonEventCR ev) override
 Used for create dynamics when defining a region by points (REGION_CREATE_Points). More...
 
virtual bool _OnModelMotion (DgnButtonEventCR ev) override
 Request _DecorateScreen be called for flood dynamic area. More...
 
virtual bool _OnModifierKeyTransition (bool wentDown, int key) override
 Used to monitor control key up/down event for additional selection. More...
 
virtual bool _OnModifyComplete (DgnButtonEventCR ev) override
 Exit or restart tool after accepting region result. More...
 
virtual bool _OnResetButton (DgnButtonEventCR ev) override
 Accept region by points, cycle between over-lapping elements, restart or exit tool. More...
 
virtual bool _OnDataButton (DgnButtonEventCR ev) override
 Identify elements/area and advance tool state. More...
 
virtual void _OnUndoPreviousStep () override
 Used to undo last point when defining a region by points (REGION_CREATE_Points). More...
 
virtual void _OnCleanup () override
 Add tool instance to registered IViewTransients providers. More...
 
virtual void _OnPostInstall () override
 Drop tool instance from registered IViewTransients providers. More...
 
- Protected Member Functions inherited from DgnElementSetTool
virtual bool _OnInstall () override
 Called to ensure that the preferred ElemSource is satisfied. More...
 
virtual void _OnReinitialize () override
 Call to reset tool to initial state. More...
 
virtual StatusInt _OnRedrawOperation (EditElementHandleR el, ViewContextR context, bool *canUseCached) override
 Called during complex dynamics. More...
 
virtual void _OnResymbolize (ViewContextR context) override
 Called during complex dynamics. More...
 
virtual void _OnRedrawInit (ViewContextR context) override
 Called at the start of the redraw operation before visiting any elements. More...
 
virtual void _OnRedrawFinish (ViewContextR context) override
 Called after visiting all elements but before detaching view. More...
 
virtual StatusInt _OnRedrawComplete (ViewContextR context) override
 Called at the end of the redraw operation after visiting all elements. More...
 
virtual bool _WantAutoLocate ()
 Called from _SetupAndPromptForNextAction to enable auto-locate for SOURCE_Pick. More...
 
virtual RefLocateOption _GetReferenceLocateOptions ()
 Called from SetLocateCriteria and controls how the search model ref list is populated. More...
 
virtual void _SetLocateCursor (bool enableLocate)
 Call/Called to choose cursor appropriate to current tool state. More...
 
virtual size_t _GetAdditionalLocateNumRequired ()
 Implemented by multi-select tools that may require more than 1 element to complete the current tool phase. More...
 
bool WantAdditionalLocateHelper (DgnButtonEventCP ev)
 Helper method multi-select tools can call to implement _WantAdditionalLocate. More...
 
virtual HitPathCP _DoLocate (DgnButtonEventCR ev, bool newSearch, ComponentMode complexComponent)
 Call/Called to perform a locate at the given button location. More...
 
virtual ComponentMode _GetComponentMode ()
 Get component mode for pick/auto-locate... More...
 
virtual void _LocateOneElement (DgnButtonEventCR ev, bool newSearch)
 Call/Called to locate an element and add or remove the hit from the tool's ElementAgenda. More...
 
virtual EditElementHandleP _BuildLocateAgenda (HitPathCP path, DgnButtonEventCP ev)
 Called to insert the selected hit into the tool's ElementAgenda, or to remove a previously selected element if the control key is held and the tool supports additional locates, WantAdditionalLocate returns true. More...
 
virtual void _RemoveAgendaElement (EditElementHandleR el)
 Call/Called to remove an element from the ElementAgenda. More...
 
virtual void _BeginPickElements ()
 Call/Called to initialize locate logic, next data point will perform a locate. More...
 
bool OnModifierKeyTransitionHelper (bool wentDown, int key)
 Helper method multi-select tools can call to implement _OnModifierKeyTransition. More...
 
virtual bool _OnModelStartDrag (DgnButtonEventCR ev) override
 Called when a drag event is detected. More...
 
virtual bool _OnModelEndDrag (DgnButtonEventCR ev) override
 Called when drag event completes. More...
 
virtual UsesDragSelect _IsDragSelectActive ()
 Call/Called to check the current drag selection mode. More...
 
virtual bool _GetDragAnchorPoint (DPoint3dP anchorPt)
 Call/Called to return the anchor point location for the data point that initiated the drag event. More...
 
virtual bool _BuildDragSelectAgenda (FenceParamsP fp, DgnButtonEventCR ev)
 Called to add or remove the elements selected by the drag operation from the tool's ElementAgenda. More...
 
virtual bool _GetDragSelectOverlapMode (DgnButtonEventCR ev)
 Called to check the current drag box selection mode. More...
 
virtual void _GetDragSelectSymbology (UInt32 &color, UInt32 &fillColor, UInt32 &style, UInt32 &weight, DgnButtonEventCR ev)
 Called to get the symbology to use for the drag selection decorators. More...
 
virtual void _GetBoxPoints (DPoint3dP shapePointsP, DgnCoordSystem sys, DPoint3dCR activeOrigin, DPoint3dCR activeCorner, ViewportP vp)
 Called to get the drag select points to use to setup a FenceParams for selecting elements. More...
 
virtual bool _NotifyListeners (ElementAgendaR, AgendaOperation, AgendaModify, AgendaEvent, void *eventArg=NULL)
 Called to send event to IElementAgendaEvents listeners. More...
 
virtual AgendaOperation _GetAgendaOperation ()
 Called to see if tool wants to send out IElementAgendaEvents. More...
 
virtual AgendaModify _GetAgendaModify ()
 Called when sending IElementAgendaEvents to include the type of modification. More...
 
virtual bool _UseActiveFence ()
 Allow tool to choose whether the active fence is used for USES_FENCE_Check check. More...
 
virtual UsesFence _AllowFence ()
 Should the active fence be used, required, or ignored as a possible ElemSource. More...
 
virtual UsesSelection _AllowSelection ()
 Should the active selection set be used, required, or ignored as a possible ElemSource. More...
 
virtual ElemSource _GetPreferredElemSource ()
 Called to decide on ElemSource. More...
 
virtual ElemSource _GetElemSource () const
 Call/Called to return the currently selection ElemSource. More...
 
virtual void _SetElemSource (ElemSource source)
 Called to set tool's ElemSource from what is returned by GetPreferredElemSource. More...
 
virtual bool _HiliteFenceElems ()
 Call to query if elements selected from the active fence should be hilited. More...
 
virtual void _ModifyAgendaEntries ()
 Called to modify the list of elements before calling _ProcessAgenda. More...
 
virtual void _BuildAgenda (DgnButtonEventCR ev)
 Call/Called to populate tool's ElementAgenda from the active selection set. More...
 
ElementAgendaR GetElementAgenda ()
 Call to return a pointer to the tool's ElementAgenda. More...
 
virtual bool _GetAnchorPoint (DPoint3dP anchorPt)
 Call/Called to get the accept or locate point that populated the ElementAgenda. More...
 
virtual void _SetAnchorPoint (DPoint3dCP anchorPt)
 Call to set/clear the accept or locate point return by GetAnchorPoint. More...
 
virtual DgnModelRefP _GetDestinationModelRef () override
 Called to get the destination model for copied element, usually ACTIVEMODEL. More...
 
virtual bool _IsFenceOverlap ()
 Called to check whether to include elements that overlap the active fence. More...
 
virtual bool _IsFenceVoid ()
 Called to check whether we are looking for elements inside or outside the active fence. More...
 
virtual bool _IsFenceClip ()
 Called to check whether current fence mode is clip. More...
 
virtual bool _SetupForModify (DgnButtonEventCR ev, bool isDynamics)
 Called before each dynamics frame and once for final accept. More...
 
virtual ClipResult _GetFenceClipResult ()
 Called to determine the action ModifyAgenda needs to take post-clip. More...
 
virtual StatusInt _DoFenceClip ()
 Called to pre-clip elements before calling ModifyAgenda. More...
 
virtual StatusInt _OnElementModifyClip (EditElementHandleR el, FenceParamsP fp, FenceClipFlags options)
 Called by _ProcessAgenda to allow tool to apply fence clip to elements. More...
 
void SetupAndPromptForNextActionHelper ()
 Helper method tools can call from an override of _SetupAndPromptForNextAction to enable/disable AccuSnap/Auto-Locate since calling super also outputs defaults prompts. More...
 
virtual bool _NeedPointForDynamics ()
 Called from _OnPostInstall. More...
 
virtual bool _NeedPointForSelection ()
 Called from _OnPostInstall for SOURCE_SelectionSet. More...
 
- Protected Member Functions inherited from DgnPrimitiveTool
virtual void _ExitTool () override
 Start the default primitive command and terminate the current command. More...
 
virtual void _OnRestartTool ()=0
 Called when an external event may invalidate the current tool's state. More...
 
virtual bool _IsSingleShot ()
 Called to test if tool was started in single-shot mode. More...
 
virtual bool _CheckSingleShot ()
 Called from DgnPrimitiveTool::_OnReinitialize and DgnElementSetTool::_OnModifyComplete to see if tool was started in single-shot mode and should exit instead of restarting. More...
 
void EnableUndoPreviousStep ()
 Tools should call this if they want Ctrl+Z to start calling _OnUndoPreviousStep. More...
 
bool GetDynamicsStarted ()
 Call to find out of complex dynamics are currently active. More...
 
virtual void _BeginDynamics ()
 Call to initialize complex dynamics. More...
 
virtual void _EndDynamics ()
 Call to terminate complex dynamics. More...
 
virtual IDrawElementAgenda_GetDrawDynamicsTxnChanges ()
 Query if the tool wants to control how to draw changes made in the nested transaction during a dynamics frame. More...
 
- Protected Member Functions inherited from DgnTool
virtual bool _OnResetButtonUp (DgnButtonEventCR ev)
 
virtual bool _OnDataButtonUp (DgnButtonEventCR ev)
 
virtual bool _OnModelNoMotion (DgnButtonEventCR ev)
 Called when cursor is stationary in a view. More...
 
virtual bool _OnModelMotionStopped (DgnButtonEventCR ev)
 Called when cursor stops moving in a view. More...
 
virtual bool _OnMouseWheel (DgnMouseWheelEvent const *ev)
 Called when mouse wheel event is detected. More...
 
virtual bool _OnKeyTransition (bool wentDown, int key, bool shiftIsDown, bool ctrlIsDown)
 Called when certain keys are pressed or released. More...
 
virtual bool _On3DInputEvent (Dgn3DInputEvent const &)
 
virtual bool _DisableEditAction ()
 Called so tool can prevent reset pop-up menu from opening. More...
 
virtual StatusInt _PerformEditAction (int index)
 Called so tool can override default reset pop-up menu. More...
 
virtual void _OverrideViewCursors (ViewportR, DgnDisplay::CursorP &active, DgnDisplay::CursorP &inactive)
 
void SetCmdName (int id, int prompt)
 Call to setup the current tool name and initial prompt. More...
 
virtual void _GetToolName (WStringR name)
 Called to get the current tool name. More...
 
virtual bool _PopulateToolSettings ()
 Called to populate the tool tool settings for this tool. More...
 
- Protected Member Functions inherited from RefCounted< IRefCounted >
virtual ~RefCounted ()
 
- Protected Member Functions inherited from IRefCounted
virtual ~IRefCounted ()
 
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 
- Protected Member Functions inherited from ModifyOp
virtual void _SetWantMakeCopy (bool val) override
 Call to set copy option. More...
 
virtual void _SetWantGGLock (bool val) override
 Call to set graphic group number remap option for copy. More...
 
virtual bool _WantMakeCopy () const override
 Call to determine whether original element is being modified or copied. More...
 
virtual bool _WantCheckGGLock () const override
 Call to determine whether copied elements will have their graphic group number remapped or cleared. More...
 
virtual ElementCopyContextP _GetCopyContext ()
 CopyContext used by ModifyOp::OnPreElementModify call to DoCopy when ModifyOp::WantMakeCopy is true. More...
 
virtual void _ClearCopyContext ()
 Flush deferred copy-related changes and release the ElementCopyContext used by ModifyOp::OnPreElementModify, if any. More...
 
virtual StatusInt _DoOperationForModify (EditElementHandleR eeh) override
 Called to perform element modification. More...
 
virtual StatusInt _OnPreElementModify (EditElementHandleR eeh)
 Called to perform pre-modification checks/changes. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DgnTool
static DgnViewToolGetActiveViewTool ()
 Call to return the current DgnViewTool. More...
 
static DgnPrimitiveToolGetActivePrimitiveTool ()
 Call to return the current DgnPrimitiveTool. More...
 
- Static Protected Member Functions inherited from DgnElementSetTool
static void OutputErrorMessage (ErrorNums msg)
 Call to output a specific error message. More...
 
- Protected Attributes inherited from DgnTool
int m_toolId
 
int m_toolPrompt
 
MdlDescm_mdlDesc
 
UInt32 m_currentQualifierMask
 
bool m_modifierKeyWentDown
 
int m_modifierKey
 
int m_resrved [8]
 

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

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