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
+30 -30
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/EgkPolyLine.h"
#include "/EgtDev/Include/EgnStringUtils.h"
#include "/EgtDev/Include/EGkLuaAux.h"
#include "/EgtDev/Include/EGkPolyLine.h"
#include "/EgtDev/Include/EGnStringUtils.h"
using namespace std ;
@@ -31,13 +31,13 @@ static const double LIN_TOL_DEF = 0.05 ;
static int
LuaCreateSurfTmBBox( lua_State* L)
{
// 2 o 3 parametri : ParentId, BBox3d [, sRefType]
// 2 o 3 parametri : ParentId, BBox3d [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
BBox3d b3Box ;
LuaCheckParam( L, 2, b3Box)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 3, nRefType) ;
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// creo STM bounding box
int nId = EgtCreateSurfTmBBox( nParentId, b3Box, nRefType) ;
@@ -53,7 +53,7 @@ LuaCreateSurfTmBBox( lua_State* L)
static int
LuaCreateSurfTmBox( lua_State* L)
{
// 5 o 6 parametri : ParentId, PtIni, PtCross, PtDir, dHeight [, sRefType]
// 5 o 6 parametri : ParentId, PtIni, PtCross, PtDir, dHeight [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptIni ;
@@ -65,7 +65,7 @@ LuaCreateSurfTmBox( lua_State* L)
double dHeight ;
LuaCheckParam( L, 5, dHeight)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 6, nRefType) ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM parallelepipedo
int nId = EgtCreateSurfTmBox( nParentId, ptIni.v, ptCross.v, ptDir.v, dHeight, nRefType) ;
@@ -81,7 +81,7 @@ LuaCreateSurfTmBox( lua_State* L)
static int
LuaCreateSurfTmPyramid( lua_State* L)
{
// 5 o 6 parametri : ParentId, PtIni, PtCross, PtDir, dHeight [, sRefType]
// 5 o 6 parametri : ParentId, PtIni, PtCross, PtDir, dHeight [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptIni ;
@@ -93,7 +93,7 @@ LuaCreateSurfTmPyramid( lua_State* L)
double dHeight ;
LuaCheckParam( L, 5, dHeight)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 6, nRefType) ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM cilindro
int nId = EgtCreateSurfTmPyramid( nParentId, ptIni.v, ptCross.v, ptDir.v, dHeight, nRefType) ;
@@ -109,7 +109,7 @@ LuaCreateSurfTmPyramid( lua_State* L)
static int
LuaCreateSurfTmCylinder( lua_State* L)
{
// 5 o 6 o 7 parametri : ParentId, PtOrig, vtN, dRad, dHeight [, dTol] [, sRefType]
// 5 o 6 o 7 parametri : ParentId, PtOrig, vtN, dRad, dHeight [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptOrig ;
@@ -123,9 +123,9 @@ LuaCreateSurfTmCylinder( lua_State* L)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 6, dLinTol))
LuaGetRefType( L, 7, nRefType) ;
LuaGetParam( L, 7, nRefType) ;
else
LuaGetRefType( L, 6, nRefType) ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM cilindro
int nId = EgtCreateSurfTmCylinder( nParentId, ptOrig.v, vtN.v, dRad, dHeight, dLinTol, nRefType) ;
@@ -141,7 +141,7 @@ LuaCreateSurfTmCylinder( lua_State* L)
static int
LuaCreateSurfTmCone( lua_State* L)
{
// 5 o 6 o 7 parametri : ParentId, PtOrig, vtN, dRad, dHeight [, dTol] [, sRefType]
// 5 o 6 o 7 parametri : ParentId, PtOrig, vtN, dRad, dHeight [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptOrig ;
@@ -155,9 +155,9 @@ LuaCreateSurfTmCone( lua_State* L)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 6, dLinTol))
LuaGetRefType( L, 7, nRefType) ;
LuaGetParam( L, 7, nRefType) ;
else
LuaGetRefType( L, 6, nRefType) ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM cilindro
int nId = EgtCreateSurfTmCone( nParentId, ptOrig.v, vtN.v, dRad, dHeight, dLinTol, nRefType) ;
@@ -173,7 +173,7 @@ LuaCreateSurfTmCone( lua_State* L)
static int
LuaCreateSurfTmSphere( lua_State* L)
{
// 3 o 4 o 5 parametri : ParentId, PtOrig, dRad [, dTol] [, sRefType]
// 3 o 4 o 5 parametri : ParentId, PtOrig, dRad [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptOrig ;
@@ -183,9 +183,9 @@ LuaCreateSurfTmSphere( lua_State* L)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 4, dLinTol))
LuaGetRefType( L, 5, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
else
LuaGetRefType( L, 4, nRefType) ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo STM cilindro
int nId = EgtCreateSurfTmSphere( nParentId, ptOrig.v, dRad, dLinTol, nRefType) ;
@@ -247,7 +247,7 @@ LuaCreateSurfTmByRegion( lua_State* L)
static int
LuaCreateSurfTmByExtrusion( lua_State* L)
{
// 3 o 4 o 5 parametri : ParentId, CrvIds, vtExtr [, dTol] [, sRefType]
// 3 o 4 o 5 parametri : ParentId, CrvIds, vtExtr [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
INTVECTOR vCrvIds ;
@@ -257,9 +257,9 @@ LuaCreateSurfTmByExtrusion( lua_State* L)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 4, dLinTol))
LuaGetRefType( L, 5, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
else
LuaGetRefType( L, 4, nRefType) ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo STM estrudendo uno o più percorsi, se piani si possono mettere i tappi
int nId = EgtCreateSurfTmByExtrusion( nParentId, vCrvIds, vtExtr,
@@ -276,7 +276,7 @@ LuaCreateSurfTmByExtrusion( lua_State* L)
static int
LuaCreateSurfTmByRegionExtrusion( lua_State* L)
{
// 3 o 4 o 5 parametri : ParentId, CrvIds, vtExtr [, dTol] [, sRefType]
// 3 o 4 o 5 parametri : ParentId, CrvIds, vtExtr [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
INTVECTOR vCrvIds ;
@@ -286,9 +286,9 @@ LuaCreateSurfTmByRegionExtrusion( lua_State* L)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 4, dLinTol))
LuaGetRefType( L, 5, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
else
LuaGetRefType( L, 4, nRefType) ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo STM estrudendo uno o più percorsi, con aggiunta dei tappi
int nId = EgtCreateSurfTmByRegionExtrusion( nParentId, vCrvIds, vtExtr, dLinTol, nRefType) ;
@@ -304,7 +304,7 @@ LuaCreateSurfTmByRegionExtrusion( lua_State* L)
static int
LuaCreateSurfTmByRevolve( lua_State* L)
{
// 5 o 6 o 7 parametri : ParentId, CrvId, ptAx, vtAx, bCapEnds [, dTol] [, sRefType]
// 5 o 6 o 7 parametri : ParentId, CrvId, ptAx, vtAx, bCapEnds [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrvId ;
@@ -318,9 +318,9 @@ LuaCreateSurfTmByRevolve( lua_State* L)
double dLinTol = 0.1 ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 6, dLinTol))
LuaGetRefType( L, 7, nRefType) ;
LuaGetParam( L, 7, nRefType) ;
else
LuaGetRefType( L, 6, nRefType) ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM riempiendo un contorno piano
int nId = EgtCreateSurfTmByRevolve( nParentId, nCrvId, ptAx.v, vtAx.v, bCapEnds, dLinTol, nRefType) ;
@@ -336,7 +336,7 @@ LuaCreateSurfTmByRevolve( lua_State* L)
static int
LuaCreateSurfTmByScrewing( lua_State* L)
{
// 6 o 7 o 8 parametri : ParentId, CrvId, ptAx, vtAx, dAngRotDeg, dMove [, dTol] [, sRefType]
// 6 o 7 o 8 parametri : ParentId, CrvId, ptAx, vtAx, dAngRotDeg, dMove [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrvId ;
@@ -352,9 +352,9 @@ LuaCreateSurfTmByScrewing( lua_State* L)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 7, dLinTol))
LuaGetRefType( L, 8, nRefType) ;
LuaGetParam( L, 8, nRefType) ;
else
LuaGetRefType( L, 7, nRefType) ;
LuaGetParam( L, 7, nRefType) ;
LuaClearStack( L) ;
// creo STM riempiendo un contorno piano
int nId = EgtCreateSurfTmByScrewing( nParentId, nCrvId, ptAx.v, vtAx.v, dAngRotDeg, dMove, dLinTol, nRefType) ;