PickObjectsInRectangle GoSubGraph


I’m wondering about the behaviour of PickObjectsInRectangle. I have the following situation:

I’m trying to select a bunch of nodes inside a subgraph. If the subgraph is Selectable, only the subgraph itself will be returned by PickObjectsInRectangle. If it is not selectale, only the subnodes will be returned.

I would like both the subgraph and its nodes to be returned. Is this possible ?


The PickObjectsInRectangle (in GoDocument and GoLayer) methods aren’t virtual. So the choices are to override GoView.SelectInRectangle or GoToolRubberBanding.DoRubberBand.

In either one, call the "base" method, then iterate the View.Selection and add children of selected SubGraphs to the Selection.

I was thinking of something like that, but I believe you have some private cache for picking, and I can’t benefit from them if I rewrite picking code myself to know which children of the selected graphs are selected (I work in SelectableOnlyIntersectsBounds mode).

Well, you didn’t mention that SelectableOnlyIntersectsBounds mode before…

The caching will be used (if it can be) in the call to the base, but you're going to have to do it without the cache in your code that extends the definition of selection within SubGraphs. I don't see another way...