QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RSpatialIndexSimple.h
Go to the documentation of this file.
1
20#ifndef RSPATIALINDEXSIMPLE_H
21#define RSPATIALINDEXSIMPLE_H
22
23#include "core_global.h"
24
25#include <QSet>
26#include <QList>
27
28#include "RSpatialIndex.h"
29
30class RBox;
31class RRequireHeap;
32class RSpatialIndex;
34
35
36
44public:
46 virtual ~RSpatialIndexSimple();
47
48 virtual RSpatialIndex* create();
49 virtual void clear();
50
54 virtual void addToIndex(
55 int id, int pos,
56 double x1, double y1, double z1,
57 double x2, double y2, double z2
58 );
59
60 //virtual void removeFromIndex(int id);
61 virtual bool removeFromIndex(
62 int id, int pos,
63 double x1, double y1, double z1,
64 double x2, double y2, double z2);
65
66 virtual bool removeFromIndex(int id, const QList<RBox>& bb);
67
69 double x1, double y1, double z1,
70 double x2, double y2, double z2,
71 RSpatialIndexVisitor* dataVisitor=NULL
72 );
73
75 double x1, double y1, double z1,
76 double x2, double y2, double z2,
77 RSpatialIndexVisitor* dataVisitor=NULL
78 );
79
81 uint k,
82 double x, double y, double z,
83 RSpatialIndexVisitor* dataVisitor=NULL
84 );
85
86protected:
87 //QMultiHash<RBox, int> si;
89};
90
92
93#endif
Q_DECLARE_METATYPE(RMath *)
Definition RDebug.h:38
Represents a box e.g.
Definition RBox.h:46
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RRequireHeap.h:30
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,...
virtual void clear()=0
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
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.
Simple spatial index implementation.
Definition RSpatialIndexSimple.h:43
QMap< int, QList< RBox > > si
Definition RSpatialIndexSimple.h:88
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RSpatialIndexVisitor.h:35
#define QCADCORE_EXPORT
Definition core_global.h:10
#define NULL
Definition opennurbs_system.h:256