Skip to content

Commit 31bdbb4

Browse files
committed
add deletion
1 parent d634e45 commit 31bdbb4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

SpatialIndex_Indexer.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,32 @@
7272
]]></Implementation>
7373
</Method>
7474

75+
<Method name="Delete">
76+
<FormalSpec>x:%Float,y:%Float,id:%String,block:%String=..#ROOTNODE</FormalSpec>
77+
<Implementation><![CDATA[
78+
#dim node As IndexNode
79+
set node = ##class(IndexNode).Get(..indexGlobal, block)
80+
if ('..IsInside(x, y, block)) return
81+
if (node.isLeaf){
82+
if ('..Contains(x, y, block)) {
83+
//TODO: throw error
84+
return
85+
}
86+
kill @..indexGlobal@(block, "data", x, y, id)
87+
if ('..Contains(x, y, block)){
88+
set node.size=node.size-1
89+
do ##class(IndexNode).Put(..indexGlobal, block, node)
90+
}
91+
92+
}
93+
else{
94+
for i=0:1:3 {
95+
do ..Delete(x, y, id, block_i)
96+
}
97+
}
98+
]]></Implementation>
99+
</Method>
100+
75101
<Method name="IsInside">
76102
<FormalSpec>x:%Float,y:%Float,block:%String</FormalSpec>
77103
<ReturnType>%Boolean</ReturnType>

0 commit comments

Comments
 (0)