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.