20#ifndef RSPATIALINDEXNAVEL_H
21#define RSPATIALINDEXNAVEL_H
40 Q_ASSERT(this->ids.length()==this->bbs.length());
94 const QList<int>&
ids;
95 const QList<QList<RBox> >&
bbs;
113 double x1,
double y1,
double z1,
114 double x2,
double y2,
double z2) {
118 if (this->
id ==
id) {
119 double p1[] = { x1, y1, z1 };
120 double p2[] = { x2, y2, z2 };
128 double ,
double ,
double ,
129 double ,
double ,
double ) {}
157 RSiRegion(
double x1,
double y1,
double z1,
double x2,
double y2,
double z2);
168 RSiPoint(
double x,
double y,
double z);
181 ids(ids), dataVisitor(dataVisitor) {
186 if (dataVisitor !=
NULL) {
190 fprintf(stderr,
"error: node has no shape\n");
195 if (region ==
NULL) {
197 "error: node shape in spacial index is not a SpatialIndex::Region\n");
200 dataVisitor->visitNode(region->
m_pLow[0],
226 if (dataVisitor !=
NULL) {
230 fprintf(stderr,
"error: data node has no shape\n");
235 if (region ==
NULL) {
237 "error: shape in spacial index is not a SpatialIndex::Region\n");
244 dataVisitor->visitData(
id, pos, region->
m_pLow[0],
257 void visitData(std::vector<const SpatialIndex::IData*>& v) {
258 std::vector<const SpatialIndex::IData*>::iterator it;
259 for (it = v.begin(); it != v.end(); it++) {
260 printf(
"Visitor::visitData[]: %lld\n", (
long long int)(*it)->getIdentifier());
277 virtual void clear();
279 virtual void bulkLoad(
const QList<int>& ids,
const QList<QList<RBox> >& bbs);
282 double x1,
double y1,
double z1,
283 double x2,
double y2,
double z2);
294 double x1,
double y1,
double z1,
295 double x2,
double y2,
double z2);
298 double x1,
double y1,
double z1,
299 double x2,
double y2,
double z2,
305 double x1,
double y1,
double z1,
306 double x2,
double y2,
double z2,
311 double x,
double y,
double z,
320 void addToIndex(
int id,
int pos,
const RSiRegion& region,
size_t dataLength = 0,
321 const uint8_t* data =
NULL);
void init(void basePath)
Definition AddBlockInit.js:2
Q_DECLARE_METATYPE(RMath *)
Represents a box e.g.
Definition RBox.h:46
RVector getMinimum() const
Definition RBox.cpp:330
RVector getMaximum() const
Definition RBox.cpp:337
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RSpatialIndexNavel.h:35
int index
Definition RSpatialIndexNavel.h:96
RSiDataStream(const QList< int > &ids, const QList< QList< RBox > > &bbs)
Definition RSpatialIndexNavel.h:37
bool done
Definition RSpatialIndexNavel.h:98
virtual SpatialIndex::IData * getNext()
Definition RSpatialIndexNavel.h:45
const QList< int > & ids
Definition RSpatialIndexNavel.h:94
virtual void rewind()
Definition RSpatialIndexNavel.h:88
const QList< QList< RBox > > & bbs
Definition RSpatialIndexNavel.h:95
virtual uint32_t size()
Definition RSpatialIndexNavel.h:84
virtual bool hasNext()
Definition RSpatialIndexNavel.h:80
virtual ~RSiDataStream()
Definition RSpatialIndexNavel.h:43
int pos
Definition RSpatialIndexNavel.h:97
Definition RSpatialIndexNavel.h:105
RSiGetRegionVisitor(int id)
Definition RSpatialIndexNavel.h:107
virtual void visitData(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)
Definition RSpatialIndexNavel.h:112
virtual void visitNode(double, double, double, double, double, double)
Definition RSpatialIndexNavel.h:127
int id
Definition RSpatialIndexNavel.h:132
bool found
Definition RSpatialIndexNavel.h:134
SpatialIndex::Region region
Definition RSpatialIndexNavel.h:133
virtual ~RSiGetRegionVisitor()
Definition RSpatialIndexNavel.h:110
Abstract base class for spatial index implementations.
Definition RSpatialIndex.h:69
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,...
static int getId(qint64 siid)
Definition RSpatialIndex.cpp:49
static int getPos(qint64 siid)
Definition RSpatialIndex.cpp:53
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 void bulkLoad(const QList< int > &ids, const QList< QList< RBox > > &bbs)
Definition RSpatialIndex.cpp:57
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
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.
static qint64 getSIId(int id, int pos)
Definition RSpatialIndex.cpp:45
Internal representation of a point.
Definition RSpatialIndexNavel.h:166
Internal representation of a rectangular region.
Definition RSpatialIndexNavel.h:155
Internal node and data visitor.
Definition RSpatialIndexNavel.h:178
RSpatialIndexVisitor * dataVisitor
Definition RSpatialIndexNavel.h:266
void visitNode(const SpatialIndex::INode &n)
Definition RSpatialIndexNavel.h:184
void visitData(const SpatialIndex::IData &d)
Definition RSpatialIndexNavel.h:207
void visitData(std::vector< const SpatialIndex::IData * > &v)
Definition RSpatialIndexNavel.h:257
QMap< int, QSet< int > > & ids
Definition RSpatialIndexNavel.h:265
Visitor(QMap< int, QSet< int > > &ids, RSpatialIndexVisitor *dataVisitor=NULL)
Definition RSpatialIndexNavel.h:180
Spatial index class.
Definition RSpatialIndexNavel.h:147
SpatialIndex::ISpatialIndex * tree
Definition RSpatialIndexNavel.h:346
QList< int > queryIntersectedSimple(const RBox &b)
Definition RSpatialIndexNavel.h:301
SpatialIndex::IStorageManager * buff
Definition RSpatialIndexNavel.h:347
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RSpatialIndexVisitor.h:35
double x
Getter function for this property: getX Setter function for this property: setX
Definition RVector.h:313
double y
Getter function for this property: getY Setter function for this property: setY
Definition RVector.h:319
double z
Getter function for this property: getZ Setter function for this property: setZ
Definition RVector.h:325
Definition SpatialIndex.h:127
Definition SpatialIndex.h:134
virtual void getShape(IShape **out) const =0
virtual id_type getIdentifier() const =0
Definition SpatialIndex.h:114
Definition SpatialIndex.h:68
Definition SpatialIndex.h:192
Definition SpatialIndex.h:156
Definition SpatialIndex.h:166
double * m_pHigh
Definition Region.h:99
double * m_pLow
Definition Region.h:98
#define NULL
Definition opennurbs_system.h:256
#define false
Definition opennurbs_system.h:252
#define QCADSPATIALINDEX_EXPORT
Definition spatialindex_global.h:10