/** * Convenience implementation for scripts. */ QPair<int, int> RSpatialIndex::queryNearestNeighbor(double x, double y, double z) { QMap<int, QSet<int> > res = queryNearestNeighbor(1, x, y, z); QList<int> keys = res.keys(); if (keys.length()<1) { qWarning() << "RSpatialIndex::queryNearestNeighbor: no result"; return QPair<int, int>(-1,-1); } return QPair<int, int>(keys.at(0), res[keys.at(0)].toList().first()); }
QMap<int, QSet<int> > RSpatialIndexNavel::queryNearestNeighbor( unsigned int k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor) { return queryNearestNeighbor( k, RSpatialIndexNavel::RSiPoint(x, y, z), dataVisitor ); }