Files
EgtExecutor/LUA_GdbModifyVol.cpp
T
Dario Sassi c935ebbf35 EgtExecutor 1.6v7 :
- introdotte prime funzioni Exe e Lua per solidi Zmap.
2016-10-27 16:45:50 +00:00

79 lines
2.5 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2016-2016
//----------------------------------------------------------------------------
// File : LUA_GdbModifyVol.cpp Data : 27.10.16 Versione : 1.6v7
// Contenuto : Funzioni di modifica dei solidi per LUA.
//
//
//
// Modifiche : 27.10.16 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "LUA.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGkLuaAux.h"
using namespace std ;
//----------------------------------------------------------------------------
static int
LuaVolZmapSetStdTool( lua_State* L)
{
// 5 parametri : Id, sToolName, dLen, dDiam, dCornR
int nId ;
LuaCheckParam( L, 1, nId)
string sToolName ;
LuaCheckParam( L, 2, sToolName)
double dLen ;
LuaCheckParam( L, 3, dLen)
double dDiam ;
LuaCheckParam( L, 4, dDiam)
double dCornR ;
LuaCheckParam( L, 5, dCornR)
LuaClearStack( L) ;
// imposto utensile standard a Zmap indicato
bool bOk = ExeVolZmapSetStdTool( nId, sToolName, dLen, dDiam, dCornR) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaVolZmapMillingStep( lua_State* L)
{
// 5 o 6 parametri : nId, ptPs, vtDs, ptPe, vtDe [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptPs ;
LuaCheckParam( L, 2, ptPs)
Vector3d vtDs ;
LuaCheckParam( L, 3, vtDs)
Point3d ptPe ;
LuaCheckParam( L, 4, ptPe)
Vector3d vtDe ;
LuaCheckParam( L, 5, vtDe)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// eseguo movimento di fresatura con l'utensile già associato a Zmap
bool bOk = ExeVolZmapMillingStep( nId, ptPs, vtDs, ptPe, vtDe, nRefType) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGdbModifyVol( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetStdTool", LuaVolZmapSetStdTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapMillingStep", LuaVolZmapMillingStep) ;
return bOk ;
}