diff --git a/API.h b/API.h index 959ead0..4df2f66 100644 --- a/API.h +++ b/API.h @@ -22,41 +22,41 @@ ILogger* GetLogger( void) ; //--------------------------- GeomDB ----------------------------------------- -BOOL __stdcall EgtOpenFile( int nGseCtx, const std::string& sFilePath) ; -BOOL __stdcall EgtSaveFile( int nGseCtx, const std::string& sFilePath, int nFlag) ; +BOOL __stdcall EgtOpenFile( const std::string& sFilePath) ; +BOOL __stdcall EgtSaveFile( const std::string& sFilePath, int nFlag) ; //--------------------------- GeomDB Create ---------------------------------- -int __stdcall EgtCreateCurveBezier( int nGseCtx, int nParentId, int nDegree, const PNTVECTOR& vPnt) ; -int __stdcall EgtCreateCurveBezierRational( int nGseCtx, int nParentId, int nDegree, const PNTUVECTOR& vPntW) ; -int __stdcall EgtCreateCurveCompo( int nGseCtx, int nParentId, const INTVECTOR& vIds, bool bErase) ; -int __stdcall EgtCreateCurveCompoFromPoints( int nGseCtx, int nParentId, const PolyLine& PL) ; -int __stdcall EgtCreateCurveCompoFromPointBulges( int nGseCtx, int nParentId, const PolyArc& PA) ; -int __stdcall EgtCreateText( int nGseCtx, int nParentId, const std::string& sText, +int __stdcall EgtCreateCurveBezier( int nParentId, int nDegree, const PNTVECTOR& vPnt) ; +int __stdcall EgtCreateCurveBezierRational( int nParentId, int nDegree, const PNTUVECTOR& vPntW) ; +int __stdcall EgtCreateCurveCompo( int nParentId, const INTVECTOR& vIds, bool bErase) ; +int __stdcall EgtCreateCurveCompoFromPoints( int nParentId, const PolyLine& PL) ; +int __stdcall EgtCreateCurveCompoFromPointBulges( int nParentId, const PolyArc& PA) ; +int __stdcall EgtCreateText( int nParentId, const std::string& sText, const Point3d& ptP, double dAngRotDeg, double dH) ; -int __stdcall EgtCreateTextEx( int nGseCtx, int nParentId, const std::string& sText, +int __stdcall EgtCreateTextEx( int nParentId, const std::string& sText, const Point3d& ptP, double dAngRotDeg, const std::string& sFont, int nW, bool bItalic, double dH, double dRat, double dAddAdv, int nInsPos) ; //--------------------------- GdbModify -------------------------------------- -BOOL __stdcall EgtModifyText( int nGseCtx, int nId, const std::string& sNewText) ; -BOOL __stdcall EgtChangeTextFont( int nGseCtx, int nId, const std::string& sNewFont) ; +BOOL __stdcall EgtModifyText( int nId, const std::string& sNewText) ; +BOOL __stdcall EgtChangeTextFont( int nId, const std::string& sNewFont) ; //--------------------------- GdbObjAttribs ---------------------------------- BOOL __stdcall EgtStdColor( const std::string& sName, int& nRed, int& nGreen, int& nBlue, int& nAlpha) ; -BOOL __stdcall EgtSetName( int nGseCtx, int nId, const std::string& sName) ; -BOOL __stdcall EgtGetName( int nGseCtx, int nId, std::string& sName) ; -BOOL __stdcall EgtSetInfo( int nGseCtx, int nId, const std::string& sKey, const std::string& sInfo) ; -BOOL __stdcall EgtGetInfo( int nGseCtx, int nId, const std::string& sKey, std::string& sInfo) ; -BOOL __stdcall EgtExistsInfo( int nGseCtx, int nId, const std::string& sKey) ; -BOOL __stdcall EgtRemoveInfo( int nGseCtx, int nId, const std::string& sKey) ; +BOOL __stdcall EgtSetName( int nId, const std::string& sName) ; +BOOL __stdcall EgtGetName( int nId, std::string& sName) ; +BOOL __stdcall EgtSetInfo( int nId, const std::string& sKey, const std::string& sInfo) ; +BOOL __stdcall EgtGetInfo( int nId, const std::string& sKey, std::string& sInfo) ; +BOOL __stdcall EgtExistsInfo( int nId, const std::string& sKey) ; +BOOL __stdcall EgtRemoveInfo( int nId, const std::string& sKey) ; //--------------------------- GeoSnap ---------------------------------------- -BOOL __stdcall EgtFrame( int nGseCtx, int nId, Frame3d& frFrame) ; +BOOL __stdcall EgtFrame( int nId, Frame3d& frFrame) ; //--------------------------- Exchange --------------------------------------- int __stdcall EgtGetFileType( const std::string& sFilePath) ; -BOOL __stdcall EgtImportDxf( int nGseCtx, const std::string& sFilePath) ; -BOOL __stdcall EgtImportStl( int nGseCtx, const std::string& sFilePath) ; -BOOL __stdcall EgtImportCnc( int nGseCtx, const std::string& sFilePath) ; -BOOL __stdcall EgtExportDxf( int nGseCtx, int nId, const std::string& sFilePath) ; -BOOL __stdcall EgtExportStl( int nGseCtx, 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) ; diff --git a/API_CurveModif.cpp b/API_CurveModif.cpp index 3c070d0..3840257 100644 --- a/API_CurveModif.cpp +++ b/API_CurveModif.cpp @@ -24,9 +24,9 @@ //---------------------------------------------------------------------------- BOOL -__stdcall EgtInvertCurve( int nGseCtx, int nId) +__stdcall EgtInvertCurve( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -38,9 +38,9 @@ __stdcall EgtInvertCurve( int nGseCtx, int nId) //---------------------------------------------------------------------------- BOOL -__stdcall EgtModifyCurveStartPoint( int nGseCtx, int nId, const double ptP[3]) +__stdcall EgtModifyCurveStartPoint( int nId, const double ptP[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -52,9 +52,9 @@ __stdcall EgtModifyCurveStartPoint( int nGseCtx, int nId, const double ptP[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtModifyCurveEndPoint( int nGseCtx, int nId, const double ptP[3]) +__stdcall EgtModifyCurveEndPoint( int nId, const double ptP[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -66,9 +66,9 @@ __stdcall EgtModifyCurveEndPoint( int nGseCtx, int nId, const double ptP[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtModifyCurveExtrusion( int nGseCtx, int nId, const double vtExtr[3]) +__stdcall EgtModifyCurveExtrusion( int nId, const double vtExtr[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -80,9 +80,9 @@ __stdcall EgtModifyCurveExtrusion( int nGseCtx, int nId, const double vtExtr[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtModifyCurveThickness( int nGseCtx, int nId, double dThick) +__stdcall EgtModifyCurveThickness( int nId, double dThick) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -94,9 +94,9 @@ __stdcall EgtModifyCurveThickness( int nGseCtx, int nId, double dThick) //---------------------------------------------------------------------------- BOOL -__stdcall EgtTrimCurveStartAtLen( int nGseCtx, int nId, double dLen) +__stdcall EgtTrimCurveStartAtLen( int nId, double dLen) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -108,9 +108,9 @@ __stdcall EgtTrimCurveStartAtLen( int nGseCtx, int nId, double dLen) //---------------------------------------------------------------------------- BOOL -__stdcall EgtTrimCurveEndAtLen( int nGseCtx, int nId, double dLen) +__stdcall EgtTrimCurveEndAtLen( int nId, double dLen) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -122,9 +122,9 @@ __stdcall EgtTrimCurveEndAtLen( int nGseCtx, int nId, double dLen) //---------------------------------------------------------------------------- BOOL -__stdcall EgtTrimCurveStartAtParam( int nGseCtx, int nId, double dPar) +__stdcall EgtTrimCurveStartAtParam( int nId, double dPar) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -136,9 +136,9 @@ __stdcall EgtTrimCurveStartAtParam( int nGseCtx, int nId, double dPar) //---------------------------------------------------------------------------- BOOL -__stdcall EgtTrimCurveEndAtParam( int nGseCtx, int nId, double dPar) +__stdcall EgtTrimCurveEndAtParam( int nId, double dPar) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; @@ -150,9 +150,9 @@ __stdcall EgtTrimCurveEndAtParam( int nGseCtx, int nId, double dPar) //---------------------------------------------------------------------------- BOOL -__stdcall EgtTrimCurveStartEndAtParam( int nGseCtx, int nId, double dParS, double dParE) +__stdcall EgtTrimCurveStartEndAtParam( int nId, double dParS, double dParE) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero la curva ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ; diff --git a/API_Exchange.cpp b/API_Exchange.cpp index 133c85a..39eb9a8 100644 --- a/API_Exchange.cpp +++ b/API_Exchange.cpp @@ -67,16 +67,16 @@ __stdcall EgtGetFileType( const string& sFilePath) //----------------------------------------------------------------------------- BOOL -__stdcall EgtImportDxf( int nGseCtx, const wchar_t* wsFilePath) +__stdcall EgtImportDxf( const wchar_t* wsFilePath) { - return EgtImportDxf( nGseCtx, wstrztoA( wsFilePath)) ; + return EgtImportDxf( wstrztoA( wsFilePath)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtImportDxf( int nGseCtx, const string& sFilePath) +__stdcall EgtImportDxf( const string& sFilePath) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // importo il file DXF // aggiungo un gruppo pezzo @@ -90,16 +90,16 @@ __stdcall EgtImportDxf( int nGseCtx, const string& sFilePath) //----------------------------------------------------------------------------- BOOL -__stdcall EgtImportStl( int nGseCtx, const wchar_t* wsFilePath) +__stdcall EgtImportStl( const wchar_t* wsFilePath) { - return EgtImportStl( nGseCtx, wstrztoA( wsFilePath)) ; + return EgtImportStl( wstrztoA( wsFilePath)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtImportStl( int nGseCtx, const string& sFilePath) +__stdcall EgtImportStl( const string& sFilePath) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // importo il file STL // aggiungo un gruppo pezzo e un gruppo layer @@ -114,16 +114,16 @@ __stdcall EgtImportStl( int nGseCtx, const string& sFilePath) //----------------------------------------------------------------------------- BOOL -__stdcall EgtImportCnc( int nGseCtx, const wchar_t* wsFilePath) +__stdcall EgtImportCnc( const wchar_t* wsFilePath) { - return EgtImportCnc( nGseCtx, wstrztoA( wsFilePath)) ; + return EgtImportCnc( wstrztoA( wsFilePath)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtImportCnc( int nGseCtx, const string& sFilePath) +__stdcall EgtImportCnc( const string& sFilePath) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // importo il file CNC // aggiungo un gruppo pezzo @@ -137,16 +137,16 @@ __stdcall EgtImportCnc( int nGseCtx, const string& sFilePath) //----------------------------------------------------------------------------- BOOL -__stdcall EgtExportDxf( int nGseCtx, int nId, const wchar_t* wsFilePath) +__stdcall EgtExportDxf( int nId, const wchar_t* wsFilePath) { - return EgtExportDxf( nGseCtx, nId, wstrztoA( wsFilePath)) ; + return EgtExportDxf( nId, wstrztoA( wsFilePath)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtExportDxf( int nGseCtx, int nId, const string& sFilePath) +__stdcall EgtExportDxf( int nId, const string& sFilePath) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // esporto il file DXF // preparo l'esportatore @@ -158,16 +158,16 @@ __stdcall EgtExportDxf( int nGseCtx, int nId, const string& sFilePath) //----------------------------------------------------------------------------- BOOL -__stdcall EgtExportStl( int nGseCtx, int nId, const wchar_t* wsFilePath) +__stdcall EgtExportStl( int nId, const wchar_t* wsFilePath) { - return EgtExportStl( nGseCtx, nId, wstrztoA( wsFilePath)) ; + return EgtExportStl( nId, wstrztoA( wsFilePath)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtExportStl( int nGseCtx, int nId, const string& sFilePath) +__stdcall EgtExportStl( int nId, const string& sFilePath) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // esporto il file STL // preparo l'esportatore diff --git a/API_GdbCreate.cpp b/API_GdbCreate.cpp index 587bd45..bab9ed3 100644 --- a/API_GdbCreate.cpp +++ b/API_GdbCreate.cpp @@ -36,10 +36,10 @@ static bool GetPolyLineFromCurve( IGeomDB* pGeomDB, int nId, const Frame3d& frDe //------------------------------------------------------------------------------- int -__stdcall EgtCreateGroup( int nGseCtx, int nParentId, const double ptOrig[3], +__stdcall EgtCreateGroup( int nParentId, const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // costruisco il riferimento Frame3d frFrame ; @@ -51,9 +51,9 @@ __stdcall EgtCreateGroup( int nGseCtx, int nParentId, const double ptOrig[3], //------------------------------------------------------------------------------- int -__stdcall EgtCreateGeoPoint( int nGseCtx, int nParentId, const double ptP[3]) +__stdcall EgtCreateGeoPoint( int nParentId, const double ptP[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo il punto PtrOwner pGeoPnt( CreateGeoPoint3d()) ; @@ -68,9 +68,9 @@ __stdcall EgtCreateGeoPoint( int nGseCtx, int nParentId, const double ptP[3]) //------------------------------------------------------------------------------- int -__stdcall EgtCreateGeoVector( int nGseCtx, int nParentId, const double vtV[3], const double ptB[3]) +__stdcall EgtCreateGeoVector( int nParentId, const double vtV[3], const double ptB[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo il vettore PtrOwner pGeoVct( CreateGeoVector3d()) ; @@ -85,10 +85,10 @@ __stdcall EgtCreateGeoVector( int nGseCtx, int nParentId, const double vtV[3], c //------------------------------------------------------------------------------- int -__stdcall EgtCreateGeoFrame( int nGseCtx, int nParentId, const double ptOrig[3], +__stdcall EgtCreateGeoFrame( int nParentId, const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo il riferimento PtrOwner pGeoFrm( CreateGeoFrame3d()) ; @@ -103,10 +103,9 @@ __stdcall EgtCreateGeoFrame( int nGseCtx, int nParentId, const double ptOrig[3], //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveLine( int nGseCtx, int nParentId, - const double ptIni[3], const double ptFin[3]) +__stdcall EgtCreateCurveLine( int nParentId, const double ptIni[3], const double ptFin[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo la linea PtrOwner pCrvLine( CreateCurveLine()) ; @@ -121,10 +120,10 @@ __stdcall EgtCreateCurveLine( int nGseCtx, int nParentId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveLineMinPointCurve( int nGseCtx, int nParentId, +__stdcall EgtCreateCurveLineMinPointCurve( int nParentId, const double ptStart[3], int nCrvId, double dNearPar) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero il riferimento del gruppo destinazione Frame3d frPoint ; @@ -162,10 +161,10 @@ __stdcall EgtCreateCurveLineMinPointCurve( int nGseCtx, int nParentId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCircle( int nGseCtx, int nParentId, +__stdcall EgtCreateCurveCircle( int nParentId, const double ptCen[3], const double vtN[3], double dRad) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo l'arco PtrOwner pCrvArc( CreateCurveArc()) ; @@ -180,10 +179,10 @@ __stdcall EgtCreateCurveCircle( int nGseCtx, int nParentId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCircleXY( int nGseCtx, int nParentId, +__stdcall EgtCreateCurveCircleXY( int nParentId, const double ptCen[3], double dRad) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo l'arco PtrOwner pCrvArc( CreateCurveArc()) ; @@ -198,10 +197,10 @@ __stdcall EgtCreateCurveCircleXY( int nGseCtx, int nParentId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCircle3P( int nGseCtx, int nParentId, +__stdcall EgtCreateCurveCircle3P( int nParentId, const double ptP1[3], const double ptP2[3], const double ptP3[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo l'arco PtrOwner pCrvArc( CreateCurveArc()) ; @@ -216,11 +215,11 @@ __stdcall EgtCreateCurveCircle3P( int nGseCtx, int nParentId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveArc( int nGseCtx, int nParentId, +__stdcall EgtCreateCurveArc( int nParentId, const double ptCen[3], const double vtN[3], double dRad, const double vtS[3], double dAngCenDeg, double dDeltaN) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo l'arco PtrOwner pCrvArc( CreateCurveArc()) ; @@ -235,11 +234,11 @@ __stdcall EgtCreateCurveArc( int nGseCtx, int nParentId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveArcXY( int nGseCtx, int nParentId, +__stdcall EgtCreateCurveArcXY( int nParentId, const double ptCen[3], double dRad, double dAngStartDeg, double dAngCenDeg, double dDeltaZ) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo l'arco PtrOwner pCrvArc( CreateCurveArc()) ; @@ -254,10 +253,10 @@ __stdcall EgtCreateCurveArcXY( int nGseCtx, int nParentId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveArc3P( int nGseCtx, int nParentId, +__stdcall EgtCreateCurveArc3P( int nParentId, const double ptP1[3], const double ptP2[3], const double ptP3[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo l'arco PtrOwner pCrvArc( CreateCurveArc()) ; @@ -272,21 +271,21 @@ __stdcall EgtCreateCurveArc3P( int nGseCtx, int nParentId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveBezier( int nGseCtx, int nParentId, int nDegree, const double ptCtrls[]) +__stdcall EgtCreateCurveBezier( int nParentId, int nDegree, const double ptCtrls[]) { PNTVECTOR vPnt ; vPnt.reserve( nDegree + 1) ; for ( int i = 0 ; i <= nDegree ; ++i) { vPnt.push_back( Point3d( ptCtrls[3*i], ptCtrls[3*i+1], ptCtrls[3*i+2])) ; } - return EgtCreateCurveBezier( nGseCtx, nParentId, nDegree, vPnt) ; + return EgtCreateCurveBezier( nParentId, nDegree, vPnt) ; } //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveBezier( int nGseCtx, int nParentId, int nDegree, const PNTVECTOR& vPnt) +__stdcall EgtCreateCurveBezier( int nParentId, int nDegree, const PNTVECTOR& vPnt) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // il numero dei punti deve essere pari al grado + 1 if ( vPnt.size() != nDegree + 1) @@ -312,21 +311,21 @@ __stdcall EgtCreateCurveBezier( int nGseCtx, int nParentId, int nDegree, const P //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveBezierRational( int nGseCtx, int nParentId, int nDegree, const double ptCtrlWs[]) +__stdcall EgtCreateCurveBezierRational( int nParentId, int nDegree, const double ptCtrlWs[]) { PNTUVECTOR vPntW ; vPntW.reserve( nDegree + 1) ; for ( int i = 0 ; i <= nDegree ; ++i) { vPntW.push_back( make_pair( Point3d( ptCtrlWs[4*i], ptCtrlWs[4*i+1], ptCtrlWs[4*i+2]), ptCtrlWs[4*i+3])) ; } - return EgtCreateCurveBezierRational( nGseCtx, nParentId, nDegree, vPntW) ; + return EgtCreateCurveBezierRational( nParentId, nDegree, vPntW) ; } //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveBezierRational( int nGseCtx, int nParentId, int nDegree, const PNTUVECTOR& vPntW) +__stdcall EgtCreateCurveBezierRational( int nParentId, int nDegree, const PNTUVECTOR& vPntW) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // il numero dei punti deve essere pari al grado + 1 if ( vPntW.size() != nDegree + 1) @@ -352,9 +351,9 @@ __stdcall EgtCreateCurveBezierRational( int nGseCtx, int nParentId, int nDegree, //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveBezierFromArc( int nGseCtx, int nParentId, int nArcId, BOOL bErase) +__stdcall EgtCreateCurveBezierFromArc( int nParentId, int nArcId, BOOL bErase) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo la curva di Bezier PtrOwner pCrvBez( CreateCurveBezier()) ; @@ -397,21 +396,21 @@ __stdcall EgtCreateCurveBezierFromArc( int nGseCtx, int nParentId, int nArcId, B //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCompo( int nGseCtx, int nParentId, int nNumId, const int nIds[], BOOL bErase) +__stdcall EgtCreateCurveCompo( int nParentId, int nNumId, const int nIds[], BOOL bErase) { INTVECTOR vIds ; vIds.reserve( nNumId) ; for ( int i = 0 ; i < nNumId ; ++i) { vIds.push_back( nIds[i]) ; } - return EgtCreateCurveCompo( nGseCtx, nParentId, vIds, ( bErase != FALSE)) ; + return EgtCreateCurveCompo( nParentId, vIds, ( bErase != FALSE)) ; } //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCompo( int nGseCtx, int nParentId, const INTVECTOR& vIds, bool bErase) +__stdcall EgtCreateCurveCompo( int nParentId, const INTVECTOR& vIds, bool bErase) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo la curva composita PtrOwner pCrvCompo( CreateCurveComposite()) ; @@ -468,20 +467,20 @@ __stdcall EgtCreateCurveCompo( int nGseCtx, int nParentId, const INTVECTOR& vIds //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCompoFromPoints( int nGseCtx, int nParentId, int nP, const double ptPs[]) +__stdcall EgtCreateCurveCompoFromPoints( int nParentId, int nP, const double ptPs[]) { PolyLine PL ; for ( int i = 0 ; i < nP ; ++i) { PL.AddUPoint( 0, Point3d( ptPs[3*i], ptPs[3*i+1], ptPs[3*i+2])) ; } - return EgtCreateCurveCompoFromPoints( nGseCtx, nParentId, PL) ; + return EgtCreateCurveCompoFromPoints( nParentId, PL) ; } //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCompoFromPoints( int nGseCtx, int nParentId, const PolyLine& PL) +__stdcall EgtCreateCurveCompoFromPoints( int nParentId, const PolyLine& PL) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo la curva composita PtrOwner pCrvCompo( CreateCurveComposite()) ; @@ -496,20 +495,20 @@ __stdcall EgtCreateCurveCompoFromPoints( int nGseCtx, int nParentId, const PolyL //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCompoFromPointBulges( int nGseCtx, int nParentId, int nPB, const double ptPBs[]) +__stdcall EgtCreateCurveCompoFromPointBulges( int nParentId, int nPB, const double ptPBs[]) { PolyArc PA ; for ( int i = 0 ; i < nPB ; ++i) { PA.AddUPoint( 0, Point3d( ptPBs[4*i], ptPBs[4*i+1], ptPBs[4*i+2]), ptPBs[4*i+3]) ; } - return EgtCreateCurveCompoFromPointBulges( nGseCtx, nParentId, PA) ; + return EgtCreateCurveCompoFromPointBulges( nParentId, PA) ; } //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCompoFromPointBulges( int nGseCtx, int nParentId, const PolyArc& PA) +__stdcall EgtCreateCurveCompoFromPointBulges( int nParentId, const PolyArc& PA) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo la curva composita PtrOwner pCrvCompo( CreateCurveComposite()) ; @@ -524,10 +523,10 @@ __stdcall EgtCreateCurveCompoFromPointBulges( int nGseCtx, int nParentId, const //------------------------------------------------------------------------------- int -__stdcall EgtCreateCurveCompoFromPolygonSide( int nGseCtx, int nParentId, int nNumSides, +__stdcall EgtCreateCurveCompoFromPolygonSide( int nParentId, int nNumSides, const double ptIni[3], const double ptFin[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo la curva composita PtrOwner pCrvCompo( CreateCurveComposite()) ; @@ -542,9 +541,9 @@ __stdcall EgtCreateCurveCompoFromPolygonSide( int nGseCtx, int nParentId, int nN //------------------------------------------------------------------------------- int -__stdcall EgtCreateSurfTriMeshByContour( int nGseCtx, int nParentId, int nCrvId, double dLinTol) +__stdcall EgtCreateSurfTriMeshByContour( int nParentId, int nCrvId, double dLinTol) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero il riferimento del gruppo destinazione Frame3d frDest ; @@ -567,18 +566,18 @@ __stdcall EgtCreateSurfTriMeshByContour( int nGseCtx, int nParentId, int nCrvId, //------------------------------------------------------------------------------- int -__stdcall EgtCreateText( int nGseCtx, int nParentId, const wchar_t* wsText, +__stdcall EgtCreateText( int nParentId, const wchar_t* wsText, const double ptP[3], double dAngRotDeg, double dH) { - return EgtCreateText( nGseCtx, nParentId, wstrztoA( wsText), Point3d( ptP), dAngRotDeg, dH) ; + return EgtCreateText( nParentId, wstrztoA( wsText), Point3d( ptP), dAngRotDeg, dH) ; } //------------------------------------------------------------------------------- int -__stdcall EgtCreateText( int nGseCtx, int nParentId, const string& sText, +__stdcall EgtCreateText( int nParentId, const string& sText, const Point3d& ptP, double dAngRotDeg, double dH) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo il testo PtrOwner pTXT( CreateExtText()) ; @@ -593,21 +592,21 @@ __stdcall EgtCreateText( int nGseCtx, int nParentId, const string& sText, //------------------------------------------------------------------------------- int -__stdcall EgtCreateTextEx( int nGseCtx, int nParentId, const wchar_t* wsText, +__stdcall EgtCreateTextEx( int nParentId, const wchar_t* wsText, const double ptP[3], double dAngRotDeg, const wchar_t* wsFont, int nW, BOOL bItalic, double dH, double dRat, double dAddAdv, int nInsPos) { - return EgtCreateTextEx( nGseCtx, nParentId, wstrztoA( wsText), Point3d( ptP), dAngRotDeg, + return EgtCreateTextEx( nParentId, wstrztoA( wsText), Point3d( ptP), dAngRotDeg, wstrztoA( wsFont), nW, ( bItalic != FALSE), dH, dRat, dAddAdv, nInsPos) ; } //------------------------------------------------------------------------------- int -__stdcall EgtCreateTextEx( int nGseCtx, int nParentId, const string& sText, +__stdcall EgtCreateTextEx( int nParentId, const string& sText, const Point3d& ptP, double dAngRotDeg, const string& sFont, int nW, bool bItalic, double dH, double dRat, double dAddAdv, int nInsPos) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // creo il testo PtrOwner pTXT( CreateExtText()) ; diff --git a/API_GdbModify.cpp b/API_GdbModify.cpp index 94c15b6..a22c252 100644 --- a/API_GdbModify.cpp +++ b/API_GdbModify.cpp @@ -33,9 +33,9 @@ using namespace std ; //------------------------------------------------------------------------------- BOOL -__stdcall EgtChangeVectorBase( int nGseCtx, int nId, const double ptB[3]) +__stdcall EgtChangeVectorBase( int nId, const double ptB[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il vettore IGeoVector3d* pGVect = GetGeoVector3d( pGeomDB->GetGeoObj( nId)) ; @@ -47,16 +47,16 @@ __stdcall EgtChangeVectorBase( int nGseCtx, int nId, const double ptB[3]) //------------------------------------------------------------------------------- BOOL -__stdcall EgtModifyText( int nGseCtx, int nId, const wchar_t* wsNewText) +__stdcall EgtModifyText( int nId, const wchar_t* wsNewText) { - return EgtModifyText( nGseCtx, nId, wstrztoA( wsNewText)) ; + return EgtModifyText( nId, wstrztoA( wsNewText)) ; } //------------------------------------------------------------------------------- BOOL -__stdcall EgtModifyText( int nGseCtx, int nId, const string& sNewText) +__stdcall EgtModifyText( int nId, const string& sNewText) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il testo IExtText* pTXT = GetExtText( pGeomDB->GetGeoObj( nId)) ; @@ -68,16 +68,16 @@ __stdcall EgtModifyText( int nGseCtx, int nId, const string& sNewText) //------------------------------------------------------------------------------- BOOL -__stdcall EgtChangeTextFont( int nGseCtx, int nId, const wchar_t* wsNewFont) +__stdcall EgtChangeTextFont( int nId, const wchar_t* wsNewFont) { - return EgtChangeTextFont( nGseCtx, nId, wstrztoA( wsNewFont)) ; + return EgtChangeTextFont( nId, wstrztoA( wsNewFont)) ; } //------------------------------------------------------------------------------- BOOL -__stdcall EgtChangeTextFont( int nGseCtx, int nId, const string& sNewFont) +__stdcall EgtChangeTextFont( int nId, const string& sNewFont) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il testo IExtText* pTXT = GetExtText( pGeomDB->GetGeoObj( nId)) ; @@ -89,9 +89,9 @@ __stdcall EgtChangeTextFont( int nGseCtx, int nId, const string& sNewFont) //------------------------------------------------------------------------------- BOOL -__stdcall EgtFlipText( int nGseCtx, int nId) +__stdcall EgtFlipText( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il testo IExtText* pTXT = GetExtText( pGeomDB->GetGeoObj( nId)) ; @@ -103,9 +103,9 @@ __stdcall EgtFlipText( int nGseCtx, int nId) //------------------------------------------------------------------------------- BOOL -__stdcall EgtMirrorText( int nGseCtx, int nId, BOOL bOnL) +__stdcall EgtMirrorText( int nId, BOOL bOnL) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il testo IExtText* pTXT = GetExtText( pGeomDB->GetGeoObj( nId)) ; @@ -117,9 +117,9 @@ __stdcall EgtMirrorText( int nGseCtx, int nId, BOOL bOnL) //------------------------------------------------------------------------------- BOOL -__stdcall EgtTextToOutline( int nGseCtx, int nId, int nDestGroupId) +__stdcall EgtTextToOutline( int nId, int nDestGroupId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il testo IExtText* pTXT = GetExtText( pGeomDB->GetGeoObj( nId)) ; @@ -151,9 +151,9 @@ __stdcall EgtTextToOutline( int nGseCtx, int nId, int nDestGroupId) //------------------------------------------------------------------------------- BOOL -__stdcall EgtSplitText( int nGseCtx, int nId, int nDestGroupId) +__stdcall EgtSplitText( int nId, int nDestGroupId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il testo IExtText* pTXT = GetExtText( pGeomDB->GetGeoObj( nId)) ; diff --git a/API_GdbObjAttribs.cpp b/API_GdbObjAttribs.cpp index 616c07a..ca43378 100644 --- a/API_GdbObjAttribs.cpp +++ b/API_GdbObjAttribs.cpp @@ -25,9 +25,9 @@ using namespace std ; //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetLevel( int nGseCtx, int nId, int nLevel) +__stdcall EgtSetLevel( int nId, int nLevel) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // imposto il livello return ( pGeomDB->SetLevel( nId, nLevel) ? TRUE : FALSE) ; @@ -35,9 +35,9 @@ __stdcall EgtSetLevel( int nGseCtx, int nId, int nLevel) //----------------------------------------------------------------------------- BOOL -__stdcall EgtRevertLevel( int nGseCtx, int nId) +__stdcall EgtRevertLevel( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // porto il livello allo stato precedente return ( pGeomDB->RevertLevel( nId) ? TRUE : FALSE) ; @@ -45,9 +45,9 @@ __stdcall EgtRevertLevel( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetLevel( int nGseCtx, int nId, int* pnLevel) +__stdcall EgtGetLevel( int nId, int* pnLevel) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico il parametro if ( pnLevel == nullptr) @@ -58,9 +58,9 @@ __stdcall EgtGetLevel( int nGseCtx, int nId, int* pnLevel) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetCalcLevel( int nGseCtx, int nId, int* pnLevel) +__stdcall EgtGetCalcLevel( int nId, int* pnLevel) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico il parametro if ( pnLevel == nullptr) @@ -71,9 +71,9 @@ __stdcall EgtGetCalcLevel( int nGseCtx, int nId, int* pnLevel) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetMode( int nGseCtx, int nId, int nMode) +__stdcall EgtSetMode( int nId, int nMode) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // imposto il modo return ( pGeomDB->SetMode( nId, nMode) ? TRUE : FALSE) ; @@ -81,9 +81,9 @@ __stdcall EgtSetMode( int nGseCtx, int nId, int nMode) //----------------------------------------------------------------------------- BOOL -__stdcall EgtRevertMode( int nGseCtx, int nId) +__stdcall EgtRevertMode( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // porto il modo allo stato precedente return ( pGeomDB->RevertMode( nId) ? TRUE : FALSE) ; @@ -91,9 +91,9 @@ __stdcall EgtRevertMode( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetMode( int nGseCtx, int nId, int* pnMode) +__stdcall EgtGetMode( int nId, int* pnMode) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico il parametro if ( pnMode == nullptr) @@ -104,9 +104,9 @@ __stdcall EgtGetMode( int nGseCtx, int nId, int* pnMode) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetCalcMode( int nGseCtx, int nId, int* pnMode) +__stdcall EgtGetCalcMode( int nId, int* pnMode) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico il parametro if ( pnMode == nullptr) @@ -117,9 +117,9 @@ __stdcall EgtGetCalcMode( int nGseCtx, int nId, int* pnMode) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetStatus( int nGseCtx, int nId, int nStat) +__stdcall EgtSetStatus( int nId, int nStat) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // imposto il modo return ( pGeomDB->SetStatus( nId, nStat) ? TRUE : FALSE) ; @@ -127,9 +127,9 @@ __stdcall EgtSetStatus( int nGseCtx, int nId, int nStat) //----------------------------------------------------------------------------- BOOL -__stdcall EgtRevertStatus( int nGseCtx, int nId) +__stdcall EgtRevertStatus( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // porto lo stato al valore precedente return ( pGeomDB->RevertStatus( nId) ? TRUE : FALSE) ; @@ -137,9 +137,9 @@ __stdcall EgtRevertStatus( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetStatus( int nGseCtx, int nId, int* pnStat) +__stdcall EgtGetStatus( int nId, int* pnStat) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico il parametro if ( pnStat == nullptr) @@ -150,9 +150,9 @@ __stdcall EgtGetStatus( int nGseCtx, int nId, int* pnStat) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetCalcStatus( int nGseCtx, int nId, int* pnStat) +__stdcall EgtGetCalcStatus( int nId, int* pnStat) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico il parametro if ( pnStat == nullptr) @@ -163,9 +163,9 @@ __stdcall EgtGetCalcStatus( int nGseCtx, int nId, int* pnStat) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetMark( int nGseCtx, int nId) +__stdcall EgtSetMark( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // imposto l'evidenziazione return ( pGeomDB->SetMark( nId) ? TRUE : FALSE) ; @@ -173,9 +173,9 @@ __stdcall EgtSetMark( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtResetMark( int nGseCtx, int nId) +__stdcall EgtResetMark( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // cancello l'evidenziazione return ( pGeomDB->ResetMark( nId) ? TRUE : FALSE) ; @@ -183,9 +183,9 @@ __stdcall EgtResetMark( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetMark( int nGseCtx, int nId, BOOL* pbMark) +__stdcall EgtGetMark( int nId, BOOL* pbMark) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico il parametro if ( pbMark == nullptr) @@ -196,9 +196,9 @@ __stdcall EgtGetMark( int nGseCtx, int nId, BOOL* pbMark) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetCalcMark( int nGseCtx, int nId, BOOL* pbMark) +__stdcall EgtGetCalcMark( int nId, BOOL* pbMark) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico il parametro if ( pbMark == nullptr) @@ -233,9 +233,9 @@ __stdcall EgtStdColor( const string& sName, int& nRed, int& nGreen, int& nBlue, //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetColor( int nGseCtx, int nId, int nRed, int nGreen, int nBlue, int nAlpha) +__stdcall EgtSetColor( int nId, int nRed, int nGreen, int nBlue, int nAlpha) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // assegno il colore Color cCol( nRed, nGreen, nBlue, nAlpha) ; @@ -244,9 +244,9 @@ __stdcall EgtSetColor( int nGseCtx, int nId, int nRed, int nGreen, int nBlue, in //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetColor( int nGseCtx, int nId, int& nRed, int& nGreen, int& nBlue, int& nAlpha) +__stdcall EgtGetColor( int nId, int& nRed, int& nGreen, int& nBlue, int& nAlpha) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il colore Color cCol ; @@ -263,9 +263,9 @@ __stdcall EgtGetColor( int nGseCtx, int nId, int& nRed, int& nGreen, int& nBlue, //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetCalcColor( int nGseCtx, int nId, int& nRed, int& nGreen, int& nBlue, int& nAlpha) +__stdcall EgtGetCalcColor( int nId, int& nRed, int& nGreen, int& nBlue, int& nAlpha) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il colore Color cCol ; @@ -282,16 +282,16 @@ __stdcall EgtGetCalcColor( int nGseCtx, int nId, int& nRed, int& nGreen, int& nB //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetName( int nGseCtx, int nId, const wchar_t* wsName) +__stdcall EgtSetName( int nId, const wchar_t* wsName) { - return EgtSetName( nGseCtx, nId, wstrztoA( wsName)) ; + return EgtSetName( nId, wstrztoA( wsName)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetName( int nGseCtx, int nId, const string& sName) +__stdcall EgtSetName( int nId, const string& sName) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // assegno il nome return ( pGeomDB->SetName( nId, sName) ? TRUE : FALSE) ; @@ -299,10 +299,10 @@ __stdcall EgtSetName( int nGseCtx, int nId, const string& sName) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetName( int nGseCtx, int nId, wchar_t*& wsName) +__stdcall EgtGetName( int nId, wchar_t*& wsName) { string sName ; - if ( ! EgtGetName( nGseCtx, nId, sName)) + if ( ! EgtGetName( nId, sName)) return FALSE ; wsName = _wcsdup( stringtoW( sName)) ; return (( wsName == nullptr) ? FALSE : TRUE) ; @@ -310,9 +310,9 @@ __stdcall EgtGetName( int nGseCtx, int nId, wchar_t*& wsName) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetName( int nGseCtx, int nId, string& sName) +__stdcall EgtGetName( int nId, string& sName) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero il nome return pGeomDB->GetName( nId, sName) ; @@ -320,9 +320,9 @@ __stdcall EgtGetName( int nGseCtx, int nId, string& sName) //----------------------------------------------------------------------------- BOOL -__stdcall EgtExistsName( int nGseCtx, int nId) +__stdcall EgtExistsName( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico esistenza del nome return ( pGeomDB->ExistsName( nId) ? TRUE : FALSE) ; @@ -330,9 +330,9 @@ __stdcall EgtExistsName( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtRemoveName( int nGseCtx, int nId) +__stdcall EgtRemoveName( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // rimuovo il nome return ( pGeomDB->RemoveName( nId) ? TRUE : FALSE) ; @@ -340,16 +340,16 @@ __stdcall EgtRemoveName( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetInfo( int nGseCtx, int nId, const wchar_t* wsKey, const wchar_t* wsInfo) +__stdcall EgtSetInfo( int nId, const wchar_t* wsKey, const wchar_t* wsInfo) { - return EgtSetInfo( nGseCtx, nId, wstrztoA( wsKey), wstrztoA( wsInfo)) ; + return EgtSetInfo( nId, wstrztoA( wsKey), wstrztoA( wsInfo)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetInfo( int nGseCtx, int nId, const string& sKey, const string& sInfo) +__stdcall EgtSetInfo( int nId, const string& sKey, const string& sInfo) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // assegno la info return ( pGeomDB->SetInfo( nId, sKey, sInfo) ? TRUE : FALSE) ; @@ -357,10 +357,10 @@ __stdcall EgtSetInfo( int nGseCtx, int nId, const string& sKey, const string& sI //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetInfo( int nGseCtx, int nId, const wchar_t* wsKey, wchar_t*& wsInfo) +__stdcall EgtGetInfo( int nId, const wchar_t* wsKey, wchar_t*& wsInfo) { string sInfo ; - if ( ! EgtGetInfo( nGseCtx, nId, wstrztoA( wsKey), sInfo)) + if ( ! EgtGetInfo( nId, wstrztoA( wsKey), sInfo)) return FALSE ; wsInfo = _wcsdup( stringtoW( sInfo)) ; return (( wsInfo == nullptr) ? FALSE : TRUE) ; @@ -368,9 +368,9 @@ __stdcall EgtGetInfo( int nGseCtx, int nId, const wchar_t* wsKey, wchar_t*& wsIn //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetInfo( int nGseCtx, int nId, const string& sKey, string& sInfo) +__stdcall EgtGetInfo( int nId, const string& sKey, string& sInfo) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero la info return pGeomDB->GetInfo( nId, sKey, sInfo) ; @@ -378,16 +378,16 @@ __stdcall EgtGetInfo( int nGseCtx, int nId, const string& sKey, string& sInfo) //----------------------------------------------------------------------------- BOOL -__stdcall EgtExistsInfo( int nGseCtx, int nId, const wchar_t* wsKey) +__stdcall EgtExistsInfo( int nId, const wchar_t* wsKey) { - return EgtExistsInfo( nGseCtx, nId, wstrztoA( wsKey)) ; + return EgtExistsInfo( nId, wstrztoA( wsKey)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtExistsInfo( int nGseCtx, int nId, const string& sKey) +__stdcall EgtExistsInfo( int nId, const string& sKey) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico esistenza info return ( pGeomDB->ExistsInfo( nId, sKey) ? TRUE : FALSE) ; @@ -395,16 +395,16 @@ __stdcall EgtExistsInfo( int nGseCtx, int nId, const string& sKey) //----------------------------------------------------------------------------- BOOL -__stdcall EgtRemoveInfo( int nGseCtx, int nId, const wchar_t* wsKey) +__stdcall EgtRemoveInfo( int nId, const wchar_t* wsKey) { - return EgtRemoveInfo( nGseCtx, nId, wstrztoA( wsKey)) ; + return EgtRemoveInfo( nId, wstrztoA( wsKey)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtRemoveInfo( int nGseCtx, int nId, const string& sKey) +__stdcall EgtRemoveInfo( int nId, const string& sKey) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // rimuovo la info return ( pGeomDB->RemoveInfo( nId, sKey) ? TRUE : FALSE) ; diff --git a/API_GdbObjSelection.cpp b/API_GdbObjSelection.cpp index 933ac9c..539ac56 100644 --- a/API_GdbObjSelection.cpp +++ b/API_GdbObjSelection.cpp @@ -25,9 +25,9 @@ using namespace std ; //----------------------------------------------------------------------------- BOOL - __stdcall EgtIsSelectedObj( int nGseCtx, int nId) + __stdcall EgtIsSelectedObj( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico se l'oggetto è selezionato return ( pGeomDB->IsSelectedObj( nId) ? TRUE : FALSE) ; @@ -35,9 +35,9 @@ BOOL //----------------------------------------------------------------------------- BOOL - __stdcall EgtSelectObj( int nGseCtx, int nId) + __stdcall EgtSelectObj( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // seleziono l'oggetto return ( pGeomDB->SelectObj( nId) ? TRUE : FALSE) ; @@ -45,9 +45,9 @@ BOOL //----------------------------------------------------------------------------- BOOL - __stdcall EgtDeselectObj( int nGseCtx, int nId) + __stdcall EgtDeselectObj( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // deseleziono l'oggetto return ( pGeomDB->DeselectObj( nId) ? TRUE : FALSE) ; @@ -55,9 +55,9 @@ BOOL //----------------------------------------------------------------------------- BOOL - __stdcall EgtDeselectAll( int nGseCtx) + __stdcall EgtDeselectAll( void) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // deseleziono tutto return ( pGeomDB->ClearSelection() ? TRUE : FALSE) ; diff --git a/API_GdbObjects.cpp b/API_GdbObjects.cpp index 679eb2a..6cdd15b 100644 --- a/API_GdbObjects.cpp +++ b/API_GdbObjects.cpp @@ -25,9 +25,9 @@ using namespace std ; //----------------------------------------------------------------------------- BOOL - __stdcall EgtExistsObj( int nGseCtx, int nId) + __stdcall EgtExistsObj( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // verifico se esiste l'oggetto return ( pGeomDB->ExistsObj( nId) ? TRUE : FALSE) ; @@ -35,9 +35,9 @@ BOOL //----------------------------------------------------------------------------- int - __stdcall EgtGetGroupObjs( int nGseCtx, int nId) + __stdcall EgtGetGroupObjs( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero il numero di oggetti nel gruppo return ( pGeomDB->GetGroupObjs( nId)) ; @@ -45,9 +45,9 @@ int //----------------------------------------------------------------------------- int -__stdcall EgtGetFirstInGroup( int nGseCtx, int nGroupId) +__stdcall EgtGetFirstInGroup( int nGroupId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero il primo oggetto nel gruppo return pGeomDB->GetFirstInGroup( nGroupId) ; @@ -55,9 +55,9 @@ __stdcall EgtGetFirstInGroup( int nGseCtx, int nGroupId) //----------------------------------------------------------------------------- int -__stdcall EgtGetNext( int nGseCtx, int nId) +__stdcall EgtGetNext( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero il prossimo oggetto nello stesso gruppo return pGeomDB->GetNext( nId) ; @@ -65,9 +65,9 @@ __stdcall EgtGetNext( int nGseCtx, int nId) //----------------------------------------------------------------------------- int -__stdcall EgtGetLastInGroup( int nGseCtx, int nGroupId) +__stdcall EgtGetLastInGroup( int nGroupId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero l'ultimo oggetto nel gruppo return pGeomDB->GetLastInGroup( nGroupId) ; @@ -75,9 +75,9 @@ __stdcall EgtGetLastInGroup( int nGseCtx, int nGroupId) //----------------------------------------------------------------------------- int -__stdcall EgtGetPrev( int nGseCtx, int nId) +__stdcall EgtGetPrev( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero il precedente oggetto nello stesso gruppo return pGeomDB->GetPrev( nId) ; @@ -85,9 +85,9 @@ __stdcall EgtGetPrev( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetBBox( int nGseCtx, int nId, int nFlag, double ptMin[3], double ptMax[3]) +__stdcall EgtGetBBox( int nId, int nFlag, double ptMin[3], double ptMax[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero il bounding box locale dell'oggetto BBox3d b3Loc ; @@ -104,9 +104,9 @@ __stdcall EgtGetBBox( int nGseCtx, int nId, int nFlag, double ptMin[3], double p //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetBBoxGlob( int nGseCtx, int nId, int nFlag, double ptMin[3], double ptMax[3]) +__stdcall EgtGetBBoxGlob( int nId, int nFlag, double ptMin[3], double ptMax[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // recupero il bounding box globale dell'oggetto BBox3d b3Loc ; @@ -123,9 +123,9 @@ __stdcall EgtGetBBoxGlob( int nGseCtx, int nId, int nFlag, double ptMin[3], doub //----------------------------------------------------------------------------- int -__stdcall EgtCopy( int nGseCtx, int nSouId, int nRefId, int nSonBeforeAfter) +__stdcall EgtCopy( int nSouId, int nRefId, int nSonBeforeAfter) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // eseguo la copia return pGeomDB->Copy( nSouId, GDB_ID_NULL, nRefId, nSonBeforeAfter) ; @@ -133,9 +133,9 @@ __stdcall EgtCopy( int nGseCtx, int nSouId, int nRefId, int nSonBeforeAfter) //----------------------------------------------------------------------------- int -__stdcall EgtCopyGlob( int nGseCtx, int nSouId, int nRefId, int nSonBeforeAfter) +__stdcall EgtCopyGlob( int nSouId, int nRefId, int nSonBeforeAfter) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // eseguo la copia mantenendo la posizione in globale return pGeomDB->CopyGlob( nSouId, GDB_ID_NULL, nRefId, nSonBeforeAfter) ; @@ -143,9 +143,9 @@ __stdcall EgtCopyGlob( int nGseCtx, int nSouId, int nRefId, int nSonBeforeAfter) //----------------------------------------------------------------------------- BOOL -__stdcall EgtRelocate( int nGseCtx, int nSouId, int nRefId, int nSonBeforeAfter) +__stdcall EgtRelocate( int nSouId, int nRefId, int nSonBeforeAfter) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // eseguo la rilocazione return ( pGeomDB->Relocate( nSouId, nRefId, nSonBeforeAfter) ? TRUE : FALSE) ; @@ -153,9 +153,9 @@ __stdcall EgtRelocate( int nGseCtx, int nSouId, int nRefId, int nSonBeforeAfter) //----------------------------------------------------------------------------- BOOL -__stdcall EgtRelocateGlob( int nGseCtx, int nSouId, int nRefId, int nSonBeforeAfter) +__stdcall EgtRelocateGlob( int nSouId, int nRefId, int nSonBeforeAfter) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // eseguo la rilocazione mantenendo la posizione in globale return ( pGeomDB->RelocateGlob( nSouId, nRefId, nSonBeforeAfter) ? TRUE : FALSE) ; @@ -163,9 +163,9 @@ __stdcall EgtRelocateGlob( int nGseCtx, int nSouId, int nRefId, int nSonBeforeAf //----------------------------------------------------------------------------- BOOL -__stdcall EgtErase( int nGseCtx, int nId) +__stdcall EgtErase( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) // eseguo la cancellazione return ( pGeomDB->Erase( nId) ? TRUE : FALSE) ; @@ -173,9 +173,9 @@ __stdcall EgtErase( int nGseCtx, int nId) //----------------------------------------------------------------------------- int -__stdcall EgtGetType( int nGseCtx, int nId) +__stdcall EgtGetType( int nId) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_TY_NONE) // recupero il tipo GDB int nType = pGeomDB->GetGdbType( nId) ; @@ -195,9 +195,9 @@ __stdcall EgtGetType( int nGseCtx, int nId) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetTitle( int nGseCtx, int nId, wchar_t*& wsTitle) +__stdcall EgtGetTitle( int nId, wchar_t*& wsTitle) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero l'oggetto geometrico const IGeoObj* pGeoObj = pGeomDB->GetGeoObj( nId) ; @@ -210,9 +210,9 @@ __stdcall EgtGetTitle( int nGseCtx, int nId, wchar_t*& wsTitle) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGroupDump( int nGseCtx, int nId, wchar_t*& wsDump) +__stdcall EgtGroupDump( int nId, wchar_t*& wsDump) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // preparo l'intestazione string sDump = "Group " + ToString( nId) + "\r\n" ; @@ -250,9 +250,9 @@ __stdcall EgtGroupDump( int nGseCtx, int nId, wchar_t*& wsDump) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGeoObjDump( int nGseCtx, int nId, wchar_t*& wsDump) +__stdcall EgtGeoObjDump( int nId, wchar_t*& wsDump) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // recupero l'oggetto geometrico const IGeoObj* pGeoObj = pGeomDB->GetGeoObj( nId) ; diff --git a/API_GeoSnap.cpp b/API_GeoSnap.cpp index 9d4f465..1858190 100644 --- a/API_GeoSnap.cpp +++ b/API_GeoSnap.cpp @@ -24,9 +24,9 @@ //---------------------------------------------------------------------------- BOOL -__stdcall EgtStartPoint( int nGseCtx, int nId, double ptP[3]) +__stdcall EgtStartPoint( int nId, double ptP[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -96,9 +96,9 @@ __stdcall EgtStartPoint( int nGseCtx, int nId, double ptP[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtEndPoint( int nGseCtx, int nId, double ptP[3]) +__stdcall EgtEndPoint( int nId, double ptP[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -135,9 +135,9 @@ __stdcall EgtEndPoint( int nGseCtx, int nId, double ptP[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtMidPoint( int nGseCtx, int nId, double ptP[3]) +__stdcall EgtMidPoint( int nId, double ptP[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -174,9 +174,9 @@ __stdcall EgtMidPoint( int nGseCtx, int nId, double ptP[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtCenterPoint( int nGseCtx, int nId, double ptP[3]) +__stdcall EgtCenterPoint( int nId, double ptP[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -213,9 +213,9 @@ __stdcall EgtCenterPoint( int nGseCtx, int nId, double ptP[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtAtParamPoint( int nGseCtx, int nId, double dU, double ptP[3]) +__stdcall EgtAtParamPoint( int nId, double dU, double ptP[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -239,9 +239,9 @@ __stdcall EgtAtParamPoint( int nGseCtx, int nId, double dU, double ptP[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtStartVector( int nGseCtx, int nId, double vtV[3]) +__stdcall EgtStartVector( int nId, double vtV[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -276,9 +276,9 @@ __stdcall EgtStartVector( int nGseCtx, int nId, double vtV[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtEndVector( int nGseCtx, int nId, double vtV[3]) +__stdcall EgtEndVector( int nId, double vtV[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -302,9 +302,9 @@ __stdcall EgtEndVector( int nGseCtx, int nId, double vtV[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtMidVector( int nGseCtx, int nId, double vtV[3]) +__stdcall EgtMidVector( int nId, double vtV[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -328,9 +328,9 @@ __stdcall EgtMidVector( int nGseCtx, int nId, double vtV[3]) //---------------------------------------------------------------------------- BOOL -__stdcall EgtAtParamVector( int nGseCtx, int nId, double dU, int nSide, double vtV[3]) +__stdcall EgtAtParamVector( int nId, double dU, int nSide, double vtV[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se non è entità geometrica const IGeoObj* pGObj ; @@ -360,11 +360,11 @@ __stdcall EgtAtParamVector( int nGseCtx, int nId, double dU, int nSide, double v //---------------------------------------------------------------------------- BOOL -__stdcall EgtFrame( int nGseCtx, int nId, double ptOrig[3], double vtX[3], double vtY[3], double vtZ[3]) +__stdcall EgtFrame( int nId, double ptOrig[3], double vtX[3], double vtY[3], double vtZ[3]) { // recupero il frame Frame3d frFrame ; - if ( ! EgtFrame( nGseCtx, nId, frFrame)) + if ( ! EgtFrame( nId, frFrame)) return FALSE ; // assegno l'origine ptOrig[0] = frFrame.Orig().x ; @@ -387,9 +387,9 @@ __stdcall EgtFrame( int nGseCtx, int nId, double ptOrig[3], double vtX[3], doubl //---------------------------------------------------------------------------- BOOL -__stdcall EgtFrame( int nGseCtx, int nId, Frame3d& frFrame) +__stdcall EgtFrame( int nId, Frame3d& frFrame) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // se gruppo if ( pGeomDB->GetGroupFrame( nId, frFrame)) diff --git a/API_GeoTransform.cpp b/API_GeoTransform.cpp index 699a018..d31085d 100644 --- a/API_GeoTransform.cpp +++ b/API_GeoTransform.cpp @@ -22,9 +22,9 @@ using namespace std ; //------------------------------------------------------------------------------- BOOL -__stdcall EgtMove( int nGseCtx, int nId, double vVtMove[3]) +__stdcall EgtMove( int nId, double vVtMove[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo traslazione return ( pGeomDB->Translate( nId, Vector3d( vVtMove)) ? TRUE : FALSE) ; @@ -32,9 +32,9 @@ __stdcall EgtMove( int nGseCtx, int nId, double vVtMove[3]) //------------------------------------------------------------------------------- BOOL -__stdcall EgtMoveGlob( int nGseCtx, int nId, double vVtMove[3]) +__stdcall EgtMoveGlob( int nId, double vVtMove[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo traslazione return ( pGeomDB->TranslateGlob( nId, Vector3d( vVtMove)) ? TRUE : FALSE) ; @@ -42,9 +42,9 @@ __stdcall EgtMoveGlob( int nGseCtx, int nId, double vVtMove[3]) //------------------------------------------------------------------------------- BOOL -__stdcall EgtMoveGroup( int nGseCtx, int nId, double vVtMove[3]) +__stdcall EgtMoveGroup( int nId, double vVtMove[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo traslazione return ( pGeomDB->TranslateGroup( nId, Vector3d( vVtMove)) ? TRUE : FALSE) ; @@ -52,9 +52,9 @@ __stdcall EgtMoveGroup( int nGseCtx, int nId, double vVtMove[3]) //------------------------------------------------------------------------------- BOOL -__stdcall EgtRotate( int nGseCtx, int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg) +__stdcall EgtRotate( int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo rotazione return ( pGeomDB->Rotate( nId, Point3d( vPtAx), Vector3d( vVtAx), dAngRotDeg) ? TRUE : FALSE) ; @@ -62,9 +62,9 @@ __stdcall EgtRotate( int nGseCtx, int nId, double vPtAx[3], double vVtAx[3], dou //------------------------------------------------------------------------------- BOOL -__stdcall EgtRotateGlob( int nGseCtx, int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg) +__stdcall EgtRotateGlob( int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo rotazione return ( pGeomDB->RotateGlob( nId, Point3d( vPtAx), Vector3d( vVtAx), dAngRotDeg) ? TRUE : FALSE) ; @@ -72,9 +72,9 @@ __stdcall EgtRotateGlob( int nGseCtx, int nId, double vPtAx[3], double vVtAx[3], //------------------------------------------------------------------------------- BOOL -__stdcall EgtRotateGroup( int nGseCtx, int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg) +__stdcall EgtRotateGroup( int nId, double vPtAx[3], double vVtAx[3], double dAngRotDeg) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo rotazione return ( pGeomDB->RotateGroup( nId, Point3d( vPtAx), Vector3d( vVtAx), dAngRotDeg) ? TRUE : FALSE) ; @@ -82,11 +82,11 @@ __stdcall EgtRotateGroup( int nGseCtx, int nId, double vPtAx[3], double vVtAx[3] //------------------------------------------------------------------------------- BOOL -__stdcall EgtScale( int nGseCtx, int nId, const double vOrig[3], +__stdcall EgtScale( int nId, const double vOrig[3], const double vX[3], const double vY[3], const double vZ[3], double dCoeffX, double dCoeffY, double dCoeffZ) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo rotazione Frame3d frFrame ; @@ -97,11 +97,11 @@ __stdcall EgtScale( int nGseCtx, int nId, const double vOrig[3], //------------------------------------------------------------------------------- BOOL -__stdcall EgtScaleGlob( int nGseCtx, int nId, const double vOrig[3], +__stdcall EgtScaleGlob( int nId, const double vOrig[3], const double vX[3], const double vY[3], const double vZ[3], double dCoeffX, double dCoeffY, double dCoeffZ) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo rotazione Frame3d frFrame ; @@ -112,11 +112,11 @@ __stdcall EgtScaleGlob( int nGseCtx, int nId, const double vOrig[3], //------------------------------------------------------------------------------- BOOL -__stdcall EgtScaleGroup( int nGseCtx, int nId, const double vOrig[3], +__stdcall EgtScaleGroup( int nId, const double vOrig[3], const double vX[3], const double vY[3], const double vZ[3], double dCoeffX, double dCoeffY, double dCoeffZ) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo rotazione Frame3d frFrame ; @@ -127,9 +127,9 @@ __stdcall EgtScaleGroup( int nGseCtx, int nId, const double vOrig[3], //------------------------------------------------------------------------------- BOOL -__stdcall EgtMirror( int nGseCtx, int nId, const double vPnt[3], const double vN[3]) +__stdcall EgtMirror( int nId, const double vPnt[3], const double vN[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo specularità return ( pGeomDB->Mirror( nId, Point3d( vPnt), Vector3d( vN)) ? TRUE : FALSE) ; @@ -137,9 +137,9 @@ __stdcall EgtMirror( int nGseCtx, int nId, const double vPnt[3], const double vN //------------------------------------------------------------------------------- BOOL -__stdcall EgtMirrorGlob( int nGseCtx, int nId, const double vPnt[3], const double vN[3]) +__stdcall EgtMirrorGlob( int nId, const double vPnt[3], const double vN[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo specularità return ( pGeomDB->MirrorGlob( nId, Point3d( vPnt), Vector3d( vN)) ? TRUE : FALSE) ; @@ -147,9 +147,9 @@ __stdcall EgtMirrorGlob( int nGseCtx, int nId, const double vPnt[3], const doubl //------------------------------------------------------------------------------- BOOL -__stdcall EgtMirrorGroup( int nGseCtx, int nId, const double vPnt[3], const double vN[3]) +__stdcall EgtMirrorGroup( int nId, const double vPnt[3], const double vN[3]) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo specularità return ( pGeomDB->MirrorGroup( nId, Point3d( vPnt), Vector3d( vN)) ? TRUE : FALSE) ; @@ -157,10 +157,10 @@ __stdcall EgtMirrorGroup( int nGseCtx, int nId, const double vPnt[3], const doub //------------------------------------------------------------------------------- BOOL -__stdcall EgtShear( int nGseCtx, int nId, const double vPnt[3], const double vN[3], +__stdcall EgtShear( int nId, const double vPnt[3], const double vN[3], const double vDir[3], double dCoeff) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo stiramento return ( pGeomDB->Shear( nId, Point3d( vPnt), Vector3d( vN), Vector3d( vDir), dCoeff) ? TRUE : FALSE) ; @@ -168,10 +168,10 @@ __stdcall EgtShear( int nGseCtx, int nId, const double vPnt[3], const double vN[ //------------------------------------------------------------------------------- BOOL -__stdcall EgtShearGlob( int nGseCtx, int nId, const double vPnt[3], const double vN[3], +__stdcall EgtShearGlob( int nId, const double vPnt[3], const double vN[3], const double vDir[3], double dCoeff) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo stiramento return ( pGeomDB->ShearGlob( nId, Point3d( vPnt), Vector3d( vN), Vector3d( vDir), dCoeff) ? TRUE : FALSE) ; @@ -179,10 +179,10 @@ __stdcall EgtShearGlob( int nGseCtx, int nId, const double vPnt[3], const double //------------------------------------------------------------------------------- BOOL -__stdcall EgtShearGroup( int nGseCtx, int nId, const double vPnt[3], const double vN[3], +__stdcall EgtShearGroup( int nId, const double vPnt[3], const double vN[3], const double vDir[3], double dCoeff) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // eseguo stiramento return ( pGeomDB->ShearGroup( nId, Point3d( vPnt), Vector3d( vN), Vector3d( vDir), dCoeff) ? TRUE : FALSE) ; diff --git a/API_GeomDB.cpp b/API_GeomDB.cpp index 33d4006..ec9b37b 100644 --- a/API_GeomDB.cpp +++ b/API_GeomDB.cpp @@ -29,6 +29,7 @@ __stdcall EgtInitGeomDB( void) // creo e recupero un contesto libero int nGseCtx = CreateGseContext() ; if ( nGseCtx == 0) { + ResetCurrGseContext() ; LOG_ERROR( GetLogger(), "Error in CreateGseContext (" __FUNCTION__ ")") return 0 ; } @@ -40,6 +41,8 @@ __stdcall EgtInitGeomDB( void) pGseCtx->m_pGeomDB = Release( pGeomDB) ; pGseCtx->m_pGeomDB->Init() ; pGseCtx->m_pGeomDB->SetDefaultMaterial( pGseCtx->m_colDef) ; + // rendo corrente il contesto + SetCurrGseContext( nGseCtx) ; // log avvio DB geometrico string sLog = "GeomDB started " + ToString( nGseCtx) ; LOG_INFO( GetLogger(), sLog.c_str()) @@ -49,9 +52,30 @@ __stdcall EgtInitGeomDB( void) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetDefaultMaterial( int nGseCtx, int nRed, int nGreen, int nBlue) +__stdcall EgtSetCurrentContext( int nGseCtx) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + return ( SetCurrGseContext( nGseCtx) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtResetCurrentContext( void) +{ + return ( ResetCurrGseContext() ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +int +__stdcall EgtGetCurrentContext( void) +{ + return GetIndCurrGseContext() ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtSetDefaultMaterial( int nRed, int nGreen, int nBlue) +{ + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_GEOMDB( pGseCtx, FALSE) // imposto il materiale di default pGseCtx->m_colDef.Set( nRed, nGreen, nBlue) ; @@ -61,9 +85,9 @@ __stdcall EgtSetDefaultMaterial( int nGseCtx, int nRed, int nGreen, int nBlue) //----------------------------------------------------------------------------- BOOL -__stdcall EgtNewFile( int nGseCtx) +__stdcall EgtNewFile( void) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_GEOMDB( pGseCtx, FALSE) // reinizializzazione (con pulizia) del DB geometrico pGseCtx->m_pGeomDB->Init() ; @@ -73,34 +97,34 @@ __stdcall EgtNewFile( int nGseCtx) //----------------------------------------------------------------------------- BOOL -__stdcall EgtOpenFile( int nGseCtx, const wchar_t* wsFilePath) +__stdcall EgtOpenFile( const wchar_t* wsFilePath) { - return EgtOpenFile( nGseCtx, wstrztoA( wsFilePath)) ; + return EgtOpenFile( wstrztoA( wsFilePath)) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtOpenFile( int nGseCtx, const string& sFilePath) +__stdcall EgtOpenFile( const string& sFilePath) { // reinizializzazione (con pulizia) del DB geometrico - if ( ! EgtNewFile( nGseCtx)) + if ( ! EgtNewFile()) return FALSE ; // carico il file - return ( GetGeomDB( nGseCtx)->Load( sFilePath) ? TRUE : FALSE) ; + return ( GetCurrGeomDB()->Load( sFilePath) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtSaveFile( int nGseCtx, const wchar_t* wsFilePath, int nFlag) +__stdcall EgtSaveFile( const wchar_t* wsFilePath, int nFlag) { - return EgtSaveFile( nGseCtx, wstrztoA( wsFilePath), nFlag) ; + return EgtSaveFile( wstrztoA( wsFilePath), nFlag) ; } //----------------------------------------------------------------------------- BOOL -__stdcall EgtSaveFile( int nGseCtx, const string& sFilePath, int nFlag) +__stdcall EgtSaveFile( const string& sFilePath, int nFlag) { - IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, FALSE) // salvo il file return ( pGeomDB->Save( sFilePath, nFlag) ? TRUE : FALSE) ; diff --git a/API_Lua.cpp b/API_Lua.cpp index cf1ca90..df20171 100644 --- a/API_Lua.cpp +++ b/API_Lua.cpp @@ -21,13 +21,6 @@ using namespace std ; -//----------------------------------------------------------------------------- -BOOL -__stdcall EgtLuaSetContext( int nGseCtx) -{ - return ( LuaSetGseContext( nGseCtx) ? TRUE : FALSE) ; -} - //----------------------------------------------------------------------------- BOOL __stdcall EgtLuaExecLine( const wchar_t* wsLine) diff --git a/API_Scene.cpp b/API_Scene.cpp index 9781f46..9b3b4f7 100644 --- a/API_Scene.cpp +++ b/API_Scene.cpp @@ -23,9 +23,9 @@ using namespace std ; //----------------------------------------------------------------------------- BOOL -__stdcall EgtInitScene( int nGseCtx, HWND hWnd, int nDriver, int b2Buff, int nColorBits, int nDepthBits) +__stdcall EgtInitScene( HWND hWnd, int nDriver, int b2Buff, int nColorBits, int nDepthBits) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX( pGseCtx, FALSE) // inizializzazione scena OpenGL PtrOwner pScene( CreateEGrScene()) ; @@ -55,10 +55,10 @@ __stdcall EgtInitScene( int nGseCtx, HWND hWnd, int nDriver, int b2Buff, int nCo //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetBackground( int nGseCtx, int nTopRed, int nTopGreen, int nTopBlue, +__stdcall EgtSetBackground( int nTopRed, int nTopGreen, int nTopBlue, int nBottomRed, int nBottomGreen, int nBottomBlue, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto lo sfondo pGseCtx->m_pScene->SetBackground( Color( nTopRed, nTopGreen, nTopBlue), @@ -70,9 +70,9 @@ __stdcall EgtSetBackground( int nGseCtx, int nTopRed, int nTopGreen, int nTopBlu //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetMarkAttribs( int nGseCtx, int nRed, int nGreen, int nBlue) +__stdcall EgtSetMarkAttribs( int nRed, int nGreen, int nBlue) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto il colore del Mark Color MKcol( nRed, nGreen, nBlue) ; @@ -81,9 +81,9 @@ __stdcall EgtSetMarkAttribs( int nGseCtx, int nRed, int nGreen, int nBlue) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetGeoLineAttribs( int nGseCtx, int nRed, int nGreen, int nBlue) +__stdcall EgtSetGeoLineAttribs( int nRed, int nGreen, int nBlue) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto il colore della linea geometrica gestita direttamente dalla scena Color Glcol( nRed, nGreen, nBlue) ; @@ -92,9 +92,9 @@ __stdcall EgtSetGeoLineAttribs( int nGseCtx, int nRed, int nGreen, int nBlue) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetWinRectAttribs( int nGseCtx, BOOL bOutline, int nRed, int nGreen, int nBlue, int nAlpha) +__stdcall EgtSetWinRectAttribs( BOOL bOutline, int nRed, int nGreen, int nBlue, int nAlpha) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto il colore della linea geometrica gestita direttamente dalla scena Color WRcol( nRed, nGreen, nBlue, nAlpha) ; @@ -103,9 +103,9 @@ __stdcall EgtSetWinRectAttribs( int nGseCtx, BOOL bOutline, int nRed, int nGreen //----------------------------------------------------------------------------- BOOL -__stdcall EgtResize( int nGseCtx, int nW, int nH) +__stdcall EgtResize( int nW, int nH) { - IEGrScene* pScene = GetScene( nGseCtx) ; + IEGrScene* pScene = GetCurrScene() ; VERIFY_SCENE( pScene, FALSE) // eseguo resize pScene->Resize( nW, nH) ; @@ -114,9 +114,9 @@ __stdcall EgtResize( int nGseCtx, int nW, int nH) //----------------------------------------------------------------------------- BOOL -__stdcall EgtDraw( int nGseCtx) +__stdcall EgtDraw( void) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // eseguo disegno pGseCtx->m_pScene->Draw() ; @@ -128,9 +128,9 @@ __stdcall EgtDraw( int nGseCtx) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSelect( int nGseCtx, int nWinX, int nWinY, int nSelW, int nSelH, int* pnSel) +__stdcall EgtSelect( int nWinX, int nWinY, int nSelW, int nSelH, int* pnSel) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // eseguo la selezione return ( pGseCtx->m_pScene->Select( Point3d( nWinX, nWinY), nSelW, nSelH, *pnSel) ? TRUE : FALSE) ; @@ -138,9 +138,9 @@ __stdcall EgtSelect( int nGseCtx, int nWinX, int nWinY, int nSelW, int nSelH, in //----------------------------------------------------------------------------- int -__stdcall EgtGetFirstSelectedObj( int nGseCtx) +__stdcall EgtGetFirstSelectedObj( void) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // restituisco il primo oggetto selezionato return pGseCtx->m_pScene->GetFirstSelectedObj() ; @@ -148,9 +148,9 @@ __stdcall EgtGetFirstSelectedObj( int nGseCtx) //----------------------------------------------------------------------------- int -__stdcall EgtGetNextSelectedObj( int nGseCtx) +__stdcall EgtGetNextSelectedObj( void) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // restituisco il successivo oggetto selezionato return pGseCtx->m_pScene->GetNextSelectedObj() ; @@ -158,10 +158,10 @@ __stdcall EgtGetNextSelectedObj( int nGseCtx) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetSelectedSnapPoint( int nGseCtx, int nSnap, int nWinX, int nWinY, int nSelW, int nSelH, +__stdcall EgtGetSelectedSnapPoint( int nSnap, int nWinX, int nWinY, int nSelW, int nSelH, double ptP[3]) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // trovo il punto snap da selezione Point3d ptSnap ; @@ -175,9 +175,9 @@ __stdcall EgtGetSelectedSnapPoint( int nGseCtx, int nSnap, int nWinX, int nWinY, //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetShowMode( int nGseCtx, int nShowMode, BOOL bRedraw) +__stdcall EgtSetShowMode( int nShowMode, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto il modo di visualizzazione if ( nShowMode >= SM_WIREFRAME && nShowMode <= SM_SHADING) { @@ -192,9 +192,9 @@ __stdcall EgtSetShowMode( int nGseCtx, int nShowMode, BOOL bRedraw) //----------------------------------------------------------------------------- int -__stdcall EgtGetShowMode( int nGseCtx) +__stdcall EgtGetShowMode( void) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // recupero il modo di visualizzazione return pGseCtx->m_pScene->GetShowMode() ; @@ -202,9 +202,9 @@ __stdcall EgtGetShowMode( int nGseCtx) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetShowCurveDirection( int nGseCtx, BOOL bShow, BOOL bRedraw) +__stdcall EgtSetShowCurveDirection( BOOL bShow, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto stato pGseCtx->m_pScene->SetShowCurveDirection( bShow != FALSE) ; @@ -215,9 +215,9 @@ __stdcall EgtSetShowCurveDirection( int nGseCtx, BOOL bShow, BOOL bRedraw) //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetShowCurveDirection( int nGseCtx) +__stdcall EgtGetShowCurveDirection( void) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // recupero lo stato return pGseCtx->m_pScene->GetShowCurveDirection() ; @@ -225,9 +225,9 @@ __stdcall EgtGetShowCurveDirection( int nGseCtx) //----------------------------------------------------------------------------- BOOL -__stdcall EgtZoom( int nGseCtx, int nZoom, BOOL bRedraw) +__stdcall EgtZoom( int nZoom, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) const double COEFF_IN = 0.9 ; @@ -259,9 +259,9 @@ __stdcall EgtZoom( int nGseCtx, int nZoom, BOOL bRedraw) //----------------------------------------------------------------------------- BOOL -__stdcall EgtZoomOnPoint( int nGseCtx, int nWinX, int nWinY, double dCoeff, BOOL bRedraw) +__stdcall EgtZoomOnPoint( int nWinX, int nWinY, double dCoeff, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // eseguo zoom pGseCtx->m_pScene->ZoomOnPoint( Point3d( nWinX, nWinY), dCoeff) ; @@ -272,9 +272,9 @@ __stdcall EgtZoomOnPoint( int nGseCtx, int nWinX, int nWinY, double dCoeff, BOOL //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetGeoLine( int nGseCtx, const double ptP1[3], const double ptP2[3], BOOL bRedraw) +__stdcall EgtSetGeoLine( const double ptP1[3], const double ptP2[3], BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // disegno linea per distanza o similari pGseCtx->m_pScene->SetGeoLine( Point3d( ptP1), Point3d( ptP2)) ; @@ -285,9 +285,9 @@ __stdcall EgtSetGeoLine( int nGseCtx, const double ptP1[3], const double ptP2[3] //----------------------------------------------------------------------------- BOOL -__stdcall EgtResetGeoLine( int nGseCtx, BOOL bRedraw) +__stdcall EgtResetGeoLine( BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // cancello linea per distanza o similari pGseCtx->m_pScene->ResetGeoLine() ; @@ -298,9 +298,9 @@ __stdcall EgtResetGeoLine( int nGseCtx, BOOL bRedraw) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetWinRect( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw) +__stdcall EgtSetWinRect( int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // disegno finestra per zoom pGseCtx->m_pScene->SetWinRect( Point3d( nPrevX, nPrevY), Point3d( nCurrX, nCurrY)) ; @@ -311,9 +311,9 @@ __stdcall EgtSetWinRect( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int nC //----------------------------------------------------------------------------- BOOL -__stdcall EgtResetWinRect( int nGseCtx, BOOL bRedraw) +__stdcall EgtResetWinRect( BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // cancello finestra per zoom pGseCtx->m_pScene->ResetWinRect() ; @@ -324,9 +324,9 @@ __stdcall EgtResetWinRect( int nGseCtx, BOOL bRedraw) //----------------------------------------------------------------------------- BOOL -__stdcall EgtZoomWin( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw) +__stdcall EgtZoomWin( int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // eseguo zoom su finestra pGseCtx->m_pScene->ZoomWin( Point3d( nPrevX, nPrevY), Point3d( nCurrX, nCurrY)) ; @@ -337,9 +337,9 @@ __stdcall EgtZoomWin( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int nCurr //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetView( int nGseCtx, int nView, BOOL bRedraw) +__stdcall EgtSetView( int nView, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto vista if ( nView >= CT_TOP && nView <= CT_ISO_NW) { @@ -354,9 +354,9 @@ __stdcall EgtSetView( int nGseCtx, int nView, BOOL bRedraw) //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetGenericView( int nGseCtx, double dAngVertDeg, double dAngHorizDeg, BOOL bRedraw) +__stdcall EgtSetGenericView( double dAngVertDeg, double dAngHorizDeg, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto vista pGseCtx->m_pScene->SetCamera( dAngVertDeg, dAngHorizDeg, 0) ; @@ -367,9 +367,9 @@ __stdcall EgtSetGenericView( int nGseCtx, double dAngVertDeg, double dAngHorizDe //----------------------------------------------------------------------------- BOOL -__stdcall EgtSetViewCenter( int nGseCtx, const double ptP[3], BOOL bRedraw) +__stdcall EgtSetViewCenter( const double ptP[3], BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // imposto vista pGseCtx->m_pScene->SetCenter( Point3d( ptP)) ; @@ -380,9 +380,9 @@ __stdcall EgtSetViewCenter( int nGseCtx, const double ptP[3], BOOL bRedraw) //----------------------------------------------------------------------------- BOOL -__stdcall EgtPanCamera( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw) +__stdcall EgtPanCamera( int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // eseguo panoramica pGseCtx->m_pScene->PanCamera( Point3d( nPrevX, nPrevY), Point3d( nCurrX, nCurrY)) ; @@ -393,9 +393,9 @@ __stdcall EgtPanCamera( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int nCu //----------------------------------------------------------------------------- BOOL -__stdcall EgtRotateCamera( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw) +__stdcall EgtRotateCamera( int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_SCENE( pGseCtx, FALSE) // eseguo rotazione camera pGseCtx->m_pScene->RotateCamera( Point3d( nPrevX, nPrevY), Point3d( nCurrX, nCurrY)) ; @@ -406,9 +406,9 @@ __stdcall EgtRotateCamera( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int //----------------------------------------------------------------------------- BOOL -__stdcall EgtGetCameraDir( int nGseCtx, int* pnDir) +__stdcall EgtGetCameraDir( int* pnDir) { - IEGrScene* pScene = GetScene( nGseCtx) ; + IEGrScene* pScene = GetCurrScene() ; VERIFY_SCENE( pScene, FALSE) // recupero direzione di vista if ( pnDir == nullptr) @@ -419,9 +419,9 @@ __stdcall EgtGetCameraDir( int nGseCtx, int* pnDir) //----------------------------------------------------------------------------- BOOL -__stdcall EgtUnProjectPoint( int nGseCtx, int nWinX, int nWinY, double ptP[3]) +__stdcall EgtUnProjectPoint( int nWinX, int nWinY, double ptP[3]) { - IEGrScene* pScene = GetScene( nGseCtx) ; + IEGrScene* pScene = GetCurrScene() ; VERIFY_SCENE( pScene, FALSE) // eseguo l'inverso della proiezione (considero Z punto su centro) Point3d ptView( nWinX, nWinY, pScene->GetProjectedCenter().z) ; @@ -436,9 +436,9 @@ __stdcall EgtUnProjectPoint( int nGseCtx, int nWinX, int nWinY, double ptP[3]) //----------------------------------------------------------------------------- BOOL -__stdcall EgtProjectPoint( int nGseCtx, const double ptP[3], double ptWin[3]) +__stdcall EgtProjectPoint( const double ptP[3], double ptWin[3]) { - IEGrScene* pScene = GetScene( nGseCtx) ; + IEGrScene* pScene = GetCurrScene() ; VERIFY_SCENE( pScene, FALSE) // eseguo la proiezione Point3d ptView ; diff --git a/API_TscExec.cpp b/API_TscExec.cpp index 5cff10a..ff4f891 100644 --- a/API_TscExec.cpp +++ b/API_TscExec.cpp @@ -28,9 +28,9 @@ using namespace std ; //----------------------------------------------------------------------------- BOOL -__stdcall EgtInitTscExec( int nGseCtx) +__stdcall EgtInitTscExec( void) { - GseContext* pGseCtx = GetGseContext( nGseCtx) ; + GseContext* pGseCtx = GetCurrGseContext() ; VERIFY_CTX_GEOMDB( pGseCtx, FALSE) // eventuale pulizia esecutore e suoi oggetti @@ -72,9 +72,9 @@ __stdcall EgtInitTscExec( int nGseCtx) //----------------------------------------------------------------------------- BOOL -__stdcall EgtTscExecFile( int nGseCtx, const wchar_t* wsFilePath) +__stdcall EgtTscExecFile( const wchar_t* wsFilePath) { - ICmdParser* pTscExec = GetTscExecutor( nGseCtx) ; + ICmdParser* pTscExec = GetCurrTscExecutor() ; VERIFY_TSCEXEC( pTscExec, FALSE) // converto nome file @@ -94,9 +94,9 @@ __stdcall EgtTscExecFile( int nGseCtx, const wchar_t* wsFilePath) //----------------------------------------------------------------------------- BOOL -__stdcall EgtTscExecLine( int nGseCtx, const wchar_t* wsLine) +__stdcall EgtTscExecLine( const wchar_t* wsLine) { - ICmdParser* pTscExec = GetTscExecutor( nGseCtx) ; + ICmdParser* pTscExec = GetCurrTscExecutor() ; VERIFY_TSCEXEC( pTscExec, FALSE) // eseguo il comando return ( pTscExec->ExecLine( wstrztoA( wsLine)) ? TRUE : FALSE) ; diff --git a/EgtInterface.rc b/EgtInterface.rc index b7e0026..c99b83f 100644 Binary files a/EgtInterface.rc and b/EgtInterface.rc differ diff --git a/GseContext.cpp b/GseContext.cpp index b11e755..5675242 100644 --- a/GseContext.cpp +++ b/GseContext.cpp @@ -15,6 +15,7 @@ #include "GseContext.h" //---------------------------------------------------------------------------- +static int s_nCurrGseCtx = 0 ; static const int MAX_CTX = 10 ; static bool s_GseOn[MAX_CTX] = { false, false, false, false, false, false, false, false, false, false} ; static GseContext s_GseCtx[MAX_CTX] ; @@ -91,3 +92,66 @@ GetTscExecutor( int nInd) return ( s_GseCtx[nInd-1].m_pTscExec) ; } +//---------------------------------------------------------------------------- +bool +SetCurrGseContext( int nInd) +{ + if ( nInd < 1 || nInd > MAX_CTX || ! s_GseOn[nInd-1]) { + s_nCurrGseCtx = 0 ; + return false ; + } + s_nCurrGseCtx = nInd ; + return true ; +} + +//---------------------------------------------------------------------------- +bool +ResetCurrGseContext( void) +{ + s_nCurrGseCtx = 0 ; + return true ; +} + +//---------------------------------------------------------------------------- +int +GetIndCurrGseContext( void) +{ + return s_nCurrGseCtx ; +} + +//---------------------------------------------------------------------------- +GseContext* +GetCurrGseContext( void) +{ + if ( s_nCurrGseCtx < 1 || s_nCurrGseCtx > MAX_CTX || ! s_GseOn[s_nCurrGseCtx-1]) + return nullptr ; + return &(s_GseCtx[s_nCurrGseCtx-1]) ; +} + +//---------------------------------------------------------------------------- +IGeomDB* +GetCurrGeomDB( void) +{ + if ( s_nCurrGseCtx < 1 || s_nCurrGseCtx > MAX_CTX || ! s_GseOn[s_nCurrGseCtx-1]) + return nullptr ; + return ( s_GseCtx[s_nCurrGseCtx-1].m_pGeomDB) ; +} + +//---------------------------------------------------------------------------- +IEGrScene* +GetCurrScene( void) +{ + if ( s_nCurrGseCtx < 1 || s_nCurrGseCtx > MAX_CTX || ! s_GseOn[s_nCurrGseCtx-1]) + return nullptr ; + return ( s_GseCtx[s_nCurrGseCtx-1].m_pScene) ; +} + +//---------------------------------------------------------------------------- +ICmdParser* +GetCurrTscExecutor( void) +{ + if ( s_nCurrGseCtx < 1 || s_nCurrGseCtx > MAX_CTX || ! s_GseOn[s_nCurrGseCtx-1]) + return nullptr ; + return ( s_GseCtx[s_nCurrGseCtx-1].m_pTscExec) ; +} + diff --git a/GseContext.h b/GseContext.h index 6a314f3..8b56f49 100644 --- a/GseContext.h +++ b/GseContext.h @@ -60,3 +60,10 @@ GseContext* GetGseContext( int nInd) ; IGeomDB* GetGeomDB( int nInd) ; IEGrScene* GetScene( int nInd) ; ICmdParser* GetTscExecutor( int nInd) ; +bool SetCurrGseContext( int nInd) ; +bool ResetCurrGseContext( void) ; +int GetIndCurrGseContext( void) ; +GseContext* GetCurrGseContext( void) ; +IGeomDB* GetCurrGeomDB( void) ; +IEGrScene* GetCurrScene( void) ; +ICmdParser* GetCurrTscExecutor( void) ; diff --git a/LUA.h b/LUA.h index 567015f..1494118 100644 --- a/LUA.h +++ b/LUA.h @@ -25,8 +25,6 @@ class Color ; //-------------------------- General ----------------------------------------- bool LuaInit( void) ; bool LuaExit( void) ; -bool LuaSetGseContext( int nGseContext) ; -int LuaGetGseContext( void) ; bool LuaExecLine( const std::string& sLine) ; bool LuaExecFile( const std::string& sFile) ; const std::string& LuaGetLastError( void) ; diff --git a/LUA_CurveModif.cpp b/LUA_CurveModif.cpp index 8d86469..84253a4 100644 --- a/LUA_CurveModif.cpp +++ b/LUA_CurveModif.cpp @@ -30,7 +30,7 @@ LuaInvertCurve( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // inverto la curva - bool bOk = ( EgtInvertCurve( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtInvertCurve( nId) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -46,7 +46,7 @@ LuaModifyCurveStartPoint( lua_State* L) LuaCheckParam( L, 2, ptStart) LuaClearStack( L) ; // modifico il punto iniziale - bool bOk = ( EgtModifyCurveStartPoint( LuaGetGseContext(), nId, ptStart.v) ? true : false) ; + bool bOk = ( EgtModifyCurveStartPoint( nId, ptStart.v) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -62,7 +62,7 @@ LuaModifyCurveEndPoint( lua_State* L) LuaCheckParam( L, 2, ptEnd) LuaClearStack( L) ; // modifico il punto finale - bool bOk = ( EgtModifyCurveEndPoint( LuaGetGseContext(), nId, ptEnd.v) ? true : false) ; + bool bOk = ( EgtModifyCurveEndPoint( nId, ptEnd.v) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -78,7 +78,7 @@ LuaModifyCurveExtrusion( lua_State* L) LuaCheckParam( L, 2, vtExtr) LuaClearStack( L) ; // modifico il vettore estrusione - bool bOk = ( EgtModifyCurveExtrusion( LuaGetGseContext(), nId, vtExtr.v) ? true : false) ; + bool bOk = ( EgtModifyCurveExtrusion( nId, vtExtr.v) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -94,7 +94,7 @@ LuaModifyCurveThickness( lua_State* L) LuaCheckParam( L, 2, dThick) LuaClearStack( L) ; // modifico il vettore estrusione - bool bOk = ( EgtModifyCurveThickness( LuaGetGseContext(), nId, dThick) ? true : false) ; + bool bOk = ( EgtModifyCurveThickness( nId, dThick) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -110,7 +110,7 @@ LuaTrimCurveStartAtLen( lua_State* L) LuaCheckParam( L, 2, dLen) LuaClearStack( L) ; // taglio la curva all'inizio - bool bOk = ( EgtTrimCurveStartAtLen( LuaGetGseContext(), nId, dLen) ? true : false) ; + bool bOk = ( EgtTrimCurveStartAtLen( nId, dLen) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -126,7 +126,7 @@ LuaTrimCurveEndAtLen( lua_State* L) LuaCheckParam( L, 2, dLen) LuaClearStack( L) ; // taglio la curva alla fine - bool bOk = ( EgtTrimCurveEndAtLen( LuaGetGseContext(), nId, dLen) ? true : false) ; + bool bOk = ( EgtTrimCurveEndAtLen( nId, dLen) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -142,7 +142,7 @@ LuaTrimCurveStartAtParam( lua_State* L) LuaCheckParam( L, 2, dPar) LuaClearStack( L) ; // taglio la curva all' inizio - bool bOk = ( EgtTrimCurveStartAtParam( LuaGetGseContext(), nId, dPar) ? true : false) ; + bool bOk = ( EgtTrimCurveStartAtParam( nId, dPar) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -158,7 +158,7 @@ LuaTrimCurveEndAtParam( lua_State* L) LuaCheckParam( L, 2, dPar) LuaClearStack( L) ; // taglio la curva alla fine - bool bOk = ( EgtTrimCurveEndAtParam( LuaGetGseContext(), nId, dPar) ? true : false) ; + bool bOk = ( EgtTrimCurveEndAtParam( nId, dPar) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -176,7 +176,7 @@ LuaTrimCurveStartEndAtParam( lua_State* L) LuaCheckParam( L, 3, dParE) LuaClearStack( L) ; // taglio la curva alla fine - bool bOk = ( EgtTrimCurveStartEndAtParam( LuaGetGseContext(), nId, dParS, dParE) ? true : false) ; + bool bOk = ( EgtTrimCurveStartEndAtParam( nId, dParS, dParE) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } diff --git a/LUA_Exchange.cpp b/LUA_Exchange.cpp index e8e9fa3..3149ded 100644 --- a/LUA_Exchange.cpp +++ b/LUA_Exchange.cpp @@ -31,7 +31,7 @@ LuaImportDxf( lua_State* L) LuaCheckParam( L, 1, sFilePath) LuaClearStack( L) ; // apro il file - bool bOk = ( EgtImportDxf( LuaGetGseContext(), sFilePath) != FALSE) ; + bool bOk = ( EgtImportDxf( sFilePath) != FALSE) ; // 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( LuaGetGseContext(), sFilePath) != FALSE) ; + bool bOk = ( EgtImportStl( sFilePath) != FALSE) ; // 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( LuaGetGseContext(), sFilePath) != FALSE) ; + bool bOk = ( EgtImportCnc( sFilePath) != FALSE) ; // 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( LuaGetGseContext(), nGroupId, sFilePath) != FALSE) ; + bool bOk = ( EgtExportDxf( nGroupId, sFilePath) != FALSE) ; // 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( LuaGetGseContext(), nGroupId, sFilePath) != FALSE) ; + bool bOk = ( EgtExportStl( nGroupId, sFilePath) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; diff --git a/LUA_GdbCreate.cpp b/LUA_GdbCreate.cpp index cca5ae9..a7a1546 100644 --- a/LUA_GdbCreate.cpp +++ b/LUA_GdbCreate.cpp @@ -34,7 +34,7 @@ LuaCreateGroup( lua_State* L) LuaGetParam( L, 2, frFrame) ; LuaClearStack( L) ; // creo il gruppo - int nId = EgtCreateGroup( LuaGetGseContext(), nParentId, frFrame.Orig().v, + int nId = EgtCreateGroup( nParentId, frFrame.Orig().v, frFrame.VersX().v, frFrame.VersY().v, frFrame.VersZ().v) ; // restituisco il risultato if ( nId != GDB_ID_NULL) @@ -55,7 +55,7 @@ LuaCreateGeoPoint( lua_State* L) LuaCheckParam( L, 2, ptP) LuaClearStack( L) ; // creo il segmento di retta - int nId = EgtCreateGeoPoint( LuaGetGseContext(), nParentId, ptP.v) ; + int nId = EgtCreateGeoPoint( nParentId, ptP.v) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -80,7 +80,7 @@ LuaCreateGeoVector( lua_State* L) LuaClearStack( L) ; // creo il segmento di retta vtV *= dScale ; - int nId = EgtCreateGeoVector( LuaGetGseContext(), nParentId, vtV.v, ptB.v) ; + int nId = EgtCreateGeoVector( nParentId, vtV.v, ptB.v) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -100,7 +100,7 @@ LuaCreateGeoFrame( lua_State* L) LuaCheckParam( L, 2, frFrame) ; LuaClearStack( L) ; // creo il gruppo - int nId = EgtCreateGeoFrame( LuaGetGseContext(), nParentId, frFrame.Orig().v, + int nId = EgtCreateGeoFrame( nParentId, frFrame.Orig().v, frFrame.VersX().v, frFrame.VersY().v, frFrame.VersZ().v) ; // restituisco il risultato if ( nId != GDB_ID_NULL) @@ -123,7 +123,7 @@ LuaCreateCurveLine( lua_State* L) LuaCheckParam( L, 3, ptFin) LuaClearStack( L) ; // creo il segmento di retta - int nId = EgtCreateCurveLine( LuaGetGseContext(), nParentId, ptIni.v, ptFin.v) ; + int nId = EgtCreateCurveLine( nParentId, ptIni.v, ptFin.v) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -147,7 +147,7 @@ LuaCreateCurveLineMinPointCurve( lua_State* L) LuaGetParam( L, 4, dNearPar) ; LuaClearStack( L) ; // creo il segmento di retta - int nId = EgtCreateCurveLineMinPointCurve( LuaGetGseContext(), nParentId, ptIni.v, nCrvId, dNearPar) ; + int nId = EgtCreateCurveLineMinPointCurve( nParentId, ptIni.v, nCrvId, dNearPar) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -171,7 +171,7 @@ LuaCreateCurveCircle( lua_State* L) LuaCheckParam( L, 4, dRad) LuaClearStack( L) ; // creo l'arco - int nId = EgtCreateCurveCircle( LuaGetGseContext(), nParentId, ptCen.v, vtN.v, dRad) ; + int nId = EgtCreateCurveCircle( nParentId, ptCen.v, vtN.v, dRad) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -193,7 +193,7 @@ LuaCreateCurveCircleXY( lua_State* L) LuaCheckParam( L, 3, dRad) LuaClearStack( L) ; // creo l'arco - int nId = EgtCreateCurveCircleXY( LuaGetGseContext(), nParentId, ptCen.v, dRad) ; + int nId = EgtCreateCurveCircleXY( nParentId, ptCen.v, dRad) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -217,7 +217,7 @@ LuaCreateCurveCircle3P( lua_State* L) LuaCheckParam( L, 4, ptP3) LuaClearStack( L) ; // creo l'arco - int nId = EgtCreateCurveCircle3P( LuaGetGseContext(), nParentId, ptP1.v, ptP2.v, ptP3.v) ; + int nId = EgtCreateCurveCircle3P( nParentId, ptP1.v, ptP2.v, ptP3.v) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -247,7 +247,7 @@ LuaCreateCurveArc( lua_State* L) LuaCheckParam( L, 7, dDeltaN) LuaClearStack( L) ; // creo l'arco - int nId = EgtCreateCurveArc( LuaGetGseContext(), nParentId, ptCen.v, vtN.v, dRad, vtS.v, dAngCenDeg, dDeltaN) ; + int nId = EgtCreateCurveArc( nParentId, ptCen.v, vtN.v, dRad, vtS.v, dAngCenDeg, dDeltaN) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -275,7 +275,7 @@ LuaCreateCurveArcXY( lua_State* L) LuaCheckParam( L, 6, dDeltaZ) LuaClearStack( L) ; // creo l'arco - int nId = EgtCreateCurveArcXY( LuaGetGseContext(), nParentId, ptCen.v, dRad, dAngStartDeg, dAngCenDeg, dDeltaZ) ; + int nId = EgtCreateCurveArcXY( nParentId, ptCen.v, dRad, dAngStartDeg, dAngCenDeg, dDeltaZ) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -299,7 +299,7 @@ LuaCreateCurveArc3P( lua_State* L) LuaCheckParam( L, 4, ptP3) LuaClearStack( L) ; // creo l'arco - int nId = EgtCreateCurveArc3P( LuaGetGseContext(), nParentId, ptP1.v, ptP2.v, ptP3.v) ; + int nId = EgtCreateCurveArc3P( nParentId, ptP1.v, ptP2.v, ptP3.v) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -324,7 +324,7 @@ LuaCreateCurveBezier( lua_State* L) if ( vPnt.size() != nDegree + 1) return luaL_error( L, "Wrong Control Points Number") ; // creo la curva - int nId = EgtCreateCurveBezier( LuaGetGseContext(), nParentId, nDegree, vPnt) ; + int nId = EgtCreateCurveBezier( nParentId, nDegree, vPnt) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -349,7 +349,7 @@ LuaCreateCurveBezierRational( lua_State* L) if ( vPntW.size() != nDegree + 1) return luaL_error( L, "Wrong Control Points Number") ; // creo la curva - int nId = EgtCreateCurveBezierRational( LuaGetGseContext(), nParentId, nDegree, vPntW) ; + int nId = EgtCreateCurveBezierRational( nParentId, nDegree, vPntW) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -371,7 +371,7 @@ LuaCreateCurveBezierFromArc( lua_State* L) LuaGetParam( L, 3, bErase) ; LuaClearStack( L) ; // creo la curva - int nId = EgtCreateCurveBezierFromArc( LuaGetGseContext(), nParentId, nArcId, bErase) ; + int nId = EgtCreateCurveBezierFromArc( nParentId, nArcId, bErase) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -393,7 +393,7 @@ LuaCreateCurveCompo( lua_State* L) LuaGetParam( L, 3, bErase) ; LuaClearStack( L) ; // creo la curva composita - int nId = EgtCreateCurveCompo( LuaGetGseContext(), nParentId, vIds, ( bErase ? TRUE : FALSE)) ; + int nId = EgtCreateCurveCompo( nParentId, vIds, ( bErase ? TRUE : FALSE)) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -416,7 +416,7 @@ LuaCreateCurveCompoFromPoints( lua_State* L) for ( size_t i = 0 ; i < vPnt.size() ; ++ i) PL.AddUPoint( 0, vPnt[i]) ; // creo la curva composita - int nId = EgtCreateCurveCompoFromPoints( LuaGetGseContext(), nParentId, PL) ; + int nId = EgtCreateCurveCompoFromPoints( nParentId, PL) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -439,7 +439,7 @@ LuaCreateCurveCompoFromPointBulges( lua_State* L) for ( size_t i = 0 ; i < vPntB.size() ; ++ i) PA.AddUPoint( 0, vPntB[i].first, vPntB[i].second) ; // creo la curva composita - int nId = EgtCreateCurveCompoFromPointBulges( LuaGetGseContext(), nParentId, PA) ; + int nId = EgtCreateCurveCompoFromPointBulges( nParentId, PA) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -463,7 +463,7 @@ LuaCreateCurveCompoFromPolygonSide( lua_State* L) LuaCheckParam( L, 4, ptFin) LuaClearStack( L) ; // creo il poligono - int nId = EgtCreateCurveCompoFromPolygonSide( LuaGetGseContext(), nParentId, nNumSides, ptIni.v, ptFin.v) ; + int nId = EgtCreateCurveCompoFromPolygonSide( nParentId, nNumSides, ptIni.v, ptFin.v) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -485,7 +485,7 @@ LuaCreateSurfTriMeshByContour( lua_State* L) LuaGetParam( L, 3, dLinTol) ; LuaClearStack( L) ; // creo STM riempiendo un contorno piano - int nId = EgtCreateSurfTriMeshByContour( LuaGetGseContext(), nParentId, nCrvId, dLinTol) ; + int nId = EgtCreateSurfTriMeshByContour( nParentId, nCrvId, dLinTol) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -511,7 +511,7 @@ LuaCreateText( lua_State* L) LuaCheckParam( L, 5, dH) ; LuaClearStack( L) ; // creo il testo - int nId = EgtCreateText( LuaGetGseContext(), nParentId, sText, ptP, dAngRotDeg, dH) ; + int nId = EgtCreateText( nParentId, sText, ptP, dAngRotDeg, dH) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -571,7 +571,7 @@ LuaCreateTextEx( lua_State* L) nInsPos = ETXT_IPBR ; LuaClearStack( L) ; // creo il testo in modo esteso - int nId = EgtCreateTextEx( LuaGetGseContext(), nParentId, sText, ptP, dAngRotDeg, + int nId = EgtCreateTextEx( nParentId, sText, ptP, dAngRotDeg, sFont, nW, bItalic, dH, dRat, dAddAdv, nInsPos) ; // restituisco il risultato if ( nId != GDB_ID_NULL) diff --git a/LUA_GdbModify.cpp b/LUA_GdbModify.cpp index 55383fa..a976d8d 100644 --- a/LUA_GdbModify.cpp +++ b/LUA_GdbModify.cpp @@ -33,7 +33,7 @@ LuaChangeVectorBase( lua_State* L) LuaCheckParam( L, 2, ptBase) LuaClearStack( L) ; // modifica del testo - bool bOk = ( EgtChangeVectorBase( LuaGetGseContext(), nId, ptBase.v) ? true : false) ; + bool bOk = ( EgtChangeVectorBase( nId, ptBase.v) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -49,7 +49,7 @@ LuaModifyText( lua_State* L) LuaCheckParam( L, 2, sNewText) LuaClearStack( L) ; // modifica del testo - bool bOk = ( EgtModifyText( LuaGetGseContext(), nId, sNewText) ? true : false) ; + bool bOk = ( EgtModifyText( nId, sNewText) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -65,7 +65,7 @@ LuaChangeTextFont( lua_State* L) LuaCheckParam( L, 2, sNewFont) LuaClearStack( L) ; // modifica del testo - bool bOk = ( EgtChangeTextFont( LuaGetGseContext(), nId, sNewFont) ? true : false) ; + bool bOk = ( EgtChangeTextFont( nId, sNewFont) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -79,7 +79,7 @@ LuaFlipText( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // flip del testo - bool bOk = ( EgtFlipText( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtFlipText( nId) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -100,7 +100,7 @@ LuaMirrorText( lua_State* L) } LuaClearStack( L) ; // flip del testo - bool bOk = ( EgtMirrorText( LuaGetGseContext(), nId, bOnL) ? true : false) ; + bool bOk = ( EgtMirrorText( nId, bOnL) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -116,7 +116,7 @@ LuaTextToOutline( lua_State* L) LuaCheckParam( L, 2, nIdGroupDest) LuaClearStack( L) ; // esplosione del testo in outline - bool bOk = ( EgtTextToOutline( LuaGetGseContext(), nId, nIdGroupDest) ? true : false) ; + bool bOk = ( EgtTextToOutline( nId, nIdGroupDest) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } @@ -132,7 +132,7 @@ LuaSplitText( lua_State* L) LuaCheckParam( L, 2, nIdGroupDest) LuaClearStack( L) ; // esplosione del testo in più testi, uno per riga - bool bOk = ( EgtSplitText( LuaGetGseContext(), nId, nIdGroupDest) ? true : false) ; + bool bOk = ( EgtSplitText( nId, nIdGroupDest) ? true : false) ; LuaSetReturn( L, bOk) ; return 1 ; } diff --git a/LUA_GdbObjAttribs.cpp b/LUA_GdbObjAttribs.cpp index 81b0ef8..cbdbd44 100644 --- a/LUA_GdbObjAttribs.cpp +++ b/LUA_GdbObjAttribs.cpp @@ -38,7 +38,7 @@ LuaSetLevel( lua_State* L) nLevel = GDB_LV_TEMP ; LuaClearStack( L) ; // imposto lo stato - bool bOk = ( EgtSetLevel( LuaGetGseContext(), nId, nLevel) ? true : false) ; + bool bOk = ( EgtSetLevel( nId, nLevel) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -53,7 +53,7 @@ LuaRevertLevel( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // porto il livello al valore precedente - bool bOk = ( EgtRevertLevel( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtRevertLevel( nId) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -69,7 +69,7 @@ LuaGetLevel( lua_State* L) LuaClearStack( L) ; // recupero il livello int nLevel ; - if ( EgtGetLevel( LuaGetGseContext(), nId, &nLevel)) + if ( EgtGetLevel( nId, &nLevel)) // restituisco il risultato LuaSetReturn( L, nLevel) ; else @@ -87,7 +87,7 @@ LuaGetCalcLevel( lua_State* L) LuaClearStack( L) ; // recupero il livello int nLevel ; - if ( EgtGetCalcLevel( LuaGetGseContext(), nId, &nLevel)) + if ( EgtGetCalcLevel( nId, &nLevel)) // restituisco il risultato LuaSetReturn( L, nLevel) ; else @@ -112,7 +112,7 @@ LuaSetMode( lua_State* L) nMode = GDB_MD_HIDDEN ; LuaClearStack( L) ; // imposto il modo - bool bOk = ( EgtSetMode( LuaGetGseContext(), nId, nMode) ? true : false) ; + bool bOk = ( EgtSetMode( nId, nMode) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -127,7 +127,7 @@ LuaRevertMode( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // porto il modo al valore precedente - bool bOk = ( EgtRevertMode( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtRevertMode( nId) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -143,7 +143,7 @@ LuaGetMode( lua_State* L) LuaClearStack( L) ; // recupero il modo int nMode ; - if ( EgtGetMode( LuaGetGseContext(), nId, &nMode)) + if ( EgtGetMode( nId, &nMode)) // restituisco il risultato LuaSetReturn( L, nMode) ; else @@ -161,7 +161,7 @@ LuaGetCalcMode( lua_State* L) LuaClearStack( L) ; // recupero il modo calcolato (ovvero proprio ed ereditato) int nMode ; - if ( EgtGetCalcMode( LuaGetGseContext(), nId, &nMode)) + if ( EgtGetCalcMode( nId, &nMode)) // restituisco il risultato LuaSetReturn( L, nMode) ; else @@ -186,7 +186,7 @@ LuaSetStatus( lua_State* L) nStatus = GDB_ST_SEL ; LuaClearStack( L) ; // imposto lo stato - bool bOk = ( EgtSetStatus( LuaGetGseContext(), nId, nStatus) ? true : false) ; + bool bOk = ( EgtSetStatus( nId, nStatus) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -201,7 +201,7 @@ LuaRevertStatus( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // porto lo stato al valore precedente - bool bOk = ( EgtRevertStatus( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtRevertStatus( nId) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -217,7 +217,7 @@ LuaGetStatus( lua_State* L) LuaClearStack( L) ; // recupero lo stato int nStatus ; - if ( EgtGetStatus( LuaGetGseContext(), nId, &nStatus)) + if ( EgtGetStatus( nId, &nStatus)) // restituisco il risultato LuaSetReturn( L, nStatus) ; else @@ -235,7 +235,7 @@ LuaGetCalcStatus( lua_State* L) LuaClearStack( L) ; // recupero lo stato int nStatus ; - if ( EgtGetCalcStatus( LuaGetGseContext(), nId, &nStatus)) + if ( EgtGetCalcStatus( nId, &nStatus)) // restituisco il risultato LuaSetReturn( L, nStatus) ; else @@ -252,7 +252,7 @@ LuaSetMark( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // imposto l'evidenziazione - bool bOk = ( EgtSetMark( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtSetMark( nId) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -267,7 +267,7 @@ LuaResetMark( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // cancello l'evidenziazione - bool bOk = ( EgtResetMark( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtResetMark( nId) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -283,7 +283,7 @@ LuaGetMark( lua_State* L) LuaClearStack( L) ; // recupero lo stato di evidenziazione BOOL nMark ; - if ( EgtGetMark( LuaGetGseContext(), nId, &nMark)) + if ( EgtGetMark( nId, &nMark)) // restituisco il risultato LuaSetReturn( L, ( nMark != FALSE)) ; else @@ -301,7 +301,7 @@ LuaGetCalcMark( lua_State* L) LuaClearStack( L) ; // recupero lo stato calcolato di evidenziazione BOOL nMark ; - if ( EgtGetCalcMark( LuaGetGseContext(), nId, &nMark)) + if ( EgtGetCalcMark( nId, &nMark)) // restituisco il risultato LuaSetReturn( L, ( nMark != FALSE)) ; else @@ -342,7 +342,7 @@ LuaSetColor( lua_State* L) // assegno il colore bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtSetColor( LuaGetGseContext(), vId[i], cCol.GetIntRed(), + if ( ! EgtSetColor( vId[i], cCol.GetIntRed(), cCol.GetIntGreen(), cCol.GetIntBlue(), cCol.GetIntAlpha())) bOk = false ; } @@ -361,7 +361,7 @@ LuaGetColor( lua_State* L) LuaClearStack( L) ; // recupero il colore int nRed, nGreen, nBlue, nAlpha ; - if ( EgtGetColor( LuaGetGseContext(), nId, nRed, nGreen, nBlue, nAlpha)) { + if ( EgtGetColor( nId, nRed, nGreen, nBlue, nAlpha)) { Color cCol( nRed, nGreen, nBlue, nAlpha) ; // restituisco il risultato LuaSetReturn( L, cCol) ; @@ -381,7 +381,7 @@ LuaGetCalcColor( lua_State* L) LuaClearStack( L) ; // recupero il colore int nRed, nGreen, nBlue, nAlpha ; - if ( EgtGetCalcColor( LuaGetGseContext(), nId, nRed, nGreen, nBlue, nAlpha)) { + if ( EgtGetCalcColor( nId, nRed, nGreen, nBlue, nAlpha)) { Color cCol( nRed, nGreen, nBlue, nAlpha) ; // restituisco il risultato LuaSetReturn( L, cCol) ; @@ -402,7 +402,7 @@ LuaSetName( lua_State* L) LuaCheckParam( L, 2, sName) LuaClearStack( L) ; // assegno il nome - bool bOk = ( EgtSetName( LuaGetGseContext(), nId, sName) ? true : false) ; + bool bOk = ( EgtSetName( nId, sName) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -418,7 +418,7 @@ LuaGetName( lua_State* L) LuaClearStack( L) ; // recupero il nome string sName ; - bool bOk = ( EgtGetName( LuaGetGseContext(), nId, sName) ? true : false) ; + bool bOk = ( EgtGetName( nId, sName) ? true : false) ; // restituisco il risultato if ( bOk) LuaSetReturn( L, sName) ; @@ -436,7 +436,7 @@ LuaExistsName( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // verifico esistenza nome - bool bOk = ( EgtExistsName( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtExistsName( nId) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -451,7 +451,7 @@ LuaRemoveName( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // verifico esistenza nome - bool bOk = ( EgtRemoveName( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtRemoveName( nId) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -470,7 +470,7 @@ LuaSetInfo( lua_State* L) LuaCheckParam( L, 3, sInfo) LuaClearStack( L) ; // assegno la info - bool bOk = ( EgtSetInfo( LuaGetGseContext(), nId, sKey, sInfo) ? true : false) ; + bool bOk = ( EgtSetInfo( nId, sKey, sInfo) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -488,7 +488,7 @@ LuaGetInfo( lua_State* L) LuaClearStack( L) ; // recupero l'info string sInfo ; - bool bOk = ( EgtGetInfo( LuaGetGseContext(), nId, sKey, sInfo) ? true : false) ; + bool bOk = ( EgtGetInfo( nId, sKey, sInfo) ? true : false) ; // restituisco il risultato if ( bOk) LuaSetReturn( L, sInfo) ; @@ -508,7 +508,7 @@ LuaExistsInfo( lua_State* L) LuaCheckParam( L, 2, sKey) LuaClearStack( L) ; // verifico esistenza info - bool bOk = ( EgtExistsInfo( LuaGetGseContext(), nId, sKey) ? true : false) ; + bool bOk = ( EgtExistsInfo( nId, sKey) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -525,7 +525,7 @@ LuaRemoveInfo( lua_State* L) LuaCheckParam( L, 2, sKey) LuaClearStack( L) ; // rimuovo info - bool bOk = ( EgtRemoveInfo( LuaGetGseContext(), nId, sKey) ? true : false) ; + bool bOk = ( EgtRemoveInfo( nId, sKey) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; diff --git a/LUA_GdbObjects.cpp b/LUA_GdbObjects.cpp index f943fee..3a057c6 100644 --- a/LUA_GdbObjects.cpp +++ b/LUA_GdbObjects.cpp @@ -31,7 +31,7 @@ LuaExistsObj( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // verifico esistenza oggetto - bool bOk = ( EgtExistsObj( LuaGetGseContext(), nId) ? true : false) ; + bool bOk = ( EgtExistsObj( nId) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -46,7 +46,7 @@ LuaGetGroupObjs( lua_State* L) LuaCheckParam( L, 1, nGroupId) LuaClearStack( L) ; // verifico esistenza oggetto - int nObjs = EgtGetGroupObjs( LuaGetGseContext(), nGroupId) ; + int nObjs = EgtGetGroupObjs( nGroupId) ; // restituisco il risultato LuaSetReturn( L, nObjs) ; return 1 ; @@ -61,7 +61,7 @@ LuaGetFirstInGroup( lua_State* L) LuaCheckParam( L, 1, nGroupId) LuaClearStack( L) ; // recupero il primo oggetto del gruppo - int nId = EgtGetFirstInGroup( LuaGetGseContext(), nGroupId) ; + int nId = EgtGetFirstInGroup( nGroupId) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -79,7 +79,7 @@ LuaGetNext( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // recupero il prossimo oggetto nello stesso gruppo - int nNextId = EgtGetNext( LuaGetGseContext(), nId) ; + int nNextId = EgtGetNext( nId) ; // restituisco il risultato if ( nNextId != GDB_ID_NULL) LuaSetReturn( L, nNextId) ; @@ -97,7 +97,7 @@ LuaGetLastInGroup( lua_State* L) LuaCheckParam( L, 1, nGroupId) LuaClearStack( L) ; // recupero l'ultimo oggetto del gruppo - int nId = EgtGetLastInGroup( LuaGetGseContext(), nGroupId) ; + int nId = EgtGetLastInGroup( nGroupId) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetReturn( L, nId) ; @@ -115,7 +115,7 @@ LuaGetPrev( lua_State* L) LuaCheckParam( L, 1, nId) LuaClearStack( L) ; // recupero il precedente oggetto nello stesso gruppo - int nPrevId = EgtGetPrev( LuaGetGseContext(), nId) ; + int nPrevId = EgtGetPrev( nId) ; // restituisco il risultato if ( nPrevId != GDB_ID_NULL) LuaSetReturn( L, nPrevId) ; @@ -144,7 +144,7 @@ LuaCopy( lua_State* L) } LuaClearStack( L) ; // eseguo la copia - int nNewId = EgtCopy( LuaGetGseContext(), nSouId, nRefId, nSonBeforeAfter) ; + int nNewId = EgtCopy( nSouId, nRefId, nSonBeforeAfter) ; // restituisco il risultato if ( nNewId != GDB_ID_NULL) LuaSetReturn( L, nNewId) ; @@ -173,7 +173,7 @@ LuaCopyGlob( lua_State* L) } LuaClearStack( L) ; // eseguo la copia - int nNewId = EgtCopyGlob( LuaGetGseContext(), nSouId, nRefId, nSonBeforeAfter) ; + int nNewId = EgtCopyGlob( nSouId, nRefId, nSonBeforeAfter) ; // restituisco il risultato if ( nNewId != GDB_ID_NULL) LuaSetReturn( L, nNewId) ; @@ -202,7 +202,7 @@ LuaRelocate( lua_State* L) } LuaClearStack( L) ; // eseguo la rilocazione - bool bOk = ( EgtRelocate( LuaGetGseContext(), nSouId, nRefId, nSonBeforeAfter) ? true : false) ; + bool bOk = ( EgtRelocate( nSouId, nRefId, nSonBeforeAfter) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -228,7 +228,7 @@ LuaRelocateGlob( lua_State* L) } LuaClearStack( L) ; // eseguo la rilocazione - bool bOk = ( EgtRelocateGlob( LuaGetGseContext(), nSouId, nRefId, nSonBeforeAfter) ? true : false) ; + bool bOk = ( EgtRelocateGlob( nSouId, nRefId, nSonBeforeAfter) ? true : false) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -244,7 +244,7 @@ LuaErase( lua_State* L) // eseguo la cancellazione bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtErase( LuaGetGseContext(), vId[i])) + if ( ! EgtErase( vId[i])) bOk = false ; } // restituisco il risultato diff --git a/LUA_General.cpp b/LUA_General.cpp index d071181..47daaa8 100644 --- a/LUA_General.cpp +++ b/LUA_General.cpp @@ -23,7 +23,6 @@ using namespace std ; //---------------------------------------------------------------------------- static lua_State* s_L = nullptr ; -static int s_nCurrGseCtx = 1 ; static string s_LastError ; static PerformanceCounter s_Counter ; @@ -107,23 +106,6 @@ LuaExit( void) return true ; } -//---------------------------------------------------------------------------- -bool -LuaSetGseContext( int nGseCtx) -{ - GseContext* pGseCtx = GetGseContext( nGseCtx) ; - VERIFY_CTX_GEOMDB( pGseCtx, false) - s_nCurrGseCtx = nGseCtx ; - return true ; -} - -//---------------------------------------------------------------------------- -int -LuaGetGseContext( void) -{ - return s_nCurrGseCtx ; -} - //---------------------------------------------------------------------------- bool LuaExecLine( const string& sLine) @@ -214,7 +196,7 @@ SetContext( lua_State* L) LuaCheckParam( L, 1, nGseCtx) LuaClearStack( L) ; // imposto il contesto - bool bOk = LuaSetGseContext( nGseCtx) ; + bool bOk = SetCurrGseContext( nGseCtx) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -227,7 +209,7 @@ GetContext( lua_State* L) // nessun parametro LuaClearStack( L) ; // restituisco l'indice del contesto - LuaSetReturn( L, s_nCurrGseCtx) ; + LuaSetReturn( L, GetIndCurrGseContext()) ; return 1 ; } diff --git a/LUA_GeoSnap.cpp b/LUA_GeoSnap.cpp index 2fb7fd8..0980acb 100644 --- a/LUA_GeoSnap.cpp +++ b/LUA_GeoSnap.cpp @@ -31,7 +31,7 @@ LuaStartPoint( lua_State* L) LuaClearStack( L) ; // recupero il punto iniziale dell'entità Point3d ptP ; - if ( EgtStartPoint( LuaGetGseContext(), nId, ptP.v)) + if ( EgtStartPoint( nId, ptP.v)) LuaSetReturn( L, ptP) ; else LuaSetReturn( L) ; @@ -48,7 +48,7 @@ LuaEndPoint( lua_State* L) LuaClearStack( L) ; // recupero il punto finale dell'entità Point3d ptP ; - if ( EgtEndPoint( LuaGetGseContext(), nId, ptP.v)) + if ( EgtEndPoint( nId, ptP.v)) LuaSetReturn( L, ptP) ; else LuaSetReturn( L) ; @@ -65,7 +65,7 @@ LuaMidPoint( lua_State* L) LuaClearStack( L) ; // recupero il punto centrale dell'entità Point3d ptP ; - if ( EgtMidPoint( LuaGetGseContext(), nId, ptP.v)) + if ( EgtMidPoint( nId, ptP.v)) LuaSetReturn( L, ptP) ; else LuaSetReturn( L) ; @@ -82,7 +82,7 @@ LuaCenterPoint( lua_State* L) LuaClearStack( L) ; // recupero il punto centrale dell'entità Point3d ptP ; - if ( EgtCenterPoint( LuaGetGseContext(), nId, ptP.v)) + if ( EgtCenterPoint( nId, ptP.v)) LuaSetReturn( L, ptP) ; else LuaSetReturn( L) ; @@ -101,7 +101,7 @@ LuaAtParamPoint( lua_State* L) LuaClearStack( L) ; // recupero il punto in posizione parametrica U della curva Point3d ptP ; - if ( EgtAtParamPoint( LuaGetGseContext(), nId, dU, ptP.v)) + if ( EgtAtParamPoint( nId, dU, ptP.v)) LuaSetReturn( L, ptP) ; else LuaSetReturn( L) ; @@ -118,7 +118,7 @@ LuaStartVector( lua_State* L) LuaClearStack( L) ; // recupero il vettore tangente all'inizio della curva Vector3d vtV ; - if ( EgtStartVector( LuaGetGseContext(), nId, vtV.v)) + if ( EgtStartVector( nId, vtV.v)) LuaSetReturn( L, vtV) ; else LuaSetReturn( L) ; @@ -135,7 +135,7 @@ LuaEndVector( lua_State* L) LuaClearStack( L) ; // recupero il vettore tangente alla fine della curva Vector3d vtV ; - if ( EgtEndVector( LuaGetGseContext(), nId, vtV.v)) + if ( EgtEndVector( nId, vtV.v)) LuaSetReturn( L, vtV) ; else LuaSetReturn( L) ; @@ -152,7 +152,7 @@ LuaMidVector( lua_State* L) LuaClearStack( L) ; // recupero il vettore tangente nel punto medio della curva Vector3d vtV ; - if ( EgtMidVector( LuaGetGseContext(), nId, vtV.v)) + if ( EgtMidVector( nId, vtV.v)) LuaSetReturn( L, vtV) ; else LuaSetReturn( L) ; @@ -175,7 +175,7 @@ LuaAtParamVector( lua_State* L) LuaClearStack( L) ; // recupero il punto in posizione parametrica U della curva Vector3d vtV ; - if ( EgtAtParamVector( LuaGetGseContext(), nId, dU, nSide, vtV.v)) + if ( EgtAtParamVector( nId, dU, nSide, vtV.v)) LuaSetReturn( L, vtV) ; else LuaSetReturn( L) ; @@ -192,7 +192,7 @@ LuaFrame( lua_State* L) LuaClearStack( L) ; // recupero il frame Frame3d frFrame ; - if ( EgtFrame( LuaGetGseContext(), nId, frFrame)) + if ( EgtFrame( nId, frFrame)) LuaSetReturn( L, frFrame) ; else LuaSetReturn( L) ; diff --git a/LUA_GeoTransform.cpp b/LUA_GeoTransform.cpp index 96a5403..5ef0993 100644 --- a/LUA_GeoTransform.cpp +++ b/LUA_GeoTransform.cpp @@ -35,7 +35,7 @@ LuaMove( lua_State* L) // eseguo traslazione bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtMove( LuaGetGseContext(), vId[i], vtMove.v)) + if ( ! EgtMove( vId[i], vtMove.v)) bOk = false ; } // restituisco il risultato @@ -56,7 +56,7 @@ LuaMoveGlob( lua_State* L) // eseguo traslazione bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtMoveGlob( LuaGetGseContext(), vId[i], vtMove.v)) + if ( ! EgtMoveGlob( vId[i], vtMove.v)) bOk = false ; } // restituisco il risultato @@ -77,7 +77,7 @@ LuaMoveGroup( lua_State* L) // eseguo traslazione bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtMoveGroup( LuaGetGseContext(), vId[i], vtMove.v)) + if ( ! EgtMoveGroup( vId[i], vtMove.v)) bOk = false ; } // restituisco il risultato @@ -102,7 +102,7 @@ LuaRotate( lua_State* L) // eseguo rotazione bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtRotate( LuaGetGseContext(), vId[i], ptAx.v, vtAx.v, dAngRotDeg)) + if ( ! EgtRotate( vId[i], ptAx.v, vtAx.v, dAngRotDeg)) bOk = false ; } // restituisco il risultato @@ -127,7 +127,7 @@ LuaRotateGlob( lua_State* L) // eseguo rotazione bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtRotateGlob( LuaGetGseContext(), vId[i], ptAx.v, vtAx.v, dAngRotDeg)) + if ( ! EgtRotateGlob( vId[i], ptAx.v, vtAx.v, dAngRotDeg)) bOk = false ; } // restituisco il risultato @@ -152,7 +152,7 @@ LuaRotateGroup( lua_State* L) // eseguo rotazione bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtRotateGroup( LuaGetGseContext(), vId[i], ptAx.v, vtAx.v, dAngRotDeg)) + if ( ! EgtRotateGroup( vId[i], ptAx.v, vtAx.v, dAngRotDeg)) bOk = false ; } // restituisco il risultato @@ -179,7 +179,7 @@ LuaScale( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtScale( LuaGetGseContext(), vId[i], frRef.Orig().v, + if ( ! EgtScale( vId[i], frRef.Orig().v, frRef.VersX().v, frRef.VersY().v, frRef.VersZ().v, dCoeffX, dCoeffY, dCoeffZ)) bOk = false ; @@ -208,7 +208,7 @@ LuaScaleGlob( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtScaleGlob( LuaGetGseContext(), vId[i], frRef.Orig().v, + if ( ! EgtScaleGlob( vId[i], frRef.Orig().v, frRef.VersX().v, frRef.VersY().v, frRef.VersZ().v, dCoeffX, dCoeffY, dCoeffZ)) bOk = false ; @@ -237,7 +237,7 @@ LuaScaleGroup( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtScaleGroup( LuaGetGseContext(), vId[i], frRef.Orig().v, + if ( ! EgtScaleGroup( vId[i], frRef.Orig().v, frRef.VersX().v, frRef.VersY().v, frRef.VersZ().v, dCoeffX, dCoeffY, dCoeffZ)) bOk = false ; @@ -262,7 +262,7 @@ LuaMirror( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtMirror( LuaGetGseContext(), vId[i], ptOn.v, vtN.v)) + if ( ! EgtMirror( vId[i], ptOn.v, vtN.v)) bOk = false ; } // restituisco il risultato @@ -285,7 +285,7 @@ LuaMirrorGlob( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtMirrorGlob( LuaGetGseContext(), vId[i], ptOn.v, vtN.v)) + if ( ! EgtMirrorGlob( vId[i], ptOn.v, vtN.v)) bOk = false ; } // restituisco il risultato @@ -308,7 +308,7 @@ LuaMirrorGroup( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtMirrorGroup( LuaGetGseContext(), vId[i], ptOn.v, vtN.v)) + if ( ! EgtMirrorGroup( vId[i], ptOn.v, vtN.v)) bOk = false ; } // restituisco il risultato @@ -335,7 +335,7 @@ LuaShear( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtShear( LuaGetGseContext(), vId[i], ptOn.v, vtN.v, vtDir.v, dCoeff)) + if ( ! EgtShear( vId[i], ptOn.v, vtN.v, vtDir.v, dCoeff)) bOk = false ; } // restituisco il risultato @@ -362,7 +362,7 @@ LuaShearGlob( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtShearGlob( LuaGetGseContext(), vId[i], ptOn.v, vtN.v, vtDir.v, dCoeff)) + if ( ! EgtShearGlob( vId[i], ptOn.v, vtN.v, vtDir.v, dCoeff)) bOk = false ; } // restituisco il risultato @@ -389,7 +389,7 @@ LuaShearGroup( lua_State* L) // eseguo scalatura bool bOk = true ; for ( size_t i = 0 ; i < vId.size() && bOk ; ++ i) { - if ( ! EgtShearGroup( LuaGetGseContext(), vId[i], ptOn.v, vtN.v, vtDir.v, dCoeff)) + if ( ! EgtShearGroup( vId[i], ptOn.v, vtN.v, vtDir.v, dCoeff)) bOk = false ; } // restituisco il risultato diff --git a/LUA_GeomDB.cpp b/LUA_GeomDB.cpp index 327c55c..4126bdf 100644 --- a/LUA_GeomDB.cpp +++ b/LUA_GeomDB.cpp @@ -32,8 +32,7 @@ LuaSetDefaultMaterial( lua_State* L) return luaL_error( L, "Invalide first parameter") ; LuaClearStack( L) ; // imposto il colore di default - bool bOk = ( EgtSetDefaultMaterial( LuaGetGseContext(), colDef.GetIntRed(), - colDef.GetIntGreen(), colDef.GetIntBlue()) != FALSE) ; + bool bOk = ( EgtSetDefaultMaterial( colDef.GetIntRed(), colDef.GetIntGreen(), colDef.GetIntBlue()) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -46,7 +45,7 @@ LuaNewFile( lua_State* L) // nessun parametro LuaClearStack( L) ; // nuovo progetto - bool bOk = ( EgtNewFile( LuaGetGseContext()) != FALSE) ; + bool bOk = ( EgtNewFile() != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -61,7 +60,7 @@ LuaOpenFile( lua_State* L) LuaCheckParam( L, 1, sFilePath) LuaClearStack( L) ; // apro il file - bool bOk = ( EgtOpenFile( LuaGetGseContext(), sFilePath) != FALSE) ; + bool bOk = ( EgtOpenFile( sFilePath) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -85,7 +84,7 @@ LuaSaveFile( lua_State* L) LuaClearStack( L) ; } // salvo il file - bool bOk = ( EgtSaveFile( LuaGetGseContext(), sFilePath, nFlag) != FALSE) ; + bool bOk = ( EgtSaveFile( sFilePath, nFlag) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; diff --git a/LUA_Scene.cpp b/LUA_Scene.cpp index 26a8821..34bb234 100644 --- a/LUA_Scene.cpp +++ b/LUA_Scene.cpp @@ -35,7 +35,7 @@ LuaSetBackground( lua_State* L) LuaCheckParam( L, 3, bRedraw) LuaClearStack( L) ; // imposto lo sfondo - bool bOk = ( EgtSetBackground( LuaGetGseContext(), colTop.GetIntRed(), colTop.GetIntGreen(), colTop.GetIntBlue(), + bool bOk = ( EgtSetBackground( colTop.GetIntRed(), colTop.GetIntGreen(), colTop.GetIntBlue(), colBot.GetIntRed(), colBot.GetIntGreen(), colBot.GetIntBlue(), bRedraw) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; @@ -49,7 +49,7 @@ LuaDraw( lua_State* L) // nessun parametro LuaClearStack( L) ; // eseguo ridisegno - bool bOk = ( EgtDraw( LuaGetGseContext()) != FALSE) ; + bool bOk = ( EgtDraw() != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -72,7 +72,7 @@ LuaSetShowMode( lua_State* L) LuaCheckParam( L, 2, bRedraw) LuaClearStack( L) ; // imposto il modo di visualizzazione - bool bOk = ( EgtSetShowMode( LuaGetGseContext(), nShowMode, bRedraw) != FALSE) ; + bool bOk = ( EgtSetShowMode( nShowMode, bRedraw) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -89,7 +89,7 @@ LuaSetShowCurveDirection( lua_State* L) LuaCheckParam( L, 2, bRedraw) LuaClearStack( L) ; // imposto visualizzazione direzione curve - bool bOk = ( EgtSetShowCurveDirection( LuaGetGseContext(), bShowCrvDir, bRedraw) != FALSE) ; + bool bOk = ( EgtSetShowCurveDirection( bShowCrvDir, bRedraw) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -112,7 +112,7 @@ LuaZoom( lua_State* L) LuaCheckParam( L, 2, bRedraw) LuaClearStack( L) ; // imposto zoom - bool bOk = ( EgtZoom( LuaGetGseContext(), nZoomType, bRedraw) != FALSE) ; + bool bOk = ( EgtZoom( nZoomType, bRedraw) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -147,7 +147,7 @@ LuaSetView( lua_State* L) LuaCheckParam( L, 2, bRedraw) LuaClearStack( L) ; // imposto direzione di vista - bool bOk = ( EgtSetView( LuaGetGseContext(), nViewDir, bRedraw) != FALSE) ; + bool bOk = ( EgtSetView( nViewDir, bRedraw) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -166,7 +166,7 @@ LuaSetGenericView( lua_State* L) LuaCheckParam( L, 3, bRedraw) LuaClearStack( L) ; // imposto direzione di vista - bool bOk = ( EgtSetGenericView( LuaGetGseContext(), dAngVertDeg, dAngHorizDeg, bRedraw) != FALSE) ; + bool bOk = ( EgtSetGenericView( dAngVertDeg, dAngHorizDeg, bRedraw) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ; @@ -183,7 +183,7 @@ LuaSetViewCenter( lua_State* L) LuaCheckParam( L, 2, bRedraw) LuaClearStack( L) ; // imposto centro di vista - bool bOk = ( EgtSetViewCenter( LuaGetGseContext(), ptCen.v, bRedraw) != FALSE) ; + bool bOk = ( EgtSetViewCenter( ptCen.v, bRedraw) != FALSE) ; // restituisco il risultato LuaSetReturn( L, bOk) ; return 1 ;