EgtInterface 1.6d3 :

- costanti stringa sostituite con costanti numeriche
- modificate funzioni API e LUA per scansione pezzi e layer
- aggiunta pulizia memoria al caricamento messaggi (necessario al cambio lingua)
- migliorie varie a funzioni Lua.
This commit is contained in:
Dario Sassi
2015-04-20 08:43:10 +00:00
parent fd718143e6
commit 9d3dc5e537
38 changed files with 810 additions and 824 deletions
+20 -31
View File
@@ -16,11 +16,11 @@
#include "API.h"
#include "LUA.h"
#include "LUA_Base.h"
#include "LUA_Aux.h"
#include "/EgtDev/Include/EInAPI.h"
#include "/EgtDev/Include/EInConst.h"
#include "/EgtDev/Include/EGkCurve.h"
#include "/EgtDev/Include/EgnStringUtils.h"
#include "/EgtDev/Include/EGkLuaAux.h"
#include "/EgtDev/Include/EGnStringUtils.h"
using namespace std ;
@@ -49,14 +49,7 @@ LuaOffsetCurve( lua_State* L)
double dDist ;
LuaCheckParam( L, 2, dDist)
int nType = ICurve::OFF_FILLET ;
if ( lua_gettop( L) >= 3) {
string sType ;
LuaCheckParam( L, 3, sType)
if ( sType == "CHAMFER")
nType = ICurve::OFF_CHAMFER ;
else if ( sType == "EXTEND")
nType = ICurve::OFF_EXTEND ;
}
LuaGetParam( L, 3, nType) ;
LuaClearStack( L) ;
// offset della curva
bool bOk = ( EgtOffsetCurve( nId, dDist, nType) != FALSE) ;
@@ -68,13 +61,13 @@ LuaOffsetCurve( lua_State* L)
static int
LuaChangeClosedCurveStartPoint( lua_State* L)
{
// 2 o 3 parametri : Id, NewStart [, sRefType]
// 2 o 3 parametri : Id, NewStart [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptStart ;
LuaCheckParam( L, 2, ptStart)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 3, nRefType) ;
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// modifico il punto iniziale
bool bOk = ( EgtChangeClosedCurveStartPoint( nId, ptStart.v, nRefType) != FALSE) ;
@@ -86,13 +79,13 @@ LuaChangeClosedCurveStartPoint( lua_State* L)
static int
LuaModifyCurveStartPoint( lua_State* L)
{
// 2 o 3 parametri : Id, NewStart [, sRefType]
// 2 o 3 parametri : Id, NewStart [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptStart ;
LuaCheckParam( L, 2, ptStart)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 3, nRefType) ;
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// modifico il punto iniziale
bool bOk = ( EgtModifyCurveStartPoint( nId, ptStart.v, nRefType) != FALSE) ;
@@ -104,13 +97,13 @@ LuaModifyCurveStartPoint( lua_State* L)
static int
LuaModifyCurveEndPoint( lua_State* L)
{
// 2 o 3 parametri : Id, NewEnd [, sRefType]
// 2 o 3 parametri : Id, NewEnd [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptEnd ;
LuaCheckParam( L, 2, ptEnd)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 3, nRefType) ;
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// modifico il punto finale
bool bOk = ( EgtModifyCurveEndPoint( nId, ptEnd.v, nRefType) != FALSE) ;
@@ -122,13 +115,13 @@ LuaModifyCurveEndPoint( lua_State* L)
static int
LuaModifyCurveExtrusion( lua_State* L)
{
// 2 o 3 parametri : Id/s, vtExtr [, sRefType]
// 2 o 3 parametri : Id/s, vtExtr [, nRefType]
INTVECTOR vId ;
LuaCheckParam( L, 1, vId)
Vector3d vtExtr ;
LuaCheckParam( L, 2, vtExtr)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 3, nRefType) ;
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// modifico il vettore estrusione
bool bOk = EgtModifyCurveExtrusion( vId, vtExtr, nRefType) ;
@@ -240,7 +233,7 @@ LuaTrimCurveStartEndAtParam( lua_State* L)
static int
LuaTrimExtendCurveByLen( lua_State* L)
{
// 3 o 4 parametri : Id, dLen, ptNear [, sRefType]
// 3 o 4 parametri : Id, dLen, ptNear [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
double dLen ;
@@ -248,7 +241,7 @@ LuaTrimExtendCurveByLen( lua_State* L)
Point3d ptNear ;
LuaCheckParam( L, 3, ptNear)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 4, nRefType) ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// taglio o allungo la curva nell'estremo più vicino al punto
bool bOk = ( EgtTrimExtendCurveByLen( nId, dLen, ptNear.v, nRefType) != FALSE) ;
@@ -279,13 +272,13 @@ LuaSplitCurve( lua_State* L)
static int
LuaSplitCurveAtPoint( lua_State* L)
{
// 2 o 3 parametri : Id, ptOn [, sRefType]
// 2 o 3 parametri : Id, ptOn [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptOn ;
LuaCheckParam( L, 2, ptOn)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 3, nRefType) ;
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// divido la curva nel punto
int nNewId = EgtSplitCurveAtPoint( nId, ptOn.v, nRefType) ;
@@ -335,18 +328,14 @@ LuaExplodeCurveCompo( lua_State* L)
static int
LuaExplodeCurveBezier( lua_State* L)
{
// 2 o 3 parametri : Id, bArcsVsLines [, dLinTol]
// 2 o 3 parametri : Id, nArcsVsLines [, dLinTol]
int nId ;
LuaCheckParam( L, 1, nId)
bool bArcsVsLines ;
string sTemp ;
LuaCheckParam( L, 2, sTemp)
ToUpper( sTemp) ;
if ( sTemp == "LINES")
bArcsVsLines = false ;
int nTemp ;
LuaCheckParam( L, 2, nTemp)
bool bArcsVsLines = ( nTemp != 0) ;
double dLinTol = 0.01 ;
if ( lua_gettop( L) >= 3)
LuaCheckParam( L, 3, dLinTol)
LuaGetParam( L, 3, dLinTol) ;
LuaClearStack( L) ;
// esplosione della curva composita
int nNewId = EgtExplodeCurveBezier( nId, bArcsVsLines, dLinTol) ;