Files
EgtExecutor/LUA_GdbCreateSurf.cpp
T
Dario Sassi a8c3af9438 EgtExecutor :
- aggiunta EXE e LUA CreateCurveCompoByReorder
- aggiunta EXE e LUA CreateCirclesAlongCurve
- aggiunta EXE e LUA CreateSurfFrFatCurve
- aggiunte ExeChainCurvesInGroup e ExeReorderCurvesInGroup per concatenare e riordinare senza unire le curve in una composita
- aggiunta classe CmdLogOff per disabilitare temporaneamente log comandi (e ripristinare lo stato precedenyte in automatico)
- aggiunte EXE e LUA MdbSetGeneralParam e MdbGetGeneralParam che inglobano le vecchie funzioni su SafeZ
- migliorata ExeAdjustFlatPartLayer.
2016-01-27 07:52:30 +00:00

611 lines
19 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2015
//----------------------------------------------------------------------------
// File : LUA_GdbCreateSurf.cpp Data : 07.01.15 Versione : 1.6a1
// Contenuto : Funzioni di creazione superfici per LUA.
//
//
//
// Modifiche : 07.01.15 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"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGnStringUtils.h"
using namespace std ;
//-------------------------------------------------------------------------------
static const double LIN_TOL_DEF = 0.05 ;
//-------------------------------------------------------------------------------
static int
LuaCreateSurfFrRectangle( lua_State* L)
{
// 3 o 4 parametri : ParentId, ptIni, ptCross [,nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptIni ;
LuaCheckParam( L, 2, ptIni)
Point3d ptCross ;
LuaCheckParam( L, 3, ptCross)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo una regione piana
int nId = ExeCreateSurfFrRectangle( nParentId, ptIni, ptCross, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfFrRectangle3P( lua_State* L)
{
// 4 o 5 parametri : ParentId, ptIni, ptCross, ptDir [,nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptIni ;
LuaCheckParam( L, 2, ptIni)
Point3d ptCross ;
LuaCheckParam( L, 3, ptCross)
Point3d ptDir ;
LuaCheckParam( L, 4, ptDir)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo una regione piana
int nId = ExeCreateSurfFrRectangle3P( nParentId, ptIni, ptCross, ptDir, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfFrStadium( lua_State* L)
{
// 3 o 4 parametri : ParentId, ptIni, ptCross [,nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptIni ;
LuaCheckParam( L, 2, ptIni)
Point3d ptCross ;
LuaCheckParam( L, 3, ptCross)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo una regione piana
int nId = ExeCreateSurfFrStadium( nParentId, ptIni, ptCross, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfFrDisk( lua_State* L)
{
// 3 o 4 parametri : ParentId, ptOrig, dRad [,nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptOrig ;
LuaCheckParam( L, 2, ptOrig)
double dRad ;
LuaCheckParam( L, 3, dRad)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo una regione piana
int nId = ExeCreateSurfFrDisk( nParentId, ptOrig, dRad, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfFlatRegion( lua_State* L)
{
// 2 parametri : ParentId, CrvIds
int nParentId ;
LuaCheckParam( L, 1, nParentId)
INTVECTOR vCrvIds ;
LuaCheckParam( L, 2, vCrvIds)
LuaClearStack( L) ;
// creo una regione piana
int nCount = 0 ;
int nId = ExeCreateSurfFlatRegion( nParentId, vCrvIds, &nCount) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfFrFatCurve( lua_State* L)
{
// 4 parametri : ParentId, nCrvId, dRad, bSquared
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrvId ;
LuaCheckParam( L, 2, nCrvId)
double dRad ;
LuaCheckParam( L, 3, dRad)
bool bSquared ;
LuaCheckParam( L, 4, bSquared)
LuaClearStack( L) ;
// creo una regione piana
int nCount = 0 ;
int nId = ExeCreateSurfFrFatCurve( nParentId, nCrvId, dRad, bSquared) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmBBox( lua_State* L)
{
// 2 o 3 parametri : ParentId, BBox3d [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
BBox3d b3Box ;
LuaCheckParam( L, 2, b3Box)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// creo STM bounding box
int nId = ExeCreateSurfTmBBox( nParentId, b3Box, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmBox( lua_State* L)
{
// 5 o 6 parametri : ParentId, PtIni, PtCross, PtDir, dHeight [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptIni ;
LuaCheckParam( L, 2, ptIni)
Point3d ptCross ;
LuaCheckParam( L, 3, ptCross)
Point3d ptDir ;
LuaCheckParam( L, 4, ptDir)
double dHeight ;
LuaCheckParam( L, 5, dHeight)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM parallelepipedo
int nId = ExeCreateSurfTmBox( nParentId, ptIni, ptCross, ptDir, dHeight, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmPyramid( lua_State* L)
{
// 5 o 6 parametri : ParentId, PtIni, PtCross, PtDir, dHeight [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptIni ;
LuaCheckParam( L, 2, ptIni)
Point3d ptCross ;
LuaCheckParam( L, 3, ptCross)
Point3d ptDir ;
LuaCheckParam( L, 4, ptDir)
double dHeight ;
LuaCheckParam( L, 5, dHeight)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM cilindro
int nId = ExeCreateSurfTmPyramid( nParentId, ptIni, ptCross, ptDir, dHeight, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmCylinder( lua_State* L)
{
// 5 o 6 o 7 parametri : ParentId, PtOrig, vtN, dRad, dHeight [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptOrig ;
LuaCheckParam( L, 2, ptOrig)
Vector3d vtN ;
LuaCheckParam( L, 3, vtN)
double dRad ;
LuaCheckParam( L, 4, dRad)
double dHeight ;
LuaCheckParam( L, 5, dHeight)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 6, dLinTol))
LuaGetParam( L, 7, nRefType) ;
else
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM cilindro
int nId = ExeCreateSurfTmCylinder( nParentId, ptOrig, vtN, dRad, dHeight, dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmCone( lua_State* L)
{
// 5 o 6 o 7 parametri : ParentId, PtOrig, vtN, dRad, dHeight [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptOrig ;
LuaCheckParam( L, 2, ptOrig)
Vector3d vtN ;
LuaCheckParam( L, 3, vtN)
double dRad ;
LuaCheckParam( L, 4, dRad)
double dHeight ;
LuaCheckParam( L, 5, dHeight)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 6, dLinTol))
LuaGetParam( L, 7, nRefType) ;
else
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM cilindro
int nId = ExeCreateSurfTmCone( nParentId, ptOrig, vtN, dRad, dHeight, dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmSphere( lua_State* L)
{
// 3 o 4 o 5 parametri : ParentId, PtOrig, dRad [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptOrig ;
LuaCheckParam( L, 2, ptOrig)
double dRad ;
LuaCheckParam( L, 3, dRad)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 4, dLinTol))
LuaGetParam( L, 5, nRefType) ;
else
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo STM cilindro
int nId = ExeCreateSurfTmSphere( nParentId, ptOrig, dRad, dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmByFlatContour( lua_State* L)
{
// 2 o 3 parametri : ParentId, CrvId [, dTol]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrvId ;
LuaCheckParam( L, 2, nCrvId)
double dLinTol = LIN_TOL_DEF ;
if ( lua_gettop( L) >= 3)
LuaCheckParam( L, 3, dLinTol) ;
LuaClearStack( L) ;
// creo STM riempiendo un contorno piano
int nId = ExeCreateSurfTmByFlatContour( nParentId, nCrvId, dLinTol) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmByRegion( lua_State* L)
{
// 2 o 3 parametri : ParentId, CrvIds [, dTol]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
INTVECTOR vCrvIds ;
LuaCheckParam( L, 2, vCrvIds)
double dLinTol = LIN_TOL_DEF ;
if ( lua_gettop( L) >= 3)
LuaCheckParam( L, 3, dLinTol) ;
LuaClearStack( L) ;
// creo STM riempiendo una regione (piana)
int nId = ExeCreateSurfTmByRegion( nParentId, vCrvIds, dLinTol) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmByExtrusion( lua_State* L)
{
// 3 o 4 o 5 parametri : ParentId, CrvIds, vtExtr [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
INTVECTOR vCrvIds ;
LuaCheckParam( L, 2, vCrvIds)
Vector3d vtExtr ;
LuaCheckParam( L, 3, vtExtr)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 4, dLinTol))
LuaGetParam( L, 5, nRefType) ;
else
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo STM estrudendo uno o più percorsi, se piani si possono mettere i tappi
int nId = ExeCreateSurfTmByExtrusion( nParentId, vCrvIds, vtExtr,
dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmByRegionExtrusion( lua_State* L)
{
// 3 o 4 o 5 parametri : ParentId, CrvIds, vtExtr [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
INTVECTOR vCrvIds ;
LuaCheckParam( L, 2, vCrvIds)
Vector3d vtExtr ;
LuaCheckParam( L, 3, vtExtr)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 4, dLinTol))
LuaGetParam( L, 5, nRefType) ;
else
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo STM estrudendo uno o più percorsi, con aggiunta dei tappi
int nId = ExeCreateSurfTmByRegionExtrusion( nParentId, vCrvIds, vtExtr, dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmByRevolve( lua_State* L)
{
// 5 o 6 o 7 parametri : ParentId, CrvId, ptAx, vtAx, bCapEnds [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrvId ;
LuaCheckParam( L, 2, nCrvId)
Point3d ptAx ;
LuaCheckParam( L, 3, ptAx)
Vector3d vtAx ;
LuaCheckParam( L, 4, vtAx)
bool bCapEnds ;
LuaCheckParam( L, 5, bCapEnds)
double dLinTol = 0.1 ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 6, dLinTol))
LuaGetParam( L, 7, nRefType) ;
else
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM riempiendo un contorno piano
int nId = ExeCreateSurfTmByRevolve( nParentId, nCrvId, ptAx, vtAx, bCapEnds, dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmByScrewing( lua_State* L)
{
// 6 o 7 o 8 parametri : ParentId, CrvId, ptAx, vtAx, dAngRotDeg, dMove [, dTol] [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrvId ;
LuaCheckParam( L, 2, nCrvId)
Point3d ptAx ;
LuaCheckParam( L, 3, ptAx)
Vector3d vtAx ;
LuaCheckParam( L, 4, vtAx)
double dAngRotDeg ;
LuaCheckParam( L, 5, dAngRotDeg)
double dMove ;
LuaCheckParam( L, 6, dMove)
double dLinTol = LIN_TOL_DEF ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 7, dLinTol))
LuaGetParam( L, 8, nRefType) ;
else
LuaGetParam( L, 7, nRefType) ;
LuaClearStack( L) ;
// creo STM riempiendo un contorno piano
int nId = ExeCreateSurfTmByScrewing( nParentId, nCrvId, ptAx, vtAx, dAngRotDeg, dMove, dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTmRuled( lua_State* L)
{
// 3 o 4 parametri : ParentId, PtOrCrvId1, PtOrCrvId2, [, dTol]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nPtOrCrvId1 ;
LuaCheckParam( L, 2, nPtOrCrvId1)
int nPtOrCrvId2 ;
LuaCheckParam( L, 3, nPtOrCrvId2)
double dLinTol = LIN_TOL_DEF ;
if ( lua_gettop( L) >= 4)
LuaCheckParam( L, 4, dLinTol) ;
LuaClearStack( L) ;
// creo STM riempiendo un contorno piano
int nId = ExeCreateSurfTmRuled( nParentId, nPtOrCrvId1, nPtOrCrvId2, dLinTol) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaCreateSurfTmByTriangles( lua_State* L)
{
// 2 o 3 parametri : ParentId, Id/s [, bErase]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
INTVECTOR vId ;
LuaCheckParam( L, 2, vId)
bool bErase = true ;
if ( lua_gettop( L) >= 3)
LuaCheckParam( L, 3, bErase) ;
LuaClearStack( L) ;
// creo STM mediante cucitura di superfici
int nId = ExeCreateSurfTmByTriangles( nParentId, vId, bErase) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaCreateSurfTmBySewing( lua_State* L)
{
// 2 o 3 parametri : ParentId, Id/s [, bErase]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
INTVECTOR vId ;
LuaCheckParam( L, 2, vId)
bool bErase = true ;
if ( lua_gettop( L) >= 3)
LuaCheckParam( L, 3, bErase) ;
LuaClearStack( L) ;
// creo STM mediante cucitura di superfici
int nId = ExeCreateSurfTmBySewing( nParentId, vId, bErase) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGdbCreateSurf( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrRectangle", LuaCreateSurfFrRectangle) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrRectangle3P", LuaCreateSurfFrRectangle3P) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrStadium", LuaCreateSurfFrStadium) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrDisk", LuaCreateSurfFrDisk) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrFatCurve", LuaCreateSurfFrFatCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFlatRegion", LuaCreateSurfFlatRegion) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmBBox", LuaCreateSurfTmBBox) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmBox", LuaCreateSurfTmBox) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmPyramid", LuaCreateSurfTmPyramid) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmCylinder", LuaCreateSurfTmCylinder) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmCone", LuaCreateSurfTmCone) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSphere", LuaCreateSurfTmSphere) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByFlatContour", LuaCreateSurfTmByFlatContour) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByRegion", LuaCreateSurfTmByRegion) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByExtrusion", LuaCreateSurfTmByExtrusion) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByRegionExtrusion", LuaCreateSurfTmByRegionExtrusion) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByRevolve", LuaCreateSurfTmByRevolve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByScrewing", LuaCreateSurfTmByScrewing) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRuled", LuaCreateSurfTmRuled) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByTriangles", LuaCreateSurfTmByTriangles) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmBySewing", LuaCreateSurfTmBySewing) ;
return bOk ;
}