Typedefs | |
typedef enum LOCATE_FILTER_Status | LOCATE_FILTER_Status |
NOTE: These types are duplicates of the LocateFilterStatus values - they are here for V7 compatibility only. More... | |
typedef DgnPlatform::LocateFilterStatus(* | LocateFunc_LocateFilter )(DgnPlatform::LOCATE_Action action, MSElementCP pElement, DgnModelRefP modelRef, UInt32 filePosition, DPoint3dCP pPoint, int viewNumber, HitPathCP hitPath, WStringR rejectReason) |
UserFunction for Pre and Post Locate Filters. More... | |
typedef void(* | LocateFunc_OverridePathDescription )(DisplayPathCP path, WStringR description) |
UserFunction for LocateCallback::SetOverridePathDescriptionFunction. More... | |
typedef bool(* | LocateFunc_ElementDoubleClick )(DisplayPathCP path) |
UserFunction for LocateCallback::SetElementDoubleClickFunction. More... | |
typedef void(* | LocateFunc_ElementLocated )(MSElementP element, DgnModelRefP modelRef, long filePos, DPoint3dCP point, int viewNum) |
UserFunction for LocateCallback::SetElementLocatedFunction. More... | |
Enumerations | |
enum | LOCATE_FILTER_Status { LOCATE_ELEMENT_REJECT = DgnPlatform::LOCATE_FILTER_STATUS_Reject, LOCATE_ELEMENT_NEUTRAL = DgnPlatform::LOCATE_FILTER_STATUS_Neutral, LOCATE_ELEMENT_ACCEPT = DgnPlatform::LOCATE_FILTER_STATUS_Accept } |
NOTE: These types are duplicates of the LocateFilterStatus values - they are here for V7 compatibility only. More... | |
enum | LocateMethod { LOCATE_METHOD_SelectionSet = 1, LOCATE_METHOD_AutoLocate = 2, LOCATE_METHOD_Manual = 3 } |
The reasons that an AcceptFunc from mdlState_startModifyCommand was called by MicroStation. More... | |
Functions | |
UInt32 | mdlLocate_findElement (Dpoint3d const *inPoint, int viewNum, bool useLastSearch, DgnPlatform::ComponentMode componentFlag, bool hilite) |
This is the lowest-level routine in the element location API. More... | |
UInt32 | mdlLocate_findElementEx (LocateFailure *reason, WStringP explanation, DPoint3dCP inPoint, int viewNum, bool restart, DgnPlatform::ComponentMode componentFlag, bool hilite) |
Same as mdlLocate_findElement, except that this function returns an explanation of why no elements were found. More... | |
HitPathCP | mdlLocate_findPath (LocateFailure *reason, WStringP explanation, bool restart, DPoint3dCP inPoint, int viewNum, DgnPlatform::ComponentMode componentFlag, bool hilite, bool doGroups) |
Same as mdlLocate_findElementEx, except that this function returns a DgnPlatform::HitPath. More... | |
int | mdlLocate_identifyElement (DgnPlatform::ComponentMode componentFlag, bool notFoundMsg) |
This function automatically becomes the Datapoint function when mdlState_startModifyCommand is called. More... | |
void | mdlLocate_init () |
Unhilte Current Hit (if hilited), erase the Tentative Point (if any), and then empty the Hit List. More... | |
void | mdlLocate_clear () |
Equivalent to mdlLocate_init, except that this function also clears the Current Hit. More... | |
void | mdlLocate_restart (bool restart) |
Restart the Element Location process. More... | |
void | mdlLocate_setCursor () |
Set MicroStation's active cursor to be the "locate" cursor. More... | |
static LocateFunc_LocateFilter | SetPreLocateFunction (LocateFunc_LocateFilter newFunc) |
Set up the locate function for all elements that are in the proximity of the test point, but before MicroStation applies the Search Criteria. More... | |
static LocateFunc_LocateFilter | SetPostLocateFunction (LocateFunc_LocateFilter newFunc) |
Set up the locate function for all elements that are in the proximity of the test point, after the element has already passed the Search Criteria. More... | |
static MdlFunc_Accept | SetAcceptFunction (MdlFunc_Accept newFunc) |
Set up the locate function for when the user accepts the highlighted element. More... | |
static MdlFunc_Show | SetShowFunction (MdlFunc_Show newFunc) |
Set up the locate function to show the result of a selection. More... | |
static MdlFunc_Clean | SetCleanFunction (MdlFunc_Clean newFunc) |
Set up the locate function to clean up the result of a selection. More... | |
static MdlFunc_NotFound | SetNotFoundFunction (MdlFunc_NotFound newFunc) |
Set up the locate function that is called whenever MicroStation attempts to Locate an element, but no acceptable elements were found. More... | |
static LocateFunc_LocateFilter | SetGlobalPreLocateFunction (LocateFunc_LocateFilter newFunc) |
This is the same as SetPreLocateFunction, except that this function is remains active regardless of the active command. More... | |
static LocateFunc_LocateFilter | SetGlobalPostLocateFunction (LocateFunc_LocateFilter newFunc) |
This is the same as SetPostLocateFunction, except that this function is remains active regardless of the active command. More... | |
static Select_UserFunction | SetSelectCmdFunction (Select_UserFunction newFunc) |
Set up the locate function that is called whenever MicroStation attempts to Locate an element, but no acceptable elements were found. More... | |
static LocateFunc_OverridePathDescription | SetOverridePathDescriptionFunction (LocateFunc_OverridePathDescription newFunc) |
Set up the locate function that is called to provide a description of a DisplayPathCP for the user. More... | |
static LocateFunc_ElementDoubleClick | SetElementDoubleClickFunction (LocateFunc_ElementDoubleClick newFunc) |
Set up the locate function to respond to double-click events on an element. More... | |
static LocateFunc_ElementLocated | SetElementLocatedFunction (LocateFunc_ElementLocated newFunc) |
Kept for compatability. More... | |
bool | mdlLocate_isElementHilited () |
Determine whether the Current Hit is hilited on the screen. More... | |
void | mdlLocate_clearHilited (bool redraw) |
If the Current Hit is hilited, unhilite it. More... | |
void | mdlLocate_setStartElem (UInt32 filePos, DgnModelRefP modelRef) |
Set the locate logic to find new elements starting with the specified filePos, modelRef. More... | |
bool | mdlLocate_getCurrentToolState (void) |
Check whether the current tool state is element location. More... | |
LocateMethod | mdlLocate_getLocateMethod () |
Get the method that was used to locate the element. More... | |
typedef enum LOCATE_FILTER_Status LOCATE_FILTER_Status |
NOTE: These types are duplicates of the LocateFilterStatus values - they are here for V7 compatibility only.
The Element Location process provides the mechansim for users to indicate which elements should be considered by a tool. This process is essential for both element modification and query tools that perform operations that use existing elements. The Element Location functions are designed to give the user feedback about which elements are being selected, and allow the user to "reset to next" if the wrong element is chosen.
MicroStation provides two approachs for users to indicate elements to tools: either by pre-selecting them using the Selection Tool to create a selection set, or by pointing to the elements with the cursor and clicking. In general, tools should be written to support both approaches. However, some tools require additional input that is not available from a pre-selected list (e.g. the order of selection is significant or a specific location on an element is important. For this reason, some tools can not support selection sets.
The first step in the Element Location process is to establish a criteria for acceptable elements. MicroStation internally saves a set of Search Criteria that it uses to find acceptable elements. The Search Criteria are changed via the Search Criteria Functions.
Sometimes however, it is not sufficient to simply specify which elements are acceptable on the basis of Search Criteria. In that case, it is necessary to establish a Filter Function that is called for each element that passes both the Search Criteria and additional proximity testing that MicroStation performs automatically. Filter Functions are established by calling LocateCallback methods and can be either temporary (i.e. active only for the current tool), or global (i.e. active for all tools.) Filter functions must have the signature defined by LocateFunc_LocateFilter.
For each element that satifies the Search Criteria and pass all active Filter Functions, MicroStation creates a DgnPlatform::HitPath. The HitPaths are sorted and stored in the Hit List, and the "best" hit becomes the Current Hit. Any active LocateFunc_elementLocated functions are notified, and the Current Hit is hilited.
Applications can obtain information about the Current Hit by calling any of the Current Hit Functions.
If the user presses the Reset button, the "next best" DgnPlatform::HitPath in the Hit List becomes the Current Hit. If there are no more possible hits, the Current Hit becomes NULL.
typedef bool(* LocateFunc_ElementDoubleClick)(DisplayPathCP path) |
UserFunction for LocateCallback::SetElementDoubleClickFunction.
This function will be called by MicroStation whenever the user double-clicks on an element with the Element Selection Tool. All active LOCATE_ELEMENT_DOUBLECLICK functions will be called in turn until one returns true, indicating that it has "handled" the path.
[in] | path | the path of interest. |
typedef void(* LocateFunc_ElementLocated)(MSElementP element, DgnModelRefP modelRef, long filePos, DPoint3dCP point, int viewNum) |
UserFunction for LocateCallback::SetElementLocatedFunction.
[in] | element | the element that was accepted. |
[in] | modelRef | modelRef for element. |
[in] | filePos | filePos of element. |
[in] | point | point entered by user that caused this element to be accepted. |
[in] | viewNum | view that point was in. |
typedef DgnPlatform::LocateFilterStatus(* LocateFunc_LocateFilter)(DgnPlatform::LOCATE_Action action, MSElementCP pElement, DgnModelRefP modelRef, UInt32 filePosition, DPoint3dCP pPoint, int viewNumber, HitPathCP hitPath, WStringR rejectReason) |
UserFunction for Pre and Post Locate Filters.
[in] | action | the operation being performed by MicroStation |
[in] | pElement | the element under consideration |
[in] | modelRef | the modelRef for the element |
[in] | filePosition | the filePos of the element |
[in] | pPoint | user entered point in world coordinates. Sometimes (like in fence and selection set processing) pPoint can be NULL. |
[in] | viewNumber | the view in which the element was located |
[in] | hitPath | the DgnPlatform::HitPath for the element. Sometimes (like in fence and selection set processing) hitPath can be NULL. |
[out] | rejectReason | when rejecting the element, fill in with the reason for the rejection. This string will be presented to the user to explain why the element can't be picked. The buffer is 256 characters. Note: rejectReason can be NULL, in which case no rejection reason can be provided. |
typedef void(* LocateFunc_OverridePathDescription)(DisplayPathCP path, WStringR description) |
UserFunction for LocateCallback::SetOverridePathDescriptionFunction.
This function will be called by MicroStation whenever a description for a DgnPlatform::DisplayPath is required (for example, in the AccuSnap popup window). Each active SetOverridePathDescriptionFunction will be called in turn with the current description of the path from MicroStation and all previous functions. This function can add to, modify, or replace the current descriptions (or obviously leave them alone). The net result of all active LocateFunc_OverridePathDescription functions is displayed to the user.
[in] | path | the path of interest. |
[in,out] | description | path description, maximum displayed is 4096 MSWChars. |
enum LOCATE_FILTER_Status |
NOTE: These types are duplicates of the LocateFilterStatus values - they are here for V7 compatibility only.
The Element Location process provides the mechansim for users to indicate which elements should be considered by a tool. This process is essential for both element modification and query tools that perform operations that use existing elements. The Element Location functions are designed to give the user feedback about which elements are being selected, and allow the user to "reset to next" if the wrong element is chosen.
MicroStation provides two approachs for users to indicate elements to tools: either by pre-selecting them using the Selection Tool to create a selection set, or by pointing to the elements with the cursor and clicking. In general, tools should be written to support both approaches. However, some tools require additional input that is not available from a pre-selected list (e.g. the order of selection is significant or a specific location on an element is important. For this reason, some tools can not support selection sets.
The first step in the Element Location process is to establish a criteria for acceptable elements. MicroStation internally saves a set of Search Criteria that it uses to find acceptable elements. The Search Criteria are changed via the Search Criteria Functions.
Sometimes however, it is not sufficient to simply specify which elements are acceptable on the basis of Search Criteria. In that case, it is necessary to establish a Filter Function that is called for each element that passes both the Search Criteria and additional proximity testing that MicroStation performs automatically. Filter Functions are established by calling LocateCallback methods and can be either temporary (i.e. active only for the current tool), or global (i.e. active for all tools.) Filter functions must have the signature defined by LocateFunc_LocateFilter.
For each element that satifies the Search Criteria and pass all active Filter Functions, MicroStation creates a DgnPlatform::HitPath. The HitPaths are sorted and stored in the Hit List, and the "best" hit becomes the Current Hit. Any active LocateFunc_elementLocated functions are notified, and the Current Hit is hilited.
Applications can obtain information about the Current Hit by calling any of the Current Hit Functions.
If the user presses the Reset button, the "next best" DgnPlatform::HitPath in the Hit List becomes the Current Hit. If there are no more possible hits, the Current Hit becomes NULL.
Enumerator | |
---|---|
LOCATE_ELEMENT_REJECT | |
LOCATE_ELEMENT_NEUTRAL | |
LOCATE_ELEMENT_ACCEPT |
enum LocateMethod |
The reasons that an AcceptFunc from mdlState_startModifyCommand was called by MicroStation.
Call mdlLocate_getLocateMethod from within an AcceptFunc to determine which method was used to locate the element.
void mdlLocate_clear | ( | ) |
Equivalent to mdlLocate_init, except that this function also clears the Current Hit.
void mdlLocate_clearHilited | ( | bool | redraw | ) |
If the Current Hit is hilited, unhilite it.
[in] | redraw | if true, redraw the element on the screen without hilite, otherwise just turn off the hilite flag without redrawing. |
UInt32 mdlLocate_findElement | ( | Dpoint3d const * | inPoint, |
int | viewNum, | ||
bool | useLastSearch, | ||
DgnPlatform::ComponentMode | componentFlag, | ||
bool | hilite | ||
) |
This is the lowest-level routine in the element location API.
The mdlLocate_identifyElement function calls this function automatically. This function finds all elements that satisfy the ~s"Search Criteria" and pass all active Filter Functions.
[in] | inPoint | point to search about. |
[in] | viewNum | the view for inPoint. |
[in] | useLastSearch | If false, the location process starts over, otherwise return the next eligible element from the last search. |
[in] | componentFlag | is a flag that determines how complex element components are handled. |
[in] | hilite | If true, elements are highlighted when they become the Current Hit. |
UInt32 mdlLocate_findElementEx | ( | LocateFailure * | reason, |
WStringP | explanation, | ||
DPoint3dCP | inPoint, | ||
int | viewNum, | ||
bool | restart, | ||
DgnPlatform::ComponentMode | componentFlag, | ||
bool | hilite | ||
) |
Same as mdlLocate_findElement, except that this function returns an explanation of why no elements were found.
[out] | reason | the reason no elements were found. |
[out] | explanation | pass a buffer to receive the explanation, or NULL. |
[in] | inPoint | point to search about. |
[in] | viewNum | the view for inPoint. |
[in] | restart | If restart is 1, the location process starts over, otherwise return the next eligible element from the last search. |
[in] | componentFlag | is a flag that determines how complex element components are handled. |
[in] | hilite | If true, elements are highlighted when they become the Current Hit. |
HitPathCP mdlLocate_findPath | ( | LocateFailure * | reason, |
WStringP | explanation, | ||
bool | restart, | ||
DPoint3dCP | inPoint, | ||
int | viewNum, | ||
DgnPlatform::ComponentMode | componentFlag, | ||
bool | hilite, | ||
bool | doGroups | ||
) |
Same as mdlLocate_findElementEx, except that this function returns a DgnPlatform::HitPath.
Note the order of arguments is slightly different. Also, the inPoint is in world coordinates, not in the coordinate system of the CurrTrans.
[out] | reason | the reason no elements were found. |
[out] | explanation | pass a buffer to receive the explanation, or NULL. |
[in] | restart | If restart is 1, the location process starts over, otherwise return the next eligible element from the last search. |
[in] | inPoint | point to search about. |
[in] | viewNum | the view for inPoint. |
[in] | componentFlag | is a flag that determines how complex element components are handled. |
[in] | hilite | If true, elements are highlighted when they become the Current Hit. |
[in] | doGroups | If true, when hilighting, also include other elements in the same graphic group. |
bool mdlLocate_getCurrentToolState | ( | void | ) |
Check whether the current tool state is element location.
LocateMethod mdlLocate_getLocateMethod | ( | ) |
Get the method that was used to locate the element.
This function should be called from within Accept functions to determine the method the user used to pick the element.
int mdlLocate_identifyElement | ( | DgnPlatform::ComponentMode | componentFlag, |
bool | notFoundMsg | ||
) |
This function automatically becomes the Datapoint function
when mdlState_startModifyCommand is called.
MDL applications that need non-standard element location can call this function directly.
[in] | componentFlag | indicates how complex elements are treated during the location process. |
[in] | notFoundMsg | is a boolean flag indicating whether the explanation error message is displayed. |
void mdlLocate_init | ( | ) |
Unhilte Current Hit (if hilited), erase the Tentative Point (if any), and then empty the Hit List.
bool mdlLocate_isElementHilited | ( | ) |
Determine whether the Current Hit is hilited on the screen.
void mdlLocate_restart | ( | bool | restart | ) |
Restart the Element Location process.
This function is generally called as the last statement in an AcceptFunc of a tool that modifies or queries existing elements.
It first checks to see whether the Single Shot flag is on (see mdlState_checkSingleShot), and if so returns immediately without doing anything (this is because Single Shot means the user does not want the tool to repeat.)
If the tool is not in Single Shot mode, it searchs for Hits near the location of the last data point. This is useful because MicroStation tools often use the Data button to mean both "accept the Current Hit" and as the coordinates for the next search.
[in] | restart | If true, the Hit List is cleared and MicroStation restarts the locate process. If false, the next Hit in the DgnPlatform::HitList becomes the Current Hit. Generally tools set restart to true if the cursor moved a significant distance from the identifcation point and false if not. |
void mdlLocate_setCursor | ( | ) |
Set MicroStation's active cursor to be the "locate" cursor.
void mdlLocate_setStartElem | ( | UInt32 | filePos, |
DgnModelRefP | modelRef | ||
) |
Set the locate logic to find new elements starting with the specified filePos, modelRef.
[in] | filePos | the file position to start finding new elements. |
[in] | modelRef | the model in which to search for new elements. |
|
static |
Set up the locate function for when the user accepts the highlighted element.
This function is also set with the pAccept argument to mdlState_startModifyCommand.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetAcceptFunction.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Set up the locate function to clean up the result of a selection.
This function is also set with the pClean argument to mdlState_startModifyCommand.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetCleanFunction.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Set up the locate function to respond to double-click events on an element.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetElementDoubleClickFunction.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Kept for compatability.
Not called in MicroStation.
[in] | newFunc | The new function to call, or NULL. |
|
static |
This is the same as SetPostLocateFunction, except that this function is remains active regardless of the active command.
[in] | newFunc | The new function to call, or NULL. |
|
static |
This is the same as SetPreLocateFunction, except that this function is remains active regardless of the active command.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Set up the locate function that is called whenever MicroStation attempts to Locate an element, but no acceptable elements were found.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetNotFoundFunction.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Set up the locate function that is called to provide a description of a DisplayPathCP for the user.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetOverridePathDescriptionFunction.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Set up the locate function for all elements that are in the proximity of the test point, after the element has already passed the Search Criteria.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetPostLocateFunction.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Set up the locate function for all elements that are in the proximity of the test point, but before MicroStation applies the Search Criteria.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetPreLocateFunction.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Set up the locate function that is called whenever MicroStation attempts to Locate an element, but no acceptable elements were found.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetSelectCmdFunction.
[in] | newFunc | The new function to call, or NULL. |
|
static |
Set up the locate function to show the result of a selection.
This function is also set with the pShow argument to mdlState_startModifyCommand.
Whenever a primitive command is started, the locate user functions are cleared. Therefore, always call mdlState_startModifyCommand before calling SetShowFunction.
[in] | newFunc | The new function to call, or NULL. |