GLG Toolkit, C# Class Library  Version 4.6

This group contains methods for handling object selection and other user interaction with the GLG drawing. More...

Detailed Description

This group contains methods for handling object selection and other user interaction with the GLG drawing.

Functions

static GlgObject CreateSelection (GlgObject top_vp, GlgCube rectangle, GlgObject selected_vp)
 Returns a list of the objects intersecting a given rectangle. More...
 
static GlgObject CreateSelection (MouseEventArgs mouse_event, int delta, GlgObject top_vp, GlgObject selected_vp)
 Returns a list of names of objects located under the mouse. More...
 

Function Documentation

◆ CreateSelection() [1/2]

static GlgObject CreateSelection ( GlgObject  top_vp,
GlgCube  rectangle,
GlgObject  selected_vp 
)
static

Returns a list of the objects intersecting a given rectangle.

This method provides a low-level API to determine whether a mouse event was meant to select graphical objects in a drawing, and may be used inside the Trace callback to implement custom handling of mouse events.

See also CreateSelection that creates selection from an event.

Action objects attached to objects in the drawing provide a higher level interface for custom object selection processing.

Parameters
top_vpThe top viewport or light viewport of the selection query (must be an ancestor of selected_vp or the same as selected_vp). It may be either a viewport or a light viewport.
rectangleThe GlgCube object representing the bounding rectangle in screen coordinates of the selected_vp viewport. All graphical shapes whose rendering intersects this rectangle, including shapes in the top_vp viewport, are included in the selection list.
selected_vpThe viewport relatively to which the bounding rectangle is defined. When used with the mouse events, this is the viewport in which the mouse event occurred. If a light viewport is supplied, its parent viewport will be used.
Returns
An array containing all selected objects, or null if no objects were selected.

This method is similar to CreateSelectionNames method, but it returns an array of objects instead of an array of object names. The objects in the array are listed in the reversed order compared to their drawing order, so that the objects that are at the bottom of the drawing list and are drawn on top of other objects will be listed first in the array.

While CreateSelectionNames reports both the selected objects on the bottom of the hierarchy and all their parents, this method reports only objects at the bottom and doesn't include their parents. For example, if a polygon in a group is selected, only the polygon is reported and not the group. To get information about the parents of selected objects, use the GetParent method.

◆ CreateSelection() [2/2]

static GlgObject CreateSelection ( MouseEventArgs  mouse_event,
int  delta,
GlgObject  top_vp,
GlgObject  selected_vp 
)
static

Returns a list of names of objects located under the mouse.

This method provides a low-level API to determine whether a mouse event was meant to select graphical objects in a drawing, and may be used inside the Trace callback to implement custom handling of mouse events.

See also CreateSelection that creates selection for the specified area.

Action objects attached to objects in the drawing provide a higher level interface for custom object selection processing.

Parameters
mouse_eventMouse event.
deltaSpecifies the radius of the area around the cursor position that will be used to select objects. All graphical shapes whose rendering intersects this area, including shapes in the top_vp viewport, are included in the selection list.
top_vpThe top viewport or light viewport of the selection query (must be an ancestor of selected_vp or the same as selected_vp). It may be either a viewport or a light viewport.
selected_vpThe viewport in which the mouse event occurred. If a light viewport is supplied, its parent viewport will be used.
Returns
An array containing all selected objects, or null if no objects were selected.