Beta 2 - SubGraph PickObjects


I’m working with Beta 2 and genuinely appreciate the new GoSubGraph functionality… It adds alot to GoDiagram… It seems when I call PickObjects as follows with a complex series of objects below:
IGoCollection gcoll = goV.PickObjects(true,true,PF,false,null,99);
PickObjects doesn’t seem to penetrate the layers and detect underlying subgraphs and nodes… The return is limited to one item in the collection.
Any ideas?

Joe Licata


The behavior does depend on GoSubGraph.PickableBackground, of course. But either way the results are what I expected. Could you describe you situation in more detail?


The toplevel subgraph contains - one GoGeneralNode, one GoTextNode and six GoSubGraphs (each of which has varying numbers of GoIconicNodes added to them). The main and the child subgraphs have their pickable backgrounds set to true. When I do a dragdrop on the main subgraph everything is fine - the main subgraph is detected. When I do a dragdrop on a contained subgraph that has been expanded PickObjects returns only one object in the collection - the top level parent subgraph - not what I want - I want the object at the drop point (second level subgraph or its goiconicnode content). How do I get PickObjects to return the second level subgraphs or their GoIconicNodes when I do a drop on them… and also shouldn’t PickObjects return a collection of more than one object when over one of the second level GoSubraphs or GoIconicNodes in a second level subgraph?
Also of interest When I do the initial add (of Nodes and SubGraphs) to the primary level subgraph - the subgraph repositions itself to (0,0) or (-x,-y) coordinates… Forcing me to reset of the coordinates of the primary SubGraph to it’s original position before the unexplained reposition.


Got past first part of my question… but… still having problems that PickObjects returns only one object and not covered objects… and the issue of a GoSubGraphs jumping to negative coordinates still exists.
Joe Licata


I see that there really could be several different reasonable policies for what PickObjects should do with a GoSubGraph.
The implementation you have assumes that each object returned by PickObjects will have a different top-level parent. This is good for getting the most specific object of a node, without getting a lot of extraneous stuff from the same node.
But for other purposes, such as yours, it seems perfectly reasonable to be able to include several child nodes of GoSubGraphs if they happen overlap each other.
So we’ll add a GoGroup.PickObjects method that is called from GoLayer (with the same args) that just adds the result of Pick (if non-null). For GoSubGraph we can override that to support picking parts of the different immediate children of the subgraph.
As far as adding a child to a subgraph, do you make sure the child has a reasonable position before you add it?


Thanks… PickObjects is definately a new key tool… extremely useful… you are correct some of my childs have bizarre coordinates… and I only straighten them out after the parent GoSubGraph locates itself…
As far as Beta 2 goes… Added functionality especially SubGraphs adds tons to GoDiagram… its fun to program! Never thought Id say that… :)