20#ifndef RSPATIALINDEX_H
21#define RSPATIALINDEX_H
44 double x1,
double y1,
double z1,
45 double x2,
double y2,
double z2);
48 double x1,
double y1,
double z1,
49 double x2,
double y2,
double z2) {
77 static qint64 getSIId(
int id,
int pos);
78 static int getId(qint64 siid);
79 static int getPos(qint64 siid);
84 virtual void bulkLoad(
const QList<int>& ids,
const QList<QList<RBox> >& bbs);
86 virtual void bulkLoadSimple(
const QList<int>& ids,
const QList<RBox>& bbs);
93 double x1,
double y1,
double z1,
94 double x2,
double y2,
double z2
100 virtual void addToIndex(
109 virtual void addToIndex(
111 const QList<RBox>& bbs
125 double x1,
double y1,
double z1,
126 double x2,
double y2,
double z2) = 0;
132 virtual bool removeFromIndex(
int id,
int pos,
const RBox& bb);
138 virtual bool removeFromIndex(
int id,
const QList<RBox>& bb);
155 double x1,
double y1,
double z1,
156 double x2,
double y2,
double z2,
183 double x1,
double y1,
double z1,
184 double x2,
double y2,
double z2,
197 QList<int> queryContainedIds(
198 double x1,
double y1,
double z1,
199 double x2,
double y2,
double z2,
213 double x,
double y,
double z,
217 virtual QPair<int, int> queryNearestNeighbor(
double x,
double y,
double z);
Q_DECLARE_METATYPE(RMath *)
QCADCORE_EXPORT QDebug operator<<(QDebug dbg, RSpatialIndex &si)
Stream operator for QDebug.
Definition RSpatialIndex.cpp:156
Represents a box e.g.
Definition RBox.h:46
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RRequireHeap.h:30
Definition RSpatialIndex.h:37
RSpatialIndexDebugVisitor(QDebug dbg)
Definition RSpatialIndex.h:39
virtual void visitNode(double x1, double y1, double z1, double x2, double y2, double z2)
Definition RSpatialIndex.h:47
virtual ~RSpatialIndexDebugVisitor()
Definition RSpatialIndex.h:40
QDebug dbg
Definition RSpatialIndex.h:58
QList< QPair< int, int > > matches
Definition RSpatialIndex.h:59
Abstract base class for spatial index implementations.
Definition RSpatialIndex.h:69
virtual ~RSpatialIndex()
Definition RSpatialIndex.h:74
virtual QMap< int, QSet< int > > queryContained(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)=0
Queries the index for all items that are completely inside the given box x1,y1,z1,...
virtual QMap< int, QSet< int > > queryNearestNeighbor(unsigned int k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor=NULL)=0
Queries the index for closest neighbor items.
virtual bool removeFromIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)=0
Removes the entry with the given ID from this spatial index.
virtual QMap< int, QSet< int > > queryIntersected(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)=0
Queries the index for all items that are completely inside or intersect with the given box x1,...
virtual RSpatialIndex * create()=0
RSpatialIndex()
Definition RSpatialIndex.h:71
virtual void addToIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)=0
Adds a new entry into this spatial index.
int idCounter
Definition RSpatialIndex.h:220
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RSpatialIndexVisitor.h:35
virtual void visitData(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)=0
#define QCADCORE_EXPORT
Definition core_global.h:10
#define NULL
Definition opennurbs_system.h:256