Download O2 Spatial User Manual

Transcript
O2 Engine API : Spatial Index
o2x_spatial_index_create
Summary
Cr eat e a spat ial in dex associat ed wit h a collect ion of per sist en t object s.
Syntax
#include <o2.h>
#include <o2_error.h>
#include <o2_spatialindex.h>
int o2x_spatial_index_create( Handle colHd,
char * volumeName,
void *opaque);
Description
Ver ifies in t h e spat ial in dex cat alogu e t h at th e collect ion in dicat ed by
t h e par am et er colHd h as n ot been pr eviou sly associat ed with a spat ial
in dex.
Cr eat es t h e O2 St or e file for th e spatial in dex t r ee in t h e volu m e declar ed
by t h e par am eter volumeName or in t h e sam e volu m e of t h e collect ion , if
volumeName is set t o zer o.
In it ializes t h e spat ial in dex as a fu n ct ion of t h e par am et er opaque.
Wh en u sin g th e O2 Spat ial in dexin g en gin e, t h e par am et er opaque is
expect ed to be of t ype o2_SiArgList*. Th is class en ables t h e u ser t o set
all t h e spat ial in dex par am et er s as (option , valu e) cou ples.
Th e followin g exam ple sh ows h ow to bu ild su ch an object :
o2_SiArgList argList;
argList.addArgument("IndexType", "RQuadTree");
argList.addArgument("KeyCoordType", "Integer32");
argList.addArgument("Dimension", 2);
Th e ar gu m en t s, wh ich m u st be set by u sin g an o2_SiArgList object ,
in clu de t h ose descr ibed in sect ion 3.5. Th e ar gu m en t s ar e descr ibed
below :
O2Spatial User Manual
73