Files
EgtExecutor/LUA_GdbGet.cpp
Dario Sassi 98e88db863 EgtExecutor 2.2c3 :
- aggiustamenti per cambio nome costante Curva di Bezier
- aggiunte funzioni Exe e Lua per superfici di Bezier.
2020-03-26 11:55:40 +00:00

87 lines
2.4 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2020-2020
//----------------------------------------------------------------------------
// File : LUA_GdbGetVol.cpp Data : 23.03.20 Versione : 2.2c3
// Contenuto : Funzioni di interrogazione dei solidi per LUA.
//
//
//
// Modifiche : 23.03.20 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "LUA.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGkLuaAux.h"
using namespace std ;
//----------------------------------------------------------------------------
static int
LuaTextNormVersor( lua_State* L)
{
// 1 o 2 parametri : Id [, nRefId]
int nId ;
LuaCheckParam( L, 1, nId)
int nRefId = nId ;
LuaGetParam( L, 2, nRefId) ;
LuaClearStack( L) ;
// recupero il versore
Vector3d vtNorm ;
if ( ExeTextNormVersor( nId, nRefId, vtNorm))
LuaSetParam( L, vtNorm) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaTextContent( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il contenuto
string sText ;
if ( ExeTextGetContent( nId, sText))
LuaSetParam( L, sText) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaTextFont( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero il font
string sFont ;
if ( ExeTextGetFont( nId, sFont))
LuaSetParam( L, sFont) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGdbGet( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTextNormVersor", LuaTextNormVersor) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTextContent", LuaTextContent) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTextFont", LuaTextFont) ;
return bOk ;
}