Target subsystem
The Target subsystem is where the tool meets the program. Tool targets form the interface between a cursor tool and the data it operates on. The Target subsystem defines three general target types that support not only the Taligent Selection Tool, but potentially many other tools as well. Each target type produces TModelSelections for the tool to operate on. The target itself allows the tool to specify the data it wants to operate on in a generic way.
TSelectionToolTarget defines the base functionality. All selection targets handle feedback and can return a selection and the area where that selection's data is displayed onscreen.
- GetSelection returns a TModelSelection representing the selected data. The MSelectionMapping held by the TSelectionToolTarget is used by derived classes to create the actual selection.
- GetSelectionDisplayArea returns an area that encompasses the part of the screen where the selected data is displayed. If the area were to be drawn onscreen, it would completely cover the part of the screen where the selected data is displayed and nothing else. The MSelectionMapping's GetSelectionDisplayArea function is used internally to calculate this value.
- AdoptFeedback, OrphanFeedback, and ReplaceFeedback allow the tool to provide appropriate user feedback. These member functions call the held MFeedbacker in their implementation to actually display the feedback.
- GetFeedbacker and GetMapping provide access to an MFeedbacker and MSelectionMapping for derived classes.
TCurrentSelectionTarget represents the current model selection. It allows the tool to copy and set the current selection. TCurrentSelectionTarget obtains most of its functionality from an MGUIBundle it holds a reference to.
TInsertionTarget facilitates insertion of data at a particular location onscreen. The tool specifies a point onscreen and the target returns an empty model selection that inserts data into its model in such a way that the data shows up at the specified location (or close to it).
TSelectionTarget supports "rubber band" and "lasso" selection. The tool can specify an arbitrary area and the target returns a selection for all the data displayed in that area.
- SetSelectedArea allows the tool to specify the area it needs selected.
- GetSelectedArea returns the area the tool specified with SetSelectedArea. Note that this value might be different from the value returned by the derived GetSelectionDisplayArea function. GetSelectionDisplayArea returns a tight fitting area that only contains the data specified by the model selection. GetSelectedArea returns the area the tool specified in SetSelectedArea.
It is also possible for GetSelectedArea to return a nonempty area while GetSelectionDisplayArea returns an empty or undefined one. This happens when no data is displayed in the specified area.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.
Generated with WebMaker