EgtInterface 1.6a4 :
- completamento modifiche per registrazione comandi in lua e per gestione RefType e RefId.
This commit is contained in:
+46
-5
@@ -16,23 +16,44 @@
|
||||
#include "LUA.h"
|
||||
#include "API.h"
|
||||
#include "/EgtDev/Include/EInAPI.h"
|
||||
#include "/EgtDev/Include/EInConst.h"
|
||||
#include "/EgtDev/Include/EgnStringUtils.h"
|
||||
#include "/EgtDev/Extern/Lua/Include/lua.hpp"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaChangeGroupFrame( lua_State* L)
|
||||
{
|
||||
// 2 o 3 parametri : Id, frNewRef [, sRefType]
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
Frame3d frNewRef ;
|
||||
LuaCheckParam( L, 2, frNewRef)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetRefType( L, 3, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// modifica del riferimento
|
||||
bool bOk = ( EgtChangeGroupFrame( nId, frNewRef, nRefType) != FALSE) ;
|
||||
LuaSetReturn( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaChangeVectorBase( lua_State* L)
|
||||
{
|
||||
// 2 parametri : Id, ptBase
|
||||
// 2 o 3 parametri : Id, ptBase [, sRefType]
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
Point3d ptBase ;
|
||||
LuaCheckParam( L, 2, ptBase)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetRefType( L, 3, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// modifica del testo
|
||||
bool bOk = ( EgtChangeVectorBase( nId, ptBase.v) != FALSE) ;
|
||||
// modifica del punto base
|
||||
bool bOk = ( EgtChangeVectorBase( nId, ptBase.v, nRefType) != FALSE) ;
|
||||
LuaSetReturn( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
@@ -56,6 +77,24 @@ LuaInvertSurf( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmDoSewing( lua_State* L)
|
||||
{
|
||||
// 1 o 2 parametri : Id/s [, bErase]
|
||||
INTVECTOR vId ;
|
||||
LuaCheckParam( L, 1, vId)
|
||||
bool bErase = true ;
|
||||
if ( lua_gettop( L) >= 2)
|
||||
LuaCheckParam( L, 2, bErase) ;
|
||||
LuaClearStack( L) ;
|
||||
// eseguo inversione superfici
|
||||
bool bOk = EgtSurfTmDoSewing( vId, bErase) ;
|
||||
// restituisco il risultato
|
||||
LuaSetReturn( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaModifyText( lua_State* L)
|
||||
@@ -67,7 +106,7 @@ LuaModifyText( lua_State* L)
|
||||
LuaCheckParam( L, 2, sNewText)
|
||||
LuaClearStack( L) ;
|
||||
// modifica del testo
|
||||
bool bOk = ( EgtModifyText( nId, sNewText) != FALSE) ;
|
||||
bool bOk = EgtModifyText( nId, sNewText) ;
|
||||
LuaSetReturn( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
@@ -83,7 +122,7 @@ LuaChangeTextFont( lua_State* L)
|
||||
LuaCheckParam( L, 2, sNewFont)
|
||||
LuaClearStack( L) ;
|
||||
// modifica del testo
|
||||
bool bOk = ( EgtChangeTextFont( nId, sNewFont) != FALSE) ;
|
||||
bool bOk = EgtChangeTextFont( nId, sNewFont) ;
|
||||
LuaSetReturn( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
@@ -157,8 +196,10 @@ bool
|
||||
LuaInstallGdbModify( lua_State* L)
|
||||
{
|
||||
try {
|
||||
lua_register( L, "EgtChangeGroupFrame", LuaChangeGroupFrame) ;
|
||||
lua_register( L, "EgtChangeVectorBase", LuaChangeVectorBase) ;
|
||||
lua_register( L, "EgtInvertSurf", LuaInvertSurf) ;
|
||||
lua_register( L, "EgtSurfTmDoSewing", LuaSurfTmDoSewing) ;
|
||||
lua_register( L, "EgtModifyText", LuaModifyText) ;
|
||||
lua_register( L, "EgtChangeTextFont", LuaChangeTextFont) ;
|
||||
lua_register( L, "EgtFlipText", LuaFlipText) ;
|
||||
|
||||
Reference in New Issue
Block a user