// ... IlvGrapher* grapher = new IlvGrapher(display); // ... Fill in the grapher with nodes and links here // Create the bus node; the number of points and // the coordinates are not important IlvPoint point(10,10); IlvPolyline* bus = new IlvPolyline(display, 1, &point); grapher->addNode(bus); // ... Fill in the grapher with links between each node // and the bus here IlvBusLayout* layout = new IlvBusLayout(); layout->attach(grapher); // Specify the bus node layout->setBus(bus); 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; |