EgtExecutor 1.6g5 :

- in creazione curve eliminata la normale (si deduce dal riferimento indicato)
- in creazione gruppo di inserimento è layer corrente da costante
- gestino carattere ' nelle stringhe per lua.
This commit is contained in:
Dario Sassi
2015-07-20 13:07:09 +00:00
parent fece5ea9fb
commit b14c634bc3
12 changed files with 793 additions and 311 deletions
+37
View File
@@ -12,6 +12,8 @@
//----------------------------------------------------------------------------
#include "stdafx.h"
#include "EXE.h"
#include "EXE_Macro.h"
#include "AuxTools.h"
#include "/EgtDev/Include/EGkExtText.h"
#include "/EgtDev/Include/EMkDispositionConst.h"
@@ -20,6 +22,29 @@
using namespace std ;
//----------------------------------------------------------------------------
const string
IdToString( int nId)
{
GseContext* pCtx = GetCurrGseContext() ;
VERIFY_CTX( pCtx, "GDB_ID.NULL")
switch ( nId) {
case GDB_ID_ROOT : return "GDB_ID.ROOT" ;
case GDB_ID_NULL : return "GDB_ID.NULL" ;
case GDB_ID_SEL : return "GDB_ID.SEL" ;
case GDB_ID_GRID : return "GDB_ID.GRID" ;
case GDB_ID_CURRPART : return "GDB_ID.CP" ;
case GDB_ID_CURRLAYER : return "GDB_ID.CL" ;
default :
if ( nId == pCtx->m_nCurrPart)
return "GDB_ID.CP" ;
else if ( nId == pCtx->m_nCurrLayer)
return "GDB_ID.CL" ;
else
return ToString( nId) ;
}
}
//----------------------------------------------------------------------------
const string
IdListToString( const INTVECTOR& vIds)
@@ -113,6 +138,18 @@ OffsTypeToString( int nOffsType)
}
}
//----------------------------------------------------------------------------
const char*
InterpTypeToString( int nIntpType)
{
switch ( nIntpType) {
case ITT_AKIMA : return "GDB_PI.AKIMA" ;
default :
case ITT_AKIMA_CORNER : return "GDB_PI.AKIMA_CORNER" ;
case ITT_BESSEL : return "GDB_PI.BESSEL" ;
}
}
//----------------------------------------------------------------------------
const char*
ApproxTypeToString( int nApprType)
+4
View File
@@ -17,6 +17,8 @@
class IGeomDB ;
//----------------------------------------------------------------------------
// Id con gestione delle relative costanti
const std::string IdToString( int nId) ;
// Lista di Id completa (parametro per lua)
const std::string IdListToString( const INTVECTOR& vIds) ;
// Tipo del file Nge
@@ -31,6 +33,8 @@ const char* RefTypeToString( int nRefType) ;
const char* ETxtInsPosToString( int nETxtInsPos) ;
// Tipo di offset di curva
const char* OffsTypeToString( int nOffsType) ;
// Tipo di interpolazione di punti
const char* InterpTypeToString( int nIntpType) ;
// Tipo di approssimazione di curva
const char* ApproxTypeToString( int nApprType) ;
// Flag per posizione corner rispetto a grezzo
+63 -44
View File
@@ -34,6 +34,7 @@ ExeCreateGroup( int nParentId, const Frame3d& frFrame, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -52,12 +53,17 @@ ExeCreateGroup( int nParentId, const Frame3d& frFrame, int nRefType)
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
if ( AreSameFrame( frFrame, GLOB_FRM))
sLua = "EgtGroup(" + ToString( nParentId) + "," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
if ( AreSameFrame( frFrame, GLOB_FRM)) {
if ( nRefType == RTY_LOC)
sLua = "EgtGroup(" + IdToString( nParentId) + ")" +
" -- Id=" + ToString( nId) ;
else
sLua = "EgtGroup(" + IdToString( nParentId) + "," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
}
else
sLua = "EgtGroup(" + ToString( nParentId) + ",{{" +
sLua = "EgtGroup(" + IdToString( nParentId) + ",{{" +
ToString( frFrame.Orig()) + "},{" +
ToString( frFrame.VersX()) + "},{" +
ToString( frFrame.VersY()) + "},{" +
@@ -76,12 +82,13 @@ ExeCreateGeoPoint( int nParentId, const Point3d& ptP, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale il punto
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
// creo il punto
PtrOwner<IGeoPoint3d> pGeoPnt( CreateGeoPoint3d()) ;
bOk = bOk && ! IsNull( pGeoPnt) ;
@@ -92,7 +99,7 @@ ExeCreateGeoPoint( int nParentId, const Point3d& ptP, int nRefType)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtPoint(" + ToString( nParentId) + ",{" +
string sLua = "EgtPoint(" + IdToString( nParentId) + ",{" +
ToString( ptP) + "}," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
@@ -108,13 +115,14 @@ ExeCreateGeoVector( int nParentId, const Vector3d& vtV, const Point3d& ptB, int
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale il vettore e il punto
Vector3d vtVL = GetVectorLocal( pGeomDB, vtV, nRefType, frLoc) ; ;
Point3d ptBL = GetPointLocal( pGeomDB, ptB, nRefType, frLoc) ; ;
Vector3d vtVL = GetVectorLocal( pGeomDB, vtV, nRefType, frLoc) ;
Point3d ptBL = GetPointLocal( pGeomDB, ptB, nRefType, frLoc) ;
// creo il vettore
PtrOwner<IGeoVector3d> pGeoVct( CreateGeoVector3d()) ;
bOk = bOk && ! IsNull( pGeoVct) ;
@@ -127,12 +135,12 @@ ExeCreateGeoVector( int nParentId, const Vector3d& vtV, const Point3d& ptB, int
if ( IsCmdLog()) {
string sLua ;
if ( ptB.IsSmall())
sLua = "EgtVector(" + ToString( nParentId) + ",{" +
sLua = "EgtVector(" + IdToString( nParentId) + ",{" +
ToString( vtV) + "}," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
else
sLua = "EgtVector(" + ToString( nParentId) + ",{" +
sLua = "EgtVector(" + IdToString( nParentId) + ",{" +
ToString( vtV) + "},{" +
ToString( ptB) + "}," +
RefTypeToString( nRefType) + ")" +
@@ -149,15 +157,16 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptOrigL = GetPointLocal( pGeomDB, frFrame.Orig(), nRefType, frLoc) ; ;
Vector3d vtXL = GetVectorLocal( pGeomDB, frFrame.VersX(), nRefType, frLoc) ; ;
Vector3d vtYL = GetVectorLocal( pGeomDB, frFrame.VersY(), nRefType, frLoc) ; ;
Vector3d vtZL = GetVectorLocal( pGeomDB, frFrame.VersZ(), nRefType, frLoc) ; ;
Point3d ptOrigL = GetPointLocal( pGeomDB, frFrame.Orig(), nRefType, frLoc) ;
Vector3d vtXL = GetVectorLocal( pGeomDB, frFrame.VersX(), nRefType, frLoc) ;
Vector3d vtYL = GetVectorLocal( pGeomDB, frFrame.VersY(), nRefType, frLoc) ;
Vector3d vtZL = GetVectorLocal( pGeomDB, frFrame.VersZ(), nRefType, frLoc) ;
// creo e setto il riferimento
PtrOwner<IGeoFrame3d> pGeoFrm( CreateGeoFrame3d()) ;
bOk = bOk && ! IsNull( pGeoFrm) ;
@@ -167,7 +176,7 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtFrame(" + ToString( nParentId) + ",{{" +
string sLua = "EgtFrame(" + IdToString( nParentId) + ",{{" +
ToString( frFrame.Orig()) + "},{" +
ToString( frFrame.VersX()) + "},{" +
ToString( frFrame.VersY()) + "},{" +
@@ -182,19 +191,20 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
//-------------------------------------------------------------------------------
int
ExeCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
ExeCreateText( int nParentId, const Point3d& ptP,
const string& sText, double dH, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, X_AX, nRefType, frLoc) ; ;
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
Vector3d vtDL = GetVectorLocal( pGeomDB, X_AX, nRefType, frLoc) ;
// creo il testo e lo riempio
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;
@@ -204,10 +214,11 @@ ExeCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtText(" + ToString( nParentId) + ",{" +
ToString( ptP) + "}," +
ToString( dAngRotDeg) + ",'" +
sText + "','" +
string sLuaText = sText ;
ReplaceString( sLuaText, "'", "\\'") ;
string sLua = "EgtText(" + IdToString( nParentId) + ",{" +
ToString( ptP) + "},'" +
sLuaText + "'," +
ToString( dH) + "," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
@@ -219,19 +230,20 @@ ExeCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
//-------------------------------------------------------------------------------
int
ExeCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
ExeCreateTextEx( int nParentId, const Point3d& ptP, double dAngRotDeg,
const string& sText, const string& sFont, bool bItalic, double dH, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, vtN, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, vtD, nRefType, frLoc) ; ;
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
Vector3d vtDL = GetVectorLocal( pGeomDB, FromPolar(1, dAngRotDeg), nRefType, frLoc) ;
// creo il testo e lo riempio
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;
@@ -241,12 +253,15 @@ ExeCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const V
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtTextEx(" + ToString( nParentId) + ",{" +
ToString( ptP) + "},{" +
ToString( vtN) + "},{" +
ToString( vtD) + "},'" +
sText + "','" +
sFont + "'," +
string sLuaText = sText ;
ReplaceString( sLuaText, "'", "\\'") ;
string sLuaFont = sFont ;
ReplaceString( sLuaFont, "'", "\\'") ;
string sLua = "EgtTextEx(" + IdToString( nParentId) + ",{" +
ToString( ptP) + "}," +
ToString( dAngRotDeg) + ",'" +
sLuaText + "','" +
sLuaFont + "'," +
( bItalic ? "'I'" : "'S'") + "," +
ToString( dH) + "," +
RefTypeToString( nRefType) + ")" +
@@ -259,20 +274,21 @@ ExeCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const V
//-------------------------------------------------------------------------------
int
ExeCreateTextAdv( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
ExeCreateTextAdv( int nParentId, const Point3d& ptP, double dAngRotDeg,
const string& sText, const string& sFont,
int nW, bool bItalic, double dH, double dRat, double dAddAdv, int nInsPos, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, vtN, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, vtD, nRefType, frLoc) ; ;
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
Vector3d vtDL = GetVectorLocal( pGeomDB, FromPolar(1, dAngRotDeg), nRefType, frLoc) ;
// creo il testo e lo imposto
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;
@@ -282,12 +298,15 @@ ExeCreateTextAdv( int nParentId, const Point3d& ptP, const Vector3d& vtN, const
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtTextAdv(" + ToString( nParentId) + ",{" +
ToString( ptP) + "},{" +
ToString( vtN) + "},{" +
ToString( vtD) + "},'" +
sText + "','" +
sFont + "'," +
string sLuaText = sText ;
ReplaceString( sLuaText, "'", "\\'") ;
string sLuaFont = sFont ;
ReplaceString( sLuaFont, "'", "\\'") ;
string sLua = "EgtTextAdv(" + IdToString( nParentId) + ",{" +
ToString( ptP) + "}," +
ToString( dAngRotDeg) + ",'" +
sLuaText + "','" +
sLuaFont + "'," +
ToString( nW) + "," +
( bItalic ? "'I'" : "'S'") + "," +
ToString( dH) + "," +
+394 -123
View File
File diff suppressed because it is too large Load Diff
+30 -15
View File
@@ -36,6 +36,7 @@ ExeCreateSurfTmBBox( int nParentId, const BBox3d& b3Box, int nRefType)
// bounding box orientato come gli assi del riferimento
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
// recupero il riferimento locale
Frame3d frLoc ;
bool bOk = pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
@@ -65,7 +66,7 @@ ExeCreateSurfTmBBox( int nParentId, const BBox3d& b3Box, int nRefType)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmBBox(" + ToString( nParentId) + ",{{" +
string sLua = "EgtSurfTmBBox(" + IdToString( nParentId) + ",{{" +
ToString( b3Box.GetMin()) + "},{" +
ToString( b3Box.GetMax()) + "}}," +
RefTypeToString( nRefType) + ")" +
@@ -83,6 +84,7 @@ ExeCreateSurfTmBox( int nParentId, const Point3d& ptIni, const Point3d& ptCross,
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
// recupero il riferimento locale
Frame3d frLoc ;
bool bOk = pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
@@ -111,7 +113,7 @@ ExeCreateSurfTmBox( int nParentId, const Point3d& ptIni, const Point3d& ptCross,
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmBox(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmBox(" + IdToString( nParentId) + ",{" +
ToString( ptIni) + "},{" +
ToString( ptCross) + "},{" +
ToString( ptDir) + "}," +
@@ -131,6 +133,7 @@ ExeCreateSurfTmPyramid( int nParentId, const Point3d& ptIni, const Point3d& ptCr
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -161,7 +164,7 @@ ExeCreateSurfTmPyramid( int nParentId, const Point3d& ptIni, const Point3d& ptCr
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmPyramid(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmPyramid(" + IdToString( nParentId) + ",{" +
ToString( ptIni) + "},{" +
ToString( ptCross) + "},{" +
ToString( ptDir) + "}," +
@@ -181,6 +184,7 @@ ExeCreateSurfTmCylinder( int nParentId, const Point3d& ptOrig, const Vector3d& v
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -201,7 +205,7 @@ ExeCreateSurfTmCylinder( int nParentId, const Point3d& ptOrig, const Vector3d& v
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmCylinder(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmCylinder(" + IdToString( nParentId) + ",{" +
ToString( ptOrig) + "},{" +
ToString( vtN) + "}," +
ToString( dRad) + "," +
@@ -222,6 +226,7 @@ ExeCreateSurfTmCone( int nParentId, const Point3d& ptOrig, const Vector3d& vtN,
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -242,7 +247,7 @@ ExeCreateSurfTmCone( int nParentId, const Point3d& ptOrig, const Vector3d& vtN,
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmCone(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmCone(" + IdToString( nParentId) + ",{" +
ToString( ptOrig) + "},{" +
ToString( vtN) + "}," +
ToString( dRad) + "," +
@@ -263,6 +268,7 @@ ExeCreateSurfTmSphere( int nParentId, const Point3d& ptOrig,
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -279,7 +285,7 @@ ExeCreateSurfTmSphere( int nParentId, const Point3d& ptOrig,
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmSphere(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmSphere(" + IdToString( nParentId) + ",{" +
ToString( ptOrig) + "}," +
ToString( dRad) + "," +
ToString( dLinTol) + "," +
@@ -297,6 +303,7 @@ ExeCreateSurfTmByFlatContour( int nParentId, int nCrvId, double dLinTol)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -311,7 +318,7 @@ ExeCreateSurfTmByFlatContour( int nParentId, int nCrvId, double dLinTol)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmByFlatContour(" + ToString( nParentId) + "," +
string sLua = "EgtSurfTmByFlatContour(" + IdToString( nParentId) + "," +
ToString( nCrvId) + "," +
ToString( dLinTol) + ")" +
" -- Id=" + ToString( nNewId) ;
@@ -327,6 +334,7 @@ ExeCreateSurfTmByRegion( int nParentId, INTVECTOR& vCrvIds, double dLinTol)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -355,7 +363,7 @@ ExeCreateSurfTmByRegion( int nParentId, INTVECTOR& vCrvIds, double dLinTol)
for ( size_t i = 0 ; i < vCrvIds.size() ; ++ i)
sIds += ToString( vCrvIds[i]) + "," ;
sIds.pop_back() ;
string sLua = "EgtSurfTmByRegion(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmByRegion(" + IdToString( nParentId) + ",{" +
sIds + "}," +
ToString( dLinTol) + ")" +
" -- Id=" + ToString( nNewId) ;
@@ -372,6 +380,7 @@ ExeCreateSurfTmByExtrusion( int nParentId, INTVECTOR& vCrvIds, const Vector3d& v
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -406,7 +415,7 @@ ExeCreateSurfTmByExtrusion( int nParentId, INTVECTOR& vCrvIds, const Vector3d& v
for ( size_t i = 0 ; i < vCrvIds.size() ; ++ i)
sIds += ToString( vCrvIds[i]) + "," ;
sIds.pop_back() ;
string sLua = "EgtSurfTmByExtrusion(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmByExtrusion(" + IdToString( nParentId) + ",{" +
sIds + "},{" +
ToString( vtExtr) + "}," +
ToString( dLinTol) + "," +
@@ -425,6 +434,7 @@ ExeCreateSurfTmByRegionExtrusion( int nParentId, INTVECTOR& vCrvIds, const Vecto
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -453,7 +463,7 @@ ExeCreateSurfTmByRegionExtrusion( int nParentId, INTVECTOR& vCrvIds, const Vecto
for ( size_t i = 0 ; i < vCrvIds.size() ; ++ i)
sIds += ToString( vCrvIds[i]) + "," ;
sIds.pop_back() ;
string sLua = "EgtSurfTmByRegionExtrusion(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmByRegionExtrusion(" + IdToString( nParentId) + ",{" +
sIds + "},{" +
ToString( vtExtr) + "}," +
ToString( dLinTol) + "," +
@@ -473,6 +483,7 @@ ExeCreateSurfTmByRevolve( int nParentId, int nCrvId,
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -490,7 +501,7 @@ ExeCreateSurfTmByRevolve( int nParentId, int nCrvId,
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmByRevolve(" + ToString( nParentId) + "," +
string sLua = "EgtSurfTmByRevolve(" + IdToString( nParentId) + "," +
ToString( nCrvId) + ",{" +
ToString( ptAx) + "},{" +
ToString( vtAx) + "}," +
@@ -512,6 +523,7 @@ ExeCreateSurfTmByScrewing( int nParentId, int nCrvId,
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -529,7 +541,7 @@ ExeCreateSurfTmByScrewing( int nParentId, int nCrvId,
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmByScrewing(" + ToString( nParentId) + "," +
string sLua = "EgtSurfTmByScrewing(" + IdToString( nParentId) + "," +
ToString( nCrvId) + ",{" +
ToString( ptAx) + "},{" +
ToString( vtAx) + "}," +
@@ -550,6 +562,7 @@ ExeCreateSurfTmRuled( int nParentId, int nPtOrCrvId1, int nPtOrCrvId2, double dL
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -608,7 +621,7 @@ ExeCreateSurfTmRuled( int nParentId, int nPtOrCrvId1, int nPtOrCrvId2, double dL
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmRuled(" + ToString( nParentId) + "," +
string sLua = "EgtSurfTmRuled(" + IdToString( nParentId) + "," +
ToString( nPtOrCrvId1) + "," +
ToString( nPtOrCrvId2) + "," +
ToString( dLinTol) + ")" +
@@ -625,6 +638,7 @@ ExeCreateSurfTmByTriangles( int nParentId, const INTVECTOR& vIds, bool bErase)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
// almeno un oggetto nell'elenco
bool bOk = ( vIds.size() > 0) ;
// recupero il riferimento locale
@@ -678,7 +692,7 @@ ExeCreateSurfTmByTriangles( int nParentId, const INTVECTOR& vIds, bool bErase)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmByTriangles(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmByTriangles(" + IdToString( nParentId) + ",{" +
IdListToString( vIds) + "}," +
( bErase ? "true" : "false") + ")" +
" -- Id=" + ToString( nNewId) ;
@@ -694,6 +708,7 @@ ExeCreateSurfTmBySewing( int nParentId, const INTVECTOR& vIds, bool bErase)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
// almeno un oggetto nell'elenco
bool bOk = ( vIds.size() > 0) ;
// recupero il riferimento locale
@@ -746,7 +761,7 @@ ExeCreateSurfTmBySewing( int nParentId, const INTVECTOR& vIds, bool bErase)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmBySewing(" + ToString( nParentId) + ",{" +
string sLua = "EgtSurfTmBySewing(" + IdToString( nParentId) + ",{" +
IdListToString( vIds) + "}," +
( bErase ? "true" : "false") + ")" +
" -- Id=" + ToString( nNewId) ;
+12 -4
View File
@@ -406,8 +406,10 @@ ExeSetName( int nId, const string& sName)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLuaName = sName ;
ReplaceString( sLuaName, "'", "\\'") ;
string sLua = "EgtSetName(" + ToString( nId) + ",'" +
sName + "')" +
sLuaName + "')" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
@@ -465,9 +467,13 @@ ExeSetInfo( int nId, const string& sKey, const string& sInfo)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLuaKey = sKey ;
ReplaceString( sLuaKey, "'", "\\'") ;
string sLuaInfo = sInfo ;
ReplaceString( sLuaInfo, "'", "\\'") ;
string sLua = "EgtSetInfo(" + ToString( nId) + ",'" +
sKey + "','" +
sInfo + "')" +
sLuaKey + "','" +
sLuaInfo + "')" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
@@ -528,8 +534,10 @@ ExeRemoveInfo( int nId, const string& sKey)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLuaKey = sKey ;
ReplaceString( sLuaKey, "'", "\\'") ;
string sLua = "EgtRemoveInfo(" + ToString( nId) + ",'" +
sKey + "')" +
sLuaKey + "')" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
+1
View File
@@ -206,6 +206,7 @@ ExeLuaExecFile( const string& sFilePath)
if ( IsCmdLog()) {
string sLuaPath = sFilePath ;
ReplaceString( sLuaPath, "\\", "\\\\") ;
ReplaceString( sLuaPath, "'", "\\'") ;
string sLua = "dofile('" + sLuaPath + "')" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
BIN
View File
Binary file not shown.
+18
View File
@@ -12,10 +12,28 @@
//----------------------------------------------------------------------------
#include "stdafx.h"
#include "EXE.h"
#include "EXE_Macro.h"
#include "GeoTools.h"
#include "/EgtDev/Include/EGkGeomDB.h"
#include "/EgtDev/Include/EXeConst.h"
//----------------------------------------------------------------------------
int
AdjustId( int nId)
{
GseContext* pCtx = GetCurrGseContext() ;
VERIFY_CTX( pCtx, GDB_ID_NULL)
if ( nId == GDB_ID_CURRPART)
return pCtx->m_nCurrPart ;
else if ( nId == GDB_ID_CURRLAYER)
return pCtx->m_nCurrLayer ;
else if ( nId <= GDB_ID_NULL)
return GDB_ID_NULL ;
else
return nId ;
}
//----------------------------------------------------------------------------
Vector3d
GetVectorLocal( IGeomDB* pGeomDB, const Vector3d& vtV, int nRefType, const Frame3d& frLoc)
+2
View File
@@ -17,6 +17,8 @@
class IGeomDB ;
//----------------------------------------------------------------------------
// Sistemo Id per pezzo o layer correnti
int AdjustId( int nId) ;
// Vettore espresso nel riferimento desiderato partendo da vettore nel riferimento RefType
Vector3d GetVectorLocal( IGeomDB* pGeomDB, const Vector3d& vtV, int nRefType, const Frame3d& frLoc) ;
// Punto espresso nel riferimento desiderato partendo da punto nel riferimento RefType
+27 -33
View File
@@ -121,22 +121,20 @@ LuaCreateGeoFrame( lua_State* L)
static int
LuaCreateText( lua_State* L)
{
// 5 o 6 parametri : ParentId, ptP, AngRotDeg, Text, H [, nRefType]
// 4 o 5 parametri : ParentId, ptP, Text, H [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptP ;
LuaCheckParam( L, 2, ptP) ;
double dAngRotDeg ;
LuaCheckParam( L, 3, dAngRotDeg) ;
string sText ;
LuaCheckParam( L, 4, sText)
LuaCheckParam( L, 3, sText)
double dH ;
LuaCheckParam( L, 5, dH) ;
LuaCheckParam( L, 4, dH) ;
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo il testo
int nId = ExeCreateText( nParentId, ptP, dAngRotDeg, sText, dH, nRefType) ;
int nId = ExeCreateText( nParentId, ptP, sText, dH, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -149,30 +147,28 @@ LuaCreateText( lua_State* L)
static int
LuaCreateTextEx( lua_State* L)
{
// 8 o 9 parametri : ParentId, ptP, vtN, vtD, Text, Font, bItalic, H [, nRefType]
// 7 o 8 parametri : ParentId, ptP, dAngRotDeg, Text, Font, bItalic, H [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptP ;
LuaCheckParam( L, 2, ptP) ;
Vector3d vtN ;
LuaCheckParam( L, 3, vtN) ;
Vector3d vtD ;
LuaCheckParam( L, 4, vtD) ;
double dAngRotDeg ;
LuaCheckParam( L, 3, dAngRotDeg) ;
string sText ;
LuaCheckParam( L, 5, sText)
LuaCheckParam( L, 4, sText)
string sFont ;
LuaCheckParam( L, 6, sFont) ;
LuaCheckParam( L, 5, sFont) ;
string sItalic ;
LuaCheckParam( L, 7, sItalic)
LuaCheckParam( L, 6, sItalic)
ToUpper( sItalic) ;
bool bItalic = ( sItalic == "I") ;
double dH ;
LuaCheckParam( L, 8, dH) ;
LuaCheckParam( L, 7, dH) ;
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 9, nRefType) ;
LuaGetParam( L, 8, nRefType) ;
LuaClearStack( L) ;
// creo il testo in modo esteso
int nId = ExeCreateTextEx( nParentId, ptP, vtN, vtD, sText, sFont, bItalic, dH, nRefType) ;
int nId = ExeCreateTextEx( nParentId, ptP, dAngRotDeg, sText, sFont, bItalic, dH, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -185,38 +181,36 @@ LuaCreateTextEx( lua_State* L)
static int
LuaCreateTextAdv( lua_State* L)
{
// 12 o 13 parametri : ParentId, ptP, vtN, vtD, Text, Font, W, sItalic, H, Rat, AddAdv, InsPos [, nRefType]
// 11 o 12 parametri : ParentId, ptP, dAngRotDeg, Text, Font, W, sItalic, H, Rat, AddAdv, InsPos [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptP ;
LuaCheckParam( L, 2, ptP) ;
Vector3d vtN ;
LuaCheckParam( L, 3, vtN) ;
Vector3d vtD ;
LuaCheckParam( L, 4, vtD) ;
double dAngRotDeg ;
LuaCheckParam( L, 3, dAngRotDeg) ;
string sText ;
LuaCheckParam( L, 5, sText)
LuaCheckParam( L, 4, sText)
string sFont ;
LuaCheckParam( L, 6, sFont)
LuaCheckParam( L, 5, sFont)
int nW ;
LuaCheckParam( L, 7, nW)
LuaCheckParam( L, 6, nW)
string sItalic ;
LuaCheckParam( L, 8, sItalic)
LuaCheckParam( L, 7, sItalic)
ToUpper( sItalic) ;
bool bItalic = ( sItalic == "I") ;
double dH ;
LuaCheckParam( L, 9, dH)
LuaCheckParam( L, 8, dH)
double dRat ;
LuaCheckParam( L, 10, dRat)
LuaCheckParam( L, 9, dRat)
double dAddAdv ;
LuaCheckParam( L, 11, dAddAdv)
LuaCheckParam( L, 10, dAddAdv)
int nInsPos ;
LuaCheckParam( L, 12, nInsPos)
LuaCheckParam( L, 11, nInsPos)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 13, nRefType) ;
LuaGetParam( L, 12, nRefType) ;
LuaClearStack( L) ;
// creo il testo in modo avanzato
int nId = ExeCreateTextAdv( nParentId, ptP, vtN, vtD,
int nId = ExeCreateTextAdv( nParentId, ptP, dAngRotDeg,
sText, sFont, nW, bItalic, dH, dRat, dAddAdv, nInsPos, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
+205 -92
View File
@@ -79,6 +79,32 @@ LuaCreateCurveLineEx( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateCurveLinePDL( lua_State* L)
{
// 4 o 5 parametri : ParentId, PtIni, dDirDeg, dLen [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptIni ;
LuaCheckParam( L, 2, ptIni)
double dDirDeg ;
LuaCheckParam( L, 3, dDirDeg)
double dLen ;
LuaCheckParam( L, 4, dLen)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo il segmento di retta
int nId = ExeCreateCurveLinePDL( nParentId, ptIni, dDirDeg, dLen, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateCurveLinePVL( lua_State* L)
@@ -137,20 +163,18 @@ LuaCreateCurveLineMinPointCurve( lua_State* L)
static int
LuaCreateCurveCircle( lua_State* L)
{
// 4 o 5 parametri : ParentId, PtCen, VtN, Rad [, nRefType]
// 3 o 4 parametri : ParentId, PtCen, Rad [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptCen ;
LuaCheckParam( L, 2, ptCen)
Vector3d vtN ;
LuaCheckParam( L, 3, vtN)
double dRad ;
LuaCheckParam( L, 4, dRad)
LuaCheckParam( L, 3, dRad)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 5, nRefType) ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveCircle( nParentId, ptCen, vtN, dRad, nRefType) ;
int nId = ExeCreateCurveCircle( nParentId, ptCen, dRad, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -161,22 +185,20 @@ LuaCreateCurveCircle( lua_State* L)
//-------------------------------------------------------------------------------
static int
LuaCreateCurveCircleCPN( lua_State* L)
LuaCreateCurveCircleCP( lua_State* L)
{
// 4 o 5 parametri : ParentId, PtCen, PtOn, VtN [, nRefType]
// 3 o 4 parametri : ParentId, PtCen, PtOn [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptCen ;
LuaCheckParam( L, 2, ptCen)
Point3d ptOn ;
LuaCheckParam( L, 3, ptOn)
Vector3d vtN ;
LuaCheckParam( L, 4, vtN)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 5, nRefType) ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveCircleCPN( nParentId, ptCen, ptOn, vtN, nRefType) ;
int nId = ExeCreateCurveCircleCP( nParentId, ptCen, ptOn, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -187,9 +209,9 @@ LuaCreateCurveCircleCPN( lua_State* L)
//-------------------------------------------------------------------------------
static int
LuaCreateCurveCircleCPNEx( lua_State* L)
LuaCreateCurveCircleCPEx( lua_State* L)
{
// 6 o 7 parametri : ParentId, PtCen, PtOn, nSepO, nIdO, VtN [, nRefType]
// 5 o 6 parametri : ParentId, PtCen, PtOn, nSepO, nIdO [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptCen ;
@@ -200,13 +222,11 @@ LuaCreateCurveCircleCPNEx( lua_State* L)
LuaCheckParam( L, 4, nSepO)
int nIdO ;
LuaCheckParam( L, 5, nIdO)
Vector3d vtN ;
LuaCheckParam( L, 6, vtN)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 7, nRefType) ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveCircleCPNEx( nParentId, ptCen, ptOn, nSepO, nIdO, vtN, nRefType) ;
int nId = ExeCreateCurveCircleCPEx( nParentId, ptCen, ptOn, nSepO, nIdO, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -245,26 +265,24 @@ LuaCreateCurveCircle3P( lua_State* L)
static int
LuaCreateCurveArc( lua_State* L)
{
// 7 o 8 parametri : ParentId, PtCen, VtN, Rad, VtS, AngCenDeg, DeltaN [, nRefType]
// 6 o 7 parametri : ParentId, PtCen, Rad, AngIniDeg, AngCenDeg, DeltaN [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptCen ;
LuaCheckParam( L, 2, ptCen)
Vector3d vtN ;
LuaCheckParam( L, 3, vtN)
double dRad ;
LuaCheckParam( L, 4, dRad)
Vector3d vtS ;
LuaCheckParam( L, 5, vtS)
LuaCheckParam( L, 3, dRad)
double dAngIniDeg ;
LuaCheckParam( L, 4, dAngIniDeg)
double dAngCenDeg ;
LuaCheckParam( L, 6, dAngCenDeg)
LuaCheckParam( L, 5, dAngCenDeg)
double dDeltaN ;
LuaCheckParam( L, 7, dDeltaN)
LuaCheckParam( L, 6, dDeltaN)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 8, nRefType) ;
LuaGetParam( L, 7, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveArc( nParentId, ptCen, vtN, dRad, vtS, dAngCenDeg, dDeltaN, nRefType) ;
int nId = ExeCreateCurveArc( nParentId, ptCen, dRad, dAngIniDeg, dAngCenDeg, dDeltaN, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -275,9 +293,9 @@ LuaCreateCurveArc( lua_State* L)
//-------------------------------------------------------------------------------
static int
LuaCreateCurveArcC2PN( lua_State* L)
LuaCreateCurveArcC2P( lua_State* L)
{
// 5 o 6 parametri : ParentId, PtCen, PtStart, PtNearEnd, VtNorm [, nRefType]
// 4 o 5 parametri : ParentId, PtCen, PtStart, PtNearEnd [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptCen ;
@@ -286,13 +304,11 @@ LuaCreateCurveArcC2PN( lua_State* L)
LuaCheckParam( L, 3, ptStart)
Point3d ptNearEnd ;
LuaCheckParam( L, 4, ptNearEnd)
Vector3d vtNorm ;
LuaCheckParam( L, 5, vtNorm)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveArcC2PN( nParentId, ptCen, ptStart, ptNearEnd, vtNorm, nRefType) ;
int nId = ExeCreateCurveArcC2P( nParentId, ptCen, ptStart, ptNearEnd, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -303,9 +319,9 @@ LuaCreateCurveArcC2PN( lua_State* L)
//-------------------------------------------------------------------------------
static int
LuaCreateCurveArcC2PNEx( lua_State* L)
LuaCreateCurveArcC2PEx( lua_State* L)
{
// 7 o 8 parametri : ParentId, PtCen, PtStart, nSepS, nIdS, PtNearEnd, VtNorm [, nRefType]
// 6 o 7 parametri : ParentId, PtCen, PtStart, nSepS, nIdS, PtNearEnd [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptCen ;
@@ -318,13 +334,11 @@ LuaCreateCurveArcC2PNEx( lua_State* L)
LuaCheckParam( L, 5, nIdS)
Point3d ptNearEnd ;
LuaCheckParam( L, 6, ptNearEnd)
Vector3d vtNorm ;
LuaCheckParam( L, 7, vtNorm)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 8, nRefType) ;
LuaGetParam( L, 7, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveArcC2PNEx( nParentId, ptCen, ptStart, nSepS, nIdS, ptNearEnd, vtNorm, nRefType) ;
int nId = ExeCreateCurveArcC2PEx( nParentId, ptCen, ptStart, nSepS, nIdS, ptNearEnd, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -361,24 +375,22 @@ LuaCreateCurveArc3P( lua_State* L)
//-------------------------------------------------------------------------------
static int
LuaCreateCurveArc2PVN( lua_State* L)
LuaCreateCurveArc2PD( lua_State* L)
{
// 5 o 6 parametri : ParentId, PtStart, PtEnd, VtDirS, VtNorm [, nRefType]
// 4 o 5 parametri : ParentId, PtStart, PtEnd, dDirSDeg [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptStart ;
LuaCheckParam( L, 2, ptStart)
Point3d ptEnd ;
LuaCheckParam( L, 3, ptEnd)
Vector3d vtDirS ;
LuaCheckParam( L, 4, vtDirS)
Vector3d vtNorm ;
LuaCheckParam( L, 5, vtNorm)
double dDirSDeg ;
LuaCheckParam( L, 4, dDirSDeg)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveArc2PVN( nParentId, ptStart, ptEnd, vtDirS, vtNorm, nRefType) ;
int nId = ExeCreateCurveArc2PD( nParentId, ptStart, ptEnd, dDirSDeg, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -389,9 +401,9 @@ LuaCreateCurveArc2PVN( lua_State* L)
//-------------------------------------------------------------------------------
static int
LuaCreateCurveArc2PVNEx( lua_State* L)
LuaCreateCurveArc2PDEx( lua_State* L)
{
// 7 o 8 parametri : ParentId, PtStart, PtEnd, nSepE, nIdE, VtDirS, VtNorm [, nRefType]
// 6 o 7 parametri : ParentId, PtStart, PtEnd, nSepE, nIdE, dDirSDeg [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptStart ;
@@ -402,16 +414,70 @@ LuaCreateCurveArc2PVNEx( lua_State* L)
LuaCheckParam( L, 4, nSepE)
int nIdE ;
LuaCheckParam( L, 5, nIdE)
Vector3d vtDirS ;
LuaCheckParam( L, 6, vtDirS)
Vector3d vtNorm ;
LuaCheckParam( L, 7, vtNorm)
double dDirSDeg ;
LuaCheckParam( L, 6, dDirSDeg)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 8, nRefType) ;
LuaGetParam( L, 7, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveArc2PVNEx( nParentId, ptStart, ptEnd, nSepE, nIdE,
vtDirS, vtNorm, nRefType) ;
int nId = ExeCreateCurveArc2PDEx( nParentId, ptStart, ptEnd, nSepE, nIdE,
dDirSDeg, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateCurveArc2PV( lua_State* L)
{
// 4 o 5 parametri : ParentId, PtStart, PtEnd, VtDirS [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptStart ;
LuaCheckParam( L, 2, ptStart)
Point3d ptEnd ;
LuaCheckParam( L, 3, ptEnd)
Vector3d vtDirS ;
LuaCheckParam( L, 4, vtDirS)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo l'arco
int nId = ExeCreateCurveArc2PV( nParentId, ptStart, ptEnd, vtDirS, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateCurveBiArc( lua_State* L)
{
// 6 o 7 parametri : ParentId, ptStart, ptEnd, dDirSDeg, dDirEDeg, dPar [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
Point3d ptStart ;
LuaCheckParam( L, 2, ptStart)
Point3d ptEnd ;
LuaCheckParam( L, 3, ptEnd)
double dDirSDeg ;
LuaCheckParam( L, 4, dDirSDeg)
double dDirEDeg ;
LuaCheckParam( L, 5, dDirEDeg)
double dPar ;
LuaCheckParam( L, 6, dPar)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 7, nRefType) ;
LuaClearStack( L) ;
// creo l'arco di fillet
int nId = ExeCreateCurveBiArc( nParentId, ptStart, ptEnd, dDirSDeg, dDirEDeg, dPar, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -424,7 +490,7 @@ LuaCreateCurveArc2PVNEx( lua_State* L)
static int
LuaCreateCurveFillet( lua_State* L)
{
// 8 o 9 parametri : ParentId, nCrv1, PtNear1, nCrv2, PtNear2, VtNorm, dRad, bTrim [, nRefType]
// 7 o 8 parametri : ParentId, nCrv1, PtNear1, nCrv2, PtNear2, dRad, bTrim [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrv1 ;
@@ -435,18 +501,16 @@ LuaCreateCurveFillet( lua_State* L)
LuaCheckParam( L, 4, nCrv2)
Point3d ptNear2 ;
LuaCheckParam( L, 5, ptNear2)
Vector3d vtNorm ;
LuaCheckParam( L, 6, vtNorm)
double dRad ;
LuaCheckParam( L, 7, dRad)
LuaCheckParam( L, 6, dRad)
bool bTrim ;
LuaCheckParam( L, 8, bTrim)
LuaCheckParam( L, 7, bTrim)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 9, nRefType) ;
LuaGetParam( L, 8, nRefType) ;
LuaClearStack( L) ;
// creo l'arco di fillet
int nId = ExeCreateCurveFillet( nParentId, nCrv1, ptNear1, nCrv2, ptNear2,
vtNorm, dRad, bTrim, nRefType) ;
dRad, bTrim, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -459,7 +523,7 @@ LuaCreateCurveFillet( lua_State* L)
static int
LuaCreateCurveChamfer( lua_State* L)
{
// 8 o 9 parametri : ParentId, nCrv1, PtNear1, nCrv2, PtNear2, VtNorm, dDist, bTrim [, nRefType]
// 7 o 8 parametri : ParentId, nCrv1, PtNear1, nCrv2, PtNear2, dDist, bTrim [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrv1 ;
@@ -470,18 +534,16 @@ LuaCreateCurveChamfer( lua_State* L)
LuaCheckParam( L, 4, nCrv2)
Point3d ptNear2 ;
LuaCheckParam( L, 5, ptNear2)
Vector3d vtNorm ;
LuaCheckParam( L, 6, vtNorm)
double dDist ;
LuaCheckParam( L, 7, dDist)
LuaCheckParam( L, 6, dDist)
bool bTrim ;
LuaCheckParam( L, 8, bTrim)
LuaCheckParam( L, 7, bTrim)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 9, nRefType) ;
LuaGetParam( L, 8, nRefType) ;
LuaClearStack( L) ;
// creo l'arco di fillet
int nId = ExeCreateCurveChamfer( nParentId, nCrv1, ptNear1, nCrv2, ptNear2,
vtNorm, dDist, bTrim, nRefType) ;
dDist, bTrim, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -612,6 +674,34 @@ LuaCreateCurveCompoByChain( lua_State* L)
return 2 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateCurveCompoByInterpolation( lua_State* L)
{
// 3 o 4 parametri : ParentId, ptPs, nType [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
PNTVECTOR vPnt ;
LuaCheckParam( L, 2, vPnt)
int nType ;
LuaGetParam( L, 3, nType) ;
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
PolyLine PL ;
// creo una polilinea a partire dai punti
for ( size_t i = 0 ; i < vPnt.size() ; ++ i)
PL.AddUPoint( 0, vPnt[i]) ;
// creo la curva composita
int nId = ExeCreateCurveCompoByInterpolation( nParentId, PL, nType, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateCurveCompoFromPoints( lua_State* L)
@@ -664,6 +754,30 @@ LuaCreateCurveCompoFromPointBulges( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateRectangle2P( 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 il poligono
int nId = ExeCreateRectangle2P( nParentId, ptIni, ptCross, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateRectangle3P( lua_State* L)
@@ -694,7 +808,7 @@ LuaCreateRectangle3P( lua_State* L)
static int
LuaCreatePolygonFromRadius( lua_State* L)
{
// 5 o 6 parametri : ParentId, nNumSides, PtCen, PtCorn, VtN [, nRefType]
// 4 o 5 parametri : ParentId, nNumSides, PtCen, PtCorn [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nNumSides ;
@@ -703,13 +817,11 @@ LuaCreatePolygonFromRadius( lua_State* L)
LuaCheckParam( L, 3, PtCen)
Point3d PtCorn ;
LuaCheckParam( L, 4, PtCorn)
Vector3d vtN ;
LuaCheckParam( L, 5, vtN)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo il poligono
int nId = ExeCreatePolygonFromRadius( nParentId, nNumSides, PtCen, PtCorn, vtN, nRefType) ;
int nId = ExeCreatePolygonFromRadius( nParentId, nNumSides, PtCen, PtCorn, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -722,7 +834,7 @@ LuaCreatePolygonFromRadius( lua_State* L)
static int
LuaCreatePolygonFromApothem( lua_State* L)
{
// 5 o 6 parametri : ParentId, nNumSides, PtCen, PtMid, VtN [, nRefType]
// 4 o 5 parametri : ParentId, nNumSides, PtCen, PtMid [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nNumSides ;
@@ -731,13 +843,11 @@ LuaCreatePolygonFromApothem( lua_State* L)
LuaCheckParam( L, 3, PtCen)
Point3d PtMid ;
LuaCheckParam( L, 4, PtMid)
Vector3d vtN ;
LuaCheckParam( L, 5, vtN)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo il poligono
int nId = ExeCreatePolygonFromApothem( nParentId, nNumSides, PtCen, PtMid, vtN, nRefType) ;
int nId = ExeCreatePolygonFromApothem( nParentId, nNumSides, PtCen, PtMid, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -750,7 +860,7 @@ LuaCreatePolygonFromApothem( lua_State* L)
static int
LuaCreatePolygonFromSide( lua_State* L)
{
// 5 o 6 parametri : ParentId, nNumSides, PtIni, PtFin, VtN [, nRefType]
// 4 o 5 parametri : ParentId, nNumSides, PtIni, PtFin [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nNumSides ;
@@ -759,13 +869,11 @@ LuaCreatePolygonFromSide( lua_State* L)
LuaCheckParam( L, 3, ptIni)
Point3d ptFin ;
LuaCheckParam( L, 4, ptFin)
Vector3d vtN ;
LuaCheckParam( L, 5, vtN)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo il poligono
int nId = ExeCreatePolygonFromSide( nParentId, nNumSides, ptIni, ptFin, vtN, nRefType) ;
int nId = ExeCreatePolygonFromSide( nParentId, nNumSides, ptIni, ptFin, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
@@ -781,18 +889,21 @@ LuaInstallGdbCreateCurve( LuaMgr& luaMgr)
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtLine", LuaCreateCurveLine) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtLineEx", LuaCreateCurveLineEx) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtLinePDL", LuaCreateCurveLinePDL) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtLinePVL", LuaCreateCurveLinePVL) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtLineMinPointCurve", LuaCreateCurveLineMinPointCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCircle", LuaCreateCurveCircle) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCircleCPN", LuaCreateCurveCircleCPN) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCircleCPNEx", LuaCreateCurveCircleCPNEx) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCircleCP", LuaCreateCurveCircleCP) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCircleCPEx", LuaCreateCurveCircleCPEx) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCircle3P", LuaCreateCurveCircle3P) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArc", LuaCreateCurveArc) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArcC2PN", LuaCreateCurveArcC2PN) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArcC2PNEx", LuaCreateCurveArcC2PNEx) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArcC2P", LuaCreateCurveArcC2P) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArcC2PEx", LuaCreateCurveArcC2PEx) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArc3P", LuaCreateCurveArc3P) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PVN", LuaCreateCurveArc2PVN) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PVNEx", LuaCreateCurveArc2PVNEx) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PD", LuaCreateCurveArc2PD) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PDEx", LuaCreateCurveArc2PDEx) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PV", LuaCreateCurveArc2PV) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtBiArc", LuaCreateCurveBiArc) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveFillet", LuaCreateCurveFillet) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveChamfer", LuaCreateCurveChamfer) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveBezier", LuaCreateCurveBezier) ;
@@ -800,8 +911,10 @@ LuaInstallGdbCreateCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveBezierFromArc", LuaCreateCurveBezierFromArc) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompo", LuaCreateCurveCompo) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoByChain", LuaCreateCurveCompoByChain) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoByInterpolation", LuaCreateCurveCompoByInterpolation) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoFromPoints", LuaCreateCurveCompoFromPoints) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoFromPointBulges", LuaCreateCurveCompoFromPointBulges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRectangle2P", LuaCreateRectangle2P) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRectangle3P", LuaCreateRectangle3P) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtPolygonFromRadius", LuaCreatePolygonFromRadius) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtPolygonFromApothem", LuaCreatePolygonFromApothem) ;