Group: Forum Members
Last Active: 14 Years Ago
Posts: 4,
Visits: 1
|
I have a large set of shapes. I want to allow the user to cancel the layout if they don't want to wait anymore. Can you please suggest the best way to go about this.
I have been using the NOrthogonalGraphLayout as follows:
NOrthogonalGraphLayout layout = new NOrthogonalGraphLayout(); layout.MultiThreaded = true; NNodeList shapes = document.ActiveLayer.Children(NFilters.Shape2D); NLayoutContext layoutContext = new NLayoutContext(); layoutContext.GraphAdapter = new NShapeGraphAdapter(); layoutContext.BodyAdapter = new NShapeBodyAdapter(document);
NDrawingBodyContainerAdapter adapter = new NDrawingBodyContainerAdapter(document); layoutContext.BodyContainerAdapter = adapter; layout.Layout(shapes, layoutContext);
I have tried subscribing to the LayingOutGraph event, so that I could set the cancel argument, but it only seems to fire once. I also tried calling the layout routine in another thread, however that had a cross-thread problem accessing the view.
Also, is there a way to show a progress UI during the layout?
Thanks.
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Trudy, Currently you cannot interupt the Orthogonal Graph Layout, once it has started. The diagram supports execution time constrain and per iteration cancelation only of the force directed layouts, that are indenteded to perform "incremental" layouts (e.g. even after the cancel of the layout the layout can still resume from the current shape configuration). In the case of the Orthogonal Graph Layout and the other "not force directed" layouts such incremental update is not possible and that is why we have not provided a time limitation or per phase cancelation.
Best Regards, Nevron Support Team
|