EgtInterface 1.6a4 :
- completamento modifiche per registrazione comandi in lua e per gestione RefType e RefId.
This commit is contained in:
+22
-30
@@ -35,37 +35,29 @@ __stdcall EgtCreateGroup( int nParentId, const double ptOrig[3],
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
bool bOk = true ;
|
||||
// porto in locale l'origine e i versori
|
||||
Point3d ptOrigL( ptOrig) ;
|
||||
Vector3d vtXL( vX) ;
|
||||
Vector3d vtYL( vY) ;
|
||||
Vector3d vtZL( vZ) ;
|
||||
// costruisco il riferimento
|
||||
Frame3d frFrameL ;
|
||||
bOk = bOk && frFrameL.Set( ptOrig, vX, vY, vZ) ;
|
||||
// lo porto in locale
|
||||
if ( nRefType != RTY_LOC) {
|
||||
Frame3d frLoc ;
|
||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
||||
if ( nRefType == RTY_GLOB) {
|
||||
ptOrigL.ToLoc( frLoc) ;
|
||||
vtXL.ToLoc( frLoc) ;
|
||||
vtYL.ToLoc( frLoc) ;
|
||||
vtZL.ToLoc( frLoc) ;
|
||||
}
|
||||
else /* RTY_GRID */ {
|
||||
ptOrigL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
|
||||
vtXL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
|
||||
vtYL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
|
||||
vtZL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
|
||||
}
|
||||
if ( nRefType == RTY_GLOB)
|
||||
frFrameL.ToLoc( frLoc) ;
|
||||
else /* RTY_GRID */
|
||||
frFrameL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
|
||||
}
|
||||
// costruisco il riferimento
|
||||
Frame3d frFrame ;
|
||||
bOk = bOk && frFrame.Set( ptOrigL, vtXL, vtYL, vtZL) ;
|
||||
// creo il gruppo
|
||||
int nId = ( bOk ? pGeomDB->AddGroup( GDB_ID_NULL, nParentId, frFrame) : GDB_ID_NULL) ;
|
||||
int nId = ( bOk ? pGeomDB->AddGroup( GDB_ID_NULL, nParentId, frFrameL) : GDB_ID_NULL) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua ;
|
||||
if ( AreSameFrame( frFrame, GLOB_FRM))
|
||||
sLua = "EgtGroup(" + ToString( nParentId) + ")" +
|
||||
if ( AreSamePointApprox( ORIG, ptOrig) &&
|
||||
AreSameVectorExact( X_AX, vX) &&
|
||||
AreSameVectorExact( Y_AX, vY) &&
|
||||
AreSameVectorExact( Z_AX, vZ))
|
||||
sLua = "EgtGroup(" + ToString( nParentId) + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Id=" + ToString( nId) ;
|
||||
else
|
||||
sLua = "EgtGroup(" + ToString( nParentId) + ",{{" +
|
||||
@@ -228,8 +220,8 @@ __stdcall EgtCreateText( int nParentId, const double ptP[3], double dAngRotDeg,
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
|
||||
const string& sText, double dH, int nRefType)
|
||||
EgtCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
|
||||
const string& sText, double dH, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -284,8 +276,8 @@ __stdcall EgtCreateTextEx( int nParentId, const double ptP[3], const double vtN[
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
|
||||
const string& sText, const string& sFont, bool bItalic, double dH, int nRefType)
|
||||
EgtCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
|
||||
const string& sText, const string& sFont, bool bItalic, double dH, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -345,9 +337,9 @@ __stdcall EgtCreateTextAdv( int nParentId, const double ptP[3], const double vtN
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtCreateTextAdv( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
|
||||
const string& sText, const string& sFont,
|
||||
int nW, bool bItalic, double dH, double dRat, double dAddAdv, int nInsPos, int nRefType)
|
||||
EgtCreateTextAdv( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
|
||||
const string& sText, const string& sFont,
|
||||
int nW, bool bItalic, double dH, double dRat, double dAddAdv, int nInsPos, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
|
||||
Reference in New Issue
Block a user