EgtExecutor 1.6g5 :

- in creazione curve eliminata la normale (si deduce dal riferimento indicato)
- in creazione gruppo di inserimento è layer corrente da costante
- gestino carattere ' nelle stringhe per lua.
This commit is contained in:
Dario Sassi
2015-07-20 13:07:09 +00:00
parent fece5ea9fb
commit b14c634bc3
12 changed files with 793 additions and 311 deletions
+63 -44
View File
@@ -34,6 +34,7 @@ ExeCreateGroup( int nParentId, const Frame3d& frFrame, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
@@ -52,12 +53,17 @@ ExeCreateGroup( int nParentId, const Frame3d& frFrame, int nRefType)
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
if ( AreSameFrame( frFrame, GLOB_FRM))
sLua = "EgtGroup(" + ToString( nParentId) + "," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
if ( AreSameFrame( frFrame, GLOB_FRM)) {
if ( nRefType == RTY_LOC)
sLua = "EgtGroup(" + IdToString( nParentId) + ")" +
" -- Id=" + ToString( nId) ;
else
sLua = "EgtGroup(" + IdToString( nParentId) + "," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
}
else
sLua = "EgtGroup(" + ToString( nParentId) + ",{{" +
sLua = "EgtGroup(" + IdToString( nParentId) + ",{{" +
ToString( frFrame.Orig()) + "},{" +
ToString( frFrame.VersX()) + "},{" +
ToString( frFrame.VersY()) + "},{" +
@@ -76,12 +82,13 @@ ExeCreateGeoPoint( int nParentId, const Point3d& ptP, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale il punto
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
// creo il punto
PtrOwner<IGeoPoint3d> pGeoPnt( CreateGeoPoint3d()) ;
bOk = bOk && ! IsNull( pGeoPnt) ;
@@ -92,7 +99,7 @@ ExeCreateGeoPoint( int nParentId, const Point3d& ptP, int nRefType)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtPoint(" + ToString( nParentId) + ",{" +
string sLua = "EgtPoint(" + IdToString( nParentId) + ",{" +
ToString( ptP) + "}," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
@@ -108,13 +115,14 @@ ExeCreateGeoVector( int nParentId, const Vector3d& vtV, const Point3d& ptB, int
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale il vettore e il punto
Vector3d vtVL = GetVectorLocal( pGeomDB, vtV, nRefType, frLoc) ; ;
Point3d ptBL = GetPointLocal( pGeomDB, ptB, nRefType, frLoc) ; ;
Vector3d vtVL = GetVectorLocal( pGeomDB, vtV, nRefType, frLoc) ;
Point3d ptBL = GetPointLocal( pGeomDB, ptB, nRefType, frLoc) ;
// creo il vettore
PtrOwner<IGeoVector3d> pGeoVct( CreateGeoVector3d()) ;
bOk = bOk && ! IsNull( pGeoVct) ;
@@ -127,12 +135,12 @@ ExeCreateGeoVector( int nParentId, const Vector3d& vtV, const Point3d& ptB, int
if ( IsCmdLog()) {
string sLua ;
if ( ptB.IsSmall())
sLua = "EgtVector(" + ToString( nParentId) + ",{" +
sLua = "EgtVector(" + IdToString( nParentId) + ",{" +
ToString( vtV) + "}," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
else
sLua = "EgtVector(" + ToString( nParentId) + ",{" +
sLua = "EgtVector(" + IdToString( nParentId) + ",{" +
ToString( vtV) + "},{" +
ToString( ptB) + "}," +
RefTypeToString( nRefType) + ")" +
@@ -149,15 +157,16 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptOrigL = GetPointLocal( pGeomDB, frFrame.Orig(), nRefType, frLoc) ; ;
Vector3d vtXL = GetVectorLocal( pGeomDB, frFrame.VersX(), nRefType, frLoc) ; ;
Vector3d vtYL = GetVectorLocal( pGeomDB, frFrame.VersY(), nRefType, frLoc) ; ;
Vector3d vtZL = GetVectorLocal( pGeomDB, frFrame.VersZ(), nRefType, frLoc) ; ;
Point3d ptOrigL = GetPointLocal( pGeomDB, frFrame.Orig(), nRefType, frLoc) ;
Vector3d vtXL = GetVectorLocal( pGeomDB, frFrame.VersX(), nRefType, frLoc) ;
Vector3d vtYL = GetVectorLocal( pGeomDB, frFrame.VersY(), nRefType, frLoc) ;
Vector3d vtZL = GetVectorLocal( pGeomDB, frFrame.VersZ(), nRefType, frLoc) ;
// creo e setto il riferimento
PtrOwner<IGeoFrame3d> pGeoFrm( CreateGeoFrame3d()) ;
bOk = bOk && ! IsNull( pGeoFrm) ;
@@ -167,7 +176,7 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtFrame(" + ToString( nParentId) + ",{{" +
string sLua = "EgtFrame(" + IdToString( nParentId) + ",{{" +
ToString( frFrame.Orig()) + "},{" +
ToString( frFrame.VersX()) + "},{" +
ToString( frFrame.VersY()) + "},{" +
@@ -182,19 +191,20 @@ ExeCreateGeoFrame( int nParentId, const Frame3d& frFrame, int nRefType)
//-------------------------------------------------------------------------------
int
ExeCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
ExeCreateText( int nParentId, const Point3d& ptP,
const string& sText, double dH, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, X_AX, nRefType, frLoc) ; ;
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
Vector3d vtDL = GetVectorLocal( pGeomDB, X_AX, nRefType, frLoc) ;
// creo il testo e lo riempio
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;
@@ -204,10 +214,11 @@ ExeCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtText(" + ToString( nParentId) + ",{" +
ToString( ptP) + "}," +
ToString( dAngRotDeg) + ",'" +
sText + "','" +
string sLuaText = sText ;
ReplaceString( sLuaText, "'", "\\'") ;
string sLua = "EgtText(" + IdToString( nParentId) + ",{" +
ToString( ptP) + "},'" +
sLuaText + "'," +
ToString( dH) + "," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
@@ -219,19 +230,20 @@ ExeCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
//-------------------------------------------------------------------------------
int
ExeCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
ExeCreateTextEx( int nParentId, const Point3d& ptP, double dAngRotDeg,
const string& sText, const string& sFont, bool bItalic, double dH, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, vtN, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, vtD, nRefType, frLoc) ; ;
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
Vector3d vtDL = GetVectorLocal( pGeomDB, FromPolar(1, dAngRotDeg), nRefType, frLoc) ;
// creo il testo e lo riempio
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;
@@ -241,12 +253,15 @@ ExeCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const V
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtTextEx(" + ToString( nParentId) + ",{" +
ToString( ptP) + "},{" +
ToString( vtN) + "},{" +
ToString( vtD) + "},'" +
sText + "','" +
sFont + "'," +
string sLuaText = sText ;
ReplaceString( sLuaText, "'", "\\'") ;
string sLuaFont = sFont ;
ReplaceString( sLuaFont, "'", "\\'") ;
string sLua = "EgtTextEx(" + IdToString( nParentId) + ",{" +
ToString( ptP) + "}," +
ToString( dAngRotDeg) + ",'" +
sLuaText + "','" +
sLuaFont + "'," +
( bItalic ? "'I'" : "'S'") + "," +
ToString( dH) + "," +
RefTypeToString( nRefType) + ")" +
@@ -259,20 +274,21 @@ ExeCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const V
//-------------------------------------------------------------------------------
int
ExeCreateTextAdv( int nParentId, const Point3d& ptP, const Vector3d& vtN, const Vector3d& vtD,
ExeCreateTextAdv( int nParentId, const Point3d& ptP, double dAngRotDeg,
const string& sText, const string& sFont,
int nW, bool bItalic, double dH, double dRat, double dAddAdv, int nInsPos, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, vtN, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, vtD, nRefType, frLoc) ; ;
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
Vector3d vtDL = GetVectorLocal( pGeomDB, FromPolar(1, dAngRotDeg), nRefType, frLoc) ;
// creo il testo e lo imposto
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;
@@ -282,12 +298,15 @@ ExeCreateTextAdv( int nParentId, const Point3d& ptP, const Vector3d& vtN, const
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtTextAdv(" + ToString( nParentId) + ",{" +
ToString( ptP) + "},{" +
ToString( vtN) + "},{" +
ToString( vtD) + "},'" +
sText + "','" +
sFont + "'," +
string sLuaText = sText ;
ReplaceString( sLuaText, "'", "\\'") ;
string sLuaFont = sFont ;
ReplaceString( sLuaFont, "'", "\\'") ;
string sLua = "EgtTextAdv(" + IdToString( nParentId) + ",{" +
ToString( ptP) + "}," +
ToString( dAngRotDeg) + ",'" +
sLuaText + "','" +
sLuaFont + "'," +
ToString( nW) + "," +
( bItalic ? "'I'" : "'S'") + "," +
ToString( dH) + "," +