Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a5a0646ddc | |||
| b954be810c | |||
| 8500a0467e | |||
| 8145b4586c | |||
| 4de367395a | |||
| d9cf624458 | |||
| eedd2068fa | |||
| cf2b1742a0 | |||
| 29462e9536 | |||
| 7e7975c622 | |||
| 85c4af98ce | |||
| 382138e6c5 | |||
| 749830aba9 | |||
| 90449cad40 | |||
| 3d3900b39a | |||
| 1620054970 | |||
| 7d3bec9f44 | |||
| 150b35bb9e | |||
| 173728605d | |||
| d069b33424 | |||
| 4642188fd6 | |||
| e3530f6e90 | |||
| 88fc7e6eee | |||
| 964a02eae4 | |||
| dd5c8ebdd1 | |||
| 34885e1f2a | |||
| 8000a9d3a5 | |||
| 7963b9befe | |||
| 2394dfc404 | |||
| 081c3fcb78 | |||
| 002e736ec4 | |||
| 415a761039 | |||
| 8f596cab5a | |||
| 37dc8b8a7b | |||
| 06e9f85a4b | |||
| 4f42606cd3 | |||
| baa8eb42b6 | |||
| b1a11c4eaf | |||
| 553efdec1b | |||
| bc8171c4ba | |||
| 63b82fe556 | |||
| 9d4b181e1b | |||
| 65cf39c56a | |||
| 2ba94e5dc1 | |||
| 617023edb6 | |||
| e2405d10c5 | |||
| 432810452c | |||
| 0a7369bfcc | |||
| 3c0d89e3ab | |||
| 00c0e216b7 | |||
| a200549542 | |||
| d4cfe31b6f | |||
| ad6673330d | |||
| 00f52ca6ab | |||
| 8dc6cce243 | |||
| 3309939aed | |||
| d646331746 | |||
| 8192bd0feb |
+57
-24
@@ -10,6 +10,8 @@
|
|||||||
// 03.07.18 DS Aggiunto ImportPnt.
|
// 03.07.18 DS Aggiunto ImportPnt.
|
||||||
// 15.09.19 DS Aggiunto ExportSvg.
|
// 15.09.19 DS Aggiunto ExportSvg.
|
||||||
// 14.12.20 DS Aggiunto ImportBtlx.
|
// 14.12.20 DS Aggiunto ImportBtlx.
|
||||||
|
// 23.06.23 DB Aggiunto Import3dm.
|
||||||
|
// 21.09.23 DB Aggiunto Export3dm.
|
||||||
//
|
//
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -40,7 +42,6 @@ static const char* EEX_GETEEXVERSION = "GetEExVersion" ;
|
|||||||
static const char* EEX_SETEEXKEY = "SetEExKey" ;
|
static const char* EEX_SETEEXKEY = "SetEExKey" ;
|
||||||
static const char* EEX_SETEEXNETHWKEY = "SetEExNetHwKey" ;
|
static const char* EEX_SETEEXNETHWKEY = "SetEExNetHwKey" ;
|
||||||
static const char* EEX_SETBTLAUXDIR = "SetBtlAuxDir" ;
|
static const char* EEX_SETBTLAUXDIR = "SetBtlAuxDir" ;
|
||||||
static const char* EEX_SETTHREEJSAUXDIR = "SetThreeJSAuxDir" ;
|
|
||||||
static const char* EEX_CREATEBEAMMGR = "CreateBeamMgr" ;
|
static const char* EEX_CREATEBEAMMGR = "CreateBeamMgr" ;
|
||||||
static const char* EEX_CREATEIMPORTBTL = "CreateImportBtl" ;
|
static const char* EEX_CREATEIMPORTBTL = "CreateImportBtl" ;
|
||||||
static const char* EEX_CREATEIMPORTBTLX = "CreateImportBtlx" ;
|
static const char* EEX_CREATEIMPORTBTLX = "CreateImportBtlx" ;
|
||||||
@@ -50,11 +51,14 @@ static const char* EEX_CREATEIMPORTDXF = "CreateImportDxf" ;
|
|||||||
static const char* EEX_CREATEIMPORTPNT = "CreateImportPnt" ;
|
static const char* EEX_CREATEIMPORTPNT = "CreateImportPnt" ;
|
||||||
static const char* EEX_CREATEIMPORTSTL = "CreateImportStl" ;
|
static const char* EEX_CREATEIMPORTSTL = "CreateImportStl" ;
|
||||||
static const char* EEX_CREATEIMPORT3MF = "CreateImport3MF" ;
|
static const char* EEX_CREATEIMPORT3MF = "CreateImport3MF" ;
|
||||||
|
static const char* EEX_CREATEIMPORT3DM = "CreateImport3dm" ;
|
||||||
static const char* EEX_CREATEEXPORTDXF = "CreateExportDxf" ;
|
static const char* EEX_CREATEEXPORTDXF = "CreateExportDxf" ;
|
||||||
static const char* EEX_CREATEEXPORTSTL = "CreateExportStl" ;
|
static const char* EEX_CREATEEXPORTSTL = "CreateExportStl" ;
|
||||||
static const char* EEX_CREATEEXPORT3MF = "CreateExport3MF" ;
|
static const char* EEX_CREATEEXPORT3MF = "CreateExport3MF" ;
|
||||||
static const char* EEX_CREATEEXPORTTHREEJS = "CreateExportThreeJS" ;
|
static const char* EEX_CREATEEXPORT3DM = "CreateExport3dm" ;
|
||||||
static const char* EEX_CREATEEXPORTSVG = "CreateExportSvg" ;
|
static const char* EEX_CREATEEXPORTSVG = "CreateExportSvg" ;
|
||||||
|
static const char* EEX_SETTHREEJSLIBDIR = "SetThreeJSLibDir" ;
|
||||||
|
static const char* EEX_CREATEEXPORTTHREEJS = "CreateExportThreeJS" ;
|
||||||
static const char* EEX_CREATEEEXEXECUTOR = "CreateExcExecutor" ;
|
static const char* EEX_CREATEEEXEXECUTOR = "CreateExcExecutor" ;
|
||||||
|
|
||||||
|
|
||||||
@@ -181,22 +185,6 @@ MySetBtlAuxDir( const string& sBtlAuxDir)
|
|||||||
return pFun( sBtlAuxDir) ;
|
return pFun( sBtlAuxDir) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool
|
|
||||||
MySetThreeJSAuxDir( const string& sThreeJSAuxDir )
|
|
||||||
{
|
|
||||||
// verifico caricamento libreria EgtExchange
|
|
||||||
if ( s_hEEx == nullptr)
|
|
||||||
return false ;
|
|
||||||
// recupero funzione creazione oggetto
|
|
||||||
typedef bool ( *PF_SetThreeJSAuxDir)( const string& sThreeJSAuxDir) ;
|
|
||||||
PF_SetThreeJSAuxDir pFun = ( PF_SetThreeJSAuxDir) GetProcAddress( s_hEEx, EEX_SETTHREEJSAUXDIR) ;
|
|
||||||
if ( pFun == nullptr)
|
|
||||||
return false ;
|
|
||||||
return pFun( sThreeJSAuxDir) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
IBeamMgr*
|
IBeamMgr*
|
||||||
MyCreateBeamMgr( void)
|
MyCreateBeamMgr( void)
|
||||||
@@ -332,6 +320,21 @@ MyCreateImport3MF( void)
|
|||||||
return pFun() ;
|
return pFun() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
IImport3dm*
|
||||||
|
MyCreateImport3dm( void)
|
||||||
|
{
|
||||||
|
// verifico caricamento libreria EgtExchange
|
||||||
|
if ( s_hEEx == nullptr)
|
||||||
|
return nullptr ;
|
||||||
|
// recupero funzione creazione oggetto
|
||||||
|
typedef IImport3dm* (* PF_CreateImport3dm) ( void) ;
|
||||||
|
PF_CreateImport3dm pFun = (PF_CreateImport3dm)GetProcAddress( s_hEEx, EEX_CREATEIMPORT3DM) ;
|
||||||
|
if ( pFun == nullptr)
|
||||||
|
return nullptr ;
|
||||||
|
return pFun() ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
IExportDxf*
|
IExportDxf*
|
||||||
MyCreateExportDxf( void)
|
MyCreateExportDxf( void)
|
||||||
@@ -378,15 +381,15 @@ MyCreateExport3MF( void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
IExportThreeJS*
|
IExport3dm*
|
||||||
MyCreateExportThreeJS( void)
|
MyCreateExport3dm( void)
|
||||||
{
|
{
|
||||||
// verifico caricamento libreria EgtExchange
|
// verifico caricamento libreria EgtExchange
|
||||||
if ( s_hEEx == nullptr)
|
if ( s_hEEx == nullptr)
|
||||||
return nullptr ;
|
return nullptr ;
|
||||||
// recupero funzione creazione oggetto
|
// recupero funzione creazione oggetto
|
||||||
typedef IExportThreeJS* (* PF_CreateExportThreeJS) ( void) ;
|
typedef IExport3dm* (* PF_CreateExport3dm) ( void) ;
|
||||||
PF_CreateExportThreeJS pFun = (PF_CreateExportThreeJS)GetProcAddress( s_hEEx, EEX_CREATEEXPORTTHREEJS) ;
|
PF_CreateExport3dm pFun = (PF_CreateExport3dm)GetProcAddress( s_hEEx, EEX_CREATEEXPORT3DM) ;
|
||||||
if ( pFun == nullptr)
|
if ( pFun == nullptr)
|
||||||
return nullptr ;
|
return nullptr ;
|
||||||
return pFun() ;
|
return pFun() ;
|
||||||
@@ -407,6 +410,36 @@ MyCreateExportSvg( void)
|
|||||||
return pFun() ;
|
return pFun() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
MySetThreeJSLibDir( const string& sThreeJSLibDir)
|
||||||
|
{
|
||||||
|
// verifico caricamento libreria EgtExchange
|
||||||
|
if ( s_hEEx == nullptr)
|
||||||
|
return false ;
|
||||||
|
// recupero funzione creazione oggetto
|
||||||
|
typedef bool ( *PF_SetThreeJSLibDir)( const string& sThreeJSLibDir) ;
|
||||||
|
PF_SetThreeJSLibDir pFun = ( PF_SetThreeJSLibDir) GetProcAddress( s_hEEx, EEX_SETTHREEJSLIBDIR) ;
|
||||||
|
if ( pFun == nullptr)
|
||||||
|
return false ;
|
||||||
|
return pFun( sThreeJSLibDir) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
IExportThreeJS*
|
||||||
|
MyCreateExportThreeJS( void)
|
||||||
|
{
|
||||||
|
// verifico caricamento libreria EgtExchange
|
||||||
|
if ( s_hEEx == nullptr)
|
||||||
|
return nullptr ;
|
||||||
|
// recupero funzione creazione oggetto
|
||||||
|
typedef IExportThreeJS* (* PF_CreateExportThreeJS) ( void) ;
|
||||||
|
PF_CreateExportThreeJS pFun = (PF_CreateExportThreeJS)GetProcAddress( s_hEEx, EEX_CREATEEXPORTTHREEJS) ;
|
||||||
|
if ( pFun == nullptr)
|
||||||
|
return nullptr ;
|
||||||
|
return pFun() ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
IExcExecutor*
|
IExcExecutor*
|
||||||
MyCreateExcExecutor( void)
|
MyCreateExcExecutor( void)
|
||||||
|
|||||||
+5
-1
@@ -25,9 +25,11 @@ class IImportDxf ;
|
|||||||
class IImportPnt ;
|
class IImportPnt ;
|
||||||
class IImportStl ;
|
class IImportStl ;
|
||||||
class IImport3MF ;
|
class IImport3MF ;
|
||||||
|
class IImport3dm ;
|
||||||
class IExportDxf ;
|
class IExportDxf ;
|
||||||
class IExportStl ;
|
class IExportStl ;
|
||||||
class IExport3MF ;
|
class IExport3MF ;
|
||||||
|
class IExport3dm ;
|
||||||
class IExportThreeJS ;
|
class IExportThreeJS ;
|
||||||
class IExportSvg ;
|
class IExportSvg ;
|
||||||
class IExcExecutor ;
|
class IExcExecutor ;
|
||||||
@@ -41,7 +43,6 @@ void MySetEExKey( const std::string& sKey) ;
|
|||||||
void MySetEExNetHwKey( bool bNetHwKey) ;
|
void MySetEExNetHwKey( bool bNetHwKey) ;
|
||||||
const char* MyGetEExVersion( void) ;
|
const char* MyGetEExVersion( void) ;
|
||||||
bool MySetBtlAuxDir( const std::string& sBtlAuxDir) ;
|
bool MySetBtlAuxDir( const std::string& sBtlAuxDir) ;
|
||||||
bool MySetThreeJSAuxDir( const std::string& sThreeJSAuxDir) ;
|
|
||||||
IBeamMgr* MyCreateBeamMgr( void) ;
|
IBeamMgr* MyCreateBeamMgr( void) ;
|
||||||
IImportBtl* MyCreateImportBtl( void) ;
|
IImportBtl* MyCreateImportBtl( void) ;
|
||||||
IImportBtlx* MyCreateImportBtlx( void) ;
|
IImportBtlx* MyCreateImportBtlx( void) ;
|
||||||
@@ -51,9 +52,12 @@ IImportDxf* MyCreateImportDxf( void) ;
|
|||||||
IImportPnt* MyCreateImportPnt( void) ;
|
IImportPnt* MyCreateImportPnt( void) ;
|
||||||
IImportStl* MyCreateImportStl( void) ;
|
IImportStl* MyCreateImportStl( void) ;
|
||||||
IImport3MF* MyCreateImport3MF( void) ;
|
IImport3MF* MyCreateImport3MF( void) ;
|
||||||
|
IImport3dm* MyCreateImport3dm( void) ;
|
||||||
IExportDxf* MyCreateExportDxf( void) ;
|
IExportDxf* MyCreateExportDxf( void) ;
|
||||||
IExportStl* MyCreateExportStl( void) ;
|
IExportStl* MyCreateExportStl( void) ;
|
||||||
IExport3MF* MyCreateExport3MF( void) ;
|
IExport3MF* MyCreateExport3MF( void) ;
|
||||||
|
IExport3dm* MyCreateExport3dm( void) ;
|
||||||
|
bool MySetThreeJSLibDir( const std::string& sThreeJSLibDir) ;
|
||||||
IExportThreeJS* MyCreateExportThreeJS( void) ;
|
IExportThreeJS* MyCreateExportThreeJS( void) ;
|
||||||
IExportSvg* MyCreateExportSvg( void) ;
|
IExportSvg* MyCreateExportSvg( void) ;
|
||||||
IExcExecutor* MyCreateExcExecutor(void) ;
|
IExcExecutor* MyCreateExcExecutor(void) ;
|
||||||
|
|||||||
+8
-1
@@ -45,8 +45,15 @@ HMODULE s_hENs = nullptr ;
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
LoadNestingDll( ILogger* pLogger, const string& sKey, const string& sKey2)
|
LoadNestingDll( ILogger* pLogger, const string& sKey, const string& sKey2, bool bNetHwKey)
|
||||||
{
|
{
|
||||||
|
// non ammessa con chiave di rete
|
||||||
|
if ( bNetHwKey) {
|
||||||
|
std::string sErr = "Warning on Key (ENS/NET)" ;
|
||||||
|
LOG_ERROR( pLogger, sErr.c_str()) ;
|
||||||
|
FreeNestingDll() ;
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
// verifico la chiave
|
// verifico la chiave
|
||||||
if ( ! TestKeyForENs( sKey, 0, pLogger)) {
|
if ( ! TestKeyForENs( sKey, 0, pLogger)) {
|
||||||
FreeNestingDll() ;
|
FreeNestingDll() ;
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ class ILogger ;
|
|||||||
class IAutoNester ;
|
class IAutoNester ;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool LoadNestingDll( ILogger* pLogger, const std::string& sKey, const std::string& sKey2) ;
|
bool LoadNestingDll( ILogger* pLogger, const std::string& sKey, const std::string& sKey2, bool bNetHwKey) ;
|
||||||
bool FreeNestingDll( void) ;
|
bool FreeNestingDll( void) ;
|
||||||
bool IsLoadedNestingDll( void) ;
|
bool IsLoadedNestingDll( void) ;
|
||||||
void MySetENsLogger( ILogger* pLogger) ;
|
void MySetENsLogger( ILogger* pLogger) ;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// EgalTech 2014-2015
|
// EgalTech 2014-2023
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// File : EXE.h Data : 05.05.15 Versione : 1.6e2
|
// File : EXE.h Data : 05.02.23 Versione : 2.5a6
|
||||||
// Contenuto : Dichiarazioni locali per moduli EXE.
|
// Contenuto : Dichiarazioni locali per moduli EXE.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@@ -25,6 +25,7 @@ const std::string& ExeGetIniFile( void) ;
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const std::string& ExeGetKey( void) ;
|
const std::string& ExeGetKey( void) ;
|
||||||
const std::string& ExeGetNestKey( void) ;
|
const std::string& ExeGetNestKey( void) ;
|
||||||
|
const std::string& ExeGetLockId( void) ;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
ILogger* GetLogger( void) ;
|
ILogger* GetLogger( void) ;
|
||||||
@@ -38,3 +39,7 @@ bool ExeInsertMachMgr( int nInsGrp) ;
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool ExeIsDuploBase( IGeomDB* pGeomDB, int nId) ;
|
bool ExeIsDuploBase( IGeomDB* pGeomDB, int nId) ;
|
||||||
bool ExeInsertDuplo( int nInsGrp) ;
|
bool ExeInsertDuplo( int nInsGrp) ;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool ExeCreateMutex( const std::string& sMutexName) ;
|
||||||
|
bool ExeReleaseMutex( void) ;
|
||||||
|
|||||||
@@ -148,6 +148,26 @@ ExeBeamGetSideData( int nSide, Frame3d& frRef, double& dLength, double& dWidth,
|
|||||||
return pBeamMgr->GetSideData( nSide, frRef, dLength, dWidth, dHeight) ;
|
return pBeamMgr->GetSideData( nSide, frRef, dLength, dWidth, dHeight) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeBeamShowFacesName( bool bShow)
|
||||||
|
{
|
||||||
|
IBeamMgr* pBeamMgr = GetCurrBeamMgr() ;
|
||||||
|
VERIFY_BEAMMGR( pBeamMgr, false)
|
||||||
|
// imposto la visualizzazione delle facce sul pezzo corrente
|
||||||
|
return pBeamMgr->ShowFacesName( bShow) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeBeamShowLoadingSide( bool bShow, bool bFromLeft)
|
||||||
|
{
|
||||||
|
IBeamMgr* pBeamMgr = GetCurrBeamMgr() ;
|
||||||
|
VERIFY_BEAMMGR( pBeamMgr, false)
|
||||||
|
// imposto la visualizzazione del lato di carico sotto il pezzo corrente
|
||||||
|
return pBeamMgr->ShowLoadingSide( bShow, bFromLeft) ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
int
|
int
|
||||||
ExeBeamAddProcess( int nGroup, int nProc, int nSide, const string& sDes, int nProcId,
|
ExeBeamAddProcess( int nGroup, int nProc, int nSide, const string& sDes, int nProcId,
|
||||||
|
|||||||
+75
-5
@@ -25,7 +25,9 @@
|
|||||||
#include "/EgtDev/Include/EGkCDeCylClosedSurfTm.h"
|
#include "/EgtDev/Include/EGkCDeCylClosedSurfTm.h"
|
||||||
#include "/EgtDev/Include/EGkCDeConeFrustumClosedSurfTm.h"
|
#include "/EgtDev/Include/EGkCDeConeFrustumClosedSurfTm.h"
|
||||||
#include "/EgtDev/Include/EGkCDeSpheClosedSurfTm.h"
|
#include "/EgtDev/Include/EGkCDeSpheClosedSurfTm.h"
|
||||||
|
#include "/EgtDev/Include/EGkCDeClosedSurfTmClosedSurfTm.h"
|
||||||
#include "/EgtDev/Include/EGkVolZmap.h"
|
#include "/EgtDev/Include/EGkVolZmap.h"
|
||||||
|
#include "/EgtDev/Include/EGkSurfLocal.h"
|
||||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||||
|
|
||||||
using namespace std ;
|
using namespace std ;
|
||||||
@@ -67,7 +69,7 @@ MyCDeBoxVolZmap( const Frame3d& frBox, const Vector3d& vtDiag, int nZmapId, doub
|
|||||||
// porto in locale il riferimento (il vettore è già in locale a questo stesso riferimento)
|
// porto in locale il riferimento (il vettore è già in locale a questo stesso riferimento)
|
||||||
Frame3d frBoxL = GetFrameLocal( pGeomDB, frBox, nRefType, frLoc) ;
|
Frame3d frBoxL = GetFrameLocal( pGeomDB, frBox, nRefType, frLoc) ;
|
||||||
// verifico la collisione
|
// verifico la collisione
|
||||||
return ( pVZM->AvoidBox( frBoxL, vtDiag, dSafeDist) ? 0 : 1) ;
|
return ( pVZM->AvoidBox( frBoxL, vtDiag, dSafeDist, false) ? 0 : 1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -138,7 +140,7 @@ MyCDeRectPrismoidVolZmap( const Frame3d& frPrismoid, double dBaseLenX, double dB
|
|||||||
// porto in locale il riferimento (il vettore è già in locale a questo stesso riferimento)
|
// porto in locale il riferimento (il vettore è già in locale a questo stesso riferimento)
|
||||||
Frame3d frPrismoidL = GetFrameLocal( pGeomDB, frPrismoid, nRefType, frLoc) ;
|
Frame3d frPrismoidL = GetFrameLocal( pGeomDB, frPrismoid, nRefType, frLoc) ;
|
||||||
// verifico la collisione
|
// verifico la collisione
|
||||||
return ( pVZM->AvoidRectPrismoid( frPrismoidL, dBaseLenX, dBaseLenY, dTopLenX, dTopLenY, dHeight, dSafeDist) ? 0 : 1) ;
|
return ( pVZM->AvoidRectPrismoid( frPrismoidL, dBaseLenX, dBaseLenY, dTopLenX, dTopLenY, dHeight, dSafeDist, false) ? 0 : 1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -211,7 +213,7 @@ MyCDeCylVolZmap( const Frame3d& frCyl, double dR, double dH, int nZmapId, double
|
|||||||
// porto in locale il riferimento
|
// porto in locale il riferimento
|
||||||
Frame3d frCylL = GetFrameLocal( pGeomDB, frCyl, nRefType, frLoc) ;
|
Frame3d frCylL = GetFrameLocal( pGeomDB, frCyl, nRefType, frLoc) ;
|
||||||
// verifico la collisione
|
// verifico la collisione
|
||||||
return ( pVZM->AvoidCylinder( frCylL, dR, dH, dSafeDist) ? 0 : 1) ;
|
return ( pVZM->AvoidCylinder( frCylL, dR, dH, dSafeDist, false) ? 0 : 1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -279,7 +281,7 @@ MyCDeConeVolZmap( const Frame3d& frCone, double dR1, double dR2, double dH, int
|
|||||||
// porto in locale il riferimento
|
// porto in locale il riferimento
|
||||||
Frame3d frConeL = GetFrameLocal( pGeomDB, frCone, nRefType, frLoc) ;
|
Frame3d frConeL = GetFrameLocal( pGeomDB, frCone, nRefType, frLoc) ;
|
||||||
// verifico la collisione
|
// verifico la collisione
|
||||||
return ( pVZM->AvoidConeFrustum( frConeL, dR1, dR2, dH, dSafeDist) ? 0 : 1) ;
|
return ( pVZM->AvoidConeFrustum( frConeL, dR1, dR2, dH, dSafeDist, false) ? 0 : 1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -348,7 +350,7 @@ MyCDeSpheVolZmap( const Point3d& ptCen, double dRad, int nZmapId, double dSafeDi
|
|||||||
// porto in locale il centro della sfera
|
// porto in locale il centro della sfera
|
||||||
Point3d ptCenL = GetPointLocal( pGeomDB, ptCen, nRefType, frLoc) ;
|
Point3d ptCenL = GetPointLocal( pGeomDB, ptCen, nRefType, frLoc) ;
|
||||||
// verifico la collisione
|
// verifico la collisione
|
||||||
return ( pVZM->AvoidSphere( ptCenL, dRad, dSafeDist) ? 0 : 1) ;
|
return ( pVZM->AvoidSphere( ptCenL, dRad, dSafeDist, false) ? 0 : 1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -374,3 +376,71 @@ ExeCDeSpheSolid( const Point3d& ptCen, double dR, int nSolidId, double dSafeDist
|
|||||||
// restituisco risultato
|
// restituisco risultato
|
||||||
return nRes ;
|
return nRes ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MyCDeClosedSurfTmClosedSurfTm( int nSurfTm1Id, int nSurfTm2Id, double dSafeDist)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, -1)
|
||||||
|
// recupero il riferimento della seconda superficie
|
||||||
|
Frame3d frSurf2 ;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( nSurfTm2Id, frSurf2))
|
||||||
|
return -1 ;
|
||||||
|
// recupero la prima superficie in locale alla seconda
|
||||||
|
SurfLocal Surf1Loc( pGeomDB, nSurfTm1Id, frSurf2) ;
|
||||||
|
const ISurfTriMesh* pStm1 = GetSurfTriMesh( Surf1Loc) ;
|
||||||
|
if ( pStm1 == nullptr)
|
||||||
|
return -1 ;
|
||||||
|
// recupero la seconda superficie TriMesh
|
||||||
|
const ISurfTriMesh* pStm2 = GetSurfTriMesh( pGeomDB->GetGeoObj( nSurfTm2Id)) ;
|
||||||
|
if ( pStm2 == nullptr)
|
||||||
|
return -1 ;
|
||||||
|
// verifico la collisione
|
||||||
|
return ( CDeClosedSurfTmClosedSurfTm( *pStm1, *pStm2, dSafeDist) ? 1 : 0) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MyCDeClosedSurfTmVolZmap( int nSurfTmId, int nZmapId, double dSafeDist)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, -1)
|
||||||
|
// recupero il riferimento dello Zmap
|
||||||
|
Frame3d frZmap ;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( nZmapId, frZmap))
|
||||||
|
return -1 ;
|
||||||
|
// recupero la superficie in locale allo Zmap
|
||||||
|
SurfLocal SurfLoc( pGeomDB, nSurfTmId, frZmap) ;
|
||||||
|
const ISurfTriMesh* pStm = GetSurfTriMesh( SurfLoc) ;
|
||||||
|
if ( pStm == nullptr)
|
||||||
|
return -1 ;
|
||||||
|
// recupero lo Zmap
|
||||||
|
const IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nZmapId)) ;
|
||||||
|
if ( pVZM == nullptr)
|
||||||
|
return -1 ;
|
||||||
|
// verifico la collisione
|
||||||
|
return ( pVZM->AvoidSurfTm( *pStm, dSafeDist, false) ? 0 : 1) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCDeSolidSolid( int nSolid1Id, int nSolid2Id, double dSafeDist)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
int nRes = -1 ;
|
||||||
|
if ( pGeomDB != nullptr && pGeomDB->GetGeoType( nSolid1Id) == SRF_TRIMESH && pGeomDB->GetGeoType( nSolid2Id) == SRF_TRIMESH)
|
||||||
|
nRes = MyCDeClosedSurfTmClosedSurfTm( nSolid1Id, nSolid2Id, dSafeDist) ;
|
||||||
|
else if ( pGeomDB != nullptr && pGeomDB->GetGeoType( nSolid1Id) == SRF_TRIMESH && pGeomDB->GetGeoType( nSolid2Id) == VOL_ZMAP)
|
||||||
|
nRes = MyCDeClosedSurfTmVolZmap( nSolid1Id, nSolid2Id, dSafeDist) ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtCDeSolidSolid({" + IdToString( nSolid1Id) + "," +
|
||||||
|
IdToString( nSolid2Id) + "," +
|
||||||
|
ToString( dSafeDist) + ")" +
|
||||||
|
" -- Res=" + ToString( nRes) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco risultato
|
||||||
|
return nRes ;
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// Costanti per tolleranze di appossimazione
|
// Costanti per tolleranze di appossimazione
|
||||||
const double LIN_TOL_STD = 0.1 ;
|
const double LIN_TOL_STD = 0.1 ;
|
||||||
|
const double LIN_TOL_SRF = 0.05 ;
|
||||||
const double LIN_TOL_FINE = 0.01 ;
|
const double LIN_TOL_FINE = 0.01 ;
|
||||||
const double LIN_FEA_STD = 20 ;
|
const double LIN_FEA_STD = 20 ;
|
||||||
const double LIN_FEA_MAX = 400 ;
|
const double LIN_FEA_MAX = 400 ;
|
||||||
|
|||||||
+95
-20
@@ -23,16 +23,18 @@
|
|||||||
#include "/EgtDev/Include/EExImportDxf.h"
|
#include "/EgtDev/Include/EExImportDxf.h"
|
||||||
#include "/EgtDev/Include/EExImportStl.h"
|
#include "/EgtDev/Include/EExImportStl.h"
|
||||||
#include "/EgtDev/Include/EExImport3MF.h"
|
#include "/EgtDev/Include/EExImport3MF.h"
|
||||||
#include "/EgtDev/Include/EExExportThreeJS.h"
|
|
||||||
#include "/EgtDev/Include/EExImportCnc.h"
|
#include "/EgtDev/Include/EExImportCnc.h"
|
||||||
#include "/EgtDev/Include/EExImportCsf.h"
|
#include "/EgtDev/Include/EExImportCsf.h"
|
||||||
#include "/EgtDev/Include/EExImportPnt.h"
|
#include "/EgtDev/Include/EExImportPnt.h"
|
||||||
#include "/EgtDev/Include/EExImportBtl.h"
|
#include "/EgtDev/Include/EExImportBtl.h"
|
||||||
#include "/EgtDev/Include/EExImportBtlx.h"
|
#include "/EgtDev/Include/EExImportBtlx.h"
|
||||||
|
#include "/EgtDev/Include/EExImport3dm.h"
|
||||||
#include "/EgtDev/Include/EExExportDxf.h"
|
#include "/EgtDev/Include/EExExportDxf.h"
|
||||||
#include "/EgtDev/Include/EExExportStl.h"
|
#include "/EgtDev/Include/EExExportStl.h"
|
||||||
#include "/EgtDev/Include/EExExport3MF.h"
|
#include "/EgtDev/Include/EExExport3MF.h"
|
||||||
|
#include "/EgtDev/Include/EExExport3dm.h"
|
||||||
#include "/EgtDev/Include/EExExportSvg.h"
|
#include "/EgtDev/Include/EExExportSvg.h"
|
||||||
|
#include "/EgtDev/Include/EExExportThreeJS.h"
|
||||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||||
#include "/EgtDev/Include/EGnFileUtils.h"
|
#include "/EgtDev/Include/EGnFileUtils.h"
|
||||||
#include "/EgtDev/Include/EgtStringConverter.h"
|
#include "/EgtDev/Include/EgtStringConverter.h"
|
||||||
@@ -60,7 +62,7 @@ ExeGetFileType( const string& sFilePath)
|
|||||||
SplitLast( sFileName, ".", sFileTitle, sFileExt) ;
|
SplitLast( sFileName, ".", sFileTitle, sFileExt) ;
|
||||||
ToUpper( sFileExt) ;
|
ToUpper( sFileExt) ;
|
||||||
|
|
||||||
if ( sFileExt == "NGE" || sFileExt == "VME" || sFileExt == "NHE" || sFileExt == "BWE")
|
if ( sFileExt == "NGE" || sFileExt == "VME" || sFileExt == "NHE" || sFileExt == "BWE" || sFileExt == "ICRS")
|
||||||
return FT_NGE ;
|
return FT_NGE ;
|
||||||
else if ( sFileExt == "NFE")
|
else if ( sFileExt == "NFE")
|
||||||
return FT_NFE ;
|
return FT_NFE ;
|
||||||
@@ -80,6 +82,8 @@ ExeGetFileType( const string& sFilePath)
|
|||||||
return FT_BTL ;
|
return FT_BTL ;
|
||||||
else if ( sFileExt == "BTLX")
|
else if ( sFileExt == "BTLX")
|
||||||
return FT_BTLX ;
|
return FT_BTLX ;
|
||||||
|
else if ( sFileExt == "3DM")
|
||||||
|
return FT_3DM ;
|
||||||
else if ( sFileExt == "PNG" || sFileExt == "JPG" || sFileExt == "JPEG" || sFileExt == "BMP")
|
else if ( sFileExt == "PNG" || sFileExt == "JPG" || sFileExt == "JPEG" || sFileExt == "BMP")
|
||||||
return FT_IMG ;
|
return FT_IMG ;
|
||||||
else if ( sFileExt == "PNT" || sFileExt == "XYZ")
|
else if ( sFileExt == "PNT" || sFileExt == "XYZ")
|
||||||
@@ -100,6 +104,8 @@ ExeGetFileType( const string& sFilePath)
|
|||||||
return FT_VRML ;
|
return FT_VRML ;
|
||||||
else if ( sFileExt == "C3D")
|
else if ( sFileExt == "C3D")
|
||||||
return FT_C3D ;
|
return FT_C3D ;
|
||||||
|
else if ( sFileExt == "HTML")
|
||||||
|
return FT_HTML ;
|
||||||
else if ( sFileExt == "TSC")
|
else if ( sFileExt == "TSC")
|
||||||
return FT_TSC ;
|
return FT_TSC ;
|
||||||
else if ( sFileExt == "LUA")
|
else if ( sFileExt == "LUA")
|
||||||
@@ -119,14 +125,6 @@ ExeSetBtlAuxDir( const string& sBtlAuxDir)
|
|||||||
return MySetBtlAuxDir( sBtlAuxDir) ;
|
return MySetBtlAuxDir( sBtlAuxDir) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
bool
|
|
||||||
ExeSetThreeJSAuxDir( const string & sThreeJSAuxDir )
|
|
||||||
{
|
|
||||||
return MySetThreeJSAuxDir( sThreeJSAuxDir) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeImportBtl( const string& sFilePath, int nFlag)
|
ExeImportBtl( const string& sFilePath, int nFlag)
|
||||||
@@ -361,6 +359,46 @@ ExeImport3MF( const string& sFilePath)
|
|||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeImport3dm( const string& sFilePath, double dScaleFactor)
|
||||||
|
{
|
||||||
|
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||||
|
VERIFY_CTX_GEOMDB( pGseCtx, false)
|
||||||
|
bool bOk = true ;
|
||||||
|
// importo il file 3dm
|
||||||
|
// aggiungo un gruppo pezzo e un gruppo layer
|
||||||
|
int nPartId = pGseCtx->m_pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ;
|
||||||
|
int nLayerId = pGseCtx->m_pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ;
|
||||||
|
// preparo l'importatore
|
||||||
|
PtrOwner<IImport3dm> pImp3dm( MyCreateImport3dm()) ;
|
||||||
|
bOk = bOk && ! IsNull( pImp3dm) ;
|
||||||
|
// eseguo l'importazione
|
||||||
|
const DimensionStyle& DimSt = pGseCtx->m_dsCurr ;
|
||||||
|
double dExtLine = DimSt.dExtLineLen ;
|
||||||
|
double dArrLen = DimSt.dArrowLen ;
|
||||||
|
double dTextDist = DimSt.dTextDist ;
|
||||||
|
bool bLenIsMM = ( DimSt.nLenIsMM == 2 ? ExeUiUnitsAreMM() : ( DimSt.nLenIsMM != 0 )) ;
|
||||||
|
int nDecDig = DimSt.nDecDigit ;
|
||||||
|
string sFont = DimSt.sFont ;
|
||||||
|
double dTextHeight = DimSt.dTextHeight ;
|
||||||
|
bOk = bOk && pImp3dm->Import( sFilePath, pGseCtx->m_pGeomDB, nLayerId, dScaleFactor,
|
||||||
|
dTextHeight, dExtLine, dArrLen, dTextDist, bLenIsMM, nDecDig, sFont) ;
|
||||||
|
// aggiorno stato file corrente
|
||||||
|
if ( pGseCtx->m_sFilePath.empty())
|
||||||
|
pGseCtx->m_sFilePath = sFilePath ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtImport3dm('" + StringToLuaString( sFilePath) + "'," +
|
||||||
|
ToString( dScaleFactor) + ")" +
|
||||||
|
" -- Ok=" + ToString( bOk) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco il risultato
|
||||||
|
return bOk ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeAdvancedImportIsEnabled( void)
|
ExeAdvancedImportIsEnabled( void)
|
||||||
@@ -419,7 +457,8 @@ ExeAdvancedImport( const string& sFilePath, double dToler)
|
|||||||
sExec = "EgtConverterR32.exe" ;
|
sExec = "EgtConverterR32.exe" ;
|
||||||
#endif
|
#endif
|
||||||
string sCmdLine = "\"" + sExec + "\" \"" + sFilePath + "\" \"" + sFileOut + "\" \"" +
|
string sCmdLine = "\"" + sExec + "\" \"" + sFilePath + "\" \"" + sFileOut + "\" \"" +
|
||||||
ToString( dToler, 3) + "\" \"" + ToString( ExeGetDebugLevel()) +"\" \"" + ExeGetKey() + "\"" ;
|
ToString( dToler, 3) + "\" \"" + ToString( ExeGetDebugLevel()) + "\" \"" +
|
||||||
|
ExeGetKey() + "\" \"" + ExeGetLockId() + "\"" ;
|
||||||
STARTUPINFO si ;
|
STARTUPINFO si ;
|
||||||
PROCESS_INFORMATION pi ;
|
PROCESS_INFORMATION pi ;
|
||||||
ZeroMemory( &si, sizeof( si)) ;
|
ZeroMemory( &si, sizeof( si)) ;
|
||||||
@@ -453,7 +492,8 @@ ExeAdvancedImport( const string& sFilePath, double dToler)
|
|||||||
if ( ExeGetDebugLevel() < 5)
|
if ( ExeGetDebugLevel() < 5)
|
||||||
EraseFile( sFileOut) ;
|
EraseFile( sFileOut) ;
|
||||||
// aggiorno stato file corrente
|
// aggiorno stato file corrente
|
||||||
pGseCtx->m_sFilePath = sFilePath ;
|
if ( pGseCtx->m_sFilePath.empty())
|
||||||
|
pGseCtx->m_sFilePath = sFilePath ;
|
||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -468,7 +508,7 @@ ExeAdvancedImport( const string& sFilePath, double dToler)
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeExportDxf( int nId, const string& sFilePath, int nFlag)
|
ExeExportDxf( int nId, const string& sFilePath, int nFlag, int nFilter)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -478,7 +518,7 @@ ExeExportDxf( int nId, const string& sFilePath, int nFlag)
|
|||||||
PtrOwner<IExportDxf> pExpDxf( MyCreateExportDxf()) ;
|
PtrOwner<IExportDxf> pExpDxf( MyCreateExportDxf()) ;
|
||||||
bOk = bOk && ! IsNull( pExpDxf) ;
|
bOk = bOk && ! IsNull( pExpDxf) ;
|
||||||
// eseguo l'esportazione
|
// eseguo l'esportazione
|
||||||
pExpDxf->SetOptions( EEXFLT_DEFAULT, nFlag) ;
|
pExpDxf->SetOptions( nFilter, nFlag) ;
|
||||||
bOk = bOk && pExpDxf->Export( pGeomDB, nId, sFilePath) ;
|
bOk = bOk && pExpDxf->Export( pGeomDB, nId, sFilePath) ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -494,7 +534,7 @@ ExeExportDxf( int nId, const string& sFilePath, int nFlag)
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeExportStl( int nId, const string& sFilePath)
|
ExeExportStl( int nId, const string& sFilePath, int nFilter)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -504,6 +544,7 @@ ExeExportStl( int nId, const string& sFilePath)
|
|||||||
PtrOwner<IExportStl> pExpStl( MyCreateExportStl()) ;
|
PtrOwner<IExportStl> pExpStl( MyCreateExportStl()) ;
|
||||||
bOk = bOk && ! IsNull( pExpStl) ;
|
bOk = bOk && ! IsNull( pExpStl) ;
|
||||||
// eseguo l'esportazione
|
// eseguo l'esportazione
|
||||||
|
pExpStl->SetOptions( nFilter) ;
|
||||||
bOk = bOk && pExpStl->Export( pGeomDB, nId, sFilePath) ;
|
bOk = bOk && pExpStl->Export( pGeomDB, nId, sFilePath) ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -518,16 +559,17 @@ ExeExportStl( int nId, const string& sFilePath)
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeExport3MF( int nId, const string& sFilePath)
|
ExeExport3MF( int nId, const string& sFilePath, int nFilter)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
// esporto il file STL
|
// esporto il file 3MF
|
||||||
// preparo l'esportatore
|
// preparo l'esportatore
|
||||||
PtrOwner<IExport3MF> pExp3MF( MyCreateExport3MF()) ;
|
PtrOwner<IExport3MF> pExp3MF( MyCreateExport3MF()) ;
|
||||||
bOk = bOk && ! IsNull( pExp3MF) ;
|
bOk = bOk && ! IsNull( pExp3MF) ;
|
||||||
// eseguo l'esportazione
|
// eseguo l'esportazione
|
||||||
|
pExp3MF->SetOptions( nFilter) ;
|
||||||
bOk = bOk && pExp3MF->Export( pGeomDB, nId, sFilePath) ;
|
bOk = bOk && pExp3MF->Export( pGeomDB, nId, sFilePath) ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -540,6 +582,31 @@ ExeExport3MF( int nId, const string& sFilePath)
|
|||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeExport3dm( int nId, const string& sFilePath, int nFilter)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
bool bOk = true ;
|
||||||
|
// esporto il file 3dm
|
||||||
|
// preparo l'esportatore
|
||||||
|
PtrOwner<IExport3dm> pExp3dm( MyCreateExport3dm()) ;
|
||||||
|
bOk = bOk && ! IsNull( pExp3dm) ;
|
||||||
|
// eseguo l'esportazione
|
||||||
|
bOk = bOk && pExp3dm->SetOptions( nFilter) ;
|
||||||
|
bOk = bOk && pExp3dm->Export( pGeomDB, nId, sFilePath) ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtExport3dm(" + ToString( nId) + ",'" +
|
||||||
|
StringToLuaString( sFilePath) + "')" +
|
||||||
|
" -- Ok=" + ToString( bOk) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco il risultato
|
||||||
|
return bOk ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeExportSvg( int nId, const string& sFilePath, int nFilter)
|
ExeExportSvg( int nId, const string& sFilePath, int nFilter)
|
||||||
@@ -566,6 +633,13 @@ ExeExportSvg( int nId, const string& sFilePath, int nFilter)
|
|||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSetThreeJSLibDir( const string& sThreeJSLibDir)
|
||||||
|
{
|
||||||
|
return MySetThreeJSLibDir( sThreeJSLibDir) ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeExportThreeJS( int nId, const string& sFilePath, int nFilter)
|
ExeExportThreeJS( int nId, const string& sFilePath, int nFilter)
|
||||||
@@ -582,12 +656,13 @@ ExeExportThreeJS( int nId, const string& sFilePath, int nFilter)
|
|||||||
|
|
||||||
// eseguo l'esportazione
|
// eseguo l'esportazione
|
||||||
bOk = bOk && pExpThreeJS->SetOptions( nFilter) ;
|
bOk = bOk && pExpThreeJS->SetOptions( nFilter) ;
|
||||||
bOk = bOk && pExpThreeJS->Export( pGeomDB, nId, sFilePath, pScene, ExeUiUnitsAreMM()) ;
|
bOk = bOk && pExpThreeJS->Export( pGeomDB, nId, pScene, ExeUiUnitsAreMM(), sFilePath) ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
string sLua = "EgtExportThreeJS(" + ToString( nId) + ",'" +
|
string sLua = "EgtExportThreeJS(" + ToString( nId) + ",'" +
|
||||||
StringToLuaString( sFilePath) + "')" +
|
StringToLuaString( sFilePath) + "'," +
|
||||||
" -- Ok=" + ToString( bOk) ;
|
ToString( nFilter) + ")" +
|
||||||
|
" -- Ok=" + ToString( bOk) ;
|
||||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
}
|
}
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
|
|||||||
+578
-43
@@ -26,6 +26,11 @@
|
|||||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||||
#include "/EgtDev/Include/EgtStringConverter.h"
|
#include "/EgtDev/Include/EgtStringConverter.h"
|
||||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||||
|
#include "/EgtDev/Include/EGkIntersCurves.h"
|
||||||
|
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||||
|
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||||
|
#include "/EgtDev/Include/EGkDistPointCurve.h"
|
||||||
|
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||||
|
|
||||||
using namespace std ;
|
using namespace std ;
|
||||||
|
|
||||||
@@ -35,11 +40,11 @@ ExeCreateGroup( int nParentId, const Frame3d& frFrame, int nRefType)
|
|||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc ) ;
|
||||||
// porto in locale l'origine e i versori
|
// porto in locale l'origine e i versori
|
||||||
Point3d ptOrigL = GetPointLocal( pGeomDB, frFrame.Orig(), nRefType, frLoc) ;
|
Point3d ptOrigL = GetPointLocal( pGeomDB, frFrame.Orig(), nRefType, frLoc) ;
|
||||||
Vector3d vtXL = GetVectorLocal( pGeomDB, frFrame.VersX(), nRefType, frLoc) ;
|
Vector3d vtXL = GetVectorLocal( pGeomDB, frFrame.VersX(), nRefType, frLoc) ;
|
||||||
@@ -73,7 +78,7 @@ ExeCreateGroup( int nParentId, const Frame3d& frFrame, int nRefType)
|
|||||||
" -- Id=" + ToString( nId) ;
|
" -- Id=" + ToString( nId) ;
|
||||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
}
|
}
|
||||||
// restituisco l'identificativo del nuovo gruppo
|
// restituisco l'identificativo del nuovo gruppo
|
||||||
return nId ;
|
return nId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +88,7 @@ ExeCreateGeoPoint( int nParentId, const Point3d& ptP, int nRefType)
|
|||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
@@ -92,9 +97,9 @@ ExeCreateGeoPoint( int nParentId, const Point3d& ptP, int nRefType)
|
|||||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||||
// creo il punto
|
// creo il punto
|
||||||
PtrOwner<IGeoPoint3d> pGeoPnt( CreateGeoPoint3d()) ;
|
PtrOwner<IGeoPoint3d> pGeoPnt( CreateGeoPoint3d()) ;
|
||||||
bOk = bOk && ! IsNull( pGeoPnt) ;
|
bOk = bOk && !IsNull( pGeoPnt) ;
|
||||||
// setto il punto
|
// setto il punto
|
||||||
bOk = bOk && pGeoPnt->Set( ptPL) ;
|
bOk = bOk && pGeoPnt->Set( ptPL) ;
|
||||||
// inserisco il punto nel DB
|
// inserisco il punto nel DB
|
||||||
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pGeoPnt)) : GDB_ID_NULL) ;
|
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pGeoPnt)) : GDB_ID_NULL) ;
|
||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
@@ -106,7 +111,7 @@ ExeCreateGeoPoint( int nParentId, const Point3d& ptP, int nRefType)
|
|||||||
" -- Id=" + ToString( nId) ;
|
" -- Id=" + ToString( nId) ;
|
||||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
}
|
}
|
||||||
// restituisco l'identificativo della nuova entità
|
// restituisco l'identificativo della nuova entit�
|
||||||
return nId ;
|
return nId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +121,7 @@ ExeCreateGeoVector( int nParentId, const Vector3d& vtV, const Point3d& ptB, int
|
|||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
@@ -126,9 +131,9 @@ ExeCreateGeoVector( int nParentId, const Vector3d& vtV, const Point3d& ptB, int
|
|||||||
Point3d ptBL = GetPointLocal( pGeomDB, ptB, nRefType, frLoc) ;
|
Point3d ptBL = GetPointLocal( pGeomDB, ptB, nRefType, frLoc) ;
|
||||||
// creo il vettore
|
// creo il vettore
|
||||||
PtrOwner<IGeoVector3d> pGeoVct( CreateGeoVector3d()) ;
|
PtrOwner<IGeoVector3d> pGeoVct( CreateGeoVector3d()) ;
|
||||||
bOk = bOk && ! IsNull( pGeoVct) ;
|
bOk = bOk && !IsNull( pGeoVct) ;
|
||||||
// setto il vettore (con il punto base)
|
// setto il vettore (con il punto base)
|
||||||
bOk = bOk && pGeoVct->Set( vtVL, ptBL) ;
|
bOk = bOk && pGeoVct->Set( vtVL, ptBL) ;
|
||||||
// inserisco il vettore nel DB
|
// inserisco il vettore nel DB
|
||||||
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pGeoVct)) : GDB_ID_NULL) ;
|
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pGeoVct)) : GDB_ID_NULL) ;
|
||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
@@ -148,7 +153,7 @@ ExeCreateGeoVector( int nParentId, const Vector3d& vtV, const Point3d& ptB, int
|
|||||||
" -- Id=" + ToString( nId) ;
|
" -- Id=" + ToString( nId) ;
|
||||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
}
|
}
|
||||||
// restituisco l'identificativo della nuova entità
|
// restituisco l'identificativo della nuova entit�
|
||||||
return nId ;
|
return nId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,11 +163,11 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
|
|||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc ) ;
|
||||||
// porto in locale l'origine e i versori
|
// porto in locale l'origine e i versori
|
||||||
Point3d ptOrigL = GetPointLocal( pGeomDB, frFrame.Orig(), nRefType, frLoc) ;
|
Point3d ptOrigL = GetPointLocal( pGeomDB, frFrame.Orig(), nRefType, frLoc) ;
|
||||||
Vector3d vtXL = GetVectorLocal( pGeomDB, frFrame.VersX(), nRefType, frLoc) ;
|
Vector3d vtXL = GetVectorLocal( pGeomDB, frFrame.VersX(), nRefType, frLoc) ;
|
||||||
@@ -170,8 +175,8 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
|
|||||||
Vector3d vtZL = GetVectorLocal( pGeomDB, frFrame.VersZ(), nRefType, frLoc) ;
|
Vector3d vtZL = GetVectorLocal( pGeomDB, frFrame.VersZ(), nRefType, frLoc) ;
|
||||||
// creo e setto il riferimento
|
// creo e setto il riferimento
|
||||||
PtrOwner<IGeoFrame3d> pGeoFrm( CreateGeoFrame3d()) ;
|
PtrOwner<IGeoFrame3d> pGeoFrm( CreateGeoFrame3d()) ;
|
||||||
bOk = bOk && ! IsNull( pGeoFrm) ;
|
bOk = bOk && !IsNull( pGeoFrm) ;
|
||||||
bOk = bOk && pGeoFrm->Set( ptOrigL, vtXL, vtYL, vtZL) ;
|
bOk = bOk && pGeoFrm->Set( ptOrigL, vtXL, vtYL, vtZL) ;
|
||||||
// inserisco il riferimento nel DB
|
// inserisco il riferimento nel DB
|
||||||
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pGeoFrm)) : GDB_ID_NULL) ;
|
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pGeoFrm)) : GDB_ID_NULL) ;
|
||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
@@ -183,7 +188,7 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
|
|||||||
ToString( frFrame.VersY()) + "},{" +
|
ToString( frFrame.VersY()) + "},{" +
|
||||||
ToString( frFrame.VersZ()) + "}}," +
|
ToString( frFrame.VersZ()) + "}}," +
|
||||||
RefTypeToString( nRefType) + ")" +
|
RefTypeToString( nRefType) + ")" +
|
||||||
" -- Id=" + ToString( nId) ;
|
" -- Id=" + ToString( nId) ;
|
||||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
}
|
}
|
||||||
// restituisco l'identificativo del nuovo gruppo
|
// restituisco l'identificativo del nuovo gruppo
|
||||||
@@ -197,7 +202,7 @@ ExeCreateText( int nParentId, const Point3d& ptP,
|
|||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
@@ -208,7 +213,7 @@ ExeCreateText( int nParentId, const Point3d& ptP,
|
|||||||
Vector3d vtDL = GetVectorLocal( pGeomDB, X_AX, nRefType, frLoc) ;
|
Vector3d vtDL = GetVectorLocal( pGeomDB, X_AX, nRefType, frLoc) ;
|
||||||
// creo il testo e lo riempio
|
// creo il testo e lo riempio
|
||||||
PtrOwner<IExtText> pTXT( CreateExtText()) ;
|
PtrOwner<IExtText> pTXT( CreateExtText()) ;
|
||||||
bOk = bOk && ! IsNull( pTXT) ;
|
bOk = bOk && !IsNull( pTXT) ;
|
||||||
bOk = bOk && pTXT->Set( ptPL, vtNL, vtDL, sText, "", false, dH) ;
|
bOk = bOk && pTXT->Set( ptPL, vtNL, vtDL, sText, "", false, dH) ;
|
||||||
// inserisco il testo nel DB
|
// inserisco il testo nel DB
|
||||||
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pTXT)) : GDB_ID_NULL) ;
|
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pTXT)) : GDB_ID_NULL) ;
|
||||||
@@ -234,7 +239,7 @@ ExeCreateTextEx( int nParentId, const Point3d& ptP, double dAngRotDeg,
|
|||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
@@ -242,10 +247,10 @@ ExeCreateTextEx( int nParentId, const Point3d& ptP, double dAngRotDeg,
|
|||||||
// porto in locale l'origine e i versori
|
// porto in locale l'origine e i versori
|
||||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||||
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
Vector3d vtDL = GetVectorLocal( pGeomDB, FromPolar(1, dAngRotDeg), nRefType, frLoc) ;
|
Vector3d vtDL = GetVectorLocal( pGeomDB, FromPolar( 1, dAngRotDeg), nRefType, frLoc) ;
|
||||||
// creo il testo e lo riempio
|
// creo il testo e lo riempio
|
||||||
PtrOwner<IExtText> pTXT( CreateExtText()) ;
|
PtrOwner<IExtText> pTXT( CreateExtText()) ;
|
||||||
bOk = bOk && ! IsNull( pTXT) ;
|
bOk = bOk && !IsNull( pTXT) ;
|
||||||
bOk = bOk && pTXT->Set( ptPL, vtNL, vtDL, sText, sFont, bItalic, dH) ;
|
bOk = bOk && pTXT->Set( ptPL, vtNL, vtDL, sText, sFont, bItalic, dH) ;
|
||||||
// inserisco il testo nel DB
|
// inserisco il testo nel DB
|
||||||
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pTXT)) : GDB_ID_NULL) ;
|
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pTXT)) : GDB_ID_NULL) ;
|
||||||
@@ -263,7 +268,7 @@ ExeCreateTextEx( int nParentId, const Point3d& ptP, double dAngRotDeg,
|
|||||||
" -- Id=" + ToString( nId) ;
|
" -- Id=" + ToString( nId) ;
|
||||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
}
|
}
|
||||||
// restituisco l'identificativo del oggetto
|
// restituisco l'identificativo del oggetto
|
||||||
return nId ;
|
return nId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +280,7 @@ ExeCreateTextAdv( int nParentId, const Point3d& ptP, double dAngRotDeg,
|
|||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
@@ -283,10 +288,10 @@ ExeCreateTextAdv( int nParentId, const Point3d& ptP, double dAngRotDeg,
|
|||||||
// porto in locale l'origine e i versori
|
// porto in locale l'origine e i versori
|
||||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||||
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
Vector3d vtDL = GetVectorLocal( pGeomDB, FromPolar(1, dAngRotDeg), nRefType, frLoc) ;
|
Vector3d vtDL = GetVectorLocal( pGeomDB, FromPolar( 1, dAngRotDeg), nRefType, frLoc) ;
|
||||||
// creo il testo e lo imposto
|
// creo il testo e lo imposto
|
||||||
PtrOwner<IExtText> pTXT( CreateExtText()) ;
|
PtrOwner<IExtText> pTXT( CreateExtText()) ;
|
||||||
bOk = bOk && ! IsNull( pTXT) ;
|
bOk = bOk && !IsNull( pTXT) ;
|
||||||
bOk = bOk && pTXT->Set( ptPL, vtNL, vtDL, sText, sFont, nW, bItalic, dH, dRat, dAddAdv, nInsPos) ;
|
bOk = bOk && pTXT->Set( ptPL, vtNL, vtDL, sText, sFont, nW, bItalic, dH, dRat, dAddAdv, nInsPos) ;
|
||||||
// inserisco il testo nel DB
|
// inserisco il testo nel DB
|
||||||
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pTXT)) : GDB_ID_NULL) ;
|
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pTXT)) : GDB_ID_NULL) ;
|
||||||
@@ -315,12 +320,12 @@ ExeCreateTextAdv( int nParentId, const Point3d& ptP, double dAngRotDeg,
|
|||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSetCurrDimensionStyle( double dExtLineLen, double dArrowLen, double dTextDist,
|
ExeSetCurrDimensionStyle( double dExtLineLen, double dArrowLen, double dTextDist,
|
||||||
int nLenIsMM, int nDecDigit, const string& sFont, double dTextHeight)
|
int nLenIsMM, int nDecDigit, const string& sFont, double dTextHeight)
|
||||||
{
|
{
|
||||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||||
VERIFY_CTX( pGseCtx, false)
|
VERIFY_CTX( pGseCtx, false)
|
||||||
// aggiorno lo stile di quotatura corrente
|
// aggiorno lo stile di quotatura corrente
|
||||||
pGseCtx->m_dsCurr.Set( dExtLineLen, dArrowLen, dTextDist, nLenIsMM, nDecDigit, sFont, dTextHeight) ;
|
pGseCtx->m_dsCurr.Set( dExtLineLen, dArrowLen, dTextDist, nLenIsMM, nDecDigit, sFont, dTextHeight) ;
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,8 +335,8 @@ ExeResetCurrDimensionStyle( void)
|
|||||||
{
|
{
|
||||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||||
VERIFY_CTX( pGseCtx, false)
|
VERIFY_CTX( pGseCtx, false)
|
||||||
// aggiorno lo stile di quotatura corrente
|
// aggiorno lo stile di quotatura corrente
|
||||||
pGseCtx->m_dsCurr.Reset() ;
|
pGseCtx->m_dsCurr.Reset() ;
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,16 +346,16 @@ MySetDimensionStyle( IExtDimension* pDim)
|
|||||||
{
|
{
|
||||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||||
VERIFY_CTX( pGseCtx, false)
|
VERIFY_CTX( pGseCtx, false)
|
||||||
// verifico validità quotatura
|
// verifico validit� quotatura
|
||||||
if ( pDim == nullptr)
|
if ( pDim == nullptr)
|
||||||
return false ;
|
return false ;
|
||||||
// recupero lo stile di quotatura
|
// recupero lo stile di quotatura
|
||||||
const DimensionStyle& DimSt = pGseCtx->m_dsCurr ;
|
const DimensionStyle& DimSt = pGseCtx->m_dsCurr ;
|
||||||
// recupero l'unità di misura lineare per la quotatura
|
// recupero l'unit� di misura lineare per la quotatura
|
||||||
bool bLenIsMM = ( DimSt.nLenIsMM == 2 ? ExeUiUnitsAreMM() : ( DimSt.nLenIsMM != 0)) ;
|
bool bLenIsMM = ( DimSt.nLenIsMM == 2 ? ExeUiUnitsAreMM() : ( DimSt.nLenIsMM != 0 )) ;
|
||||||
// imposto lo stile
|
// imposto lo stile
|
||||||
return pDim->SetStyle( DimSt.dExtLineLen, DimSt.dArrowLen, DimSt.dTextDist,
|
return pDim->SetStyle( DimSt.dExtLineLen, DimSt.dArrowLen, DimSt.dTextDist,
|
||||||
bLenIsMM, DimSt.nDecDigit, DimSt.sFont, DimSt.dTextHeight) ;
|
bLenIsMM, DimSt.nDecDigit, DimSt.sFont, DimSt.dTextHeight) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
@@ -360,10 +365,10 @@ MyCreateLinearDimension( int nParentId, const Point3d& ptP1, const Point3d& ptP2
|
|||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc))
|
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc ))
|
||||||
return GDB_ID_NULL ;
|
return GDB_ID_NULL ;
|
||||||
// porto in locale i punti e assegno i versori
|
// porto in locale i punti e assegno i versori
|
||||||
Point3d ptP1L = GetPointLocal( pGeomDB, ptP1, nRefType, frLoc) ;
|
Point3d ptP1L = GetPointLocal( pGeomDB, ptP1, nRefType, frLoc) ;
|
||||||
@@ -373,9 +378,9 @@ MyCreateLinearDimension( int nParentId, const Point3d& ptP1, const Point3d& ptP2
|
|||||||
Vector3d vtDL = GetVectorLocal( pGeomDB, vtDir, nRefType, frLoc) ;
|
Vector3d vtDL = GetVectorLocal( pGeomDB, vtDir, nRefType, frLoc) ;
|
||||||
// creo la quota
|
// creo la quota
|
||||||
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||||
if ( IsNull( pDim) ||
|
if ( IsNull( pDim ) ||
|
||||||
! MySetDimensionStyle( pDim) ||
|
! MySetDimensionStyle( pDim ) ||
|
||||||
! pDim->SetLinear( ptP1L, ptP2L, ptDimL, vtNL, vtDL, sText))
|
! pDim->SetLinear( ptP1L, ptP2L, ptDimL, vtNL, vtDL, sText ))
|
||||||
return GDB_ID_NULL ;
|
return GDB_ID_NULL ;
|
||||||
// inserisco la quota nel DB
|
// inserisco la quota nel DB
|
||||||
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||||
@@ -414,7 +419,7 @@ ExeCreateVerticalDimension( int nParentId, const Point3d& ptP1, const Point3d& p
|
|||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
string sLua = "EgtVerticalDimension(" + IdToString( nParentId) + ",{" +
|
string sLua = "EgtVerticalDimension(" + IdToString( nParentId ) + ",{" +
|
||||||
ToString( ptP1) + "},{" +
|
ToString( ptP1) + "},{" +
|
||||||
ToString( ptP2) + "},{" +
|
ToString( ptP2) + "},{" +
|
||||||
ToString( ptDim) + "},'" +
|
ToString( ptDim) + "},'" +
|
||||||
@@ -449,3 +454,533 @@ ExeCreateAlignedDimension( int nParentId, const Point3d& ptP1, const Point3d& pt
|
|||||||
// restituisco l'identificativo del oggetto
|
// restituisco l'identificativo del oggetto
|
||||||
return nId ;
|
return nId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MyCreateRadialDimension( int nParentId, int nCrvId, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
nParentId = AdjustId( nParentId) ;
|
||||||
|
// recupero il riferimento locale
|
||||||
|
Frame3d frLoc ;
|
||||||
|
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// recupero l'arco di circonferenza e il suo frame
|
||||||
|
ICurveArc* pArc = GetCurveArc( pGeomDB->GetGeoObj( nCrvId)) ;
|
||||||
|
if ( pArc == nullptr)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
Frame3d frArc ;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( nCrvId, frArc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// porto il punto nel riferimento locale
|
||||||
|
Point3d ptDimL = GetPointLocal( pGeomDB, ptDim, nRefType, frLoc) ;
|
||||||
|
// recupero il centro e la normale e li porto nel riferimento locale
|
||||||
|
Point3d ptCenL = pArc->GetCenter() ;
|
||||||
|
ptCenL.LocToLoc( frArc, frLoc) ;
|
||||||
|
Vector3d vtNL = pArc->GetNormVersor() ;
|
||||||
|
vtNL.LocToLoc( frArc, frLoc) ;
|
||||||
|
// porto ptDimL sulla circonferenza cui appartiene l'arco
|
||||||
|
Vector3d vtDir = ptDimL - ptCenL ;
|
||||||
|
if ( ! vtDir.Normalize())
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
ptDimL = ptCenL + pArc->GetRadius() * vtDir ;
|
||||||
|
// creo la quota
|
||||||
|
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||||
|
if ( IsNull( pDim) ||
|
||||||
|
! MySetDimensionStyle( pDim) ||
|
||||||
|
! pDim->SetRadial( ptCenL, ptDimL, vtNL, sText))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// inserisco la quota nel DB
|
||||||
|
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCreateRadialDimension( int nParentId, int nCrvId, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
// eseguo
|
||||||
|
int nId = MyCreateRadialDimension( nParentId, nCrvId, ptDim, sText, nRefType) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtRadialDimension(" + IdToString( nParentId) + "," +
|
||||||
|
IdToString( nCrvId) + ",{" +
|
||||||
|
ToString( ptDim) + "},'" +
|
||||||
|
StringToLuaString( sText) + "'," +
|
||||||
|
RefTypeToString( nRefType) + ")" +
|
||||||
|
" -- Id=" + ToString( nId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco l'identificativo del oggetto
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MyCreateDiametralDimension( int nParentId, int nCrvId, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
nParentId = AdjustId( nParentId) ;
|
||||||
|
// recupero il riferimento locale
|
||||||
|
Frame3d frLoc ;
|
||||||
|
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// recupero l'arco e il suo frame
|
||||||
|
ICurveArc* pArc = GetCurveArc( pGeomDB->GetGeoObj( nCrvId)) ;
|
||||||
|
if ( pArc == nullptr)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
Frame3d frArc ;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( nCrvId, frArc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// porto il punto nel riferimento locale
|
||||||
|
Point3d ptDimL = GetPointLocal( pGeomDB, ptDim, nRefType, frLoc) ;
|
||||||
|
// recupero il centro e la normale e li porto nel riferimento locale
|
||||||
|
Point3d ptCenL = pArc->GetCenter() ;
|
||||||
|
ptCenL.LocToLoc( frArc, frLoc) ;
|
||||||
|
Vector3d vtNL = pArc->GetNormVersor() ;
|
||||||
|
vtNL.LocToLoc( frArc, frLoc) ;
|
||||||
|
// porto ptDimL sulla circonferenza
|
||||||
|
Vector3d vtDir = ptDimL - ptCenL ;
|
||||||
|
if ( ! vtDir.Normalize())
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
ptDimL = ptCenL + pArc->GetRadius() * vtDir ;
|
||||||
|
// creo la quota
|
||||||
|
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||||
|
if ( IsNull( pDim) ||
|
||||||
|
! MySetDimensionStyle( pDim) ||
|
||||||
|
! pDim->SetDiametral( ptCenL, ptDimL, vtNL, sText))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// inserisco la quota nel DB
|
||||||
|
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCreateDiametralDimension( int nParentId, int nCrvId, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
// eseguo
|
||||||
|
int nId = MyCreateDiametralDimension( nParentId, nCrvId, ptDim, sText, nRefType) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtDiametralDimension(" + IdToString( nParentId) + "," +
|
||||||
|
IdToString( nCrvId) + ",{" +
|
||||||
|
ToString( ptDim) + "},'" +
|
||||||
|
StringToLuaString( sText) + "'," +
|
||||||
|
RefTypeToString( nRefType) + ")" +
|
||||||
|
" -- Id=" + ToString( nId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco l'identificativo del oggetto
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MyCreateAngularDimension( int nParentId, const Point3d& ptP1, const Point3d& ptP0, const Point3d& ptP2,
|
||||||
|
const Point3d& ptDim, const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
nParentId = AdjustId( nParentId) ;
|
||||||
|
// recupero il riferimento locale
|
||||||
|
Frame3d frLoc ;
|
||||||
|
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// porto in locale i punti e assegno i versori
|
||||||
|
Point3d ptP0L = GetPointLocal( pGeomDB, ptP0, nRefType, frLoc) ;
|
||||||
|
Point3d ptP1L = GetPointLocal( pGeomDB, ptP1, nRefType, frLoc) ;
|
||||||
|
Point3d ptP2L = GetPointLocal( pGeomDB, ptP2, nRefType, frLoc) ;
|
||||||
|
Point3d ptDimL = GetPointLocal( pGeomDB, ptDim, nRefType, frLoc) ;
|
||||||
|
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
|
// creo la quota
|
||||||
|
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||||
|
if ( IsNull( pDim) ||
|
||||||
|
! MySetDimensionStyle( pDim ) ||
|
||||||
|
! pDim->SetAngular( ptP1L, ptP0L, ptP2L, ptDimL, vtNL, sText))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// inserisco la quota nel DB
|
||||||
|
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCreateAngularDimension( int nParentId, const Point3d& ptP1, const Point3d& ptP0, const Point3d& ptP2,
|
||||||
|
const Point3d& ptDim, const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
// eseguo
|
||||||
|
int nId = MyCreateAngularDimension( nParentId, ptP1, ptP0, ptP2, ptDim, sText, nRefType) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtAngularDimension(" + IdToString( nParentId) + ",{" +
|
||||||
|
ToString( ptP0) + "},{" +
|
||||||
|
ToString( ptP1) + "},{" +
|
||||||
|
ToString( ptP2) + "},{" +
|
||||||
|
ToString( ptDim) + "},'" +
|
||||||
|
StringToLuaString( sText) + "'," +
|
||||||
|
RefTypeToString( nRefType) + ")" +
|
||||||
|
" -- Id=" + ToString( nId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco l'identificativo del oggetto
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MyCreateAngularDimensionFromLines( int nParentId, INTVECTOR vLineIds, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
nParentId = AdjustId( nParentId) ;
|
||||||
|
// recupero il riferimento locale
|
||||||
|
Frame3d frLoc ;
|
||||||
|
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
//recupero le linee
|
||||||
|
ICurveLine* pCrv1 = GetCurveLine( pGeomDB->GetGeoObj( vLineIds[0])) ;
|
||||||
|
ICurveLine* pCrv2 = GetCurveLine( pGeomDB->GetGeoObj( vLineIds[1])) ;
|
||||||
|
if ( pCrv1 == nullptr || pCrv2 == nullptr)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
PtrOwner<ICurveLine> pL1( pCrv1->Clone()) ;
|
||||||
|
PtrOwner<ICurveLine> pL2( pCrv2->Clone()) ;
|
||||||
|
if ( IsNull( pL1 ) || ! pL1->IsValid() || IsNull( pL2) || ! pL2->IsValid())
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
//porto tutto nel frLoc
|
||||||
|
Frame3d frL1, frL2 ;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( vLineIds[0], frL1) || ! pGeomDB->GetGlobFrame( vLineIds[1], frL2))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
pL1->LocToLoc( frL1, frLoc) ;
|
||||||
|
pL2->LocToLoc( frL2, frLoc) ;
|
||||||
|
Point3d ptDimL = GetPointLocal( pGeomDB, ptDim, nRefType, frLoc) ;
|
||||||
|
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
|
|
||||||
|
//recupero i punti e le direzioni
|
||||||
|
Point3d ptP1L, ptP2L, ptP3L, ptP4L ;
|
||||||
|
Vector3d vtL1, vtL2 ;
|
||||||
|
pL1->GetStartPoint( ptP1L) ;
|
||||||
|
pL1->GetEndPoint( ptP2L) ;
|
||||||
|
pL2->GetStartPoint( ptP3L) ;
|
||||||
|
pL2->GetEndPoint( ptP4L) ;
|
||||||
|
pL1->GetStartDir( vtL1) ;
|
||||||
|
pL2->GetStartDir( vtL2) ;
|
||||||
|
|
||||||
|
// controllo se le rette sono coincidenti o parallele
|
||||||
|
if ( AreSameOrOppositeVectorApprox( vtL1, vtL2))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
// verifico se le rette si intersecano già
|
||||||
|
Point3d ptP0L ;
|
||||||
|
IntersCurveCurve pInters( *pL1, *pL2) ;
|
||||||
|
IntCrvCrvInfo Info ;
|
||||||
|
int nNumeroInters = pInters.GetIntersCount() ;
|
||||||
|
// se non ho intersezioni estendo
|
||||||
|
if ( nNumeroInters == 0) {
|
||||||
|
double dLen = pow( 10, 5) ;
|
||||||
|
pL1->ExtendStartByLen( dLen) ;
|
||||||
|
pL2->ExtendStartByLen( dLen) ;
|
||||||
|
pL1->ExtendEndByLen( dLen) ;
|
||||||
|
pL2->ExtendEndByLen( dLen) ;
|
||||||
|
|
||||||
|
//faccio intersezione
|
||||||
|
IntersCurveCurve pIntersExt( *pL1, *pL2) ;
|
||||||
|
nNumeroInters = pIntersExt.GetIntersCount() ;
|
||||||
|
|
||||||
|
// le linee estese non si intersecano, quindi vuol dire che sono quasi parallele e lontanissime
|
||||||
|
if ( nNumeroInters == 0 )
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
else {
|
||||||
|
pIntersExt.GetIntCrvCrvInfo( 0, Info) ;
|
||||||
|
// controllo che non siano coincidenti
|
||||||
|
if ( Info.bOverlap)
|
||||||
|
return false ;
|
||||||
|
else
|
||||||
|
ptP0L = Info.IciA->ptI ;
|
||||||
|
}
|
||||||
|
// seleziono i punti necessari
|
||||||
|
// se ptDimL è più vicino a ptP0L rispetto agli estremi esterni delle linee, allora tengo gli estremi interni
|
||||||
|
double dP1P0 = ( ptP1L - ptP0L ).Len() ;
|
||||||
|
double dP2P0 = ( ptP2L - ptP0L ).Len() ;
|
||||||
|
double dDimP0 = ( ptDimL - ptP0L ).Len() ;
|
||||||
|
if ( ( dDimP0 < dP1P0 || dDimP0 < dP2P0))
|
||||||
|
// se uno dei due punti è più vicino a ptP0L rispetto a ptDimL, allora tengo il punto più vicino a ptDimL
|
||||||
|
ptP1L = ( ( ptDimL - ptP1L ).Len() < ( ptDimL - ptP2L ).Len() ? ptP1L : ptP2L) ;
|
||||||
|
else
|
||||||
|
ptP1L = ( dP1P0 < dP2P0 ? ptP2L : ptP1L ) ;
|
||||||
|
// rifaccio anche per l'altro lato
|
||||||
|
double dP3P0 = ( ptP3L - ptP0L).Len() ;
|
||||||
|
double dP4P0 = ( ptP4L - ptP0L).Len() ;
|
||||||
|
if ( dDimP0 < dP3P0 || dDimP0 < dP4P0 )
|
||||||
|
ptP3L = ( ( ptDimL - ptP3L).Len() < ( ptDimL - ptP4L).Len() ? ptP3L : ptP4L ) ;
|
||||||
|
else
|
||||||
|
ptP3L = ( dP3P0 < dP4P0 ? ptP4L : ptP3L) ;
|
||||||
|
}
|
||||||
|
// se ho già intesezioni devo capire in quale quadrante si trova ptDim
|
||||||
|
else {
|
||||||
|
// recupero l'intersezione
|
||||||
|
pInters.GetIntCrvCrvInfo( 0, Info) ;
|
||||||
|
// controllo che non siano coincidenti
|
||||||
|
if ( Info.bOverlap)
|
||||||
|
return false ;
|
||||||
|
else
|
||||||
|
ptP0L = Info.IciA->ptI ; // se non coincidono restituisco l'intersezione
|
||||||
|
|
||||||
|
// se le due linee hanno un estremo in comune, estendo le linee quel lato
|
||||||
|
if ( ( AreSamePointApprox( ptP0L, ptP1L) || AreSamePointApprox( ptP0L, ptP2L)) &&
|
||||||
|
( AreSamePointApprox( ptP0L, ptP3L) || AreSamePointApprox( ptP0L, ptP4L))) {
|
||||||
|
if ( AreSamePointApprox( ptP0L, ptP1L)) {
|
||||||
|
pL1->ExtendStartByLen(Dist( ptP1L, ptP2L) / 2) ;
|
||||||
|
pL1->GetStartPoint( ptP1L) ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pL1->ExtendEndByLen(Dist( ptP1L, ptP2L) / 2) ;
|
||||||
|
pL1->GetEndPoint( ptP2L) ;
|
||||||
|
}
|
||||||
|
if ( AreSamePointApprox( ptP0L, ptP3L) ) {
|
||||||
|
pL2->ExtendStartByLen(Dist( ptP3L, ptP4L) / 2);
|
||||||
|
pL2->GetStartPoint( ptP3L) ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pL2->ExtendEndByLen(Dist( ptP3L, ptP4L) / 2);
|
||||||
|
pL2->GetEndPoint( ptP4L) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// seleziono i punti necessari
|
||||||
|
// proietto pdDim su vtLine1 e su vtLine2
|
||||||
|
Point3d ptDim1, ptDim2 ;
|
||||||
|
DistPointCurve distPL1( ptDimL, *pL1, true) ;
|
||||||
|
DistPointCurve distPL2( ptDimL, *pL2, true) ;
|
||||||
|
int nFlag1, nFlag2 ;
|
||||||
|
if ( ! distPL1.GetMinDistPoint( 0, ptDim1, nFlag1) || ! distPL2.GetMinDistPoint( 0, ptDim2, nFlag2) )
|
||||||
|
return false ;
|
||||||
|
if ( abs(( ptDim1 - ptP1L).Len() + ( ptP0L - ptDim1).Len() - ( ptP0L - ptP1L).Len()) < EPS_SMALL ||
|
||||||
|
abs(( ptDim1 - ptP1L).Len() + ( ptP0L - ptP1L ).Len() - ( ptDim1 - ptP0L).Len()) < EPS_SMALL)
|
||||||
|
// ptDim è dal lato di ptP1L, quindi tengo ptP1L
|
||||||
|
;
|
||||||
|
else
|
||||||
|
// ptDim è dal lato di ptP2L
|
||||||
|
ptP1L = ptP2L ;
|
||||||
|
if ( abs(( ptDim2 - ptP3L).Len() + ( ptP0L - ptDim2).Len() - ( ptP0L - ptP3L).Len()) < EPS_SMALL ||
|
||||||
|
abs(( ptDim2 - ptP3L).Len() + ( ptP0L - ptP3L).Len() - ( ptDim2 - ptP0L).Len()) < EPS_SMALL)
|
||||||
|
// ptDim è dal lato di ptP1L, quindi tengo ptP3L
|
||||||
|
;
|
||||||
|
else
|
||||||
|
// ptDim è dal lato di ptP2L
|
||||||
|
ptP3L = ptP4L ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// creo la quota
|
||||||
|
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||||
|
if ( IsNull( pDim ) ||
|
||||||
|
! MySetDimensionStyle( pDim ) ||
|
||||||
|
! pDim->SetAngular( ptP1L, ptP0L, ptP3L, ptDimL, vtNL, sText))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// inserisco la quota nel DB
|
||||||
|
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCreateAngularDimensionFromLines( int nParentId, const INTVECTOR vLineIds, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
// eseguo
|
||||||
|
int nId = MyCreateAngularDimensionFromLines( nParentId, vLineIds, ptDim, sText, nRefType) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtAngularDimensionFromLines(" + IdToString( nParentId) + "," +
|
||||||
|
ToString( vLineIds[0]) + "," +
|
||||||
|
ToString( vLineIds[1]) + ",{" +
|
||||||
|
ToString( ptDim) + "},'" +
|
||||||
|
StringToLuaString( sText) + "'," +
|
||||||
|
RefTypeToString( nRefType) + ")" +
|
||||||
|
" -- Id=" + ToString( nId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco l'identificativo del oggetto
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MyCreateAngularDimensionFromArc( int nParentId, int nCrvId, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
nParentId = AdjustId( nParentId) ;
|
||||||
|
// recupero il riferimento locale
|
||||||
|
Frame3d frLoc ;
|
||||||
|
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
// recupero l'arco e il suo frame
|
||||||
|
ICurveArc* pCurve = GetCurveArc( pGeomDB->GetGeoObj( nCrvId)) ;
|
||||||
|
if ( pCurve == nullptr)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
Frame3d frArc;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( nCrvId, frArc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
PtrOwner<ICurveArc> pCrv( pCurve->Clone()) ;
|
||||||
|
if ( IsNull( pCrv ) || ! pCrv->IsValid())
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
// porto tutto nel frLoc
|
||||||
|
pCrv->LocToLoc( frArc, frLoc ) ;
|
||||||
|
Point3d ptDimL = GetPointLocal( pGeomDB, ptDim, nRefType, frLoc) ;
|
||||||
|
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
|
|
||||||
|
//recupero i punti e i versori
|
||||||
|
Point3d ptP0L, ptP1L, ptP2L ;
|
||||||
|
pCrv->GetStartPoint( ptP1L) ;
|
||||||
|
pCrv->GetEndPoint( ptP2L) ;
|
||||||
|
pCrv->GetCenterPoint( ptP0L) ;
|
||||||
|
|
||||||
|
// porto ptDimL nell'area di influenza dell'arco
|
||||||
|
Point3d ptDimNew ;
|
||||||
|
double dDist = ( ptDimL - ptP0L).Len() ;
|
||||||
|
Point3d ptMid ;
|
||||||
|
pCrv->GetMidPoint( ptMid) ;
|
||||||
|
Vector3d vtDir = ( ptMid - ptP0L) ;
|
||||||
|
vtDir.Normalize() ;
|
||||||
|
ptDimNew = ptP0L + dDist * vtDir ;
|
||||||
|
// proietto il punto sul piano XY della griglia
|
||||||
|
Frame3d frGrid = pGeomDB->GetGridFrame() ;
|
||||||
|
if ( ! frGrid.IsValid())
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
Point3d ptOrig = frGrid.Orig() ;
|
||||||
|
ptDimNew -= ( ptDimNew - ptOrig) * vtNL * vtNL;
|
||||||
|
|
||||||
|
// creo la quota
|
||||||
|
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||||
|
if ( IsNull( pDim ) ||
|
||||||
|
! MySetDimensionStyle( pDim) ||
|
||||||
|
! pDim->SetAngular( ptP1L, ptP0L, ptP2L, ptDimNew, vtNL, sText))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// inserisco la quota nel DB
|
||||||
|
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCreateAngularDimensionFromArc( int nParentId, int nCrvId, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
// eseguo
|
||||||
|
int nId = MyCreateAngularDimensionFromArc( nParentId, nCrvId, ptDim, sText, nRefType) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtAngularDimensionFromArc(" + IdToString( nParentId) + "," +
|
||||||
|
IdToString( nCrvId) + ",{" +
|
||||||
|
ToString( ptDim) + "},'" +
|
||||||
|
StringToLuaString( sText) + "'," +
|
||||||
|
RefTypeToString( nRefType) + ")" +
|
||||||
|
" -- Id=" + ToString( nId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco l'identificativo del oggetto
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MyCreateAngularDimensionFromCircle( int nParentId, int nCrvId, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
nParentId = AdjustId( nParentId ) ;
|
||||||
|
// recupero il riferimento locale
|
||||||
|
Frame3d frLoc ;
|
||||||
|
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
// recupero il cerchio e il suo frame
|
||||||
|
ICurveArc* pCurve = GetCurveArc( pGeomDB->GetGeoObj( nCrvId)) ;
|
||||||
|
if ( pCurve == nullptr)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
Frame3d frCrv;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( nCrvId, frCrv))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
PtrOwner<ICurveArc> pCrv( pCurve->Clone()) ;
|
||||||
|
if ( IsNull( pCrv ) || ! pCrv->IsValid())
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
// porto tutto nel frLoc
|
||||||
|
pCrv->LocToLoc( frCrv, frLoc ) ;
|
||||||
|
Point3d ptP1L = GetPointLocal( pGeomDB, ptP1, nRefType, frLoc) ;
|
||||||
|
Point3d ptP2L = GetPointLocal( pGeomDB, ptP2, nRefType, frLoc) ;
|
||||||
|
Point3d ptDimL = GetPointLocal( pGeomDB, ptDim, nRefType, frLoc) ;
|
||||||
|
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
|
|
||||||
|
// recupero il centro
|
||||||
|
Point3d ptP0L ;
|
||||||
|
pCrv->GetCenterPoint( ptP0L) ;
|
||||||
|
|
||||||
|
// verifico che i punti P1 e P2 siano sul cerchio, sennò prendo i più vicini
|
||||||
|
if ( ! pCrv->IsPointOn(ptP1L)) {
|
||||||
|
DistPointCurve distPC( ptP1L, *pCrv) ;
|
||||||
|
int nFlag ;
|
||||||
|
distPC.GetMinDistPoint(0,ptP1L,nFlag);
|
||||||
|
}
|
||||||
|
if ( ! pCrv->IsPointOn(ptP2L)) {
|
||||||
|
DistPointCurve distPC(ptP2L, *pCrv) ;
|
||||||
|
int nFlag ;
|
||||||
|
distPC.GetMinDistPoint(0, ptP2L, nFlag);
|
||||||
|
}
|
||||||
|
|
||||||
|
// proietto il punto sul piano XY della griglia
|
||||||
|
Frame3d frGrid = pGeomDB->GetGridFrame() ;
|
||||||
|
if ( ! frGrid.IsValid())
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
Point3d ptOrig = frGrid.Orig() ;
|
||||||
|
ptDimL -= ( ptDimL - ptOrig) * vtNL * vtNL;
|
||||||
|
|
||||||
|
// creo la quota
|
||||||
|
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||||
|
if ( IsNull( pDim) ||
|
||||||
|
! MySetDimensionStyle( pDim) ||
|
||||||
|
! pDim->SetAngular( ptP1L, ptP0L, ptP2L, ptDimL, vtNL, sText))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// inserisco la quota nel DB
|
||||||
|
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCreateAngularDimensionFromCircle( int nParentId, int nCrvId, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptDim,
|
||||||
|
const string& sText, int nRefType)
|
||||||
|
{
|
||||||
|
// eseguo
|
||||||
|
int nId = MyCreateAngularDimensionFromCircle( nParentId, nCrvId, ptP1, ptP2, ptDim, sText, nRefType) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtAngularDimensionFromCircle(" + IdToString( nParentId) + "," +
|
||||||
|
IdToString( nCrvId) + ",{" +
|
||||||
|
ToString( ptP1) + "},'" +
|
||||||
|
ToString( ptP2) + "},'" +
|
||||||
|
ToString( ptDim) + "},'" +
|
||||||
|
StringToLuaString( sText) + "'," +
|
||||||
|
RefTypeToString( nRefType) + ")" +
|
||||||
|
" -- Id=" + ToString( nId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco l'identificativo del oggetto
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|||||||
+42
-7
@@ -1091,6 +1091,44 @@ ExeCreateArc3P( int nParentId, const Point3d& ptP1,
|
|||||||
return nId ;
|
return nId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCreateArc2PB( int nParentId, const Point3d& ptStart, const Point3d& ptEnd,
|
||||||
|
double dBulge, int nRefType)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
nParentId = AdjustId( nParentId) ;
|
||||||
|
// recupero il riferimento locale
|
||||||
|
Frame3d frLoc ;
|
||||||
|
bool bOk = pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
||||||
|
// porto in locale i punti, il versore normale e quelloe estrusione
|
||||||
|
Point3d ptStartL = GetPointLocal( pGeomDB, ptStart, nRefType, frLoc) ;
|
||||||
|
Point3d ptEndL = GetPointLocal( pGeomDB, ptEnd, nRefType, frLoc) ;
|
||||||
|
Vector3d vtNormL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
|
Vector3d vtExtrL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
|
// creo l'arco (in casi particolari retta)
|
||||||
|
PtrOwner<ICurve> pCrv( bOk ? GetArc2PNB( ptStartL, ptEndL, vtNormL, dBulge) : nullptr) ;
|
||||||
|
bOk = bOk && ! IsNull( pCrv) ;
|
||||||
|
// assegno il versore estrusione
|
||||||
|
bOk = bOk && pCrv->SetExtrusion( vtExtrL) ;
|
||||||
|
// inserisco l'arco nel DB
|
||||||
|
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrv)) : GDB_ID_NULL) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtArc2PB(" + IdToString( nParentId) + ",{" +
|
||||||
|
ToString( ptStart) + "},{" +
|
||||||
|
ToString( ptEnd) + "}," +
|
||||||
|
ToString( dBulge) + "," +
|
||||||
|
RefTypeToString( nRefType) + ")" +
|
||||||
|
" -- Id=" + ToString( nId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco l'identificativo della nuova entità
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
int
|
int
|
||||||
ExeCreateArc2PD( int nParentId, const Point3d& ptStart, const Point3d& ptEnd,
|
ExeCreateArc2PD( int nParentId, const Point3d& ptStart, const Point3d& ptEnd,
|
||||||
@@ -1099,20 +1137,17 @@ ExeCreateArc2PD( int nParentId, const Point3d& ptStart, const Point3d& ptEnd,
|
|||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
nParentId = AdjustId( nParentId) ;
|
nParentId = AdjustId( nParentId) ;
|
||||||
// creo l'arco (in casi particolari retta)
|
|
||||||
PtrOwner<ICurve> pCrv ;
|
|
||||||
bool bOk = true ;
|
|
||||||
// recupero il riferimento locale
|
// recupero il riferimento locale
|
||||||
Frame3d frLoc ;
|
Frame3d frLoc ;
|
||||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
bool bOk = pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
||||||
// porto in locale i punti, il versore iniziale, quello normale e il versore estrusione
|
// porto in locale i punti, il versore iniziale, quello normale e il versore estrusione
|
||||||
Point3d ptStartL = GetPointLocal( pGeomDB, ptStart, nRefType, frLoc) ;
|
Point3d ptStartL = GetPointLocal( pGeomDB, ptStart, nRefType, frLoc) ;
|
||||||
Point3d ptEndL = GetPointLocal( pGeomDB, ptEnd, nRefType, frLoc) ;
|
Point3d ptEndL = GetPointLocal( pGeomDB, ptEnd, nRefType, frLoc) ;
|
||||||
Vector3d vtDirSL = GetVectorLocal( pGeomDB, FromPolar( 1, dDirSDeg), nRefType, frLoc) ;
|
Vector3d vtDirSL = GetVectorLocal( pGeomDB, FromPolar( 1, dDirSDeg), nRefType, frLoc) ;
|
||||||
Vector3d vtNormL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
Vector3d vtNormL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
Vector3d vtExtrL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
Vector3d vtExtrL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||||
// setto l'arco
|
// creo l'arco (in casi particolari retta)
|
||||||
pCrv.Set( GetArc2PVN( ptStartL, ptEndL, vtDirSL, vtNormL)) ;
|
PtrOwner<ICurve> pCrv( bOk ? GetArc2PVN( ptStartL, ptEndL, vtDirSL, vtNormL) : nullptr) ;
|
||||||
bOk = bOk && ! IsNull( pCrv) ;
|
bOk = bOk && ! IsNull( pCrv) ;
|
||||||
// assegno il versore estrusione
|
// assegno il versore estrusione
|
||||||
bOk = bOk && pCrv->SetExtrusion( vtExtrL) ;
|
bOk = bOk && pCrv->SetExtrusion( vtExtrL) ;
|
||||||
@@ -1948,7 +1983,7 @@ ExeCreateCurveCompoByInterpolation( int nParentId, const PolyLine& PL, int nType
|
|||||||
bFound ;
|
bFound ;
|
||||||
bFound = PL.GetNextPoint( ptP))
|
bFound = PL.GetNextPoint( ptP))
|
||||||
crvByInterp.AddPoint( ptP) ;
|
crvByInterp.AddPoint( ptP) ;
|
||||||
PtrOwner<ICurve> pCrvCompo( crvByInterp.GetCurve( nMethod, nType)) ;
|
PtrOwner<ICurve> pCrvCompo( crvByInterp.GetCurve( nMethod, nCrvType)) ;
|
||||||
bOk = bOk && ! IsNull( pCrvCompo) ;
|
bOk = bOk && ! IsNull( pCrvCompo) ;
|
||||||
// assegno il versore estrusione
|
// assegno il versore estrusione
|
||||||
bOk = bOk && pCrvCompo->SetExtrusion( Z_AX) ;
|
bOk = bOk && pCrvCompo->SetExtrusion( Z_AX) ;
|
||||||
|
|||||||
@@ -1121,6 +1121,43 @@ ExeCreateSurfTmByScrewing( int nParentId, int nCrvId,
|
|||||||
return nNewId ;
|
return nNewId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCreateSurfTmRectSwept( int nParentId, double dDimH, double dDimV, double dBevelH, double dBevelV, int nGuideId, int nCapType, double dLinTol)
|
||||||
|
{
|
||||||
|
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) ;
|
||||||
|
// recupero la guida in locale
|
||||||
|
CurveLocal CrvGuide( pGeomDB, nGuideId, frLoc) ;
|
||||||
|
bOk = bOk && ( CrvGuide.Get() != nullptr) ;
|
||||||
|
// creo la superficie trimesh
|
||||||
|
ISurfTriMesh* pSTM = nullptr ;
|
||||||
|
pSTM = ( bOk ? GetSurfTriMeshRectSwept( dDimH, dDimV, dBevelH, dBevelV, CrvGuide, nCapType, dLinTol) : nullptr) ;
|
||||||
|
// inserisco la superficie trimesh nel DB
|
||||||
|
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, pSTM) : GDB_ID_NULL) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtSurfTmRectSwept(" + IdToString( nParentId) + "," +
|
||||||
|
ToString( dDimH) + "," +
|
||||||
|
ToString( dDimV) + "," +
|
||||||
|
ToString( dBevelH) + "," +
|
||||||
|
ToString( dBevelV) + "," +
|
||||||
|
ToString( nGuideId) + "," +
|
||||||
|
ToString( nCapType) + "," +
|
||||||
|
ToString( dLinTol) + ")" +
|
||||||
|
" -- Id=" + ToString( nNewId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco l'identificativo della nuova entità
|
||||||
|
return nNewId ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
int
|
int
|
||||||
ExeCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, bool bCapEnds, double dLinTol)
|
ExeCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, bool bCapEnds, double dLinTol)
|
||||||
|
|||||||
@@ -188,6 +188,8 @@ ExeCurveIsACircle( int nId, Point3d& ptCen, Vector3d& vtN, double& dRad, bool& b
|
|||||||
bCCW = ( pArc->GetAngCenter() > 0) ;
|
bCCW = ( pArc->GetAngCenter() > 0) ;
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return false ;
|
||||||
}
|
}
|
||||||
case CRV_COMPO :
|
case CRV_COMPO :
|
||||||
{ ICurveComposite* pCompo = GetCurveComposite( pGObj) ;
|
{ ICurveComposite* pCompo = GetCurveComposite( pGObj) ;
|
||||||
@@ -548,6 +550,24 @@ ExeArcNormVersor( int nId, int nRefId, Vector3d& vtNorm)
|
|||||||
return TransformVector( pGeomDB, nId, nRefId, vtNorm) ;
|
return TransformVector( pGeomDB, nId, nRefId, vtNorm) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeCurveCompoLength( int nId, int nSimpCrv, double& dLen)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
// recupero la curva composita
|
||||||
|
const ICurveComposite* pCompoCrv = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
if ( pCompoCrv == nullptr)
|
||||||
|
return false ;
|
||||||
|
// recupero la curva semplice di indice richiesto
|
||||||
|
const ICurve* pSimpCrv = pCompoCrv->GetCurve( nSimpCrv) ;
|
||||||
|
if ( pSimpCrv == nullptr)
|
||||||
|
return false ;
|
||||||
|
// recupero la sua lunghezza
|
||||||
|
return pSimpCrv->GetLength( dLen) ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeCurveCompoCenter( int nId, int nSimpCrv, int nRefId, Point3d& ptCen)
|
ExeCurveCompoCenter( int nId, int nSimpCrv, int nRefId, Point3d& ptCen)
|
||||||
|
|||||||
+95
-1
@@ -28,6 +28,7 @@
|
|||||||
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
||||||
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
||||||
#include "/EgtDev/Include/EGkSurfBezier.h"
|
#include "/EgtDev/Include/EGkSurfBezier.h"
|
||||||
|
#include "/EgtDev/Include/EGkDistPointSurfTm.h"
|
||||||
#include "/EgtDev/Include/EGkSurfLocal.h"
|
#include "/EgtDev/Include/EGkSurfLocal.h"
|
||||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||||
|
|
||||||
@@ -48,6 +49,18 @@ ExeSurfArea( int nId, double& dArea)
|
|||||||
return ( pSurf != nullptr && pSurf->GetArea( dArea)) ;
|
return ( pSurf != nullptr && pSurf->GetArea( dArea)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSurfIsClosed( int nId)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
// recupero la superficie
|
||||||
|
ISurf* pSurf = GetSurf( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
// verifico se è superficie chiusa
|
||||||
|
return ( pSurf != nullptr && pSurf->IsClosed()) ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSurfVolume( int nId, double& dVol)
|
ExeSurfVolume( int nId, double& dVol)
|
||||||
@@ -353,6 +366,20 @@ ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bo
|
|||||||
return nFirstId ;
|
return nFirstId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeSurfTmVertexCount( int nId)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, 0)
|
||||||
|
// recupero la superficie trimesh
|
||||||
|
const ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
if ( pStm == nullptr)
|
||||||
|
return 0 ;
|
||||||
|
// recupero il numero di vertici
|
||||||
|
return pStm->GetVertexCount() ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int
|
int
|
||||||
ExeSurfTmFacetCount( int nId)
|
ExeSurfTmFacetCount( int nId)
|
||||||
@@ -367,6 +394,59 @@ ExeSurfTmFacetCount( int nId)
|
|||||||
return pStm->GetFacetCount() ;
|
return pStm->GetFacetCount() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeSurfTmPartCount( int nId)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, -1)
|
||||||
|
// recupero la superficie trimesh
|
||||||
|
const ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
if ( pStm == nullptr)
|
||||||
|
return -1 ;
|
||||||
|
// recupero il numero di parti
|
||||||
|
return pStm->GetPartCount() ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSurfTmGetVertex( int nId, int nVert, int nRefId, Point3d& ptVert)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
// recupero la superficie trimesh
|
||||||
|
const ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
if ( pStm == nullptr)
|
||||||
|
return false ;
|
||||||
|
// recupero il vertice di indice dato
|
||||||
|
if ( ! pStm->GetVertex( nVert, ptVert))
|
||||||
|
return false ;
|
||||||
|
// gestione trasformazioni ( eventuali)
|
||||||
|
return TransformPoint( pGeomDB, nId, nRefId, ptVert) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSurfTmGetNearestVertex( int nId, const Point3d& ptNear, int nRefId, int& nVert, Point3d& ptVert)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
// recupero la superficie trimesh
|
||||||
|
const ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
if ( pStm == nullptr)
|
||||||
|
return false ;
|
||||||
|
// porto il punto Near nel riferimento dell'entità
|
||||||
|
Point3d ptNearL = ptNear ;
|
||||||
|
if ( ! InvTransformPoint( pGeomDB, nId, nRefId, ptNearL))
|
||||||
|
return false ;
|
||||||
|
// recupero il vertice più vicino della superficie
|
||||||
|
nVert = GetSurfTmNearestVertex( ptNearL, *pStm) ;
|
||||||
|
if ( ! pStm->GetVertex( nVert, ptVert))
|
||||||
|
return false ;
|
||||||
|
// gestione trasformazioni ( eventuali)
|
||||||
|
return TransformPoint( pGeomDB, nId, nRefId, ptVert) ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int
|
int
|
||||||
ExeSurfTmFacetFromTria( int nId, int nT)
|
ExeSurfTmFacetFromTria( int nId, int nT)
|
||||||
@@ -910,6 +990,20 @@ ExeCopySurfTmFacet( int nId, int nFacet, int nDestGrpId)
|
|||||||
return nFacId ;
|
return nFacId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSurfTmGetAllVertInFacet( int nId, int nFacet, INTVECTOR& vVert)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
// recupero la superficie TriMesh
|
||||||
|
const ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
if ( pStm == nullptr)
|
||||||
|
return false ;
|
||||||
|
// recupero l'elenco dei vertici nella faccia
|
||||||
|
return pStm->GetAllVertInFacet( nFacet, vVert) ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSurfTmGetFacetBBox( int nId, int nFacet, int nFlag, BBox3d& b3Box)
|
ExeSurfTmGetFacetBBox( int nId, int nFacet, int nFlag, BBox3d& b3Box)
|
||||||
@@ -1318,4 +1412,4 @@ ExeExtractSurfBezierLoops( int nId, int nDestGrpId, int* pnCount)
|
|||||||
if ( pnCount != nullptr)
|
if ( pnCount != nullptr)
|
||||||
*pnCount = nCount ;
|
*pnCount = nCount ;
|
||||||
return nFirstId ;
|
return nFirstId ;
|
||||||
}
|
}
|
||||||
|
|||||||
+146
-6
@@ -186,7 +186,7 @@ ExeApproxCurve( int nId, int nApprType, double dLinTol)
|
|||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
// recupero la curva
|
// recupero la curva
|
||||||
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
|
const ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
|
||||||
bool bOk = ( pCurve != nullptr) ;
|
bool bOk = ( pCurve != nullptr) ;
|
||||||
// eseguo l'approssimazione
|
// eseguo l'approssimazione
|
||||||
PtrOwner<ICurveComposite> pCC( CreateCurveComposite()) ;
|
PtrOwner<ICurveComposite> pCC( CreateCurveComposite()) ;
|
||||||
@@ -196,6 +196,8 @@ ExeApproxCurve( int nId, int nApprType, double dLinTol)
|
|||||||
nApprType == APP_RIGHT_LINES || nApprType == APP_RIGHT_CONVEX_LINES) {
|
nApprType == APP_RIGHT_LINES || nApprType == APP_RIGHT_CONVEX_LINES) {
|
||||||
PolyLine PL ;
|
PolyLine PL ;
|
||||||
bOk = bOk && pCurve->ApproxWithLines( dLinTol, ANG_TOL_MAX_DEG, nApprType, PL) && pCC->FromPolyLine( PL) ;
|
bOk = bOk && pCurve->ApproxWithLines( dLinTol, ANG_TOL_MAX_DEG, nApprType, PL) && pCC->FromPolyLine( PL) ;
|
||||||
|
// eliminazione di small Z
|
||||||
|
bOk = bOk && pCC->RemoveSmallDefects( 0.5 * dLinTol, ANG_TOL_STD_DEG) ;
|
||||||
}
|
}
|
||||||
else { // con bi-archi
|
else { // con bi-archi
|
||||||
PolyArc PA ;
|
PolyArc PA ;
|
||||||
@@ -207,8 +209,10 @@ ExeApproxCurve( int nId, int nApprType, double dLinTol)
|
|||||||
dAngTol = min( ANG_TOL_STD_DEG + 0.2 * dCoeff * ANG_TOL_STD_DEG, ANG_TOL_MAX_DEG) ;
|
dAngTol = min( ANG_TOL_STD_DEG + 0.2 * dCoeff * ANG_TOL_STD_DEG, ANG_TOL_MAX_DEG) ;
|
||||||
}
|
}
|
||||||
bOk = bOk && pCurve->ApproxWithArcsEx( dLinTol, dAngTol, dLinFea, PA) && pCC->FromPolyArc( PA) ;
|
bOk = bOk && pCurve->ApproxWithArcsEx( dLinTol, dAngTol, dLinFea, PA) && pCC->FromPolyArc( PA) ;
|
||||||
|
// eliminazione di small Z
|
||||||
|
bOk = bOk && pCC->RemoveSmallDefects( 0.5 * dLinTol, ANG_TOL_STD_DEG) ;
|
||||||
// merge di archi identici di biarchi
|
// merge di archi identici di biarchi
|
||||||
bOk = bOk && pCC->MergeCurves( 0.5 * dLinTol, dAngTol) ;
|
bOk = bOk && pCC->MergeCurves( 0.5 * dLinTol, ANG_TOL_STD_DEG) ;
|
||||||
}
|
}
|
||||||
// copio estrusione e spessore
|
// copio estrusione e spessore
|
||||||
Vector3d vtExtr ;
|
Vector3d vtExtr ;
|
||||||
@@ -288,9 +292,9 @@ ExeChangeClosedCurveStart( int nId, double dU)
|
|||||||
bOk = bOk && ( pCurve != nullptr) ;
|
bOk = bOk && ( pCurve != nullptr) ;
|
||||||
// cambio il punto iniziale
|
// cambio il punto iniziale
|
||||||
if ( bOk && pCurve->GetType() == CRV_ARC)
|
if ( bOk && pCurve->GetType() == CRV_ARC)
|
||||||
bOk = bOk && dynamic_cast<ICurveArc*>(pCurve)->ChangeStartPoint(dU) ;
|
bOk = bOk && GetCurveArc( pCurve)->ChangeStartPoint(dU) ;
|
||||||
else if ( bOk && pCurve->GetType() == CRV_COMPO)
|
else if ( bOk && pCurve->GetType() == CRV_COMPO)
|
||||||
bOk = bOk && dynamic_cast<ICurveComposite*>(pCurve)->ChangeStartPoint(dU) ;
|
bOk = bOk && GetCurveComposite( pCurve)->ChangeStartPoint(dU) ;
|
||||||
else
|
else
|
||||||
bOk = false ;
|
bOk = false ;
|
||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
@@ -327,9 +331,9 @@ ExeChangeClosedCurveStartPoint( int nId, const Point3d& ptP, int nRefType)
|
|||||||
bOk = bOk && distPC.GetParamAtMinDistPoint( 0, dPar, nFlag) ;
|
bOk = bOk && distPC.GetParamAtMinDistPoint( 0, dPar, nFlag) ;
|
||||||
// cambio il punto iniziale
|
// cambio il punto iniziale
|
||||||
if ( bOk && pCurve->GetType() == CRV_ARC)
|
if ( bOk && pCurve->GetType() == CRV_ARC)
|
||||||
bOk = bOk && dynamic_cast<ICurveArc*>(pCurve)->ChangeStartPoint(dPar) ;
|
bOk = bOk && GetCurveArc(pCurve)->ChangeStartPoint(dPar) ;
|
||||||
else if ( bOk && pCurve->GetType() == CRV_COMPO)
|
else if ( bOk && pCurve->GetType() == CRV_COMPO)
|
||||||
bOk = bOk && dynamic_cast<ICurveComposite*>(pCurve)->ChangeStartPoint(dPar) ;
|
bOk = bOk && GetCurveComposite( pCurve)->ChangeStartPoint(dPar) ;
|
||||||
else
|
else
|
||||||
bOk = false ;
|
bOk = false ;
|
||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
@@ -405,6 +409,142 @@ ExeModifyCurveEndPoint( int nId, const Point3d& ptP, int nRefType)
|
|||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSpiralizeCurveAlongExtrusion( int nId, double dDelta)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
bool bOk = true ;
|
||||||
|
// recupero la curva
|
||||||
|
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
bOk = bOk && ( pCurve != nullptr) ;
|
||||||
|
|
||||||
|
Vector3d vtExtr ;
|
||||||
|
bOk = bOk && pCurve->GetExtrusion( vtExtr) ;
|
||||||
|
Point3d ptEnd ;
|
||||||
|
bOk = bOk && pCurve->GetEndPoint( ptEnd) ;
|
||||||
|
|
||||||
|
// se linea o arco
|
||||||
|
if ( bOk && ( pCurve->GetType() == CRV_LINE || pCurve->GetType() == CRV_ARC))
|
||||||
|
bOk = bOk && pCurve->ModifyEnd( ptEnd + dDelta * vtExtr) ;
|
||||||
|
// se composita il delta va ripartito su tutte le sottocurve
|
||||||
|
else if ( bOk && pCurve->GetType() == CRV_COMPO) {
|
||||||
|
|
||||||
|
ICurveComposite* pCompo = GetCurveComposite( pCurve) ;
|
||||||
|
double dLen ;
|
||||||
|
bOk = bOk && pCompo->GetLength( dLen) ;
|
||||||
|
|
||||||
|
// calcolo il delta di ogni sottocurva
|
||||||
|
DBLVECTOR vdDelta( pCompo->GetCurveCount() - 1) ;
|
||||||
|
for ( int i = 1 ; bOk && i < pCompo->GetCurveCount() ; i ++) {
|
||||||
|
double dLenU ;
|
||||||
|
pCompo->GetLengthAtParam( i, dLenU) ;
|
||||||
|
vdDelta[i-1] = dDelta * dLenU / dLen ;
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( int i = 1 ; bOk && i < pCompo->GetCurveCount() ; i ++) {
|
||||||
|
Point3d ptJoint ;
|
||||||
|
pCompo->GetPointD1D2( i, ICurve::FROM_MINUS, ptJoint) ;
|
||||||
|
ptJoint += vtExtr * vdDelta[i-1] ;
|
||||||
|
pCompo->ModifyJoint( i, ptJoint) ;
|
||||||
|
}
|
||||||
|
// ultimo punto
|
||||||
|
bOk = bOk && pCompo->ModifyEnd( ptEnd + dDelta * vtExtr) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExeSetModified() ;
|
||||||
|
|
||||||
|
// restituisco il risultato
|
||||||
|
return bOk ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSpiralizeCurveAlongGuide( int nCrvId, int nGuideId, double dLinTol)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
bool bOk = true ;
|
||||||
|
|
||||||
|
// recupero la curva e il suo riferimento
|
||||||
|
ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( nCrvId)) ;
|
||||||
|
bOk = bOk && ( pCrv != nullptr) ;
|
||||||
|
Frame3d frCrv ;
|
||||||
|
bOk = bOk && pGeomDB->GetGlobFrame( nCrvId, frCrv) ;
|
||||||
|
|
||||||
|
// recupero la curva guida e il suo riferimento
|
||||||
|
const ICurve * pCrvGuide = GetCurve( pGeomDB->GetGeoObj( nGuideId)) ;
|
||||||
|
bOk = bOk && ( pCrvGuide != nullptr) ;
|
||||||
|
Frame3d frGuide ;
|
||||||
|
bOk = bOk && pGeomDB->GetGlobFrame( nGuideId, frGuide) ;
|
||||||
|
|
||||||
|
// approssimo le curve con polylines
|
||||||
|
PolyLine PL1, PL2 ;
|
||||||
|
bOk = bOk && pCrv->ApproxWithLines( dLinTol, ANG_TOL_STD_DEG, APP_SPECIAL_LINES, PL1) ;
|
||||||
|
bOk = bOk && pCrvGuide->ApproxWithLines( dLinTol, ANG_TOL_STD_DEG, APP_SPECIAL_LINES, PL2) ;
|
||||||
|
// porto la polyline della curva guida nel riferimento locale
|
||||||
|
bOk = bOk && PL2.LocToLoc( frGuide, frCrv) ;
|
||||||
|
|
||||||
|
// modifico PL2 per gestire eventuali punti di intersezione
|
||||||
|
PtrOwner<ICurveComposite> pCompoGuide( CreateCurveComposite()) ;
|
||||||
|
bOk = bOk && ( ! IsNull( pCompoGuide)) ;
|
||||||
|
bOk = bOk && pCompoGuide->FromPolyLine( PL2) ;
|
||||||
|
Point3d ptP1 ;
|
||||||
|
bool bFound = bOk && PL1.GetFirstPoint( ptP1) ;
|
||||||
|
while ( bOk && bFound) {
|
||||||
|
double dAddPar ;
|
||||||
|
if ( bOk && pCompoGuide->GetParamAtPoint( ptP1, dAddPar, 100 * EPS_SMALL))
|
||||||
|
bOk = bOk && pCompoGuide->AddJoint( dAddPar) ;
|
||||||
|
bFound = PL1.GetNextPoint( ptP1) ;
|
||||||
|
}
|
||||||
|
bOk = bOk && pCompoGuide->ApproxWithLines( dLinTol, ANG_TOL_STD_DEG, APP_SPECIAL_LINES, PL2) ;
|
||||||
|
|
||||||
|
// associo i punti a minima distanza delle polylines
|
||||||
|
PNTIVECTOR vPnt1, vPnt2 ;
|
||||||
|
bool bTmp ;
|
||||||
|
bOk = bOk && AssociatePolyLinesMinDistPoints( PL1, PL2, vPnt1, vPnt2, bTmp) ;
|
||||||
|
|
||||||
|
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
|
||||||
|
bOk = bOk && ! IsNull( pCompo) ;
|
||||||
|
|
||||||
|
double dLenTot ;
|
||||||
|
Point3d ptOld ;
|
||||||
|
if ( bOk)
|
||||||
|
ptOld = vPnt2[0].first ;
|
||||||
|
bOk = bOk && pCrv->GetLength( dLenTot) ;
|
||||||
|
bOk = bOk && pCompo->AddPoint( vPnt2[0].first) ;
|
||||||
|
for ( int i = 1 ; bOk && i < ( int)vPnt1.size() - 1 ; i++) {
|
||||||
|
double dPar ;
|
||||||
|
bOk = bOk && pCrv->GetParamAtPoint( vPnt1[i].first, dPar) ;
|
||||||
|
double dLen = 0 ;
|
||||||
|
bOk = bOk && pCrv-> GetLengthAtParam( dPar, dLen) ;
|
||||||
|
// calcolo il nuovo punto per la curva
|
||||||
|
Point3d ptNew = Media( vPnt2[ vPnt1[i].second].first, vPnt1[i].first, dLen / dLenTot) ;
|
||||||
|
if ( ! AreSamePointApprox( ptOld, ptNew)) {
|
||||||
|
bOk = bOk && pCompo->AddLine( ptNew) ;
|
||||||
|
ptOld = ptNew ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( bOk && ! AreSamePointApprox( ptOld, vPnt1.back().first))
|
||||||
|
bOk = bOk && pCompo->AddLine( vPnt1.back().first) ;
|
||||||
|
|
||||||
|
// copio estrusione e spessore
|
||||||
|
Vector3d vtExtr ;
|
||||||
|
if ( bOk && pCrv->GetExtrusion( vtExtr))
|
||||||
|
pCompo->SetExtrusion( vtExtr) ;
|
||||||
|
double dThick ;
|
||||||
|
if ( bOk && pCrv->GetThickness( dThick))
|
||||||
|
pCompo->SetThickness(dThick) ;
|
||||||
|
// sostituisco la vecchia curva con la nuova
|
||||||
|
bOk = bOk && pGeomDB->ReplaceGeoObj( nCrvId, Release( pCompo)) ;
|
||||||
|
|
||||||
|
ExeSetModified() ;
|
||||||
|
|
||||||
|
// restituisco il risultato
|
||||||
|
return bOk ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static bool
|
static bool
|
||||||
ModifyOneCurveExtrusion( IGeomDB* pGeomDB, int nId, const Vector3d& vtExtr, int nRefType)
|
ModifyOneCurveExtrusion( IGeomDB* pGeomDB, int nId, const Vector3d& vtExtr, int nRefType)
|
||||||
|
|||||||
+164
-16
@@ -24,6 +24,7 @@
|
|||||||
#include "/EgtDev/Include/EGkCurveLocal.h"
|
#include "/EgtDev/Include/EGkCurveLocal.h"
|
||||||
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
||||||
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
||||||
|
#include "/EgtDev/Include/EGkSurfBezier.h"
|
||||||
#include "/EgtDev/Include/EGkSurfLocal.h"
|
#include "/EgtDev/Include/EGkSurfLocal.h"
|
||||||
#include "/EgtDev/Include/EGkStmFromTriangleSoup.h"
|
#include "/EgtDev/Include/EGkStmFromTriangleSoup.h"
|
||||||
#include "/EgtDev/Include/EGkCAvSimpleSurfFrMove.h"
|
#include "/EgtDev/Include/EGkCAvSimpleSurfFrMove.h"
|
||||||
@@ -204,12 +205,54 @@ ExeExplodeSurface( int nId, int* pnCount)
|
|||||||
return nFirstId ;
|
return nFirstId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeApproxSurface( int nId, double dLinTol)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
// opero secondo il tipo di superficie
|
||||||
|
PtrOwner<ISurfTriMesh> pStm ;
|
||||||
|
int nType = pGeomDB->GetGeoType( nId) ;
|
||||||
|
if ( nType == SRF_TRIMESH) {
|
||||||
|
// copio la superficie
|
||||||
|
const ISurfTriMesh* pStri = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
pStm.Set( pStri != nullptr ? pStri->Clone() : nullptr) ;
|
||||||
|
}
|
||||||
|
else if ( nType == SRF_FLATRGN) {
|
||||||
|
// recupero la superficie ausiliaria della regione
|
||||||
|
const ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
const ISurfTriMesh* pAuxSurf = ( pSfr != nullptr ? pSfr->GetAuxSurf() : nullptr) ;
|
||||||
|
pStm.Set( pAuxSurf != nullptr ? pAuxSurf->Clone() : nullptr) ;
|
||||||
|
}
|
||||||
|
else if ( nType == SRF_BEZIER) {
|
||||||
|
// recupero la superficie ausiliaria della Bezier
|
||||||
|
const ISurfBezier* pSbez = GetSurfBezier( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
const ISurfTriMesh* pAuxSurf = ( pSbez != nullptr ? pSbez->GetAuxSurf() : nullptr) ;
|
||||||
|
pStm.Set( pAuxSurf != nullptr ? pAuxSurf->Clone() : nullptr) ;
|
||||||
|
}
|
||||||
|
bool bOk = ( ! IsNull( pStm)) ;
|
||||||
|
// semplificazione della trimesh
|
||||||
|
bOk = bOk && pStm->DoCompacting( dLinTol) ;
|
||||||
|
// sostituisco la vecchia superficie con la nuova
|
||||||
|
bOk = bOk && pGeomDB->ReplaceGeoObj( nId, Release( pStm)) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtApproxSurf(" + ToString( nId) + "," +
|
||||||
|
ToString( dLinTol) + ")" +
|
||||||
|
" -- Ok=" + ToString( bOk) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
return bOk ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSurfFrAdd( int nId1, int nId2)
|
ExeSurfFrAdd( int nId1, int nId2)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la prima superficie FlatRegion
|
// recupero la prima superficie FlatRegion
|
||||||
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
||||||
bool bOk = ( pSfr1 != nullptr) ;
|
bool bOk = ( pSfr1 != nullptr) ;
|
||||||
@@ -238,7 +281,7 @@ bool
|
|||||||
ExeSurfFrSubtract( int nId1, int nId2)
|
ExeSurfFrSubtract( int nId1, int nId2)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la prima superficie FlatRegion
|
// recupero la prima superficie FlatRegion
|
||||||
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
||||||
bool bOk = ( pSfr1 != nullptr) ;
|
bool bOk = ( pSfr1 != nullptr) ;
|
||||||
@@ -270,7 +313,7 @@ bool
|
|||||||
ExeSurfFrIntersect( int nId1, int nId2)
|
ExeSurfFrIntersect( int nId1, int nId2)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la prima superficie FlatRegion
|
// recupero la prima superficie FlatRegion
|
||||||
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
||||||
bool bOk = ( pSfr1 != nullptr) ;
|
bool bOk = ( pSfr1 != nullptr) ;
|
||||||
@@ -302,7 +345,7 @@ bool
|
|||||||
ExeSurfFrOffset( int nId, double dDist, int nType)
|
ExeSurfFrOffset( int nId, double dDist, int nType)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la superficie FlatRegion
|
// recupero la superficie FlatRegion
|
||||||
ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId)) ;
|
ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId)) ;
|
||||||
bool bOk = ( pSfr != nullptr) ;
|
bool bOk = ( pSfr != nullptr) ;
|
||||||
@@ -328,7 +371,7 @@ bool
|
|||||||
ExeSurfFrMoveSimpleNoCollision( int nId1, int nId2, const Vector3d& vtDir, double& dLen, int nRefType)
|
ExeSurfFrMoveSimpleNoCollision( int nId1, int nId2, const Vector3d& vtDir, double& dLen, int nRefType)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la prima superficie FlatRegion
|
// recupero la prima superficie FlatRegion
|
||||||
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
||||||
bool bOk = ( pSfr1 != nullptr) ;
|
bool bOk = ( pSfr1 != nullptr) ;
|
||||||
@@ -350,7 +393,7 @@ bool
|
|||||||
ExeSurfFrRotateSimpleNoCollision( int nId1, int nId2, const Point3d& ptCen, double& dAngDeg, int nRefType)
|
ExeSurfFrRotateSimpleNoCollision( int nId1, int nId2, const Point3d& ptCen, double& dAngDeg, int nRefType)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la prima superficie FlatRegion
|
// recupero la prima superficie FlatRegion
|
||||||
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
ISurfFlatRegion* pSfr1 = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId1)) ;
|
||||||
bool bOk = ( pSfr1 != nullptr) ;
|
bool bOk = ( pSfr1 != nullptr) ;
|
||||||
@@ -367,6 +410,111 @@ ExeSurfFrRotateSimpleNoCollision( int nId1, int nId2, const Point3d& ptCen, doub
|
|||||||
return ( bOk && CAvSimpleSurfFrMove( *pSfr1, *pSfr2L).Rotate(ptCenL, dAngDeg)) ;
|
return ( bOk && CAvSimpleSurfFrMove( *pSfr1, *pSfr2L).Rotate(ptCenL, dAngDeg)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSurfTmMoveVertex( int nId, int nVert, const Point3d& ptNewVert, int nRefType, bool bUpdate)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
// recupero la superficie
|
||||||
|
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
bool bOk = ( pStm != nullptr) ;
|
||||||
|
// recupero il riferimento in cui è immersa la superficie
|
||||||
|
Frame3d frStm ;
|
||||||
|
bOk = bOk && pGeomDB->GetGlobFrame( nId, frStm) ;
|
||||||
|
// eseguo la modifica
|
||||||
|
if ( bOk) {
|
||||||
|
// porto il nuovo vertice nel riferimento della superficie
|
||||||
|
Point3d ptNewVertL = GetPointLocal( pGeomDB, ptNewVert, nRefType, frStm) ;
|
||||||
|
// eseguo la modifica
|
||||||
|
bOk = pStm->MoveVertex( nVert, ptNewVertL) ;
|
||||||
|
// se richiesto, semplificazione della trimesh
|
||||||
|
if ( bUpdate)
|
||||||
|
bOk = bOk && pStm->DoCompacting() ;
|
||||||
|
}
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtSurfTmMoveVertex(" + IdToString( nId) + "," +
|
||||||
|
ToString( nVert) + ",{" +
|
||||||
|
ToString( ptNewVert) + "}," +
|
||||||
|
RefTypeToString( nRefType) + "," +
|
||||||
|
( bUpdate ? "true" : "false") + ")" +
|
||||||
|
" -- Ok=" + ToString( bOk) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco risultato
|
||||||
|
return bOk ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
MySurfTmToTriangles( int nId, int& nCount)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
// recupero la superficie TriMesh
|
||||||
|
const ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
|
if ( pStm == nullptr)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// recupero il numero di triangoli
|
||||||
|
int nTria = pStm->GetTriangleCount() ;
|
||||||
|
// se ci sono più triangoli, li separo
|
||||||
|
if ( nTria > 1) {
|
||||||
|
// copio tutti triangoli
|
||||||
|
int nFirstId = GDB_ID_NULL ;
|
||||||
|
nCount = 0 ;
|
||||||
|
for ( int i = 0 ; i < pStm->GetTriangleSize() ; ++ i) {
|
||||||
|
ISurfTriMesh* pFac = pStm->CloneTriangle( i) ;
|
||||||
|
if ( pFac == nullptr)
|
||||||
|
continue ;
|
||||||
|
// inserisco la superficie nello stesso gruppo e nello stesso posto del GeomDB
|
||||||
|
int nNewId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nId, GDB_BEFORE, pFac) ;
|
||||||
|
if ( nNewId == GDB_ID_NULL)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// copio gli attributi
|
||||||
|
if ( ! pGeomDB->CopyAttributes( nId, nNewId))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// aggiorno contatori
|
||||||
|
if ( nFirstId == GDB_ID_NULL)
|
||||||
|
nFirstId = nNewId ;
|
||||||
|
++ nCount ;
|
||||||
|
}
|
||||||
|
// elimino la superficie originale
|
||||||
|
pGeomDB->Erase( nId) ;
|
||||||
|
// restituisco risultati
|
||||||
|
return nFirstId ;
|
||||||
|
}
|
||||||
|
// non devo fare alcunché
|
||||||
|
nCount = 1 ;
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeSurfTmToTriangles( int nId, int* pnCount)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
// verifico sia una superficie trimesh
|
||||||
|
int nFirstId = GDB_ID_NULL ;
|
||||||
|
int nCount = 0 ;
|
||||||
|
if ( pGeomDB->GetGeoType( nId) == SRF_TRIMESH) {
|
||||||
|
nFirstId = MySurfTmToTriangles( nId, nCount) ;
|
||||||
|
}
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtSurfTmToTriangles(" + IdToString( nId) + ")" +
|
||||||
|
" -- Id1=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco risultati
|
||||||
|
if ( pnCount != nullptr)
|
||||||
|
*pnCount = nCount ;
|
||||||
|
return nFirstId ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSurfTmRemoveFacet( int nId, int nFacet)
|
ExeSurfTmRemoveFacet( int nId, int nFacet)
|
||||||
@@ -381,7 +529,7 @@ ExeSurfTmRemoveFacet( int nId, int nFacet)
|
|||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
string sLua = "EgtSurfTmRemoveFacet(" + ToString( nId) + "," +
|
string sLua = "EgtSurfTmRemoveFacet(" + IdToString( nId) + "," +
|
||||||
ToString( nFacet) + ")" +
|
ToString( nFacet) + ")" +
|
||||||
" -- Ok=" + ToString( bOk) ;
|
" -- Ok=" + ToString( bOk) ;
|
||||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
@@ -404,7 +552,7 @@ ExeSurfTmSwapFacets( int nId, int nFacet1, int nFacet2)
|
|||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
string sLua = "EgtSurfTmSwapFacets(" + ToString( nId) + "," +
|
string sLua = "EgtSurfTmSwapFacets(" + IdToString( nId) + "," +
|
||||||
ToString( nFacet1) + "," +
|
ToString( nFacet1) + "," +
|
||||||
ToString( nFacet2) + ")" +
|
ToString( nFacet2) + ")" +
|
||||||
" -- Ok=" + ToString( bOk) ;
|
" -- Ok=" + ToString( bOk) ;
|
||||||
@@ -428,7 +576,7 @@ ExeSurfTmRemovePart( int nId, int nPart)
|
|||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
string sLua = "EgtSurfTmRemovePart(" + ToString( nId) + "," +
|
string sLua = "EgtSurfTmRemovePart(" + IdToString( nId) + "," +
|
||||||
ToString( nPart) + ")" +
|
ToString( nPart) + ")" +
|
||||||
" -- Ok=" + ToString( bOk) ;
|
" -- Ok=" + ToString( bOk) ;
|
||||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
@@ -442,7 +590,7 @@ bool
|
|||||||
ExeCutSurfTmPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, bool bSaveOnEq, int nRefType)
|
ExeCutSurfTmPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, bool bSaveOnEq, int nRefType)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la superficie TriMesh
|
// recupero la superficie TriMesh
|
||||||
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
bool bOk = ( pStm != nullptr) ;
|
bool bOk = ( pStm != nullptr) ;
|
||||||
@@ -460,7 +608,7 @@ ExeCutSurfTmPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, bool bSave
|
|||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
string sLua = "EgtCutSurfTmPlane(" + ToString( nId) + ",{" +
|
string sLua = "EgtCutSurfTmPlane(" + IdToString( nId) + ",{" +
|
||||||
ToString( ptOn) + "},{" +
|
ToString( ptOn) + "},{" +
|
||||||
ToString( vtN) + "}," +
|
ToString( vtN) + "}," +
|
||||||
( bSaveOnEq ? "true" : "false") + "," +
|
( bSaveOnEq ? "true" : "false") + "," +
|
||||||
@@ -477,7 +625,7 @@ bool
|
|||||||
ExeCutSurfTmClosedCurve( int nSurfId, int nCurveId, bool bSaveOnEq)
|
ExeCutSurfTmClosedCurve( int nSurfId, int nCurveId, bool bSaveOnEq)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la superficie TriMesh
|
// recupero la superficie TriMesh
|
||||||
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nSurfId)) ;
|
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nSurfId)) ;
|
||||||
bool bOk = ( pStm != nullptr) ;
|
bool bOk = ( pStm != nullptr) ;
|
||||||
@@ -507,7 +655,7 @@ bool
|
|||||||
ExeSurfTmAdd( int nId1, int nId2, bool bTwoColors)
|
ExeSurfTmAdd( int nId1, int nId2, bool bTwoColors)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la prima superficie TriMesh
|
// recupero la prima superficie TriMesh
|
||||||
ISurfTriMesh* pStm1 = GetSurfTriMesh( pGeomDB->GetGeoObj( nId1)) ;
|
ISurfTriMesh* pStm1 = GetSurfTriMesh( pGeomDB->GetGeoObj( nId1)) ;
|
||||||
bool bOk = ( pStm1 != nullptr) ;
|
bool bOk = ( pStm1 != nullptr) ;
|
||||||
@@ -539,7 +687,7 @@ bool
|
|||||||
ExeSurfTmSubtract( int nId1, int nId2, bool bTwoColors)
|
ExeSurfTmSubtract( int nId1, int nId2, bool bTwoColors)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la prima superficie TriMesh
|
// recupero la prima superficie TriMesh
|
||||||
ISurfTriMesh* pStm1 = GetSurfTriMesh( pGeomDB->GetGeoObj( nId1)) ;
|
ISurfTriMesh* pStm1 = GetSurfTriMesh( pGeomDB->GetGeoObj( nId1)) ;
|
||||||
bool bOk = ( pStm1 != nullptr) ;
|
bool bOk = ( pStm1 != nullptr) ;
|
||||||
@@ -576,7 +724,7 @@ bool
|
|||||||
ExeSurfTmIntersect( int nId1, int nId2, bool bTwoColors)
|
ExeSurfTmIntersect( int nId1, int nId2, bool bTwoColors)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la prima superficie TriMesh
|
// recupero la prima superficie TriMesh
|
||||||
ISurfTriMesh* pStm1 = GetSurfTriMesh( pGeomDB->GetGeoObj( nId1)) ;
|
ISurfTriMesh* pStm1 = GetSurfTriMesh( pGeomDB->GetGeoObj( nId1)) ;
|
||||||
bool bOk = ( pStm1 != nullptr) ;
|
bool bOk = ( pStm1 != nullptr) ;
|
||||||
@@ -613,7 +761,7 @@ bool
|
|||||||
ExeSurfTmResetTwoColors( int nId)
|
ExeSurfTmResetTwoColors( int nId)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// recupero la superficie TriMesh
|
// recupero la superficie TriMesh
|
||||||
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||||
bool bOk = ( pStm != nullptr) ;
|
bool bOk = ( pStm != nullptr) ;
|
||||||
|
|||||||
+16
-16
@@ -144,7 +144,7 @@ ExeRemoveVolZmapPart( int nId, int nPart)
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeVolZmapSetStdTool( const INTVECTOR& vIds, const string& sToolName,
|
ExeVolZmapSetStdTool( const INTVECTOR& vIds, const string& sToolName,
|
||||||
double dLen, double dDiam, double dCornR, double dCutterH, int nFlag)
|
double dLen, double dDiam, double dCornR, double dCutterH, int nFlag, bool bFirst)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -152,7 +152,7 @@ ExeVolZmapSetStdTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
||||||
bOk = ( pVZM != nullptr && pVZM->SetStdTool( sToolName, dLen, 0.5 * dDiam, dCornR, dCutterH, nFlag)) && bOk ;
|
bOk = ( pVZM != nullptr && pVZM->SetStdTool( sToolName, dLen, 0.5 * dDiam, dCornR, dCutterH, nFlag, bFirst)) && bOk ;
|
||||||
}
|
}
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -173,7 +173,7 @@ ExeVolZmapSetStdTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeVolZmapSetAdvTool( const INTVECTOR& vIds, const string& sToolName,
|
ExeVolZmapSetAdvTool( const INTVECTOR& vIds, const string& sToolName,
|
||||||
double dLen, double dDiam, double dTipLen, double dTipDiam, double dCornR, double dCutterH, int nFlag)
|
double dLen, double dDiam, double dTipLen, double dTipDiam, double dCornR, double dCutterH, int nFlag, bool bFirst)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -181,7 +181,7 @@ ExeVolZmapSetAdvTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
||||||
bOk = ( pVZM != nullptr && pVZM->SetAdvTool( sToolName, dLen, dDiam / 2, dTipLen, dTipDiam / 2, dCornR, dCutterH, nFlag)) && bOk ;
|
bOk = ( pVZM != nullptr && pVZM->SetAdvTool( sToolName, dLen, dDiam / 2, dTipLen, dTipDiam / 2, dCornR, dCutterH, nFlag, bFirst)) && bOk ;
|
||||||
}
|
}
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -204,7 +204,7 @@ ExeVolZmapSetAdvTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeVolZmapSetSawTool( const INTVECTOR& vIds, const string& sToolName,
|
ExeVolZmapSetSawTool( const INTVECTOR& vIds, const string& sToolName,
|
||||||
double dLen, double dDiam, double dThick, double dStemDiam, double dCornR, int nFlag)
|
double dLen, double dDiam, double dThick, double dStemDiam, double dCornR, int nFlag, bool bFirst)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -212,7 +212,7 @@ ExeVolZmapSetSawTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
||||||
bOk = ( pVZM != nullptr && pVZM->SetSawTool( sToolName, dLen, dDiam / 2, dThick, dStemDiam / 2, dCornR, nFlag)) && bOk ;
|
bOk = ( pVZM != nullptr && pVZM->SetSawTool( sToolName, dLen, dDiam / 2, dThick, dStemDiam / 2, dCornR, nFlag, bFirst)) && bOk ;
|
||||||
}
|
}
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -233,7 +233,7 @@ ExeVolZmapSetSawTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeVolZmapSetGenTool( const INTVECTOR& vIds, const string& sToolName, int nToolSectId, int nFlag)
|
ExeVolZmapSetGenTool( const INTVECTOR& vIds, const string& sToolName, int nToolSectId, int nFlag, bool bFirst)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -243,7 +243,7 @@ ExeVolZmapSetGenTool( const INTVECTOR& vIds, const string& sToolName, int nToolS
|
|||||||
// recupero gli Zmap e assegno i dati dell'utensile
|
// recupero gli Zmap e assegno i dati dell'utensile
|
||||||
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
||||||
bOk = ( pVZM != nullptr && pVZM->SetGenTool( sToolName, pCC, nFlag) && bOk) ;
|
bOk = ( pVZM != nullptr && pVZM->SetGenTool( sToolName, pCC, nFlag, bFirst) && bOk) ;
|
||||||
}
|
}
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -261,7 +261,7 @@ ExeVolZmapSetGenTool( const INTVECTOR& vIds, const string& sToolName, int nToolS
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeVolZmapSetMortiserTool( const INTVECTOR& vIds, const string& sToolName,
|
ExeVolZmapSetMortiserTool( const INTVECTOR& vIds, const string& sToolName,
|
||||||
double dLen, double dWidth, double dThick, double dCornR, int nFlag)
|
double dLen, double dWidth, double dThick, double dCornR, int nFlag, bool bFirst)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -269,7 +269,7 @@ ExeVolZmapSetMortiserTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
||||||
bOk = ( pVZM != nullptr && pVZM->SetMortiserTool( sToolName, dLen, dWidth, dThick, dCornR, nFlag) && bOk) ;
|
bOk = ( pVZM != nullptr && pVZM->SetMortiserTool( sToolName, dLen, dWidth, dThick, dCornR, nFlag, bFirst) && bOk) ;
|
||||||
}
|
}
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -290,7 +290,7 @@ ExeVolZmapSetMortiserTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeVolZmapSetChiselTool( const INTVECTOR& vIds, const string& sToolName,
|
ExeVolZmapSetChiselTool( const INTVECTOR& vIds, const string& sToolName,
|
||||||
double dLen, double dWidth, double dThick, int nFlag)
|
double dLen, double dWidth, double dThick, int nFlag, bool bFirst)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -298,7 +298,7 @@ ExeVolZmapSetChiselTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
||||||
bOk = ( pVZM != nullptr && pVZM->SetChiselTool( sToolName, dLen, dWidth, dThick, nFlag) && bOk) ;
|
bOk = ( pVZM != nullptr && pVZM->SetChiselTool( sToolName, dLen, dWidth, dThick, nFlag, bFirst) && bOk) ;
|
||||||
}
|
}
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -317,7 +317,7 @@ ExeVolZmapSetChiselTool( const INTVECTOR& vIds, const string& sToolName,
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeVolZmapResetTool( const INTVECTOR& vIds)
|
ExeVolZmapResetTools( const INTVECTOR& vIds)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
@@ -325,7 +325,7 @@ ExeVolZmapResetTool( const INTVECTOR& vIds)
|
|||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
for ( int i = 0 ; i < int( vIds.size()) ; ++ i) {
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( vIds[i])) ;
|
||||||
bOk = ( pVZM != nullptr && pVZM->ResetTool() && bOk) ;
|
bOk = ( pVZM != nullptr && pVZM->ResetTools() && bOk) ;
|
||||||
}
|
}
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -397,7 +397,7 @@ ExeVolZmapMillingStep( int nId, const Point3d& ptPs, const Vector3d& vtDs,
|
|||||||
Vector3d vtDeL = GetVectorLocal( pGeomDB, vtDe, nRefType, frLoc) ;
|
Vector3d vtDeL = GetVectorLocal( pGeomDB, vtDe, nRefType, frLoc) ;
|
||||||
// recupero lo Zmap e eseguo movimento di fresatura con l'utensile già associato
|
// recupero lo Zmap e eseguo movimento di fresatura con l'utensile già associato
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||||
bOk = bOk && ( pVZM != nullptr && pVZM->MillingStep( ptPsL, vtDsL, ptPeL, vtDeL)) ;
|
bOk = bOk && ( pVZM != nullptr && pVZM->MillingStep( 0, ptPsL, vtDsL, ptPeL, vtDeL)) ;
|
||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
@@ -433,7 +433,7 @@ ExeVolZmapMillingStep( int nId, const Point3d& ptPs, const Vector3d& vtDs, const
|
|||||||
Vector3d vtAeL = GetVectorLocal( pGeomDB, vtAe, nRefType, frLoc) ;
|
Vector3d vtAeL = GetVectorLocal( pGeomDB, vtAe, nRefType, frLoc) ;
|
||||||
// recupero lo Zmap e eseguo movimento di fresatura con l'utensile già associato
|
// recupero lo Zmap e eseguo movimento di fresatura con l'utensile già associato
|
||||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||||
bOk = bOk && ( pVZM != nullptr && pVZM->MillingStep( ptPsL, vtDsL, vtAsL, ptPeL, vtDeL, vtAeL)) ;
|
bOk = bOk && ( pVZM != nullptr && pVZM->MillingStep( 0, ptPsL, vtDsL, vtAsL, ptPeL, vtDeL, vtAeL)) ;
|
||||||
ExeSetModified() ;
|
ExeSetModified() ;
|
||||||
// se richiesto, salvo il comando Lua equivalente
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
if ( IsCmdLog()) {
|
if ( IsCmdLog()) {
|
||||||
|
|||||||
@@ -746,6 +746,16 @@ ExeRemoveInfo( int nId, const string& sKey)
|
|||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeGetAllInfo( int nId, STRVECTOR& vsInfo)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
|
// recupero tutte le info
|
||||||
|
return pGeomDB->GetAllInfo( nId, vsInfo) ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSetTextureName( int nId, const string& sTxrName)
|
ExeSetTextureName( int nId, const string& sTxrName)
|
||||||
|
|||||||
@@ -594,6 +594,8 @@ ExeGeoObjDump( int nId, string& sDump)
|
|||||||
sDump = pGeoObj->GetTitle() + " " + ToString( nId) + "\r\n" ;
|
sDump = pGeoObj->GetTitle() + " " + ToString( nId) + "\r\n" ;
|
||||||
// preparo gli attributi
|
// preparo gli attributi
|
||||||
pGeomDB->DumpAttributes( nId, sDump, bMM, "\r\n") ;
|
pGeomDB->DumpAttributes( nId, sDump, bMM, "\r\n") ;
|
||||||
|
// preparo stipple
|
||||||
|
pGeomDB->DumpStipple( nId, sDump, bMM, "\r\n") ;
|
||||||
// preparo TextureData
|
// preparo TextureData
|
||||||
pGeomDB->DumpTextureData( nId, sDump, bMM, "\r\n") ;
|
pGeomDB->DumpTextureData( nId, sDump, bMM, "\r\n") ;
|
||||||
// preparo UserObj
|
// preparo UserObj
|
||||||
|
|||||||
+66
-4
@@ -29,6 +29,7 @@
|
|||||||
#include "/EgtDev/Include/EGnFileUtils.h"
|
#include "/EgtDev/Include/EGnFileUtils.h"
|
||||||
#include "/EgtDev/Include/EGnGetModuleVer.h"
|
#include "/EgtDev/Include/EGnGetModuleVer.h"
|
||||||
#include "/EgtDev/Include/EGnPcInfo.h"
|
#include "/EgtDev/Include/EGnPcInfo.h"
|
||||||
|
#include "/EgtDev/Include/EGnGetKeyData.h"
|
||||||
#include "/EgtDev/Include/EgtIniFile.h"
|
#include "/EgtDev/Include/EgtIniFile.h"
|
||||||
#include "/EgtDev/Include/EgtLogger.h"
|
#include "/EgtDev/Include/EgtLogger.h"
|
||||||
#include "/EgtDev/Include/EgtStringConverter.h"
|
#include "/EgtDev/Include/EgtStringConverter.h"
|
||||||
@@ -51,6 +52,7 @@ static bool s_bNetHwKey = false ;
|
|||||||
static int s_nKeyExpDays = 0 ;
|
static int s_nKeyExpDays = 0 ;
|
||||||
static int s_nKeyOptExpDays = 0 ;
|
static int s_nKeyOptExpDays = 0 ;
|
||||||
static string s_sNestKey ;
|
static string s_sNestKey ;
|
||||||
|
static string s_sLockId ;
|
||||||
static string s_sIniFile ;
|
static string s_sIniFile ;
|
||||||
static bool s_bEnableUI = true ;
|
static bool s_bEnableUI = true ;
|
||||||
static pfProcEvents s_pFunProcEvents = nullptr ;
|
static pfProcEvents s_pFunProcEvents = nullptr ;
|
||||||
@@ -115,7 +117,7 @@ ExeInit( int nDebug, const string& sLogFile, const string& sLogMsg)
|
|||||||
LOG_INFO( s_pGenLog, MyGetEMkVersion())
|
LOG_INFO( s_pGenLog, MyGetEMkVersion())
|
||||||
|
|
||||||
// carico libreria nesting opzionale (non può usare la chiave di rete)
|
// carico libreria nesting opzionale (non può usare la chiave di rete)
|
||||||
if ( LoadNestingDll( s_pGenLog, s_sKey, s_sNestKey))
|
if ( LoadNestingDll( s_pGenLog, s_sKey, s_sNestKey, s_bNetHwKey))
|
||||||
LOG_INFO( s_pGenLog, MyGetENsVersion())
|
LOG_INFO( s_pGenLog, MyGetENsVersion())
|
||||||
|
|
||||||
// Info sulla protezione e sul sistema
|
// Info sulla protezione e sul sistema
|
||||||
@@ -188,6 +190,10 @@ ExeExit( void)
|
|||||||
s_pGenLog = nullptr ;
|
s_pGenLog = nullptr ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// libero eventuale chiave di rete
|
||||||
|
if ( s_bNetHwKey)
|
||||||
|
CloseNetHwKey() ;
|
||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,6 +224,7 @@ bool
|
|||||||
ExeSetKey( const string& sKey)
|
ExeSetKey( const string& sKey)
|
||||||
{
|
{
|
||||||
s_sKey = sKey ;
|
s_sKey = sKey ;
|
||||||
|
SetEGnKey( s_sKey) ;
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,15 +255,56 @@ bool
|
|||||||
ExeSetLockType( int nType)
|
ExeSetLockType( int nType)
|
||||||
{
|
{
|
||||||
s_nKeyType = nType ;
|
s_nKeyType = nType ;
|
||||||
|
SetEGnKeyType( s_nKeyType) ;
|
||||||
return SetLockType( nType) ;
|
return SetLockType( nType) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSetNetHwKey( bool bNetHwKey)
|
ExeSetLockId( const string& sLockId)
|
||||||
|
{
|
||||||
|
int nKeyType ;
|
||||||
|
bool bNetKey ;
|
||||||
|
int nUserId ;
|
||||||
|
GetLockIdStringInfo( sLockId, nKeyType, bNetKey, nUserId) ;
|
||||||
|
bool bOk ;
|
||||||
|
switch ( nKeyType) {
|
||||||
|
default :
|
||||||
|
ExeSetNetHwKey( false) ;
|
||||||
|
bOk = false ;
|
||||||
|
break ;
|
||||||
|
case KEY_LOCK_TYPE_SW :
|
||||||
|
ExeSetNetHwKey( false) ;
|
||||||
|
bOk = ( s_nKeyType != KEY_LOCK_TYPE_HW) ;
|
||||||
|
break ;
|
||||||
|
case KEY_LOCK_TYPE_HW :
|
||||||
|
ExeSetNetHwKey( bNetKey, nUserId) ;
|
||||||
|
bOk = true ;
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
if ( bOk)
|
||||||
|
s_sLockId = sLockId ;
|
||||||
|
else
|
||||||
|
s_sLockId = "" ;
|
||||||
|
return bOk ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
const string&
|
||||||
|
ExeGetLockId( void)
|
||||||
|
{
|
||||||
|
if ( s_sLockId.empty())
|
||||||
|
GetLockId( s_sLockId) ;
|
||||||
|
return s_sLockId ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeSetNetHwKey( bool bNetHwKey, int nUserId)
|
||||||
{
|
{
|
||||||
s_bNetHwKey = bNetHwKey ;
|
s_bNetHwKey = bNetHwKey ;
|
||||||
return SetNetHwKey( bNetHwKey) ;
|
SetEGnNetHwKey( s_bNetHwKey) ;
|
||||||
|
return SetNetHwKey( s_bNetHwKey, nUserId) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -411,7 +459,7 @@ ExeGetKeyInfo( string& sKey)
|
|||||||
sLockId = sLockId.substr( 7, 6) ;
|
sLockId = sLockId.substr( 7, 6) ;
|
||||||
if ( sLockId.empty())
|
if ( sLockId.empty())
|
||||||
return false ;
|
return false ;
|
||||||
int nLockSN ;
|
int nLockSN = 0 ;
|
||||||
if ( GetLockSN( nLockSN))
|
if ( GetLockSN( nLockSN))
|
||||||
sLockId += " (" + ToString( nLockSN) + ")" ;
|
sLockId += " (" + ToString( nLockSN) + ")" ;
|
||||||
}
|
}
|
||||||
@@ -431,6 +479,7 @@ ExeGetKeyLevel( int nProd, int nVer, int nLev, int& nKLev)
|
|||||||
{
|
{
|
||||||
// verifico la chiave e il livello
|
// verifico la chiave e il livello
|
||||||
int nRet = GetKeyLevel( s_sKey, nProd, nVer, nLev, nKLev, s_nKeyExpDays) ;
|
int nRet = GetKeyLevel( s_sKey, nProd, nVer, nLev, nKLev, s_nKeyExpDays) ;
|
||||||
|
SetEGnKeyLevel( nRet, nKLev, s_nKeyExpDays) ;
|
||||||
if ( nRet != KEY_OK) {
|
if ( nRet != KEY_OK) {
|
||||||
string sErr = "Error on Key (EGKL/" + ToString( nRet) + ")" ;
|
string sErr = "Error on Key (EGKL/" + ToString( nRet) + ")" ;
|
||||||
LOG_ERROR( s_pGenLog, sErr.c_str()) ;
|
LOG_ERROR( s_pGenLog, sErr.c_str()) ;
|
||||||
@@ -448,6 +497,7 @@ ExeGetKeyOptions( int nProd, int nVer, int nLev, unsigned int& nOpt2)
|
|||||||
// verifico la chiave e le opzioni
|
// verifico la chiave e le opzioni
|
||||||
unsigned int nOpt1 ;
|
unsigned int nOpt1 ;
|
||||||
int nRet = GetKeyOptions( s_sKey, nProd, nVer, nLev, nOpt1, nOpt2, s_nKeyOptExpDays) ;
|
int nRet = GetKeyOptions( s_sKey, nProd, nVer, nLev, nOpt1, nOpt2, s_nKeyOptExpDays) ;
|
||||||
|
SetEGnKeyOptions( nRet, nOpt1, nOpt2, s_nKeyOptExpDays) ;
|
||||||
if ( nRet != KEY_OK) {
|
if ( nRet != KEY_OK) {
|
||||||
nOpt2 = 0 ;
|
nOpt2 = 0 ;
|
||||||
string sErr = "Error on Key (EGKO/" + ToString( nRet) + ")" ;
|
string sErr = "Error on Key (EGKO/" + ToString( nRet) + ")" ;
|
||||||
@@ -536,6 +586,18 @@ ExeGetEnableUI( void)
|
|||||||
return s_bEnableUI ;
|
return s_bEnableUI ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeMessageBox( const string& sText, const string& sTitle, int nType)
|
||||||
|
{
|
||||||
|
int nRes = 0 ;
|
||||||
|
if ( ExeGetEnableUI()) {
|
||||||
|
HWND hTopWnd = ExeGetMainWindowHandle() ;
|
||||||
|
nRes = MessageBox( hTopWnd, stringtoW( sText), stringtoW( sTitle), nType | MB_TASKMODAL) ;
|
||||||
|
}
|
||||||
|
return nRes ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSetProcessEvents( pfProcEvents pFun)
|
ExeSetProcessEvents( pfProcEvents pFun)
|
||||||
|
|||||||
@@ -1005,6 +1005,105 @@ ExePlaneCurveInters( const Point3d& ptOn, const Vector3d& vtN, const int nId, co
|
|||||||
return nFirstId ;
|
return nFirstId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
MyCurveCurveInters( const int nId1, const int nId2, const int nDestGrpId, int& nPntCount, int& nCrvCount)
|
||||||
|
{
|
||||||
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||||
|
|
||||||
|
int nFirstId = GDB_ID_NULL ;
|
||||||
|
|
||||||
|
// recupero il riferimento del gruppo di destinazione
|
||||||
|
Frame3d frDest ;
|
||||||
|
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
|
||||||
|
// recupero le curve e le porto nel riferimento del gruppo di destinazione
|
||||||
|
PtrOwner<ICurve> pCrv1( GetCurve( pGeomDB->GetGeoObj( nId1))->Clone()) ;
|
||||||
|
if ( IsNull( pCrv1))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
Frame3d frCrv1 ;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( nId1, frCrv1))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
pCrv1->LocToLoc( frCrv1, frDest) ;
|
||||||
|
|
||||||
|
PtrOwner<ICurve> pCrv2( GetCurve( pGeomDB->GetGeoObj( nId2))->Clone()) ;
|
||||||
|
if ( IsNull( pCrv2))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
Frame3d frCrv2 ;
|
||||||
|
if ( ! pGeomDB->GetGlobFrame( nId2, frCrv2))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
pCrv2->LocToLoc( frCrv2, frDest) ;
|
||||||
|
|
||||||
|
// intersezione fra le curve nel piano XY locale
|
||||||
|
IntersCurveCurve intCC( *pCrv1, *pCrv2, true) ;
|
||||||
|
int nInters = intCC.GetIntersCount() ;
|
||||||
|
|
||||||
|
// recupero i punti risultanti
|
||||||
|
for ( int i = 0 ; i < nInters ; i++) {
|
||||||
|
IntCrvCrvInfo aInfo ;
|
||||||
|
intCC.GetIntCrvCrvInfo( i, aInfo) ;
|
||||||
|
// verifico se punto
|
||||||
|
if ( ! aInfo.bOverlap) {
|
||||||
|
PtrOwner<IGeoPoint3d> pGeoPnt( CreateGeoPoint3d()) ;
|
||||||
|
if ( IsNull( pGeoPnt))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
pGeoPnt->Set( aInfo.IciA[0].ptI) ;
|
||||||
|
// lo inserisco nel DB geometrico
|
||||||
|
int nNewId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( pGeoPnt)) ;
|
||||||
|
if ( nNewId == GDB_ID_NULL)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// aggiorno parametri
|
||||||
|
if ( nFirstId == GDB_ID_NULL)
|
||||||
|
nFirstId = nNewId ;
|
||||||
|
++ nPntCount ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// recupero le curve risultanti
|
||||||
|
for ( int i = 0 ; i < nInters ; i++) {
|
||||||
|
IntCrvCrvInfo aInfo ;
|
||||||
|
intCC.GetIntCrvCrvInfo( i, aInfo) ;
|
||||||
|
// verifico se curva
|
||||||
|
if ( aInfo.bOverlap) {
|
||||||
|
PtrOwner<ICurve> pCrvRes( pCrv1->CopyParamRange( aInfo.IciA[0].dU, aInfo.IciA[1].dU)) ;
|
||||||
|
if ( IsNull( pCrvRes))
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// lo inserisco nel DB geometrico
|
||||||
|
int nNewId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( pCrvRes)) ;
|
||||||
|
if ( nNewId == GDB_ID_NULL)
|
||||||
|
return GDB_ID_NULL ;
|
||||||
|
// aggiorno parametri
|
||||||
|
if ( nFirstId == GDB_ID_NULL)
|
||||||
|
nFirstId = nNewId ;
|
||||||
|
++ nCrvCount ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nFirstId ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCurveCurveInters( const int nId1, const int nId2, const int nDestGrpId, int* pnPntCount, int* pnCrvCount)
|
||||||
|
{
|
||||||
|
// eseguo
|
||||||
|
int nPntCount{ 0}, nCrvCount{ 0} ;
|
||||||
|
int nFirstId = MyCurveCurveInters( nId1, nId2, nDestGrpId, nPntCount, nCrvCount) ;
|
||||||
|
// aggiorno contatori
|
||||||
|
if ( nFirstId != GDB_ID_NULL) {
|
||||||
|
if ( pnPntCount != nullptr)
|
||||||
|
*pnPntCount = nPntCount ;
|
||||||
|
if ( pnCrvCount != nullptr)
|
||||||
|
*pnCrvCount = nCrvCount ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// restituisco l'identificativo della prima nuova entità
|
||||||
|
return nFirstId ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static bool
|
static bool
|
||||||
MyLineVolZmapInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, INTDBLVECTOR& vInters)
|
MyLineVolZmapInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, INTDBLVECTOR& vInters)
|
||||||
|
|||||||
+5
-3
@@ -262,11 +262,13 @@ ExeLuaExecLine( const string& sLine)
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeLuaExecFile( const string& sFilePath)
|
ExeLuaExecFile( const string& sFilePath, bool LogInfo)
|
||||||
{
|
{
|
||||||
// emetto info
|
// emetto info
|
||||||
string sInfo = "Exec File = " + sFilePath ;
|
if ( LogInfo) {
|
||||||
LOG_INFO( GetLogger(), sInfo.c_str())
|
string sInfo = "Exec File = " + sFilePath ;
|
||||||
|
LOG_INFO( GetLogger(), sInfo.c_str())
|
||||||
|
}
|
||||||
// disabilito il log dei comandi
|
// disabilito il log dei comandi
|
||||||
CmdLogOff cmdLogOff ;
|
CmdLogOff cmdLogOff ;
|
||||||
// esecuzione script
|
// esecuzione script
|
||||||
|
|||||||
+21
-1
@@ -245,6 +245,26 @@ ExeAddMachGroup( const string& sName, const string& sMachineName)
|
|||||||
return nId ;
|
return nId ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
ExeCopyMachGroup( const string& sSouName, const string& sName)
|
||||||
|
{
|
||||||
|
IMachMgr* pMachMgr = GetCurrMachMgr() ;
|
||||||
|
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
|
||||||
|
// copio la macchinata (gruppo di lavorazione)
|
||||||
|
int nId = pMachMgr->CopyMachGroup( sSouName, sName) ;
|
||||||
|
ExeSetModified() ;
|
||||||
|
// se richiesto, salvo il comando Lua equivalente
|
||||||
|
if ( IsCmdLog()) {
|
||||||
|
string sLua = "EgtCopyMachGroup('" + sSouName + "','" +
|
||||||
|
sName + "')" +
|
||||||
|
" -- Id=" + ToString( nId) ;
|
||||||
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||||
|
}
|
||||||
|
// restituisco il risultato
|
||||||
|
return nId ;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeRemoveMachGroup( int nMGroupId)
|
ExeRemoveMachGroup( int nMGroupId)
|
||||||
@@ -2700,7 +2720,7 @@ ExeApplyAllMachiningsEx( bool bRecalc, bool bStopOnFirstErr, string& sErrList, s
|
|||||||
while ( nOperId != GDB_ID_NULL) {
|
while ( nOperId != GDB_ID_NULL) {
|
||||||
if ( pMachMgr->GetOperationType( nOperId) == OPER_DISP) {
|
if ( pMachMgr->GetOperationType( nOperId) == OPER_DISP) {
|
||||||
pMachMgr->SetCurrPhase( pMachMgr->GetOperationPhase( nOperId)) ;
|
pMachMgr->SetCurrPhase( pMachMgr->GetOperationPhase( nOperId)) ;
|
||||||
if ( ! pMachMgr->DispositionSpecialApply( nOperId, bRecalc)) {
|
if ( ! pMachMgr->DispositionSpecialApply( nOperId, true)) {
|
||||||
bOk = false ;
|
bOk = false ;
|
||||||
if ( pMachMgr->GetLastErrorId() != 0)
|
if ( pMachMgr->GetLastErrorId() != 0)
|
||||||
sErrList += pMachMgr->GetOperationName( nOperId) + " -> " + pMachMgr->GetLastErrorString() + "\r\n" ;
|
sErrList += pMachMgr->GetOperationName( nOperId) + " -> " + pMachMgr->GetLastErrorString() + "\r\n" ;
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// EgalTech 2023-2023
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// File : EXE_Mutex.cpp Data : 05.02.23 Versione : 2.5a6
|
||||||
|
// Contenuto : Funzioni per gestione mutex.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Modifiche : 05.02.23 DS Creazione modulo.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//--------------------------- Include ----------------------------------------
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "EXE.h"
|
||||||
|
#include "/EgtDev/Include/EgtStringConverter.h"
|
||||||
|
|
||||||
|
using namespace std ;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static HANDLE s_hMutex = NULL ;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeCreateMutex( const string& sMutexName)
|
||||||
|
{
|
||||||
|
if ( s_hMutex != NULL)
|
||||||
|
return false ;
|
||||||
|
|
||||||
|
HANDLE hMutex = CreateMutex( NULL, TRUE, stringtoW( sMutexName)) ;
|
||||||
|
|
||||||
|
if ( hMutex == NULL)
|
||||||
|
return false ;
|
||||||
|
else if ( GetLastError() == ERROR_ALREADY_EXISTS) {
|
||||||
|
ReleaseMutex( hMutex) ;
|
||||||
|
CloseHandle( hMutex) ;
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
s_hMutex = hMutex ;
|
||||||
|
return true ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
ExeReleaseMutex( void)
|
||||||
|
{
|
||||||
|
if ( s_hMutex == NULL)
|
||||||
|
return true ;
|
||||||
|
|
||||||
|
bool bOk = ( ReleaseMutex( s_hMutex) != FALSE) ;
|
||||||
|
CloseHandle( s_hMutex) ;
|
||||||
|
s_hMutex = NULL ;
|
||||||
|
return bOk ;
|
||||||
|
}
|
||||||
+5
-3
@@ -212,11 +212,13 @@ ExeResize( int nW, int nH)
|
|||||||
bool
|
bool
|
||||||
ExeDraw( void)
|
ExeDraw( void)
|
||||||
{
|
{
|
||||||
|
// se interfaccia disabilitata, esco subito
|
||||||
|
if ( ! ExeGetEnableUI())
|
||||||
|
return true ;
|
||||||
GseContext* pGseCtx = GetCurrGseContext() ;
|
GseContext* pGseCtx = GetCurrGseContext() ;
|
||||||
VERIFY_CTX_SCENE( pGseCtx, false)
|
VERIFY_CTX_SCENE( pGseCtx, false)
|
||||||
// se abilitato, eseguo disegno
|
// eseguo disegno
|
||||||
if ( ExeGetEnableUI())
|
pGseCtx->m_pScene->Draw() ;
|
||||||
pGseCtx->m_pScene->Draw() ;
|
|
||||||
// valido la finestra disegnata
|
// valido la finestra disegnata
|
||||||
ValidateRgn( pGseCtx->m_hWnd, NULL) ;
|
ValidateRgn( pGseCtx->m_hWnd, NULL) ;
|
||||||
return true ;
|
return true ;
|
||||||
|
|||||||
Binary file not shown.
+5
-1
@@ -22,7 +22,7 @@
|
|||||||
<ProjectGuid>{DF654897-F85B-4108-A621-F2C4AB099A48}</ProjectGuid>
|
<ProjectGuid>{DF654897-F85B-4108-A621-F2C4AB099A48}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>EgtExecutor</RootNamespace>
|
<RootNamespace>EgtExecutor</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
@@ -104,6 +104,8 @@
|
|||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
<MinimalRebuild>false</MinimalRebuild>
|
||||||
|
<OpenMPSupport>false</OpenMPSupport>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -164,6 +166,7 @@ copy $(TargetPath) \EgtProg\DllD64</Command>
|
|||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -259,6 +262,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
|
|||||||
<ClCompile Include="EXE_GeoInters.cpp" />
|
<ClCompile Include="EXE_GeoInters.cpp" />
|
||||||
<ClCompile Include="EXE_Image.cpp" />
|
<ClCompile Include="EXE_Image.cpp" />
|
||||||
<ClCompile Include="EXE_MaxFiller.cpp" />
|
<ClCompile Include="EXE_MaxFiller.cpp" />
|
||||||
|
<ClCompile Include="EXE_Mutex.cpp" />
|
||||||
<ClCompile Include="EXE_NstAutoNesting.cpp" />
|
<ClCompile Include="EXE_NstAutoNesting.cpp" />
|
||||||
<ClCompile Include="EXE_NstMachining.cpp" />
|
<ClCompile Include="EXE_NstMachining.cpp" />
|
||||||
<ClCompile Include="EXE_NstPartNesting.cpp" />
|
<ClCompile Include="EXE_NstPartNesting.cpp" />
|
||||||
|
|||||||
@@ -386,6 +386,9 @@
|
|||||||
<ClCompile Include="LUA_BeamMgr.cpp">
|
<ClCompile Include="LUA_BeamMgr.cpp">
|
||||||
<Filter>File di origine\LUA</Filter>
|
<Filter>File di origine\LUA</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="EXE_Mutex.cpp">
|
||||||
|
<Filter>File di origine\EXE</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="EgtExecutor.rc">
|
<ResourceCompile Include="EgtExecutor.rc">
|
||||||
|
|||||||
@@ -165,6 +165,28 @@ LuaCDeSpheSolid( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCDeSolidSolid( lua_State* L)
|
||||||
|
{
|
||||||
|
// 3 parametri : nSolid1Id, nSolid2Id, dSafeDist
|
||||||
|
int nSolid1Id ;
|
||||||
|
LuaCheckParam( L, 1, nSolid1Id)
|
||||||
|
int nSolid2Id ;
|
||||||
|
LuaCheckParam( L, 2, nSolid2Id)
|
||||||
|
double dSafeDist ;
|
||||||
|
LuaCheckParam( L, 3, dSafeDist)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// eseguo verifica di collisione
|
||||||
|
int nRes = ExeCDeSolidSolid( nSolid1Id, nSolid2Id, dSafeDist) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nRes >= 0)
|
||||||
|
LuaSetParam( L, ( nRes != 0)) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
LuaInstallCDeObjSolid( LuaMgr& luaMgr)
|
LuaInstallCDeObjSolid( LuaMgr& luaMgr)
|
||||||
@@ -175,5 +197,6 @@ LuaInstallCDeObjSolid( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCDeCylSolid", LuaCDeCylSolid) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCDeCylSolid", LuaCDeCylSolid) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCDeConeSolid", LuaCDeConeSolid) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCDeConeSolid", LuaCDeConeSolid) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCDeSpheSolid", LuaCDeSpheSolid) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCDeSpheSolid", LuaCDeSpheSolid) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCDeSolidSolid", LuaCDeSolidSolid) ;
|
||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|||||||
+57
-13
@@ -169,6 +169,23 @@ LuaImport3MF( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaImport3dm( lua_State* L)
|
||||||
|
{
|
||||||
|
// 1 o 2 parametri : path del file da importare [, Fattore di scala]
|
||||||
|
string sFilePath ;
|
||||||
|
LuaCheckParam( L, 1, sFilePath)
|
||||||
|
double dScaleFactor = 1.0 ;
|
||||||
|
LuaGetParam( L, 2, dScaleFactor) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// apro il file
|
||||||
|
bool bOk = ExeImport3dm( sFilePath, dScaleFactor) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaAdvancedImport( lua_State* L)
|
LuaAdvancedImport( lua_State* L)
|
||||||
@@ -190,16 +207,18 @@ LuaAdvancedImport( lua_State* L)
|
|||||||
static int
|
static int
|
||||||
LuaExportDxf( lua_State* L)
|
LuaExportDxf( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 o 3 parametri, GroupId e path del file da esportare [, Flag]
|
// 2, 3 o 4 parametri : GroupId e path del file da esportare [, Flag] [, Filter]
|
||||||
int nGroupId ;
|
int nGroupId ;
|
||||||
LuaCheckParam( L, 1, nGroupId)
|
LuaCheckParam( L, 1, nGroupId)
|
||||||
string sFilePath ;
|
string sFilePath ;
|
||||||
LuaCheckParam( L, 2, sFilePath)
|
LuaCheckParam( L, 2, sFilePath)
|
||||||
int nFlag = EEXFLAG_DEFAULT ;
|
int nFlag = EEXFLAG_DEFAULT ;
|
||||||
LuaGetParam( L, 3, nFlag) ;
|
LuaGetParam( L, 3, nFlag) ;
|
||||||
|
int nFilter = EEXFLT_DEFAULT ;
|
||||||
|
LuaGetParam( L, 4, nFilter) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// creo il file
|
// creo il file
|
||||||
bool bOk = ExeExportDxf( nGroupId, sFilePath, nFlag) ;
|
bool bOk = ExeExportDxf( nGroupId, sFilePath, nFlag, nFilter) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -209,11 +228,13 @@ LuaExportDxf( lua_State* L)
|
|||||||
static int
|
static int
|
||||||
LuaExportStl( lua_State* L)
|
LuaExportStl( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 parametri, GroupId e path del file da esportare
|
// 2 parametri : GroupId e path del file da esportare [, Filter]
|
||||||
int nGroupId ;
|
int nGroupId ;
|
||||||
LuaCheckParam( L, 1, nGroupId)
|
LuaCheckParam( L, 1, nGroupId)
|
||||||
string sFilePath ;
|
string sFilePath ;
|
||||||
LuaCheckParam( L, 2, sFilePath)
|
LuaCheckParam( L, 2, sFilePath)
|
||||||
|
int nFilter = EEXFLT_DEFAULT ;
|
||||||
|
LuaGetParam( L, 3, nFilter) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// creo il file
|
// creo il file
|
||||||
bool bOk = ExeExportStl( nGroupId, sFilePath) ;
|
bool bOk = ExeExportStl( nGroupId, sFilePath) ;
|
||||||
@@ -226,11 +247,13 @@ LuaExportStl( lua_State* L)
|
|||||||
static int
|
static int
|
||||||
LuaExport3MF( lua_State* L)
|
LuaExport3MF( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 parametri, GroupId e path del file da esportare
|
// 2 o 3 parametri : GroupId e path del file da esportare [, Filter]
|
||||||
int nGroupId ;
|
int nGroupId ;
|
||||||
LuaCheckParam( L, 1, nGroupId)
|
LuaCheckParam( L, 1, nGroupId)
|
||||||
string sFilePath ;
|
string sFilePath ;
|
||||||
LuaCheckParam( L, 2, sFilePath)
|
LuaCheckParam( L, 2, sFilePath)
|
||||||
|
int nFilter = EEXFLT_DEFAULT ;
|
||||||
|
LuaGetParam( L, 3, nFilter) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// creo il file
|
// creo il file
|
||||||
bool bOk = ExeExport3MF( nGroupId, sFilePath) ;
|
bool bOk = ExeExport3MF( nGroupId, sFilePath) ;
|
||||||
@@ -241,19 +264,19 @@ LuaExport3MF( lua_State* L)
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaExportThreeJS( lua_State* L)
|
LuaExport3dm( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 o 3 parametri, GroupId e path del file da esportare [, Filter]
|
// 2 o 3 parametri : GroupId e path del file da esportare [, Filter]
|
||||||
int nGroupId ;
|
int nGroupId ;
|
||||||
LuaCheckParam( L, 1, nGroupId)
|
LuaCheckParam( L, 1, nGroupId)
|
||||||
string sFilePath ;
|
string sFilePath ;
|
||||||
LuaCheckParam( L, 2, sFilePath)
|
LuaCheckParam( L, 2, sFilePath)
|
||||||
int nFilter = EEXFLT_DEFAULT;
|
int nFilter = EEXFLT_DEFAULT ;
|
||||||
LuaGetParam( L, 3, nFilter);
|
LuaGetParam( L, 3, nFilter) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// creo il file
|
// creo il file
|
||||||
bool bOk = ExeExportThreeJS( nGroupId, sFilePath, nFilter) ;
|
bool bOk = ExeExport3dm( nGroupId, sFilePath) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
@@ -262,7 +285,7 @@ LuaExportThreeJS( lua_State* L)
|
|||||||
static int
|
static int
|
||||||
LuaExportSvg( lua_State* L)
|
LuaExportSvg( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 o 3 parametri, GroupId, Path del file da esportare [, Filter]
|
// 2 o 3 parametri : GroupId, Path del file da esportare [, Filter]
|
||||||
int nGroupId ;
|
int nGroupId ;
|
||||||
LuaCheckParam( L, 1, nGroupId)
|
LuaCheckParam( L, 1, nGroupId)
|
||||||
string sFilePath ;
|
string sFilePath ;
|
||||||
@@ -277,6 +300,25 @@ LuaExportSvg( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaExportThreeJS( lua_State* L)
|
||||||
|
{
|
||||||
|
// 2 o 3 parametri : GroupId, Path del file da esportare [, Filter]
|
||||||
|
int nGroupId ;
|
||||||
|
LuaCheckParam( L, 1, nGroupId)
|
||||||
|
string sFilePath ;
|
||||||
|
LuaCheckParam( L, 2, sFilePath)
|
||||||
|
int nFilter = EEXFLT_DEFAULT ;
|
||||||
|
LuaGetParam( L, 3, nFilter) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// creo il file
|
||||||
|
bool bOk = ExeExportThreeJS( nGroupId, sFilePath, nFilter) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
LuaInstallExchange( LuaMgr& luaMgr)
|
LuaInstallExchange( LuaMgr& luaMgr)
|
||||||
@@ -291,11 +333,13 @@ LuaInstallExchange( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtImportPnt", LuaImportPnt) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtImportPnt", LuaImportPnt) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtImportStl", LuaImportStl) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtImportStl", LuaImportStl) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtImport3MF", LuaImport3MF) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtImport3MF", LuaImport3MF) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtImport3dm", LuaImport3dm) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAdvancedImport", LuaAdvancedImport) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtAdvancedImport", LuaAdvancedImport) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExportDxf", LuaExportDxf) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtExportDxf", LuaExportDxf) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExportStl", LuaExportStl) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtExportStl", LuaExportStl) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExport3MF", LuaExport3MF) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtExport3MF", LuaExport3MF) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExportThreeJS", LuaExportThreeJS) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtExport3dm", LuaExport3dm) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExportSvg", LuaExportSvg) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtExportSvg", LuaExportSvg) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtExportThreeJS", LuaExportThreeJS) ;
|
||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,6 +344,170 @@ LuaCreateAlignedDimension( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateRadialDimension( lua_State* L)
|
||||||
|
{
|
||||||
|
// 4 o 5 parametri : nParentId, nCrvId, ptDim, Text [, nRefType]
|
||||||
|
int nParentId ;
|
||||||
|
LuaCheckParam( L, 1, nParentId)
|
||||||
|
int nCrvId ;
|
||||||
|
LuaCheckParam( L, 2, nCrvId) ;
|
||||||
|
Point3d ptDim ;
|
||||||
|
LuaCheckParam( L, 3, ptDim) ;
|
||||||
|
string sText ;
|
||||||
|
LuaCheckParam( L, 4, sText) ;
|
||||||
|
int nRefType = RTY_DEFAULT ;
|
||||||
|
LuaGetParam( L, 5, nRefType) ;
|
||||||
|
LuaClearStack( L ) ;
|
||||||
|
// creo la quota allineata
|
||||||
|
int nId = ExeCreateRadialDimension( nParentId, nCrvId, ptDim, sText, nRefType) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateDiametralDimension( lua_State* L )
|
||||||
|
{
|
||||||
|
// 4 o 5 parametri : nParentId, nCrvId, ptDim, Text [, nRefType]
|
||||||
|
int nParentId ;
|
||||||
|
LuaCheckParam( L, 1, nParentId)
|
||||||
|
int nCrvId ;
|
||||||
|
LuaCheckParam( L, 2, nCrvId) ;
|
||||||
|
Point3d ptDim ;
|
||||||
|
LuaCheckParam( L, 3, ptDim) ;
|
||||||
|
string sText ;
|
||||||
|
LuaCheckParam( L, 4, sText) ;
|
||||||
|
int nRefType = RTY_DEFAULT ;
|
||||||
|
LuaGetParam( L, 5, nRefType) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// creo la quota allineata
|
||||||
|
int nId = ExeCreateDiametralDimension( nParentId, nCrvId, ptDim, sText, nRefType) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateAngularDimension(lua_State* L)
|
||||||
|
{
|
||||||
|
// 6 o 7 parametri : ParentId, ptP1, ptP0, ptP2, ptDim, Text [, nRefType]
|
||||||
|
int nParentId ;
|
||||||
|
LuaCheckParam( L, 1, nParentId)
|
||||||
|
Point3d ptP1 ;
|
||||||
|
LuaCheckParam( L, 2, ptP1) ;
|
||||||
|
Point3d ptP0 ;
|
||||||
|
LuaCheckParam( L, 3, ptP0) ;
|
||||||
|
Point3d ptP2 ;
|
||||||
|
LuaCheckParam( L, 4, ptP2) ;
|
||||||
|
Point3d ptDim ;
|
||||||
|
LuaCheckParam( L, 5, ptDim) ;
|
||||||
|
string sText ;
|
||||||
|
LuaCheckParam( L, 6, sText) ;
|
||||||
|
int nRefType = RTY_DEFAULT ;
|
||||||
|
LuaGetParam( L, 7, nRefType) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// creo la quota angolare
|
||||||
|
int nId = ExeCreateAngularDimension( nParentId, ptP1, ptP0, ptP2, ptDim, sText, nRefType) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateAngularDimensionFromLines( lua_State* L)
|
||||||
|
{
|
||||||
|
// 4 o 5 parametri : nParentId, vLineIds, ptDim, Text [, nRefType]
|
||||||
|
int nParentId ;
|
||||||
|
LuaCheckParam( L, 1, nParentId)
|
||||||
|
INTVECTOR vLineIds ;
|
||||||
|
LuaCheckParam( L, 2, vLineIds) ;
|
||||||
|
Point3d ptDim ;
|
||||||
|
LuaCheckParam( L, 3, ptDim) ;
|
||||||
|
string sText ;
|
||||||
|
LuaCheckParam( L, 4, sText) ;
|
||||||
|
int nRefType = RTY_DEFAULT ;
|
||||||
|
LuaGetParam( L, 5, nRefType) ;
|
||||||
|
LuaClearStack( L ) ;
|
||||||
|
// creo la quota allineata
|
||||||
|
int nId = ExeCreateAngularDimensionFromLines( nParentId, vLineIds, ptDim, sText, nRefType) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L ) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateAngularDimensionFromArc( lua_State* L)
|
||||||
|
{
|
||||||
|
// 4 o 5 parametri : nParentId, nCrvId, ptDim, Text [, nRefType]
|
||||||
|
int nParentId ;
|
||||||
|
LuaCheckParam( L, 1, nParentId)
|
||||||
|
int nCrvId ;
|
||||||
|
LuaCheckParam( L, 2, nCrvId) ;
|
||||||
|
Point3d ptDim ;
|
||||||
|
LuaCheckParam( L, 3, ptDim) ;
|
||||||
|
string sText ;
|
||||||
|
LuaCheckParam( L, 4, sText) ;
|
||||||
|
int nRefType = RTY_DEFAULT ;
|
||||||
|
LuaGetParam( L, 5, nRefType) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// creo la quota allineata
|
||||||
|
int nId = ExeCreateAngularDimensionFromArc( nParentId, nCrvId, ptDim, sText, nRefType) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateAngularDimensionFromCircle( lua_State* L)
|
||||||
|
{
|
||||||
|
// 6 o 7 parametri : nParentId, nCrvId, ptP1, ptP2, ptDim, Text [, nRefType]
|
||||||
|
int nParentId ;
|
||||||
|
LuaCheckParam( L, 1, nParentId)
|
||||||
|
int nCrvId ;
|
||||||
|
LuaCheckParam( L, 2, nCrvId) ;
|
||||||
|
Point3d ptP1 ;
|
||||||
|
LuaCheckParam( L, 3, ptP1) ;
|
||||||
|
Point3d ptP2 ;
|
||||||
|
LuaCheckParam( L, 4, ptP2) ;
|
||||||
|
Point3d ptDim ;
|
||||||
|
LuaCheckParam( L, 5, ptDim) ;
|
||||||
|
string sText ;
|
||||||
|
LuaCheckParam( L, 6, sText) ;
|
||||||
|
int nRefType = RTY_DEFAULT ;
|
||||||
|
LuaGetParam( L, 7, nRefType) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// creo la quota allineata
|
||||||
|
int nId = ExeCreateAngularDimensionFromCircle( nParentId, nCrvId, ptP1, ptP2, ptDim, sText, nRefType) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
LuaInstallGdbCreate( LuaMgr& luaMgr)
|
LuaInstallGdbCreate( LuaMgr& luaMgr)
|
||||||
@@ -361,5 +525,11 @@ LuaInstallGdbCreate( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtHorizontalDimension", LuaCreateHorizontalDimension) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtHorizontalDimension", LuaCreateHorizontalDimension) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtVerticalDimension", LuaCreateVerticalDimension) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtVerticalDimension", LuaCreateVerticalDimension) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAlignedDimension", LuaCreateAlignedDimension) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtAlignedDimension", LuaCreateAlignedDimension) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtRadialDimension", LuaCreateRadialDimension) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtDiametralDimension", LuaCreateDiametralDimension) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimension", LuaCreateAngularDimension);
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimensionFromLines", LuaCreateAngularDimensionFromLines) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimensionFromArc", LuaCreateAngularDimensionFromArc) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimensionFromCircle", LuaCreateAngularDimensionFromCircle) ;
|
||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,6 +425,32 @@ LuaCreateArc3P( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateArc2PB( lua_State* L)
|
||||||
|
{
|
||||||
|
// 4 o 5 parametri : ParentId, PtStart, PtEnd, dBulge [, nRefType]
|
||||||
|
int nParentId ;
|
||||||
|
LuaCheckParam( L, 1, nParentId)
|
||||||
|
Point3d ptStart ;
|
||||||
|
LuaCheckParam( L, 2, ptStart)
|
||||||
|
Point3d ptEnd ;
|
||||||
|
LuaCheckParam( L, 3, ptEnd)
|
||||||
|
double dBulge ;
|
||||||
|
LuaCheckParam( L, 4, dBulge)
|
||||||
|
int nRefType = RTY_DEFAULT ;
|
||||||
|
LuaGetParam( L, 5, nRefType) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// creo l'arco
|
||||||
|
int nId = ExeCreateArc2PB( nParentId, ptStart, ptEnd, dBulge, nRefType) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaCreateArc2PD( lua_State* L)
|
LuaCreateArc2PD( lua_State* L)
|
||||||
@@ -1057,6 +1083,7 @@ LuaInstallGdbCreateCurve( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArcC2P", LuaCreateArcC2P) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArcC2P", LuaCreateArcC2P) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArcC2PEx", LuaCreateArcC2PEx) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArcC2PEx", LuaCreateArcC2PEx) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArc3P", LuaCreateArc3P) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArc3P", LuaCreateArc3P) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PB", LuaCreateArc2PB) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PD", LuaCreateArc2PD) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PD", LuaCreateArc2PD) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PDEx", LuaCreateArc2PDEx) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PDEx", LuaCreateArc2PDEx) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PV", LuaCreateArc2PV) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArc2PV", LuaCreateArc2PV) ;
|
||||||
|
|||||||
+46
-16
@@ -14,6 +14,7 @@
|
|||||||
//--------------------------- Include ----------------------------------------
|
//--------------------------- Include ----------------------------------------
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "LUA.h"
|
#include "LUA.h"
|
||||||
|
#include "EXE_Const.h"
|
||||||
#include "/EgtDev/Include/EXeExecutor.h"
|
#include "/EgtDev/Include/EXeExecutor.h"
|
||||||
#include "/EgtDev/Include/EXeConst.h"
|
#include "/EgtDev/Include/EXeConst.h"
|
||||||
#include "/EgtDev/Include/EGkLuaAux.h"
|
#include "/EgtDev/Include/EGkLuaAux.h"
|
||||||
@@ -22,9 +23,6 @@
|
|||||||
|
|
||||||
using namespace std ;
|
using namespace std ;
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
|
||||||
static const double LIN_TOL_DEF = 0.05 ;
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaCreateSurfFrRectangle( lua_State* L)
|
LuaCreateSurfFrRectangle( lua_State* L)
|
||||||
@@ -320,7 +318,7 @@ LuaCreateSurfTmCylinder( lua_State* L)
|
|||||||
LuaCheckParam( L, 4, dRad)
|
LuaCheckParam( L, 4, dRad)
|
||||||
double dHeight ;
|
double dHeight ;
|
||||||
LuaCheckParam( L, 5, dHeight)
|
LuaCheckParam( L, 5, dHeight)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
int nRefType = RTY_DEFAULT ;
|
int nRefType = RTY_DEFAULT ;
|
||||||
if ( LuaGetParam( L, 6, dLinTol))
|
if ( LuaGetParam( L, 6, dLinTol))
|
||||||
LuaGetParam( L, 7, nRefType) ;
|
LuaGetParam( L, 7, nRefType) ;
|
||||||
@@ -352,7 +350,7 @@ LuaCreateSurfTmCone( lua_State* L)
|
|||||||
LuaCheckParam( L, 4, dRad)
|
LuaCheckParam( L, 4, dRad)
|
||||||
double dHeight ;
|
double dHeight ;
|
||||||
LuaCheckParam( L, 5, dHeight)
|
LuaCheckParam( L, 5, dHeight)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
int nRefType = RTY_DEFAULT ;
|
int nRefType = RTY_DEFAULT ;
|
||||||
if ( LuaGetParam( L, 6, dLinTol))
|
if ( LuaGetParam( L, 6, dLinTol))
|
||||||
LuaGetParam( L, 7, nRefType) ;
|
LuaGetParam( L, 7, nRefType) ;
|
||||||
@@ -380,7 +378,7 @@ LuaCreateSurfTmSphere( lua_State* L)
|
|||||||
LuaCheckParam( L, 2, ptOrig)
|
LuaCheckParam( L, 2, ptOrig)
|
||||||
double dRad ;
|
double dRad ;
|
||||||
LuaCheckParam( L, 3, dRad)
|
LuaCheckParam( L, 3, dRad)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
int nRefType = RTY_DEFAULT ;
|
int nRefType = RTY_DEFAULT ;
|
||||||
if ( LuaGetParam( L, 4, dLinTol))
|
if ( LuaGetParam( L, 4, dLinTol))
|
||||||
LuaGetParam( L, 5, nRefType) ;
|
LuaGetParam( L, 5, nRefType) ;
|
||||||
@@ -406,7 +404,7 @@ LuaCreateSurfTmByFlatContour( lua_State* L)
|
|||||||
LuaCheckParam( L, 1, nParentId)
|
LuaCheckParam( L, 1, nParentId)
|
||||||
int nCrvId ;
|
int nCrvId ;
|
||||||
LuaCheckParam( L, 2, nCrvId)
|
LuaCheckParam( L, 2, nCrvId)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
if ( lua_gettop( L) >= 3)
|
if ( lua_gettop( L) >= 3)
|
||||||
LuaCheckParam( L, 3, dLinTol) ;
|
LuaCheckParam( L, 3, dLinTol) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
@@ -429,7 +427,7 @@ LuaCreateSurfTmByRegion( lua_State* L)
|
|||||||
LuaCheckParam( L, 1, nParentId)
|
LuaCheckParam( L, 1, nParentId)
|
||||||
INTVECTOR vCrvIds ;
|
INTVECTOR vCrvIds ;
|
||||||
LuaCheckParam( L, 2, vCrvIds)
|
LuaCheckParam( L, 2, vCrvIds)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
if ( lua_gettop( L) >= 3)
|
if ( lua_gettop( L) >= 3)
|
||||||
LuaCheckParam( L, 3, dLinTol) ;
|
LuaCheckParam( L, 3, dLinTol) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
@@ -454,7 +452,7 @@ LuaCreateSurfTmByExtrusion( lua_State* L)
|
|||||||
LuaCheckParam( L, 2, vCrvIds)
|
LuaCheckParam( L, 2, vCrvIds)
|
||||||
Vector3d vtExtr ;
|
Vector3d vtExtr ;
|
||||||
LuaCheckParam( L, 3, vtExtr)
|
LuaCheckParam( L, 3, vtExtr)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
int nRefType = RTY_DEFAULT ;
|
int nRefType = RTY_DEFAULT ;
|
||||||
if ( LuaGetParam( L, 4, dLinTol))
|
if ( LuaGetParam( L, 4, dLinTol))
|
||||||
LuaGetParam( L, 5, nRefType) ;
|
LuaGetParam( L, 5, nRefType) ;
|
||||||
@@ -483,7 +481,7 @@ LuaCreateSurfTmByRegionExtrusion( lua_State* L)
|
|||||||
LuaCheckParam( L, 2, vCrvIds)
|
LuaCheckParam( L, 2, vCrvIds)
|
||||||
Vector3d vtExtr ;
|
Vector3d vtExtr ;
|
||||||
LuaCheckParam( L, 3, vtExtr)
|
LuaCheckParam( L, 3, vtExtr)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
int nRefType = RTY_DEFAULT ;
|
int nRefType = RTY_DEFAULT ;
|
||||||
if ( LuaGetParam( L, 4, dLinTol))
|
if ( LuaGetParam( L, 4, dLinTol))
|
||||||
LuaGetParam( L, 5, nRefType) ;
|
LuaGetParam( L, 5, nRefType) ;
|
||||||
@@ -515,7 +513,7 @@ LuaCreateSurfTmByRevolve( lua_State* L)
|
|||||||
LuaCheckParam( L, 4, vtAx)
|
LuaCheckParam( L, 4, vtAx)
|
||||||
bool bCapEnds ;
|
bool bCapEnds ;
|
||||||
LuaCheckParam( L, 5, bCapEnds)
|
LuaCheckParam( L, 5, bCapEnds)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
int nRefType = RTY_DEFAULT ;
|
int nRefType = RTY_DEFAULT ;
|
||||||
if ( LuaGetParam( L, 6, dLinTol))
|
if ( LuaGetParam( L, 6, dLinTol))
|
||||||
LuaGetParam( L, 7, nRefType) ;
|
LuaGetParam( L, 7, nRefType) ;
|
||||||
@@ -553,7 +551,7 @@ LuaCreateSurfTmByScrewing( lua_State* L)
|
|||||||
bool bCapEnds = false ;
|
bool bCapEnds = false ;
|
||||||
if ( LuaGetParam( L, nPar, bCapEnds))
|
if ( LuaGetParam( L, nPar, bCapEnds))
|
||||||
++ nPar ;
|
++ nPar ;
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
if ( LuaGetParam( L, nPar, dLinTol))
|
if ( LuaGetParam( L, nPar, dLinTol))
|
||||||
++ nPar ;
|
++ nPar ;
|
||||||
int nRefType = RTY_DEFAULT ;
|
int nRefType = RTY_DEFAULT ;
|
||||||
@@ -570,6 +568,38 @@ LuaCreateSurfTmByScrewing( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateSurfTmRectSwept( lua_State* L)
|
||||||
|
{
|
||||||
|
// 7 o 8 parametri : ParentId, dDimH, dDimV, dBevelH, dBevelV, GuideId, nCapType [, dTol]
|
||||||
|
int nParentId ;
|
||||||
|
LuaCheckParam( L, 1, nParentId)
|
||||||
|
double dDimH ;
|
||||||
|
LuaCheckParam( L, 2, dDimH)
|
||||||
|
double dDimV ;
|
||||||
|
LuaCheckParam( L, 3, dDimV)
|
||||||
|
double dBevelH ;
|
||||||
|
LuaCheckParam( L, 4, dBevelH)
|
||||||
|
double dBevelV ;
|
||||||
|
LuaCheckParam( L, 5, dBevelV)
|
||||||
|
int nGuideId ;
|
||||||
|
LuaCheckParam( L, 6, nGuideId)
|
||||||
|
int nCapType ;
|
||||||
|
LuaCheckParam( L, 7, nCapType)
|
||||||
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
|
LuaGetParam( L, 8, dLinTol) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// creo STM rectangular swept
|
||||||
|
int nId = ExeCreateSurfTmRectSwept( nParentId, dDimH, dDimV, dBevelH, dBevelV, nGuideId, nCapType, dLinTol) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaCreateSurfTmSwept( lua_State* L)
|
LuaCreateSurfTmSwept( lua_State* L)
|
||||||
@@ -583,9 +613,8 @@ LuaCreateSurfTmSwept( lua_State* L)
|
|||||||
LuaCheckParam( L, 3, nGuideId)
|
LuaCheckParam( L, 3, nGuideId)
|
||||||
bool bCapEnds ;
|
bool bCapEnds ;
|
||||||
LuaCheckParam( L, 4, bCapEnds)
|
LuaCheckParam( L, 4, bCapEnds)
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
if ( lua_gettop( L) >= 5)
|
LuaGetParam( L, 5, dLinTol) ;
|
||||||
LuaCheckParam( L, 5, dLinTol) ;
|
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// creo STM swept
|
// creo STM swept
|
||||||
int nId = ExeCreateSurfTmSwept( nParentId, nSectId, nGuideId, bCapEnds, dLinTol) ;
|
int nId = ExeCreateSurfTmSwept( nParentId, nSectId, nGuideId, bCapEnds, dLinTol) ;
|
||||||
@@ -609,7 +638,7 @@ LuaCreateSurfTmRuled( lua_State* L)
|
|||||||
int nPtOrCrvId2 ;
|
int nPtOrCrvId2 ;
|
||||||
LuaCheckParam( L, 3, nPtOrCrvId2)
|
LuaCheckParam( L, 3, nPtOrCrvId2)
|
||||||
string sType = "IP" ;
|
string sType = "IP" ;
|
||||||
double dLinTol = LIN_TOL_DEF ;
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
if ( LuaGetParam( L, 4, sType))
|
if ( LuaGetParam( L, 4, sType))
|
||||||
LuaGetParam( L, 5, dLinTol) ;
|
LuaGetParam( L, 5, dLinTol) ;
|
||||||
else
|
else
|
||||||
@@ -812,6 +841,7 @@ LuaInstallGdbCreateSurf( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByRegionExtrusion", LuaCreateSurfTmByRegionExtrusion) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByRegionExtrusion", LuaCreateSurfTmByRegionExtrusion) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByRevolve", LuaCreateSurfTmByRevolve) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByRevolve", LuaCreateSurfTmByRevolve) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByScrewing", LuaCreateSurfTmByScrewing) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByScrewing", LuaCreateSurfTmByScrewing) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRectSwept", LuaCreateSurfTmRectSwept) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSwept", LuaCreateSurfTmSwept) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSwept", LuaCreateSurfTmSwept) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRuled", LuaCreateSurfTmRuled) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRuled", LuaCreateSurfTmRuled) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByTriangles", LuaCreateSurfTmByTriangles) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmByTriangles", LuaCreateSurfTmByTriangles) ;
|
||||||
|
|||||||
@@ -432,6 +432,25 @@ LuaArcNormVersor( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCurveCompoLength( lua_State* L)
|
||||||
|
{
|
||||||
|
// 2 parametri : Id, nCrv
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
int nCrv ;
|
||||||
|
LuaCheckParam( L, 2, nCrv)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// recupero il centro della curva semplice indicizzata
|
||||||
|
double dLen ;
|
||||||
|
if ( ExeCurveCompoLength( nId, nCrv, dLen))
|
||||||
|
LuaSetParam( L, dLen) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaCurveCompoCenter( lua_State* L)
|
LuaCurveCompoCenter( lua_State* L)
|
||||||
@@ -538,6 +557,7 @@ LuaInstallGdbGetCurve( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArcAngCenter", LuaArcAngCenter) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArcAngCenter", LuaArcAngCenter) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArcDeltaN", LuaArcDeltaN) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArcDeltaN", LuaArcDeltaN) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtArcNormVersor", LuaArcNormVersor) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtArcNormVersor", LuaArcNormVersor) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoLength", LuaCurveCompoLength) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoCenter", LuaCurveCompoCenter) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoCenter", LuaCurveCompoCenter) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoRadius", LuaCurveCompoRadius) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoRadius", LuaCurveCompoRadius) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoAngCenter", LuaCurveCompoAngCenter) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoAngCenter", LuaCurveCompoAngCenter) ;
|
||||||
|
|||||||
@@ -40,6 +40,20 @@ LuaSurfArea( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSurfIsClosed( lua_State* L)
|
||||||
|
{
|
||||||
|
// 1 parametro : Id
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// verifico se è superficie chiusa
|
||||||
|
bool bOk = ExeSurfIsClosed( nId) ;
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaSurfVolume( lua_State* L)
|
LuaSurfVolume( lua_State* L)
|
||||||
@@ -254,6 +268,20 @@ LuaSurfFrGetZigZagInfill( lua_State* L)
|
|||||||
return 2 ;
|
return 2 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSurfTmVertexCount( lua_State* L)
|
||||||
|
{
|
||||||
|
// 1 parametro : Id
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// recupero il numero di vertici della superficie trimesh
|
||||||
|
int nNbr = ExeSurfTmVertexCount( nId) ;
|
||||||
|
LuaSetParam( L, nNbr) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaSurfTmFacetCount( lua_State* L)
|
LuaSurfTmFacetCount( lua_State* L)
|
||||||
@@ -268,6 +296,72 @@ LuaSurfTmFacetCount( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSurfTmPartCount( lua_State* L)
|
||||||
|
{
|
||||||
|
// 1 parametro : Id
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// recupero il numero di parti della superficie trimesh
|
||||||
|
int nParts = ExeSurfTmPartCount( nId) ;
|
||||||
|
if ( nParts >= 0)
|
||||||
|
LuaSetParam( L, nParts) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSurfTmGetVertex( lua_State* L)
|
||||||
|
{
|
||||||
|
// 2 o 3 parametri : Id, nVert, [, nRefId]
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
int nVert ;
|
||||||
|
LuaCheckParam( L, 2, nVert)
|
||||||
|
int nRefId = nId ;
|
||||||
|
LuaGetParam( L, 3, nRefId) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// recupero il vertice di indice dato (0-based)
|
||||||
|
Point3d ptVert ;
|
||||||
|
bool bOk = ExeSurfTmGetVertex( nId, nVert, nRefId, ptVert) ;
|
||||||
|
if ( bOk)
|
||||||
|
LuaSetParam( L, ptVert) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSurfTmGetNearestVertex( lua_State* L)
|
||||||
|
{
|
||||||
|
// 2 o 3 parametri : Id, ptNear [, nRefId]
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
Point3d ptNear ;
|
||||||
|
LuaCheckParam( L, 2, ptNear)
|
||||||
|
int nRefId = nId ;
|
||||||
|
LuaGetParam( L, 3, nRefId) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// recupero il vertice più vicino della superficie
|
||||||
|
int nVert ;
|
||||||
|
Point3d ptVert ;
|
||||||
|
bool bOk = ExeSurfTmGetNearestVertex( nId, ptNear, nRefId, nVert, ptVert) ;
|
||||||
|
if ( bOk) {
|
||||||
|
LuaSetParam( L, nVert) ;
|
||||||
|
LuaSetParam( L, ptVert) ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
}
|
||||||
|
return 2 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaSurfTmFacetFromTria( lua_State* L)
|
LuaSurfTmFacetFromTria( lua_State* L)
|
||||||
@@ -288,6 +382,27 @@ LuaSurfTmFacetFromTria( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSurfTmGetAllVertInFacet( lua_State* L)
|
||||||
|
{
|
||||||
|
// 2 parametri : nId, nFacet
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
int nFacet ;
|
||||||
|
LuaCheckParam( L, 2, nFacet)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// recupero l'elenco dei vertici nella faccia
|
||||||
|
INTVECTOR vVert ;
|
||||||
|
bool bOk = ExeSurfTmGetAllVertInFacet( nId, nFacet, vVert) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( bOk)
|
||||||
|
LuaSetParam( L, vVert) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaSurfTmGetFacetBBox( lua_State* L)
|
LuaSurfTmGetFacetBBox( lua_State* L)
|
||||||
@@ -919,6 +1034,7 @@ LuaInstallGdbGetSurf( LuaMgr& luaMgr)
|
|||||||
{
|
{
|
||||||
bool bOk = ( &luaMgr != nullptr) ;
|
bool bOk = ( &luaMgr != nullptr) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfArea", LuaSurfArea) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfArea", LuaSurfArea) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfIsClosed", LuaSurfIsClosed) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfVolume", LuaSurfVolume) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfVolume", LuaSurfVolume) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrNormVersor", LuaSurfFrNormVersor) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrNormVersor", LuaSurfFrNormVersor) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrGrossArea", LuaSurfFrGrossArea) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrGrossArea", LuaSurfFrGrossArea) ;
|
||||||
@@ -929,8 +1045,13 @@ LuaInstallGdbGetSurf( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrMoveSimpleNoCollision", LuaSurfFrMoveSimpleNoCollision) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrMoveSimpleNoCollision", LuaSurfFrMoveSimpleNoCollision) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrRotateSimpleNoCollision", LuaSurfFrRotateSimpleNoCollision) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrRotateSimpleNoCollision", LuaSurfFrRotateSimpleNoCollision) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetSurfFrZigZagInfill", LuaSurfFrGetZigZagInfill) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtGetSurfFrZigZagInfill", LuaSurfFrGetZigZagInfill) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmVertexCount", LuaSurfTmVertexCount) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetCount", LuaSurfTmFacetCount) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetCount", LuaSurfTmFacetCount) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmPartCount", LuaSurfTmPartCount) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetVertex", LuaSurfTmGetVertex) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetNearestVertex", LuaSurfTmGetNearestVertex) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetFromTria", LuaSurfTmFacetFromTria) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmFacetFromTria", LuaSurfTmFacetFromTria) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetAllVertInFacet", LuaSurfTmGetAllVertInFacet) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBox", LuaSurfTmGetFacetBBox) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBox", LuaSurfTmGetFacetBBox) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBoxGlob", LuaSurfTmGetFacetBBoxGlob) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBoxGlob", LuaSurfTmGetFacetBBoxGlob) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBoxRef", LuaSurfTmGetFacetBBoxRef) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBoxRef", LuaSurfTmGetFacetBBoxRef) ;
|
||||||
|
|||||||
@@ -206,6 +206,40 @@ LuaModifyCurveEndPoint( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSpiralizeCurveAlongExtrusion( lua_State* L)
|
||||||
|
{
|
||||||
|
// 2 parametri : Id, Delta
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
double dDelta ;
|
||||||
|
LuaCheckParam( L, 2, dDelta)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// modifico la curva
|
||||||
|
bool bOk = ExeSpiralizeCurveAlongExtrusion( nId, dDelta) ;
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSpiralizeCurveAlongGuide( lua_State* L)
|
||||||
|
{
|
||||||
|
// 2 o 3 parametri : Id, IdGuide, dTol
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
int nGuideId ;
|
||||||
|
LuaCheckParam( L, 2, nGuideId)
|
||||||
|
double dTol = 10 * EPS_SMALL ;
|
||||||
|
LuaGetParam( L, 3, dTol) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// modifico la curva
|
||||||
|
bool bOk = ExeSpiralizeCurveAlongGuide( nId, nGuideId, dTol) ;
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaModifyCurveExtrusion( lua_State* L)
|
LuaModifyCurveExtrusion( lua_State* L)
|
||||||
@@ -925,6 +959,8 @@ LuaInstallGdbModifyCurve( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtChangeClosedCurveStartPoint", LuaChangeClosedCurveStartPoint) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtChangeClosedCurveStartPoint", LuaChangeClosedCurveStartPoint) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveStartPoint", LuaModifyCurveStartPoint) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveStartPoint", LuaModifyCurveStartPoint) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveEndPoint", LuaModifyCurveEndPoint) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveEndPoint", LuaModifyCurveEndPoint) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSpiralizeCurveAlongExtrusion", LuaSpiralizeCurveAlongExtrusion) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSpiralizeCurveAlongGuide", LuaSpiralizeCurveAlongGuide) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveExtrusion", LuaModifyCurveExtrusion) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveExtrusion", LuaModifyCurveExtrusion) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveThickness", LuaModifyCurveThickness) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveThickness", LuaModifyCurveThickness) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtTrimCurveStartAtLen", LuaTrimCurveStartAtLen) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtTrimCurveStartAtLen", LuaTrimCurveStartAtLen) ;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
//--------------------------- Include ----------------------------------------
|
//--------------------------- Include ----------------------------------------
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "LUA.h"
|
#include "LUA.h"
|
||||||
|
#include "EXE_Const.h"
|
||||||
#include "/EgtDev/Include/EXeExecutor.h"
|
#include "/EgtDev/Include/EXeExecutor.h"
|
||||||
#include "/EgtDev/Include/EXeConst.h"
|
#include "/EgtDev/Include/EXeConst.h"
|
||||||
#include "/EgtDev/Include/EGkCurve.h"
|
#include "/EgtDev/Include/EGkCurve.h"
|
||||||
@@ -57,6 +58,23 @@ LuaExplodeSurf( lua_State* L)
|
|||||||
return 2 ;
|
return 2 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaApproxSurf( lua_State* L)
|
||||||
|
{
|
||||||
|
// 1 o 2 parametri : Id [, dLinTol]
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
double dLinTol = LIN_TOL_SRF ;
|
||||||
|
LuaGetParam( L, 2, dLinTol) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// approssimazione della superficie
|
||||||
|
bool bOk = ExeApproxSurface( nId, dLinTol) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaSurfFrAdd( lua_State* L)
|
LuaSurfFrAdd( lua_State* L)
|
||||||
@@ -123,6 +141,49 @@ LuaSurfFrOffset( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSurfTmMoveVertex( lua_State* L)
|
||||||
|
{
|
||||||
|
// 3 o 4 o 5 parametri : nId, nVert, ptNewVert [, nRefId] [, bUpdate]
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
int nVert ;
|
||||||
|
LuaCheckParam( L, 2, nVert)
|
||||||
|
Point3d ptNewVert ;
|
||||||
|
LuaCheckParam( L, 3, ptNewVert)
|
||||||
|
int nRefType = RTY_DEFAULT ;
|
||||||
|
bool bUpdate = true ;
|
||||||
|
if ( LuaGetParam( L, 4, nRefType))
|
||||||
|
LuaGetParam( L, 5, bUpdate) ;
|
||||||
|
else
|
||||||
|
LuaGetParam( L, 4, bUpdate) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// sposto il vertice di indice dato della trimesh
|
||||||
|
bool bOk = ExeSurfTmMoveVertex( nId, nVert, ptNewVert, nRefType, bUpdate) ;
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaSurfTmToTriangles( lua_State* L)
|
||||||
|
{
|
||||||
|
// 1 parametro : nId
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// esplosione della trimesh in triangoli
|
||||||
|
int nCount ;
|
||||||
|
int nFirstId = ExeSurfTmToTriangles( nId, &nCount) ;
|
||||||
|
if ( nFirstId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nFirstId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
LuaSetParam( L, nCount) ;
|
||||||
|
return 2 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaSurfTmRemoveFacet( lua_State* L)
|
LuaSurfTmRemoveFacet( lua_State* L)
|
||||||
@@ -334,10 +395,13 @@ LuaInstallGdbModifySurf( LuaMgr& luaMgr)
|
|||||||
bool bOk = ( &luaMgr != nullptr) ;
|
bool bOk = ( &luaMgr != nullptr) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtInvertSurf", LuaInvertSurf) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtInvertSurf", LuaInvertSurf) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExplodeSurf", LuaExplodeSurf) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtExplodeSurf", LuaExplodeSurf) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtApproxSurf", LuaApproxSurf) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrAdd", LuaSurfFrAdd) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrAdd", LuaSurfFrAdd) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrSubtract", LuaSurfFrSubtract) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrSubtract", LuaSurfFrSubtract) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrIntersect", LuaSurfFrIntersect) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrIntersect", LuaSurfFrIntersect) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrOffset", LuaSurfFrOffset) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrOffset", LuaSurfFrOffset) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmMoveVertex", LuaSurfTmMoveVertex) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmToTriangles", LuaSurfTmToTriangles) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRemoveFacet", LuaSurfTmRemoveFacet) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRemoveFacet", LuaSurfTmRemoveFacet) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSwapFacets", LuaSurfTmSwapFacets) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSwapFacets", LuaSurfTmSwapFacets) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRemovePart", LuaSurfTmRemovePart) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRemovePart", LuaSurfTmRemovePart) ;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ LuaVolZmapSetStdTool( lua_State* L)
|
|||||||
LuaGetParam( L, 7, nFlag) ;
|
LuaGetParam( L, 7, nFlag) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// imposto utensile standard a Zmap indicati
|
// imposto utensile standard a Zmap indicati
|
||||||
bool bOk = ExeVolZmapSetStdTool( vIds, sToolName, dLen, dDiam, dCornR, dCutterH, nFlag) ;
|
bool bOk = ExeVolZmapSetStdTool( vIds, sToolName, dLen, dDiam, dCornR, dCutterH, nFlag, true) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -125,7 +125,7 @@ LuaVolZmapSetAdvTool( lua_State* L)
|
|||||||
LuaGetParam( L, 9, nFlag) ;
|
LuaGetParam( L, 9, nFlag) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// imposto utensile avanzato a Zmap indicati
|
// imposto utensile avanzato a Zmap indicati
|
||||||
bool bOk = ExeVolZmapSetAdvTool( vIds, sToolName, dLen, dDiam, dTipLen, dTipDiam, dCornR, dCutterH, nFlag) ;
|
bool bOk = ExeVolZmapSetAdvTool( vIds, sToolName, dLen, dDiam, dTipLen, dTipDiam, dCornR, dCutterH, nFlag, true) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -154,7 +154,7 @@ LuaVolZmapSetSawTool( lua_State* L)
|
|||||||
LuaGetParam( L, 8, nFlag) ;
|
LuaGetParam( L, 8, nFlag) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// imposto utensile avanzato a Zmap indicati
|
// imposto utensile avanzato a Zmap indicati
|
||||||
bool bOk = ExeVolZmapSetSawTool( vIds, sToolName, dLen, dDiam, dThick, dStemDiam, dCornR, nFlag) ;
|
bool bOk = ExeVolZmapSetSawTool( vIds, sToolName, dLen, dDiam, dThick, dStemDiam, dCornR, nFlag, true) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -175,7 +175,7 @@ LuaVolZmapSetGenTool( lua_State* L)
|
|||||||
LuaGetParam( L, 4, nFlag) ;
|
LuaGetParam( L, 4, nFlag) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// imposto utensile generico a Zmap indicati
|
// imposto utensile generico a Zmap indicati
|
||||||
bool bOk = ExeVolZmapSetGenTool( vIds, sToolName, nToolSectId, nFlag) ;
|
bool bOk = ExeVolZmapSetGenTool( vIds, sToolName, nToolSectId, nFlag, true) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -202,7 +202,7 @@ LuaVolZmapSetMortiserTool( lua_State* L)
|
|||||||
LuaGetParam( L, 7, nFlag) ;
|
LuaGetParam( L, 7, nFlag) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// imposto mortasatrice a Zmap indicati
|
// imposto mortasatrice a Zmap indicati
|
||||||
bool bOk = ExeVolZmapSetMortiserTool( vIds, sToolName, dLen, dWidth, dThick, dCornR, nFlag) ;
|
bool bOk = ExeVolZmapSetMortiserTool( vIds, sToolName, dLen, dWidth, dThick, dCornR, nFlag, true) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -227,7 +227,7 @@ LuaVolZmapSetChiselTool( lua_State* L)
|
|||||||
LuaGetParam( L, 6, nFlag) ;
|
LuaGetParam( L, 6, nFlag) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// imposto scalpello a Zmap indicati
|
// imposto scalpello a Zmap indicati
|
||||||
bool bOk = ExeVolZmapSetChiselTool( vIds, sToolName, dLen, dWidth, dThick, nFlag) ;
|
bool bOk = ExeVolZmapSetChiselTool( vIds, sToolName, dLen, dWidth, dThick, nFlag, true) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -242,7 +242,7 @@ LuaVolZmapResetTool( lua_State* L)
|
|||||||
LuaCheckParam( L, 1, vIds)
|
LuaCheckParam( L, 1, vIds)
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// reset utensile a Zmap indicati
|
// reset utensile a Zmap indicati
|
||||||
bool bOk = ExeVolZmapResetTool( vIds) ;
|
bool bOk = ExeVolZmapResetTools( vIds) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
|
|||||||
@@ -682,6 +682,25 @@ LuaRemoveInfo( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaGetAllInfo( lua_State* L)
|
||||||
|
{
|
||||||
|
// 1 parametro : Id
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 1, nId)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// recupero tutte le info
|
||||||
|
STRVECTOR vsInfo ;
|
||||||
|
bool bOk = ExeGetAllInfo( nId, vsInfo) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( bOk)
|
||||||
|
LuaSetParam( L, vsInfo) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaSetTextureName( lua_State* L)
|
LuaSetTextureName( lua_State* L)
|
||||||
@@ -809,6 +828,7 @@ LuaInstallGdbObjAttribs( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetInfo", LuaGetInfo) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtGetInfo", LuaGetInfo) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExistsInfo", LuaExistsInfo) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtExistsInfo", LuaExistsInfo) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveInfo", LuaRemoveInfo) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveInfo", LuaRemoveInfo) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtGetAllInfo", LuaGetAllInfo) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSetTextureName", LuaSetTextureName) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSetTextureName", LuaSetTextureName) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSetTextureFrame", LuaSetTextureFrame) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSetTextureFrame", LuaSetTextureFrame) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveTextureData", LuaRemoveTextureData) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveTextureData", LuaRemoveTextureData) ;
|
||||||
|
|||||||
+89
-22
@@ -52,7 +52,7 @@ MyPrint( lua_State* L)
|
|||||||
s = lua_tostring( L, -1) ; /* get result */
|
s = lua_tostring( L, -1) ; /* get result */
|
||||||
if ( s == nullptr)
|
if ( s == nullptr)
|
||||||
return luaL_error( L,
|
return luaL_error( L,
|
||||||
LUA_QL("tostring") " must return a string to " LUA_QL("print")) ;
|
"'tostring' must return a string to 'print'") ;
|
||||||
if ( i > 1)
|
if ( i > 1)
|
||||||
sOut += "\t" ;
|
sOut += "\t" ;
|
||||||
sOut += s ;
|
sOut += s ;
|
||||||
@@ -208,19 +208,19 @@ LuaSetVal( lua_State* L)
|
|||||||
{ bool bVal ;
|
{ bool bVal ;
|
||||||
LuaGetParam( L, 2, bVal) ;
|
LuaGetParam( L, 2, bVal) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, bVal, sNotes) ;
|
bOk = SetVal( sKey, bVal, sNotes) ;
|
||||||
} break ;
|
} break ;
|
||||||
case LUA_TNUMBER :
|
case LUA_TNUMBER :
|
||||||
{ double dVal ;
|
{ double dVal ;
|
||||||
LuaGetParam( L, 2, dVal) ;
|
LuaGetParam( L, 2, dVal) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, dVal, sNotes) ;
|
bOk = SetVal( sKey, dVal, sNotes) ;
|
||||||
} break ;
|
} break ;
|
||||||
case LUA_TSTRING :
|
case LUA_TSTRING :
|
||||||
{ string sVal ;
|
{ string sVal ;
|
||||||
LuaGetParam( L, 2, sVal) ;
|
LuaGetParam( L, 2, sVal) ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, (const string&) sVal, sNotes) ;
|
bOk = SetVal( sKey, (const string&) sVal, sNotes) ;
|
||||||
} break ;
|
} break ;
|
||||||
case LUA_TTABLE :
|
case LUA_TTABLE :
|
||||||
{ Frame3d frVal ;
|
{ Frame3d frVal ;
|
||||||
@@ -231,32 +231,35 @@ LuaSetVal( lua_State* L)
|
|||||||
STRVECTOR vsVal ;
|
STRVECTOR vsVal ;
|
||||||
if ( LuaGetParam( L, 2, frVal)) {
|
if ( LuaGetParam( L, 2, frVal)) {
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, frVal, sNotes) ;
|
bOk = SetVal( sKey, frVal, sNotes) ;
|
||||||
}
|
}
|
||||||
else if ( LuaGetParam( L, 2, b3Val)) {
|
else if ( LuaGetParam( L, 2, b3Val)) {
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, b3Val, sNotes) ;
|
bOk = SetVal( sKey, b3Val, sNotes) ;
|
||||||
}
|
}
|
||||||
else if ( LuaGetParam( L, 2, vtVal)) {
|
else if ( LuaGetParam( L, 2, vtVal)) {
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, vtVal, sNotes) ;
|
bOk = SetVal( sKey, vtVal, sNotes) ;
|
||||||
}
|
}
|
||||||
else if ( LuaGetParam( L, 2, vnVal)) {
|
else if ( LuaGetParam( L, 2, vnVal)) {
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, vnVal, sNotes) ;
|
bOk = SetVal( sKey, vnVal, sNotes) ;
|
||||||
}
|
}
|
||||||
else if ( LuaGetParam( L, 2, vdVal)) {
|
else if ( LuaGetParam( L, 2, vdVal)) {
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, vdVal, sNotes) ;
|
bOk = SetVal( sKey, vdVal, sNotes) ;
|
||||||
}
|
}
|
||||||
else if ( LuaGetParam( L, 2, vsVal)) {
|
else if ( LuaGetParam( L, 2, vsVal)) {
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
bOk = SetValInNotes( sKey, vsVal, sNotes) ;
|
bOk = SetVal( sKey, vsVal, sNotes) ;
|
||||||
}
|
}
|
||||||
} break ;
|
} break ;
|
||||||
}
|
}
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, sNotes) ;
|
if ( bOk)
|
||||||
|
LuaSetParam( L, sNotes) ;
|
||||||
|
else
|
||||||
|
LuaSetParam(L, "") ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +496,7 @@ LuaGetEnableUI( lua_State* L)
|
|||||||
static int
|
static int
|
||||||
LuaOutBox( lua_State* L)
|
LuaOutBox( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 o 3 parametri : stringa, titolo [, icona]
|
// 2, 3 o 4 parametri : sOut, sTitle [, sIcon] [, sButtons]
|
||||||
string sOut ;
|
string sOut ;
|
||||||
LuaCheckParam( L, 1, sOut)
|
LuaCheckParam( L, 1, sOut)
|
||||||
string sTitle ;
|
string sTitle ;
|
||||||
@@ -510,16 +513,34 @@ LuaOutBox( lua_State* L)
|
|||||||
nIcon = MB_ICONINFORMATION ;
|
nIcon = MB_ICONINFORMATION ;
|
||||||
else if ( sIcon == "QUESTION")
|
else if ( sIcon == "QUESTION")
|
||||||
nIcon = MB_ICONQUESTION ;
|
nIcon = MB_ICONQUESTION ;
|
||||||
|
string sButtons ;
|
||||||
|
LuaGetParam( L, 4, sButtons) ;
|
||||||
|
int nButtons = MB_OKCANCEL ;
|
||||||
|
ToUpper( sButtons) ;
|
||||||
|
if ( sButtons == "OK")
|
||||||
|
nButtons = MB_OK ;
|
||||||
|
else if ( sButtons == "OKCANCEL")
|
||||||
|
nButtons = MB_OKCANCEL ;
|
||||||
|
else if ( sButtons == "ABORTRETRYIGNORE")
|
||||||
|
nButtons = MB_ABORTRETRYIGNORE ;
|
||||||
|
else if ( sButtons == "YESNOCANCEL")
|
||||||
|
nButtons = MB_YESNOCANCEL ;
|
||||||
|
else if ( sButtons == "YESNO")
|
||||||
|
nButtons = MB_YESNO ;
|
||||||
|
else if ( sButtons == "RETRYCANCEL")
|
||||||
|
nButtons = MB_RETRYCANCEL ;
|
||||||
|
else if ( sButtons == "CANCELTRYCONTINUE")
|
||||||
|
nButtons = MB_CANCELTRYCONTINUE ;
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// se abilitata UI, emetto la finestra di dialogo
|
// emetto finestra di dialogo (solo se ablitata UI)
|
||||||
int nRes = IDCANCEL ;
|
int nRes = ExeMessageBox( sOut, sTitle, nButtons | nIcon) ;
|
||||||
if ( ExeGetEnableUI()) {
|
// risultato
|
||||||
HWND hTopWnd = ExeGetMainWindowHandle() ; // FindTopWindow() ;
|
if ( nRes == IDOK || nRes == IDRETRY || nRes == IDYES || nRes == IDTRYAGAIN)
|
||||||
nRes = MessageBox( hTopWnd, stringtoW( sOut), stringtoW( sTitle),
|
LuaSetParam( L, true) ;
|
||||||
MB_OKCANCEL | nIcon | MB_TASKMODAL) ;
|
else if ( nRes == IDNO || nRes == IDCONTINUE || nRes == IDIGNORE)
|
||||||
}
|
LuaSetParam( L, false) ;
|
||||||
// risultato (Ok->true, Cancel->false)
|
else
|
||||||
LuaSetParam( L, ( nRes == IDOK)) ;
|
LuaSetParam( L) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -985,6 +1006,49 @@ LuaWinExec( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCloseExe( lua_State* L)
|
||||||
|
{
|
||||||
|
// 1 parametro opzionale : [nExitCode]
|
||||||
|
int nExitCode = 0 ;
|
||||||
|
LuaGetParam( L, 1, nExitCode) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// eseguo chiusura forzata
|
||||||
|
bool bOk = ( TerminateProcess( GetCurrentProcess(), abs( nExitCode)) != FALSE) ;
|
||||||
|
// restituisco il risultato (in realtà il programma si è già concluso)
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCreateMutex( lua_State* L)
|
||||||
|
{
|
||||||
|
// un solo parametro : sMutexName
|
||||||
|
string sMutexName ;
|
||||||
|
LuaCheckParam( L, 1, sMutexName)
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// verifico esistenza Mutex con Nome (altrimenti lo creo per bloccare gli altri)
|
||||||
|
bool bOk = ExeCreateMutex( sMutexName) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaReleaseMutex( lua_State* L)
|
||||||
|
{
|
||||||
|
// nessun parametro
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// rilascio l'eventuale Mutex con Nome attivo
|
||||||
|
bool bOk = ExeReleaseMutex() ;
|
||||||
|
// restituisco il risultato
|
||||||
|
LuaSetParam( L, bOk) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
const int MAX_CTRLS = IDC_TEXT8 -IDC_TEXT1 + 1 ;
|
const int MAX_CTRLS = IDC_TEXT8 -IDC_TEXT1 + 1 ;
|
||||||
const int OFFS_CTRLS = 40 ;
|
const int OFFS_CTRLS = 40 ;
|
||||||
@@ -1150,7 +1214,7 @@ LuaDialogBox( lua_State* L)
|
|||||||
// se abilitata UI, lancio dialogo
|
// se abilitata UI, lancio dialogo
|
||||||
if ( ExeGetEnableUI()) {
|
if ( ExeGetEnableUI()) {
|
||||||
// lancio dialogo
|
// lancio dialogo
|
||||||
HWND hTopWnd = ExeGetMainWindowHandle() ; // FindTopWindow() ;
|
HWND hTopWnd = ExeGetMainWindowHandle() ;
|
||||||
bool bOk = ( DialogBox( GetModuleIstance(), MAKEINTRESOURCE( IDD_LUADLG), hTopWnd, (DLGPROC)DialogBoxProc) == IDOK) ;
|
bool bOk = ( DialogBox( GetModuleIstance(), MAKEINTRESOURCE( IDD_LUADLG), hTopWnd, (DLGPROC)DialogBoxProc) == IDOK) ;
|
||||||
// restituzione parametri
|
// restituzione parametri
|
||||||
if ( bOk) {
|
if ( bOk) {
|
||||||
@@ -1219,6 +1283,9 @@ LuaInstallGeneral( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtMsg", LuaGetMsg) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtMsg", LuaGetMsg) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtDialogBox", LuaDialogBox) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtDialogBox", LuaDialogBox) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtWinExec", LuaWinExec) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtWinExec", LuaWinExec) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCloseExe", LuaCloseExe) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCreateMutex", LuaCreateMutex) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtReleaseMutex", LuaReleaseMutex) ;
|
||||||
|
|
||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,38 @@ LuaPointCurveDist( lua_State* L)
|
|||||||
return 3 ;
|
return 3 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaPointCurveDistSide( lua_State* L)
|
||||||
|
{
|
||||||
|
// 3 o 4 parametri : ptP, nCrvId, vtN [, nRefId]
|
||||||
|
Point3d ptP ;
|
||||||
|
LuaCheckParam( L, 1, ptP)
|
||||||
|
int nId ;
|
||||||
|
LuaCheckParam( L, 2, nId)
|
||||||
|
Vector3d vtN ;
|
||||||
|
LuaCheckParam( L, 3, vtN)
|
||||||
|
int nRefType = nId ;
|
||||||
|
LuaGetParam( L, 4, nRefType) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// calcolo la distanza
|
||||||
|
int nSide ;
|
||||||
|
double dDist ;
|
||||||
|
Point3d ptMin ;
|
||||||
|
bool bOk = ExePointCurveDistSide( ptP, nId, vtN, nRefType, &dDist, ptMin, &nSide) ;
|
||||||
|
if ( bOk) {
|
||||||
|
LuaSetParam( L, dDist) ;
|
||||||
|
LuaSetParam( L, ptMin) ;
|
||||||
|
LuaSetParam( L, nSide) ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
}
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaPointSurfTmDist( lua_State* L)
|
LuaPointSurfTmDist( lua_State* L)
|
||||||
@@ -85,6 +117,7 @@ LuaInstallGeoDist( LuaMgr& luaMgr)
|
|||||||
{
|
{
|
||||||
bool bOk = ( &luaMgr != nullptr) ;
|
bool bOk = ( &luaMgr != nullptr) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtPointCurveDist", LuaPointCurveDist) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtPointCurveDist", LuaPointCurveDist) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtPointCurveDistSide", LuaPointCurveDistSide) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtPointSurfTmDist", LuaPointSurfTmDist) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtPointSurfTmDist", LuaPointSurfTmDist) ;
|
||||||
return bOk ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,6 +244,32 @@ LuaPlaneCurveInters( lua_State* L)
|
|||||||
return 2 ;
|
return 2 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCurveCurveInters( lua_State* L)
|
||||||
|
{
|
||||||
|
// 3 parametri : nId1, nId2, nDestGrpId
|
||||||
|
int nId1 ;
|
||||||
|
LuaCheckParam( L, 1, nId1)
|
||||||
|
int nId2 ;
|
||||||
|
LuaCheckParam( L, 2, nId2)
|
||||||
|
int nDestGrpId ;
|
||||||
|
LuaCheckParam( L, 3, nDestGrpId) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// eseguo l'intersezione
|
||||||
|
int nPntCount = 0 ;
|
||||||
|
int nCrvCount = 0 ;
|
||||||
|
int nNewId = ExeCurveCurveInters( nId1, nId2, nDestGrpId, &nPntCount, &nCrvCount) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nNewId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nNewId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
LuaSetParam( L, nPntCount) ;
|
||||||
|
LuaSetParam( L, nCrvCount) ;
|
||||||
|
return 3 ;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaLineVolZmapInters( lua_State* L)
|
LuaLineVolZmapInters( lua_State* L)
|
||||||
@@ -322,6 +348,7 @@ LuaInstallGeoInters( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtParPlanesSurfTmInters", LuaParPlanesSurfTmInters) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtParPlanesSurfTmInters", LuaParPlanesSurfTmInters) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSurfTmInters", LuaSurfTmSurfTmInters) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSurfTmInters", LuaSurfTmSurfTmInters) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtPlaneCurveInters", LuaPlaneCurveInters) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtPlaneCurveInters", LuaPlaneCurveInters) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCurveInters", LuaCurveCurveInters) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtLineVolZmapInters", LuaLineVolZmapInters) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtLineVolZmapInters", LuaLineVolZmapInters) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtPlaneVolZmapInters", LuaPlaneVolZmapInters) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtPlaneVolZmapInters", LuaPlaneVolZmapInters) ;
|
||||||
return bOk ;
|
return bOk ;
|
||||||
|
|||||||
@@ -227,6 +227,26 @@ LuaAddMachGroup( lua_State* L)
|
|||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
static int
|
||||||
|
LuaCopyMachGroup( lua_State* L)
|
||||||
|
{
|
||||||
|
// 2 parametri : nome del gruppo sorgente, nome del nuovo gruppo
|
||||||
|
string sSouName ;
|
||||||
|
LuaCheckParam( L, 1, sSouName)
|
||||||
|
string sName ;
|
||||||
|
LuaCheckParam( L, 2, sName) ;
|
||||||
|
LuaClearStack( L) ;
|
||||||
|
// copio la macchinata
|
||||||
|
int nId = ExeCopyMachGroup( sSouName, sName) ;
|
||||||
|
// restituisco il risultato
|
||||||
|
if ( nId != GDB_ID_NULL)
|
||||||
|
LuaSetParam( L, nId) ;
|
||||||
|
else
|
||||||
|
LuaSetParam( L) ;
|
||||||
|
return 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
static int
|
static int
|
||||||
LuaRemoveMachGroup( lua_State* L)
|
LuaRemoveMachGroup( lua_State* L)
|
||||||
@@ -3983,6 +4003,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
|
|||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetPrevMachGroup", LuaGetPrevMachGroup) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtGetPrevMachGroup", LuaGetPrevMachGroup) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupNewName", LuaGetMachGroupNewName) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupNewName", LuaGetMachGroupNewName) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAddMachGroup", LuaAddMachGroup) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtAddMachGroup", LuaAddMachGroup) ;
|
||||||
|
bOk = bOk && luaMgr.RegisterFunction( "EgtCopyMachGroup", LuaCopyMachGroup) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveMachGroup", LuaRemoveMachGroup) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveMachGroup", LuaRemoveMachGroup) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupName", LuaGetMachGroupName) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupName", LuaGetMachGroupName) ;
|
||||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupMachineName", LuaGetMachGroupMachineName) ;
|
bOk = bOk && luaMgr.RegisterFunction( "EgtGetMachGroupMachineName", LuaGetMachGroupMachineName) ;
|
||||||
|
|||||||
@@ -31,5 +31,5 @@
|
|||||||
#pragma comment(lib, EGTLIBDIR "EgtGeneral" EGTLIBVER ".lib")
|
#pragma comment(lib, EGTLIBDIR "EgtGeneral" EGTLIBVER ".lib")
|
||||||
#pragma comment(lib, EGTLIBDIR "EgtNumKernel" EGTLIBVER ".lib")
|
#pragma comment(lib, EGTLIBDIR "EgtNumKernel" EGTLIBVER ".lib")
|
||||||
#pragma comment(lib, EGTLIBDIR "EgtGeomKernel" EGTLIBVER ".lib")
|
#pragma comment(lib, EGTLIBDIR "EgtGeomKernel" EGTLIBVER ".lib")
|
||||||
#pragma comment(lib, EGTEXTDIR "Lua/Lib/Lua53" EGTLIBVER ".lib")
|
#pragma comment(lib, EGTEXTDIR "Lua/Lib/Lua54" EGTLIBVER ".lib")
|
||||||
#pragma comment(lib, EGTLIBDIR "SEgtLock" EGTLIBVER ".lib")
|
#pragma comment(lib, EGTLIBDIR "SEgtLock" EGTLIBVER ".lib")
|
||||||
|
|||||||
Reference in New Issue
Block a user