EgtInterface 1.5l1 :

- aggiornamento a VS2013
- alle curve si assegna in automatico estrusione come Z di griglia
- aggiunta gestione direttorio per librerie Lua
- aggiunta gestione frame di griglia (CPlane) in GeomDB
- aggiunta gestione visualizzazione riferimento globale
- aggiunto comando Lua EgtOffsetCurve
- aggiunti comandi Lua EgtExecTsc, EgtOutLog, EgtEraseFile, EgtEmptyDirectory, EgtTextFileCompare, EgtBinaryFileCompare, EgtGetVersion
- aggiunti comandi Lua EgtSetGridFrame, EgtGetGridFrame, EgtGetGridVersZ.
This commit is contained in:
Dario Sassi
2014-12-17 15:19:20 +00:00
parent 339777e202
commit 517a36a009
19 changed files with 562 additions and 88 deletions
+14 -6
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : API.h Data : 01.09.14 Versione : 1.5i1
// File : API.h Data : 01.09.14 Versione : 1.5l1
// Contenuto : Dichiarazioni locali per moduli API.
//
//
@@ -21,7 +21,12 @@
//----------------------------------------------------------------------------
ILogger* GetLogger( void) ;
//--------------------------- General ----------------------------------------
bool __stdcall EgtGetVersionInfo( std::string& sVer, const char* szNewLine) ;
//--------------------------- GeomDB -----------------------------------------
bool __stdcall EgtSetGridFrame( const Frame3d& frFrame) ;
bool __stdcall EgtGetGridFrame( Frame3d& frFrame) ;
bool __stdcall EgtOpenFile( const std::string& sFilePath) ;
bool __stdcall EgtSaveFile( const std::string& sFilePath, int nFlag) ;
@@ -83,8 +88,11 @@ BOOL __stdcall EgtSetWinRectAttribs( BOOL bOutline, Color WrCol) ;
//--------------------------- Exchange ---------------------------------------
int __stdcall EgtGetFileType( const std::string& sFilePath) ;
BOOL __stdcall EgtImportDxf( const std::string& sFilePath) ;
BOOL __stdcall EgtImportStl( const std::string& sFilePath) ;
BOOL __stdcall EgtImportCnc( const std::string& sFilePath) ;
BOOL __stdcall EgtExportDxf( int nId, const std::string& sFilePath) ;
BOOL __stdcall EgtExportStl( int nId, const std::string& sFilePath) ;
bool __stdcall EgtImportDxf( const std::string& sFilePath) ;
bool __stdcall EgtImportStl( const std::string& sFilePath) ;
bool __stdcall EgtImportCnc( const std::string& sFilePath) ;
bool __stdcall EgtExportDxf( int nId, const std::string& sFilePath) ;
bool __stdcall EgtExportStl( int nId, const std::string& sFilePath) ;
//--------------------------- TscExec ----------------------------------------
bool __stdcall EgtTscExecFile( const std::string& sFilePath) ;
+15 -15
View File
@@ -73,11 +73,11 @@ __stdcall EgtGetFileType( const string& sFilePath)
BOOL
__stdcall EgtImportDxf( const wchar_t* wsFilePath)
{
return EgtImportDxf( wstrztoA( wsFilePath)) ;
return ( EgtImportDxf( wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
bool
__stdcall EgtImportDxf( const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
@@ -89,18 +89,18 @@ __stdcall EgtImportDxf( const string& sFilePath)
PtrOwner<IImportDxf> pImpDxf( CreateImportDxf()) ;
VERIFY_NULL( Get( pImpDxf), "Error in CreateImportDxf", FALSE)
// eseguo l'importazione
return ( pImpDxf->Import( sFilePath, pGeomDB, nPartId) ? TRUE : FALSE) ;
return pImpDxf->Import( sFilePath, pGeomDB, nPartId) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtImportStl( const wchar_t* wsFilePath)
{
return EgtImportStl( wstrztoA( wsFilePath)) ;
return ( EgtImportStl( wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
bool
__stdcall EgtImportStl( const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
@@ -113,18 +113,18 @@ __stdcall EgtImportStl( const string& sFilePath)
PtrOwner<IImportStl> pImpStl( CreateImportStl()) ;
VERIFY_NULL( Get( pImpStl), "Error in CreateImportStl", FALSE)
// eseguo l'importazione
return ( pImpStl->Import( sFilePath, pGeomDB, nLayerId) ? TRUE : FALSE) ;
return pImpStl->Import( sFilePath, pGeomDB, nLayerId) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtImportCnc( const wchar_t* wsFilePath)
{
return EgtImportCnc( wstrztoA( wsFilePath)) ;
return ( EgtImportCnc( wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
bool
__stdcall EgtImportCnc( const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
@@ -136,18 +136,18 @@ __stdcall EgtImportCnc( const string& sFilePath)
PtrOwner<IImportCnc> pImpCnc( CreateImportCnc()) ;
VERIFY_NULL( Get( pImpCnc), "Error in CreateImportCnc", FALSE)
// eseguo l'importazione
return ( pImpCnc->Import( sFilePath, pGeomDB, nPartId) ? TRUE : FALSE) ;
return pImpCnc->Import( sFilePath, pGeomDB, nPartId) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtExportDxf( int nId, const wchar_t* wsFilePath)
{
return EgtExportDxf( nId, wstrztoA( wsFilePath)) ;
return ( EgtExportDxf( nId, wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
bool
__stdcall EgtExportDxf( int nId, const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
@@ -157,18 +157,18 @@ __stdcall EgtExportDxf( int nId, const string& sFilePath)
PtrOwner<IExportDxf> pExpDxf( CreateExportDxf()) ;
VERIFY_NULL( Get( pExpDxf), "Error in CreateExportDxf", FALSE)
// eseguo l'esportazione
return ( pExpDxf->Export( pGeomDB, nId, sFilePath) ? TRUE : FALSE) ;
return pExpDxf->Export( pGeomDB, nId, sFilePath) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtExportStl( int nId, const wchar_t* wsFilePath)
{
return EgtExportStl( nId, wstrztoA( wsFilePath)) ;
return ( EgtExportStl( nId, wstrztoA( wsFilePath)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
bool
__stdcall EgtExportStl( int nId, const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
@@ -178,5 +178,5 @@ __stdcall EgtExportStl( int nId, const string& sFilePath)
PtrOwner<IExportStl> pExpStl( CreateExportStl()) ;
VERIFY_NULL( Get( pExpStl), "Error in CreateExportStl", FALSE)
// eseguo l'esportazione
return ( pExpStl->Export( pGeomDB, nId, sFilePath) ? TRUE : FALSE) ;
return pExpStl->Export( pGeomDB, nId, sFilePath) ;
}
+113 -9
View File
@@ -47,6 +47,7 @@ static ICurveLine* __stdcall CreateLinePerpTwoCurves( IGeomDB* pGeomDB, int nPar
const Point3d& ptIni, int nIdI, const Point3d& ptFin, int nIdF) ;
static ICurveLine* __stdcall CreateLineTgCurvePerpCurve( IGeomDB* pGeomDB, int nParentId,
const Point3d& ptIni, int nIdI, const Point3d& ptFin, int nIdF) ;
static bool __stdcall SetExtrusionFromGridVersZ( IGeomDB* pGeomDB, int nParentId, ICurve* pCurve) ;
//-------------------------------------------------------------------------------
int
@@ -61,6 +62,9 @@ __stdcall EgtCreateCurveLine( int nParentId, const double ptIni[3], const double
// setto la linea
if ( ! pCrvLine->Set( ptIni, ptFin))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvLine)))
return GDB_ID_NULL ;
// inserisco la linea nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvLine)) ;
}
@@ -153,6 +157,9 @@ __stdcall EgtCreateCurveLineEx( int nParentId, const double ptIni[3], int nSepI,
else {
return GDB_ID_NULL ;
}
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvLine)))
return GDB_ID_NULL ;
// inserisco la linea nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvLine)) ;
}
@@ -431,6 +438,9 @@ __stdcall EgtCreateCurveLinePVL( int nParentId, const double ptIni[3], const dou
// setto la linea
if ( ! pCrvLine->SetPVL( ptIni, vtDir, dLen))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvLine)))
return GDB_ID_NULL ;
// inserisco la linea nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvLine)) ;
}
@@ -472,6 +482,9 @@ __stdcall EgtCreateCurveLineMinPointCurve( int nParentId,
// setto la linea
if ( ! pCrvLine->Set( ptStart, ptEnd))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvLine)))
return GDB_ID_NULL ;
// inserisco la linea nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvLine)) ;
}
@@ -490,6 +503,9 @@ __stdcall EgtCreateCurveCircle( int nParentId,
// setto la circonferenza
if ( ! pCrvArc->Set( ptCen, vtN, dRad))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
@@ -508,6 +524,9 @@ __stdcall EgtCreateCurveCircleXY( int nParentId,
// setto la circonferenza
if ( ! pCrvArc->SetXY( ptCen, dRad))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
@@ -528,6 +547,9 @@ __stdcall EgtCreateCurveCircleCPN( int nParentId,
// setto la circonferenza
if ( ! pCrvArc->Set( ptCen, vtN, dRad))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
@@ -546,6 +568,9 @@ __stdcall EgtCreateCurveCircle3P( int nParentId,
// setto l'arco
if ( ! pCrvArc->Set3P( ptP1, ptP2, ptP3, true))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
@@ -565,6 +590,9 @@ __stdcall EgtCreateCurveArc( int nParentId,
// setto l'arco
if ( ! pCrvArc->Set( ptCen, vtN, dRad, vtS, dAngCenDeg, dDeltaN))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
@@ -584,6 +612,9 @@ __stdcall EgtCreateCurveArcXY( int nParentId,
// setto l'arco
if ( ! pCrvArc->SetXY( ptCen, dRad, dAngStartDeg, dAngCenDeg, dDeltaZ))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
@@ -600,9 +631,13 @@ __stdcall EgtCreateCurveArc3P( int nParentId,
if ( IsNull( pCrvArc))
return GDB_ID_NULL ;
// setto l'arco
if ( pCrvArc->Set3P( ptP1, ptP2, ptP3, false))
if ( pCrvArc->Set3P( ptP1, ptP2, ptP3, false)) {
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
// se risulta essere una retta
if ( ( Point3d( ptP2) - Point3d( ptP1)) * ( Point3d( ptP3) - Point3d( ptP2)) > EPS_ZERO)
return EgtCreateCurveLine( nParentId, ptP1, ptP3) ;
@@ -624,6 +659,9 @@ __stdcall EgtCreateCurveArcC2PN( int nParentId,
// setto l'arco
if ( ! pCrvArc->SetC2PN( ptCen, ptStart, ptNearEnd, vtNorm))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
@@ -640,9 +678,13 @@ __stdcall EgtCreateCurveArc2PVN( int nParentId,
if ( IsNull( pCrvArc))
return GDB_ID_NULL ;
// setto l'arco
if ( pCrvArc->Set2PVN( ptStart, ptEnd, vtDirS, vtNorm))
if ( pCrvArc->Set2PVN( ptStart, ptEnd, vtDirS, vtNorm)) {
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvArc)))
return GDB_ID_NULL ;
// inserisco l'arco nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvArc)) ;
}
// se risulta essere una retta
if ( ( Point3d( ptEnd) - Point3d( ptStart)) * Vector3d( vtDirS) > EPS_ZERO)
return EgtCreateCurveLine( nParentId, ptStart, ptEnd) ;
@@ -686,6 +728,9 @@ __stdcall EgtCreateCurveBezier( int nParentId, int nDegree, const PNTVECTOR& vPn
// se curva nulla (ovvero ridotta a punto), errore
if ( pCrvBez->IsAPoint())
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvBez)))
return GDB_ID_NULL ;
// inserisco la curva nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvBez)) ;
}
@@ -726,6 +771,9 @@ __stdcall EgtCreateCurveBezierRational( int nParentId, int nDegree, const PNTUVE
// se curva nulla (ovvero ridotta a punto), errore
if ( pCrvBez->IsAPoint())
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvBez)))
return GDB_ID_NULL ;
// inserisco la curva nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvBez)) ;
}
@@ -832,15 +880,16 @@ __stdcall EgtCreateCurveCompo( int nParentId, const INTVECTOR& vIds, bool bErase
return false ;
}
}
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvCompo)))
return GDB_ID_NULL ;
// inserisco la curva composita nel DB
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvCompo)) ;
if ( nId != GDB_ID_NULL) {
// se richiesto, cancello le curve originali
if ( bErase) {
for ( Iter = vIds.begin() ; Iter != vIds.end() ; ++Iter) {
if ( ! pGeomDB->Erase( *Iter))
return GDB_ID_NULL ;
}
// se ok e richiesto, cancello le curve originali
if ( nId != GDB_ID_NULL && bErase) {
for ( Iter = vIds.begin() ; Iter != vIds.end() ; ++Iter) {
if ( ! pGeomDB->Erase( *Iter))
return GDB_ID_NULL ;
}
}
return nId ;
@@ -994,6 +1043,9 @@ __stdcall EgtCreateCurveCompoFromPoints( int nParentId, const PolyLine& PL)
// inserisco i segmenti che uniscono i punti
if ( ! pCrvCompo->FromPolyLine( PL))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvCompo)))
return GDB_ID_NULL ;
// inserisco la curva composita nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvCompo)) ;
}
@@ -1022,10 +1074,43 @@ __stdcall EgtCreateCurveCompoFromPointBulges( int nParentId, const PolyArc& PA)
// inserisco i segmenti e gli archi che uniscono i punti
if ( ! pCrvCompo->FromPolyArc( PA))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvCompo)))
return GDB_ID_NULL ;
// inserisco la curva composita nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvCompo)) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCompoFromRectangle( int nParentId,
const double ptIni[3], const double ptFin[3])
{
// --- Il rettangolo ha i lati paralleli agli assi della griglia corrente ---
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero il riferimento di inserimento
Frame3d frEnt ;
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frEnt))
return GDB_ID_NULL ;
// recupero il riferimento di griglia
Frame3d frGrid = pGeomDB->GetGridFrame() ;
// calcolo il vettore del lato parallelo a Y
Vector3d vtDiag = (Point3d( ptFin) - Point3d( ptIni)) ;
vtDiag.LocToLoc( frEnt, frGrid) ;
Vector3d vtLatoY( 0, vtDiag.y, 0) ;
vtLatoY.LocToLoc( frGrid, frEnt) ;
// creo la polilinea con i punti
PolyLine PL ;
PL.AddUPoint( 0, ptIni) ;
PL.AddUPoint( 1, Point3d( ptFin) - vtLatoY) ;
PL.AddUPoint( 2, ptFin) ;
PL.AddUPoint( 3, Point3d( ptIni) + vtLatoY) ;
PL.AddUPoint( 4, ptIni) ;
// creo la curva e la inserisco nel GDB
return EgtCreateCurveCompoFromPoints( nParentId, PL) ;
}
//-------------------------------------------------------------------------------
int
__stdcall EgtCreateCurveCompoFromPolygonSide( int nParentId, int nNumSides,
@@ -1040,6 +1125,25 @@ __stdcall EgtCreateCurveCompoFromPolygonSide( int nParentId, int nNumSides,
// setto la curva
if ( ! pCrvCompo->PolygonSide( nNumSides, ptIni, ptFin))
return GDB_ID_NULL ;
// assegno il versore estrusione
if ( ! SetExtrusionFromGridVersZ( pGeomDB, nParentId, Get( pCrvCompo)))
return GDB_ID_NULL ;
// inserisco la curva nel DB
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pCrvCompo)) ;
}
//-------------------------------------------------------------------------------
bool
__stdcall SetExtrusionFromGridVersZ( IGeomDB* pGeomDB, int nParentId, ICurve* pCurve)
{
// verifiche sui parametri
if ( pGeomDB == nullptr || pCurve == nullptr)
return false ;
// assegno il versore estrusione a partire dal versore Z della griglia corrente
Vector3d vtExtr = pGeomDB->GetGridFrame().VersZ() ;
Frame3d frEnt ;
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frEnt))
return false ;
vtExtr.ToLoc( frEnt) ;
return pCurve->SetExtrusion( vtExtr) ;
}
+2 -2
View File
@@ -257,7 +257,7 @@ __stdcall EgtSplitCurveAtPoint( int nId, double ptOn[3])
//----------------------------------------------------------------------------
BOOL
__stdcall EgtOffsetCurve( int nId, double dDist, int nSide, int nType)
__stdcall EgtOffsetCurve( int nId, double dDist, int nType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
@@ -266,7 +266,7 @@ __stdcall EgtOffsetCurve( int nId, double dDist, int nSide, int nType)
if ( pCurve == nullptr)
return FALSE ;
// eseguo l'offset
return ( pCurve->Offset( dDist, nSide, nType) ? TRUE : FALSE) ;
return ( pCurve->SimpleOffset( dDist, nType) ? TRUE : FALSE) ;
}
//-------------------------------------------------------------------------------
+46 -2
View File
@@ -103,13 +103,57 @@ __stdcall EgtSetKey( const wchar_t* sKey)
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetFont( const wchar_t* sNfeFontDir, const wchar_t* sDefaultFont)
__stdcall EgtSetFont( const wchar_t* wsNfeFontDir, const wchar_t* wsDefaultFont)
{
// inizializzazioni gestore font Nfe
InitFontManager( LPSTR( WtoA( sNfeFontDir)), LPSTR( WtoA( sDefaultFont))) ;
InitFontManager( LPSTR( WtoA( wsNfeFontDir)), LPSTR( WtoA( wsDefaultFont))) ;
return TRUE ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetLuaLibs( const wchar_t* wsLuaLibsDir)
{
if ( LuaSetLuaLibsDir( LPSTR( WtoA( wsLuaLibsDir))))
return TRUE ;
else
return FALSE ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetVersionInfo( wchar_t*& wsVer)
{
// recupero le informazioni sulle DLL
string sVer ;
if ( ! EgtGetVersionInfo( sVer, "\r\n"))
return FALSE ;
wsVer = _wcsdup( stringtoW( sVer)) ;
return (( wsVer == nullptr) ? FALSE : TRUE) ;
}
//-----------------------------------------------------------------------------
bool
__stdcall EgtGetVersionInfo( string& sVer, const char* szNewLine)
{
// verifico il parametro
if ( &sVer == nullptr)
return false ;
// recupero le informazioni sulle DLL
sVer += GetEInVersion() ;
sVer += szNewLine ;
sVer += GetEGrVersion() ;
sVer += szNewLine ;
sVer += GetEExVersion() ;
sVer += szNewLine ;
sVer += GetEGkVersion() ;
sVer += szNewLine ;
sVer += GetENkVersion() ;
sVer += szNewLine ;
sVer += GetEGnVersion() ;
return true ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtFreeMemory( void* pMem)
+47
View File
@@ -572,6 +572,53 @@ __stdcall EgtCurveThickness( int nId, double* pdThick)
return ( pCurve->GetThickness( *pdThick) ? TRUE : FALSE) ;
}
//----------------------------------------------------------------------------
BOOL
__stdcall EgtGetMinDistPointCurve( const double ptP[3], int nId, double* pdDist)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico i parametri
if ( pdDist == nullptr)
return FALSE ;
// recupero la curva
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCurve == nullptr)
return FALSE ;
// calcolo la minima distanza
DistPointCurve distPC( ptP, *pCurve) ;
return ( ( distPC.GetDist( *pdDist)) ? TRUE : FALSE) ;
}
//----------------------------------------------------------------------------
BOOL
__stdcall EgtGetMinDistPntSidePointCurve( const double ptP[3], int nId, double vtN[3],
double* pdDist, double ptMin[3], int* pnSide)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico i parametri
if ( pdDist == nullptr || pnSide == nullptr || ptMin == nullptr)
return FALSE ;
// recupero la curva
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCurve == nullptr)
return FALSE ;
// calcolo la minima distanza
DistPointCurve distPC( ptP, *pCurve) ;
// recupero i risultati
if ( ! distPC.GetDist( *pdDist))
return FALSE ;
int nFlag ;
Point3d ptQ ;
if ( ! distPC.GetMinDistPoint( 0, ptQ, nFlag))
return FALSE ;
VEC_FROM_3D( ptMin, ptQ)
if ( ! distPC.GetSideAtMinDistPoint( 0, vtN, *pnSide))
return FALSE ;
return TRUE ;
}
//----------------------------------------------------------------------------
BOOL
__stdcall EgtCurveArcNormVersor( int nId, double vtNorm[3])
+51
View File
@@ -83,6 +83,57 @@ __stdcall EgtSetDefaultMaterial( const int vCol[4])
return TRUE ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetGridFrame( const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3])
{
// costruisco il riferimento
Frame3d frFrame ;
if ( ! frFrame.Set( ptOrig, vX, vY, vZ))
return FALSE ;
// imposto il riferimento della griglia
return ( EgtSetGridFrame( frFrame) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
bool
__stdcall EgtSetGridFrame( const Frame3d& frFrame)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// imposto il riferimento della griglia
return pGeomDB->SetGridFrame( frFrame) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetGridFrame( double ptOrig[3], double vX[3], double vY[3], double vZ[3])
{
// recupero il riferimento della griglia
Frame3d frGrid ;
if ( EgtGetGridFrame( frGrid)) {
// assegno i valori di ritorno
VEC_FROM_3D( ptOrig, frGrid.Orig())
VEC_FROM_3D( vX, frGrid.VersX())
VEC_FROM_3D( vY, frGrid.VersY())
VEC_FROM_3D( vZ, frGrid.VersZ())
return TRUE ;
}
else
return FALSE ;
}
//-----------------------------------------------------------------------------
bool
__stdcall EgtGetGridFrame( Frame3d& frFrame)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero il riferimento della griglia
frFrame = pGeomDB->GetGridFrame() ;
return true ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtNewFile( void)
-1
View File
@@ -38,7 +38,6 @@ __stdcall EgtLuaExecFile( const wchar_t* wsFilePath)
// emetto info
string sInfo = "Exec File = " + sFilePath ;
LOG_INFO( GetLogger(), sInfo.c_str())
// esecuzione script
return ( LuaExecFile( sFilePath) ? TRUE : FALSE) ;
}
+11 -31
View File
@@ -159,6 +159,16 @@ __stdcall EgtSetWinRectAttribs( BOOL bOutline, Color WrCol)
return ( pGseCtx->m_pScene->SetWinRectAttribs( ( bOutline != FALSE), WrCol) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetGlobFrameShow( BOOL bShow)
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_SCENE( pGseCtx, FALSE)
// imposto stato visualizzazione griglia
return ( pGseCtx->m_pScene->SetGlobFrameShow( ( bShow != FALSE)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetGridShow( BOOL bShowGrid, BOOL bShowFrame)
@@ -169,36 +179,6 @@ __stdcall EgtSetGridShow( BOOL bShowGrid, BOOL bShowFrame)
return ( pGseCtx->m_pScene->SetGridShow( ( bShowGrid != FALSE), ( bShowFrame != FALSE)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetGridFrame( const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3])
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_SCENE( pGseCtx, FALSE)
// costruisco il riferimento
Frame3d frFrame ;
if ( ! frFrame.Set( ptOrig, vX, vY, vZ))
return GDB_ID_NULL ;
// imposto il riferimento della griglia
return ( pGseCtx->m_pScene->SetGridFrame( frFrame) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetGridFrame( double ptOrig[3], double vX[3], double vY[3], double vZ[3])
{
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_SCENE( pGseCtx, FALSE)
// recupero il riferimento della griglia
const Frame3d& frGrid = pGseCtx->m_pScene->GetGridFrame() ;
// assegno i valori di ritorno
VEC_FROM_3D( ptOrig, frGrid.Orig())
VEC_FROM_3D( vX, frGrid.VersX())
VEC_FROM_3D( vY, frGrid.VersY())
VEC_FROM_3D( vZ, frGrid.VersZ())
return TRUE ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetGridGeo( double dSnapStep, int nMinLineSstep, int nMajLineSstep, int nExtSstep)
@@ -545,7 +525,7 @@ __stdcall EgtSetView( int nView, BOOL bRedraw)
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_SCENE( pGseCtx, FALSE)
// imposto vista
if ( nView >= CT_TOP && nView <= CT_ISO_NW) {
if ( nView >= CT_TOP && nView <= CT_CPLANE) {
pGseCtx->m_pScene->SetCamera( nView) ;
if ( bRedraw)
pGseCtx->m_pScene->RedrawWindow() ;
+11 -4
View File
@@ -74,14 +74,21 @@ __stdcall EgtInitTscExec( void)
BOOL
__stdcall EgtTscExecFile( const wchar_t* wsFilePath)
{
ICmdParser* pTscExec = GetCurrTscExecutor() ;
VERIFY_TSCEXEC( pTscExec, FALSE)
// converto nome file
string sFilePath = wstrztoA( wsFilePath) ;
// emetto info
string sInfo = "Exec File = " + sFilePath ;
LOG_INFO( GetLogger(), sInfo.c_str())
// eseguo
return ( EgtTscExecFile( sFilePath) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
bool
__stdcall EgtTscExecFile( const string& sFilePath)
{
ICmdParser* pTscExec = GetCurrTscExecutor() ;
VERIFY_TSCEXEC( pTscExec, FALSE)
// imposto il direttorio dello script
string sFileDir, sFileName ;
@@ -89,7 +96,7 @@ __stdcall EgtTscExecFile( const wchar_t* wsFilePath)
pTscExec->SetDirReplace( "<TSCDIR>", sFileDir) ;
// esecuzione script
return ( pTscExec->Run( sFilePath) ? TRUE : FALSE) ;
return pTscExec->Run( sFilePath) ;
}
//-----------------------------------------------------------------------------
BIN
View File
Binary file not shown.
+9 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -28,23 +28,27 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -146,7 +150,9 @@ copy $(TargetPath) \EgtProg\DllD64</Command>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<OmitFramePointers>true</OmitFramePointers>
<OmitFramePointers>false</OmitFramePointers>
<OpenMPSupport>true</OpenMPSupport>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -175,6 +181,7 @@ copy $(TargetPath) \EgtProg\Dll32</Command>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<OmitFramePointers>false</OmitFramePointers>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<OpenMPSupport>true</OpenMPSupport>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
+2 -1
View File
@@ -25,6 +25,7 @@ class Color ;
//-------------------------- General -----------------------------------------
bool LuaInit( void) ;
bool LuaExit( void) ;
bool LuaSetLuaLibsDir( const std::string& sDir) ;
bool LuaExecLine( const std::string& sLine) ;
bool LuaExecFile( const std::string& sFile) ;
const std::string& LuaGetLastError( void) ;
@@ -46,7 +47,7 @@ bool LuaGetParam( lua_State* L, int nInd, PNTVECTOR& vPar) ;
bool LuaGetParam( lua_State* L, int nInd, PNTUVECTOR& vParW) ;
bool LuaClearStack( lua_State* L) ;
//
bool LuaSetReturn( lua_State* L /* nil */) ;
bool LuaSetReturn( lua_State* L /*, nil */) ;
bool LuaSetReturn( lua_State* L, bool bPar) ;
bool LuaSetReturn( lua_State* L, int nPar) ;
bool LuaSetReturn( lua_State* L, double dPar) ;
+18 -8
View File
@@ -71,14 +71,19 @@ LuaModifyCurveEndPoint( lua_State* L)
static int
LuaModifyCurveExtrusion( lua_State* L)
{
// 2 parametri : Id, vtExtr
int nId ;
LuaCheckParam( L, 1, nId)
// 2 parametri : Id/s, vtExtr
INTVECTOR vId ;
LuaCheckParam( L, 1, vId)
Vector3d vtExtr ;
LuaCheckParam( L, 2, vtExtr)
LuaClearStack( L) ;
// modifico il vettore estrusione
bool bOk = ( EgtModifyCurveExtrusion( nId, vtExtr.v) ? true : false) ;
bool bOk = true ;
for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) {
if ( EgtModifyCurveExtrusion( vId[i], vtExtr.v) == FALSE)
bOk = false ;
}
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
}
@@ -87,14 +92,19 @@ LuaModifyCurveExtrusion( lua_State* L)
static int
LuaModifyCurveThickness( lua_State* L)
{
// 2 parametri : Id, Thick
int nId ;
LuaCheckParam( L, 1, nId)
// 2 parametri : Id/s, Thick
INTVECTOR vId ;
LuaCheckParam( L, 1, vId)
double dThick ;
LuaCheckParam( L, 2, dThick)
LuaClearStack( L) ;
// modifico il vettore estrusione
bool bOk = ( EgtModifyCurveThickness( nId, dThick) ? true : false) ;
bool bOk = true ;
for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) {
if ( EgtModifyCurveThickness( vId[i], dThick) == 0)
bOk = false ;
}
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
}
+5 -5
View File
@@ -31,7 +31,7 @@ LuaImportDxf( lua_State* L)
LuaCheckParam( L, 1, sFilePath)
LuaClearStack( L) ;
// apro il file
bool bOk = ( EgtImportDxf( sFilePath) != FALSE) ;
bool bOk = EgtImportDxf( sFilePath) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
@@ -46,7 +46,7 @@ LuaImportStl( lua_State* L)
LuaCheckParam( L, 1, sFilePath)
LuaClearStack( L) ;
// apro il file
bool bOk = ( EgtImportStl( sFilePath) != FALSE) ;
bool bOk = EgtImportStl( sFilePath) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
@@ -61,7 +61,7 @@ LuaImportCnc( lua_State* L)
LuaCheckParam( L, 1, sFilePath)
LuaClearStack( L) ;
// apro il file
bool bOk = ( EgtImportCnc( sFilePath) != FALSE) ;
bool bOk = EgtImportCnc( sFilePath) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
@@ -78,7 +78,7 @@ LuaExportDxf( lua_State* L)
LuaCheckParam( L, 2, sFilePath)
LuaClearStack( L) ;
// apro il file
bool bOk = ( EgtExportDxf( nGroupId, sFilePath) != FALSE) ;
bool bOk = EgtExportDxf( nGroupId, sFilePath) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
@@ -95,7 +95,7 @@ LuaExportStl( lua_State* L)
LuaCheckParam( L, 2, sFilePath)
LuaClearStack( L) ;
// apro il file
bool bOk = ( EgtExportStl( nGroupId, sFilePath) != FALSE) ;
bool bOk = EgtExportStl( nGroupId, sFilePath) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
+19
View File
@@ -38,6 +38,24 @@ LuaChangeVectorBase( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaOffsetCurve( lua_State* L)
{
// 4 parametri : Id, dDist, nType
int nId ;
LuaCheckParam( L, 1, nId)
double dDist ;
LuaCheckParam( L, 2, dDist)
int nType ;
LuaCheckParam( L, 3, nType)
LuaClearStack( L) ;
// offset della curva
bool bOk = ( EgtOffsetCurve( nId, dDist, nType) ? true : false) ;
LuaSetReturn( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaModifyText( lua_State* L)
@@ -144,6 +162,7 @@ LuaInstallGdbModify( lua_State* L)
{
try {
lua_register( L, "EgtChangeVectorBase", LuaChangeVectorBase) ;
lua_register( L, "EgtOffsetCurve", LuaOffsetCurve) ;
lua_register( L, "EgtModifyText", LuaModifyText) ;
lua_register( L, "EgtChangeTextFont", LuaChangeTextFont) ;
lua_register( L, "EgtFlipText", LuaFlipText) ;
+152 -1
View File
@@ -16,6 +16,8 @@
#include "LUA.h"
#include "API.h"
#include "API_Macro.h"
#include "/EgtDev/Include/EGnFileUtils.h"
#include "/EgtDev/Include/EGnFileCompare.h"
#include "/EgtDev/Include/EgtPerfCounter.h"
#include "/EgtDev/Extern/Lua/Include/lua.hpp"
@@ -89,7 +91,15 @@ LuaInit( void)
return false ;
}
LOG_INFO( GetLogger(), "Lua interpreter started")
// recupero la versione di Lua
lua_getglobal( s_L, "_VERSION") ;
string sLua ;
if ( LuaGetParam( s_L, - 1, sLua))
sLua += " interpreter started" ;
else
sLua = "Lua *.* interpreter started" ;
lua_pop( s_L, 1) ;
LOG_INFO( GetLogger(), sLua.c_str())
return true ;
}
@@ -106,6 +116,29 @@ LuaExit( void)
return true ;
}
//----------------------------------------------------------------------------
bool
LuaSetLuaLibsDir( const string& sDir)
{
// recupero la stringa globale package.path
lua_getglobal( s_L, "package") ;
lua_getfield( s_L, -1, "path") ;
string sCurPath = lua_tostring( s_L, -1) ;
// verifico se la dir ricevuta è già presente
if ( sCurPath.find( sDir) != string::npos) {
lua_pop( s_L, 2) ;
return true ;
}
// imposto la nuova dir
sCurPath = sDir ;
sCurPath += "\\?.lua" ;
lua_pop( s_L, 1) ;
lua_pushstring( s_L, sCurPath.c_str()) ;
lua_setfield( s_L, -2, "path") ;
lua_pop( s_L, 1) ;
return true ;
}
//----------------------------------------------------------------------------
bool
LuaExecLine( const string& sLine)
@@ -252,6 +285,117 @@ LuaStopCounter( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaExecTsc( lua_State* L)
{
// 1 parametro : file
string sFile ;
LuaCheckParam( L, 1, sFile)
LuaClearStack( L) ;
// eseguo lo script TSC
bool bOk = EgtTscExecFile( sFile) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaOutLog( lua_State* L)
{
// 1 parametro : stringa da emettere
string sOut ;
LuaCheckParam( L, 1, sOut)
LuaClearStack( L) ;
// accodo il messaggio nel file di log
LOG_INFO( GetLogger(), sOut.c_str())
// non c'è risultato
return 0 ;
}
//-------------------------------------------------------------------------------
static int
LuaEraseFile( lua_State* L)
{
// 1 parametro : file
string sFile ;
LuaCheckParam( L, 1, sFile)
LuaClearStack( L) ;
// svuoto il direttorio
bool bOk = EraseFile( sFile) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaEmptyDirectory( lua_State* L)
{
// 1 parametro : dir
string sDir ;
LuaCheckParam( L, 1, sDir)
LuaClearStack( L) ;
// svuoto il direttorio
bool bOk = EmptyDirectory( sDir) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaTextFileCompare( lua_State* L)
{
// 4 parametri : file1, file2, inizio commento, file diff
string sFile1 ;
LuaCheckParam( L, 1, sFile1)
string sFile2 ;
LuaCheckParam( L, 2, sFile2)
string sRemStart ;
LuaCheckParam( L, 3, sRemStart)
string sFileDiff ;
LuaCheckParam( L, 4, sFileDiff)
LuaClearStack( L) ;
// eseguo il confronto
bool bOk = TextFileCompare( sFile1, sFile2, sRemStart, sFileDiff) ;
LuaSetReturn( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaBinaryFileCompare( lua_State* L)
{
// 3 parametri : file1, file2, file diff
string sFile1 ;
LuaCheckParam( L, 1, sFile1)
string sFile2 ;
LuaCheckParam( L, 2, sFile2)
string sFileDiff ;
LuaCheckParam( L, 3, sFileDiff)
LuaClearStack( L) ;
// eseguo il confronto
bool bOk = BinaryFileCompare( sFile1, sFile2, sFileDiff) ;
LuaSetReturn( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetVersion( lua_State* L)
{
// nessun parametro
// costruisco la stringa con le versioni
string sVer ;
if ( ! EgtGetVersionInfo( sVer, "\n"))
sVer = "VersionInfo error" ;
// restituisco il risultato
LuaSetReturn( L, sVer) ;
return 1 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGeneral( lua_State* L)
@@ -263,6 +407,13 @@ LuaInstallGeneral( lua_State* L)
lua_register( L, "EgtPause", LuaPause) ;
lua_register( L, "EgtStartCounter", LuaStartCounter) ;
lua_register( L, "EgtStopCounter", LuaStopCounter) ;
lua_register( L, "EgtExecTsc", LuaExecTsc) ;
lua_register( L, "EgtOutLog", LuaOutLog) ;
lua_register( L, "EgtEraseFile", LuaEraseFile) ;
lua_register( L, "EgtEmptyDirectory", LuaEmptyDirectory) ;
lua_register( L, "EgtTextFileCompare", LuaTextFileCompare) ;
lua_register( L, "EgtBinaryFileCompare", LuaBinaryFileCompare) ;
lua_register( L, "EgtGetVersion", LuaGetVersion) ;
}
catch ( ...) {
return false ;
+44
View File
@@ -40,6 +40,47 @@ LuaSetDefaultMaterial( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSetGridFrame( lua_State* L)
{
// 1 parametro : Frame
Frame3d frFrame ;
LuaCheckParam( L, 1, frFrame) ;
LuaClearStack( L) ;
// imposto il riferimento della Griglia (o CPlane)
bool bOk = ( EgtSetGridFrame( frFrame)) ;
// restituisco il risultato
LuaSetReturn( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetGridFrame( lua_State* L)
{
// nessun parametro
// recupero il riferimento della griglia
Frame3d frFrame ;
EgtGetGridFrame( frFrame) ;
// restituisco il risultato
LuaSetReturn( L, frFrame) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetGridVersZ( lua_State* L)
{
// nessun parametro
// recupero il riferimento della griglia
Frame3d frFrame ;
EgtGetGridFrame( frFrame) ;
// restituisco il risultato
LuaSetReturn( L, frFrame.VersZ()) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaNewFile( lua_State* L)
@@ -98,6 +139,9 @@ LuaInstallGeomDB( lua_State* L)
{
try {
lua_register( L, "EgtSetDefaultMaterial", LuaSetDefaultMaterial) ;
lua_register( L, "EgtSetGridFrame", LuaSetGridFrame) ;
lua_register( L, "EgtGetGridFrame", LuaGetGridFrame) ;
lua_register( L, "EgtGetGridVersZ", LuaGetGridVersZ) ;
lua_register( L, "EgtNewFile", LuaNewFile) ;
lua_register( L, "EgtOpenFile", LuaOpenFile) ;
lua_register( L, "EgtSaveFile", LuaSaveFile) ;
+3 -1
View File
@@ -121,7 +121,7 @@ LuaZoom( lua_State* L)
static int
LuaSetView( lua_State* L)
{
// 2 parametri : ViewDir ("T","F","R","B","L","BO","SWI","SEI","NEI","NWI"), flag ridisegna
// 2 parametri : ViewDir ("T","F","R","B","L","BO","SWI","SEI","NEI","NWI","CPL"), flag ridisegna
string sViewDir ;
LuaCheckParam( L, 1, sViewDir)
int nViewDir = CT_TOP ;
@@ -142,6 +142,8 @@ LuaSetView( lua_State* L)
nViewDir = CT_ISO_NE ;
else if ( sViewDir == "NWI")
nViewDir = CT_ISO_NW ;
else if ( sViewDir == "CPL")
nViewDir = CT_CPLANE ;
bool bRedraw ;
LuaCheckParam( L, 2, bRedraw)
LuaClearStack( L) ;