Very odd things

I finally got some things done, but one problem still remains.
Bascally it’s that it seems there are some invisible objects in the GoDocument that Orthogonal AvoidNodes links try to avoid. But I have toally no idea what these objects are, because all the visible objects are exactly what I added to the GoDocument, and no one is missing.
Or maybe there are actually no any invisible objects at all, but some other problem causes this effect.

This problem is quite odd. When I move some far away visible objects just a little bit, the invisible objects seem to disappear or move to a new place. I’m not sure whether it disappears or moves because I cannot see them and because maybe there are not only one such invisible objects in the GoDocument. But at the beginning when a new GoDocument and GoView are created, the invsible objects are always in the fixed places.

Here I give a breief procedure describing how the visible objects are created:

I read data from a MySQL database, and create nodes and links for the data. These nodes and links were initially put into a temporary derived GoDocument for layout calculating. And then these objects were distributed into several GoDocuments by moving the links and the nodes. One view was used to show one of these GoDocuments at a time so that it looks that there are seveal pages. I just change derived GoView.Document property to show one of these GoDocuments.

The nodes are derived from GoGeneralNode, having a number of ports derived from GoPort which has customised PortObject. Also these nodes contain a GoShape derived object, which is used as the main part of the GoGeneralNode and DragsNode is true. This main shape’s Bound is used to control the positions of the ports and GoLabels. In LayoutChildren method, I layout labels and ports according this main shape’s Bounds.

The links are derived from GoLink.

walter, I know this problem is very odd and without the whole code at hand it’s hard to understand how it can happen. But I still hope that you can give me some ideas where I should check to find the cause of this problem? Many thanks.

Are you saying that if a document just has two nodes with one link between them, the route for the link will not go straight between the nodes after the initial two turns?
And that if you drag around either node you will consistently see the Orthogonal AvoidsNodes link go “around” a blank area?
Perhaps you could override GoDocument.GetAvoidableRectangle to make sure the returned value is about what you would expect for each node. You might do the same thing with the GoDocument.IsAvoidable predicate, to make sure it returns true for your nodes and false for everything else. Finally, if you can figure out the approximate area where there seems to be something, you can try calling GoDocument.IsUnoccupied to see if the area (or part of it) is really thought to be empty of any avoidable object.
Anyway, I’m hoping that the results of GetAvoidableRectangle will be bigger than you expected for your nodes, perhaps because of some invisible object you have accidentally added to your nodes, or have not positioned in an override of LayoutChildren.