EgtExecutor :
- in ExeAddCurveCompoLineTg ora si usa ilnuovo metodo di CurveComposite AddLineTg.
This commit is contained in:
+36
-52
@@ -1541,47 +1541,6 @@ ExeAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig, bool bEndVsStart
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoLineTg( int nId, double dLen, bool bEndVsStart)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
bool bOk = true ;
|
||||
// recupero la curva composita
|
||||
ICurveComposite* pCompo = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
|
||||
bOk = bOk && ( pCompo != nullptr) ;
|
||||
// calcolo punto di allungo
|
||||
Point3d ptNew ;
|
||||
if ( bEndVsStart) {
|
||||
Point3d ptEnd ;
|
||||
Vector3d vtEnd ;
|
||||
bOk = bOk && pCompo->GetEndPoint( ptEnd) && pCompo->GetEndDir( vtEnd) ;
|
||||
if ( bOk)
|
||||
ptNew = ptEnd + vtEnd * dLen ;
|
||||
}
|
||||
else {
|
||||
Point3d ptStart ;
|
||||
Vector3d vtStart ;
|
||||
bOk = bOk && pCompo->GetStartPoint( ptStart) && pCompo->GetStartDir( vtStart) ;
|
||||
if ( bOk)
|
||||
ptNew = ptStart - vtStart * dLen ;
|
||||
}
|
||||
// eseguo la modifica
|
||||
bOk = bOk && pCompo->AddLine( ptNew, bEndVsStart) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtAddCurveCompoLineTg(" + ToString( nId) + ",{" +
|
||||
ToString( dLen) + "}," +
|
||||
( bEndVsStart ? "true" : "false") + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco il risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoLine( int nId, const Point3d& ptP, bool bEndVsStart, int nRefType)
|
||||
@@ -1615,7 +1574,7 @@ ExeAddCurveCompoLine( int nId, const Point3d& ptP, bool bEndVsStart, int nRefTyp
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoArcTg( int nId, const Point3d& ptP, bool bEndVsStart, int nRefType)
|
||||
ExeAddCurveCompoLineTg( int nId, double dLen, bool bEndVsStart)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
@@ -1623,20 +1582,14 @@ ExeAddCurveCompoArcTg( int nId, const Point3d& ptP, bool bEndVsStart, int nRefTy
|
||||
// recupero la curva composita
|
||||
ICurveComposite* pCompo = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
|
||||
bOk = bOk && ( pCompo != nullptr) ;
|
||||
// recupero il riferimento locale
|
||||
Frame3d frLoc ;
|
||||
bOk = bOk && pGeomDB->GetGlobFrame( nId, frLoc) ;
|
||||
// porto in locale il nuovo punto
|
||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||
// eseguo la modifica
|
||||
bOk = bOk && pCompo->AddArcTg( ptPL, bEndVsStart) ;
|
||||
bOk = bOk && pCompo->AddLineTg( dLen, bEndVsStart) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtAddCurveCompoArcTg(" + ToString( nId) + ",{" +
|
||||
ToString( ptP) + "}," +
|
||||
( bEndVsStart ? "true" : "false") + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
string sLua = "EgtAddCurveCompoLineTg(" + ToString( nId) + ",{" +
|
||||
ToString( dLen) + "}," +
|
||||
( bEndVsStart ? "true" : "false") + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
@@ -1677,6 +1630,37 @@ ExeAddCurveCompoArc2P( int nId, const Point3d& ptMid, const Point3d& ptP, bool b
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoArcTg( int nId, const Point3d& ptP, bool bEndVsStart, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
bool bOk = true ;
|
||||
// recupero la curva composita
|
||||
ICurveComposite* pCompo = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
|
||||
bOk = bOk && ( pCompo != nullptr) ;
|
||||
// recupero il riferimento locale
|
||||
Frame3d frLoc ;
|
||||
bOk = bOk && pGeomDB->GetGlobFrame( nId, frLoc) ;
|
||||
// porto in locale il nuovo punto
|
||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||
// eseguo la modifica
|
||||
bOk = bOk && pCompo->AddArcTg( ptPL, bEndVsStart) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtAddCurveCompoArcTg(" + ToString( nId) + ",{" +
|
||||
ToString( ptP) + "}," +
|
||||
( bEndVsStart ? "true" : "false") + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco il risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeRemoveCurveCompoCurve( int nId, bool bLast)
|
||||
|
||||
Reference in New Issue
Block a user