// ... IlvGrapher* grapher = new IlvGrapher(display); // ... Fill in here the grapher with nodes and links in IlvRandomLayout* layout = new IlvRandomLayout(); layout->attach(grapher); // Perform the layout IlvGraphLayoutReport* layoutReport = layout->performLayout(); if (layoutReport->getCode() != IlvLayoutReportLayoutDone) IlvWarning("Layout not done. Error code = %d\n", layoutReport->getCode()); // ... // If the grapher is not anymore subject of layout: layout->detach(); // Once the layout algorithm is not anymore needed: delete layout; |