// Get the previous grid IlvManagerGrid* previousGrid = manager->getGrid(view); // Create a new instance of IlvManagerGrid IlvManagerGrid* newGrid = new IlvManagerGrid(display->getPalette(), IlvPoint(0, 0), 10, 10); // Set the new grid to the view manager->setGrid(view, newGrid); // If a previous grid existed then delete it if (previousGrid) delete previousGrid; |
static void AddSnappedLine(IlvManager* manager, const IlvView* view, const IlvPoint& start, const IlvPoint& end) { IlvPoint p1 = start; IlvPoint p2 = end; // Compute the new coordinates manager->snapToGrid(view, p1); manager->snapToGrid(view, p2); // Create an object IlvLine IlvGraphic* object = new IlvLine(manager->getDisplay(), p1, p2); // Add the object to the manager manager->addObject(object); } |