Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
interop.h
Go to the documentation of this file.
1/*
2 * GXML/Graphite: Geometry and Graphics Programming Library + Utilities
3 * Copyright (C) 2000 Bruno Levy
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 * If you modify this software, you should include a notice giving the
20 * name of the person performing the modification, the date of modification,
21 * and the reason for such modification.
22 *
23 * Contact: Bruno Levy
24 *
25 * levy@loria.fr
26 *
27 * ISA Project
28 * LORIA, INRIA Lorraine,
29 * Campus Scientifique, BP 239
30 * 54506 VANDOEUVRE LES NANCY CEDEX
31 * FRANCE
32 *
33 * Note that the GNU General Public License does not permit incorporating
34 * the Software into proprietary programs.
35 */
36
37#ifndef H_OGF_GOM_LUA_INTEROP_H
38#define H_OGF_GOM_LUA_INTEROP_H
39
40#include <string>
41
47struct lua_State;
48
49namespace OGF {
50
51 class Any;
52 class MetaType;
53
54 namespace GOMLua {
55
63 void lua_pushgraphiteval(lua_State* L, const Any& value);
64
74 lua_State* L, int index, Any& result, MetaType* mtype = nullptr
75 );
76
77
83 public:
85 lua_State* L,
86 const std::string& name = "",
87 int line = 0
88 );
90 static void stacktrace(lua_State* L);
91 static void dump_table(lua_State* L, int index);
92 static const char* type_to_string(int type);
93
94 private:
95 std::string name_;
96 lua_State* state_;
97 int top_;
98 };
99
100#ifdef GEO_DEBUG
101#define geo_lua_check_stack(L) StackDebugger(L, __FILE__,__LINE__)
102#else
103#define geo_lua_check_stack(L)
104#endif
105
106 }
107}
108
109#endif
A class that stores a variable of arbitrary type.
Definition any.h:62
Small class to debug wrong management of Lua stack.
Definition interop.h:82
The representation of a type in the Meta repository.
Definition meta_type.h:222
void lua_pushgraphiteval(lua_State *L, const Any &value)
Pushes a value on the LUA stack.
void lua_tographiteval(lua_State *L, int index, Any &result, MetaType *mtype=nullptr)
Converts a LUA value to a graphite value stored in an Any.
Global Graphite namespace.
Definition common.h:76