EgtInterface 1.6a3 :

- modifiche varie per gestire GLOB, LOC e GRID sui dati geometrici
- aggiornamenti e miglirie varie
- eliminate alcune funzioni lua ormai obsolete (ArcXY e CircleXY).
This commit is contained in:
Dario Sassi
2015-01-19 18:21:58 +00:00
parent e23999b6a3
commit 4e5a81c493
19 changed files with 945 additions and 415 deletions
+35 -18
View File
@@ -17,6 +17,7 @@
#include "API.h"
#include "AuxTools.h"
#include "/EgtDev/Include/EInAPI.h"
#include "/EgtDev/Include/EInConst.h"
#include "/EgtDev/Include/EGkExtText.h"
#include "/EgtDev/Include/EgnStringUtils.h"
#include "/EgtDev/Extern/Lua/Include/lua.hpp"
@@ -28,16 +29,19 @@ using namespace std ;
static int
LuaCreateGroup( lua_State* L)
{
// 1 o 2 parametri : ParentId [, Frame]
// 1 o 2 o 3 parametri : ParentId [, Frame] [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Frame3d frFrame ;
if ( lua_gettop( L) >= 2)
LuaCheckParam( L, 2, frFrame) ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 2, frFrame))
LuaGetRefType( L, 3, nRefType) ;
else
LuaGetRefType( L, 2, nRefType) ;
LuaClearStack( L) ;
// creo il gruppo
int nId = EgtCreateGroup( nParentId, frFrame.Orig().v,
frFrame.VersX().v, frFrame.VersY().v, frFrame.VersZ().v) ;
frFrame.VersX().v, frFrame.VersY().v, frFrame.VersZ().v, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;
@@ -50,14 +54,16 @@ LuaCreateGroup( lua_State* L)
static int
LuaCreateGeoPoint( lua_State* L)
{
// 2 parametri : ParentId, PtP
// 2 o 3 parametri : ParentId, PtP [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptP ;
LuaCheckParam( L, 2, ptP)
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 3, nRefType) ;
LuaClearStack( L) ;
// creo il punto
int nId = EgtCreateGeoPoint( nParentId, ptP.v) ;
int nId = EgtCreateGeoPoint( nParentId, ptP.v, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;
@@ -70,17 +76,20 @@ LuaCreateGeoPoint( lua_State* L)
static int
LuaCreateGeoVector( lua_State* L)
{
// 2 o 3 parametri : ParentId, VtV [, PtB]
// 2 o 3 o 4 parametri : ParentId, VtV [, PtB] [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Vector3d vtV ;
LuaCheckParam( L, 2, vtV)
Point3d ptB ;
if ( lua_gettop( L) >= 3)
LuaCheckParam( L, 3, ptB) ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 3, ptB))
LuaGetRefType( L, 4, nRefType) ;
else
LuaGetRefType( L, 3, nRefType) ;
LuaClearStack( L) ;
// creo il vettore
int nId = EgtCreateGeoVector( nParentId, vtV.v, ptB.v) ;
int nId = EgtCreateGeoVector( nParentId, vtV.v, ptB.v, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;
@@ -93,15 +102,17 @@ LuaCreateGeoVector( lua_State* L)
static int
LuaCreateGeoFrame( lua_State* L)
{
// 2 parametri : ParentId, Frame
// 2 o 3 parametri : ParentId, Frame [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Frame3d frFrame ;
LuaCheckParam( L, 2, frFrame) ;
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 3, nRefType) ;
LuaClearStack( L) ;
// creo il gruppo
int nId = EgtCreateGeoFrame( nParentId, frFrame.Orig().v,
frFrame.VersX().v, frFrame.VersY().v, frFrame.VersZ().v) ;
frFrame.VersX().v, frFrame.VersY().v, frFrame.VersZ().v, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;
@@ -114,7 +125,7 @@ LuaCreateGeoFrame( lua_State* L)
static int
LuaCreateText( lua_State* L)
{
// 5 parametri : ParentId, ptP, AngRotDeg, Text, H
// 5 o 6 parametri : ParentId, ptP, AngRotDeg, Text, H [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptP ;
@@ -125,9 +136,11 @@ LuaCreateText( lua_State* L)
LuaCheckParam( L, 4, sText)
double dH ;
LuaCheckParam( L, 5, dH) ;
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo il testo
int nId = EgtCreateText( nParentId, ptP, dAngRotDeg, sText, dH) ;
int nId = EgtCreateText( nParentId, ptP, dAngRotDeg, sText, dH, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;
@@ -140,7 +153,7 @@ LuaCreateText( lua_State* L)
static int
LuaCreateTextEx( lua_State* L)
{
// 8 parametri : ParentId, ptP, vtN, vtD, Text, Font, bItalic, H
// 8 o 9 parametri : ParentId, ptP, vtN, vtD, Text, Font, bItalic, H [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptP ;
@@ -159,9 +172,11 @@ LuaCreateTextEx( lua_State* L)
bool bItalic = ( sItalic == "I") ;
double dH ;
LuaCheckParam( L, 8, dH) ;
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 9, nRefType) ;
LuaClearStack( L) ;
// creo il testo in modo esteso
int nId = EgtCreateTextEx( nParentId, ptP, vtN, vtD, sText, sFont, bItalic, dH) ;
int nId = EgtCreateTextEx( nParentId, ptP, vtN, vtD, sText, sFont, bItalic, dH, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;
@@ -174,7 +189,7 @@ LuaCreateTextEx( lua_State* L)
static int
LuaCreateTextAdv( lua_State* L)
{
// 12 parametri : ParentId, ptP, vtN, vtD, Text, Font, W, sItalic, H, Rat, AddAdv, InsPos
// 12 o 13 parametri : ParentId, ptP, vtN, vtD, Text, Font, W, sItalic, H, Rat, AddAdv, InsPos [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptP ;
@@ -202,10 +217,12 @@ LuaCreateTextAdv( lua_State* L)
string sInsPos ;
LuaCheckParam( L, 12, sInsPos) ;
int nInsPos = ETxtInsPosToString( sInsPos) ;
int nRefType = RTY_DEFAULT ;
LuaGetRefType( L, 13, nRefType) ;
LuaClearStack( L) ;
// creo il testo in modo avanzato
int nId = EgtCreateTextAdv( nParentId, ptP, vtN, vtD,
sText, sFont, nW, bItalic, dH, dRat, dAddAdv, nInsPos) ;
sText, sFont, nW, bItalic, dH, dRat, dAddAdv, nInsPos, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;