mirror of https://github.com/CGAL/cgal
Switch to PointsGraphicsItem that uses a kd-tree to quickly determine what points to redraw
This commit is contained in:
parent
4306b967ee
commit
ef0c072342
|
|
@ -12,7 +12,7 @@
|
||||||
#include <QGraphicsLineItem>
|
#include <QGraphicsLineItem>
|
||||||
|
|
||||||
// GraphicsView items and event filters (input classes)
|
// GraphicsView items and event filters (input classes)
|
||||||
#include <CGAL/Qt/PointsGraphicsItem.h>
|
#include <CGAL/Qt/PointsInKdTreeGraphicsItem.h>
|
||||||
#include <CGAL/Qt/utility.h>
|
#include <CGAL/Qt/utility.h>
|
||||||
|
|
||||||
// the two base classes
|
// the two base classes
|
||||||
|
|
@ -44,7 +44,7 @@ private:
|
||||||
CGAL::Qt::Converter<K> convert;
|
CGAL::Qt::Converter<K> convert;
|
||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
|
|
||||||
CGAL::Qt::PointsGraphicsItem<Tree> * pgi;
|
CGAL::Qt::PointsInKdTreeGraphicsItem<Tree> * pgi;
|
||||||
NearestNeighbor * nearest_neighbor;
|
NearestNeighbor * nearest_neighbor;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -128,7 +128,7 @@ MainWindow::MainWindow()
|
||||||
points.push_back(Point_2(102,2));
|
points.push_back(Point_2(102,2));
|
||||||
tree.insert(points.begin(), points.end());
|
tree.insert(points.begin(), points.end());
|
||||||
// Add a GraphicItem for the point set
|
// Add a GraphicItem for the point set
|
||||||
pgi = new CGAL::Qt::PointsGraphicsItem<Tree>(&tree);
|
pgi = new CGAL::Qt::PointsInKdTreeGraphicsItem<Tree>(&tree);
|
||||||
|
|
||||||
QObject::connect(this, SIGNAL(changed()),
|
QObject::connect(this, SIGNAL(changed()),
|
||||||
pgi, SLOT(modelChanged()));
|
pgi, SLOT(modelChanged()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue