GemaLuaCoreLib
The GeMA Lua Core library
gmLuaSpatialIndex.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
24 #ifndef _GEMALUA_SPATIALINDEX_H_
25 #define _GEMALUA_SPATIALINDEX_H_
26 
27 #include "gmLuaObject.h"
28 
29 #include <gmSpatialIndex.h>
30 
31 class GmSpatialIndex;
32 
34 class GML_API_EXPORT GmLuaSpatialIndex : public GmLuaObject
35 {
36 public:
37  GmLuaSpatialIndex(GmSpatialIndex* si, bool newIndex, const GmLogCategory& logger);
38 
39  virtual ~GmLuaSpatialIndex();
40 
41  // See comments on the base class
42  virtual const char* typeName() const { return "spatialIndex"; }
43 
44  virtual void fillMetatable(lua_State* L, int index);
45 
47  virtual void* getClassMetatableID() { static int classID = 0; return &classID; }
48 
50  GmSpatialIndex* index() const { return _si; }
51 
52 private:
53  int id (lua_State* L);
54  int hasCapability (lua_State* L);
55  int closestNode (lua_State* L);
56  int closestNodes (lua_State* L);
57  int closestNodesInRadius (lua_State* L);
58  int containingCell (lua_State* L);
59  int closestGaussPoint (lua_State* L);
60  int closestGaussPoints (lua_State* L);
61  int closestGaussPointsInRadius(lua_State* L);
62 
63 protected:
65  bool _newIndex;
66 };
67 
68 
69 #endif
Declaration of the GmLuaObject class.
GmSpatialIndex * _si
The spatial index 'wrapped' by this proxy object.
Definition: gmLuaSpatialIndex.h:64
GmSpatialIndex * index() const
Returns the wrapped spatial index.
Definition: gmLuaSpatialIndex.h:50
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition: gmLuaSpatialIndex.h:42
A proxy class to export GmSpatialIndex methods to the Lua environment.
Definition: gmLuaSpatialIndex.h:34
virtual void fillMetatable(lua_State *L, int index)=0
Function called by populateMetatable() to fill the metatable with exported methods by derived classes...
bool _newIndex
Is thos a new spatial index whose ownership belongs to the proxy?
Definition: gmLuaSpatialIndex.h:65
A proxy class to export object methods to the Lua environment.
Definition: gmLuaObject.h:35
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmLuaSpatialIndex object.
Definition: gmLuaSpatialIndex.h:47