EgtExecutor 2.3d3 :
- in AddCurveCompoCurve, AddCurveCompoLine, AddCurveCompoArcTg e AddCurveCompoArc2P aggiunto parametro per operare in coda o in testa (in lua è opzionale) - in ExeRemoveCurveCompoCurve ora si libera correttamente la memoria delle curve.
This commit is contained in:
+19
-13
@@ -1483,7 +1483,7 @@ ExeCloseCurveCompo( int nId)
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
MyAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig)
|
||||
MyAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig, bool bEndVsStart)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
@@ -1511,7 +1511,7 @@ MyAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig)
|
||||
if ( ! AreSameFrame( frSou, frLoc))
|
||||
pCopCrv->LocToLoc( frSou, frLoc) ;
|
||||
// aggiungo alla composita
|
||||
if ( ! pCompo->AddCurve( Release( pCopCrv)))
|
||||
if ( ! pCompo->AddCurve( Release( pCopCrv), bEndVsStart))
|
||||
return false ;
|
||||
// se richiesto, cancello la curva originale
|
||||
if ( bEraseOrig)
|
||||
@@ -1521,15 +1521,16 @@ MyAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig)
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig)
|
||||
ExeAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig, bool bEndVsStart)
|
||||
{
|
||||
// eseguo
|
||||
bool bOk = MyAddCurveCompoCurve( nId, nAddCrvId, bEraseOrig) ;
|
||||
bool bOk = MyAddCurveCompoCurve( nId, nAddCrvId, bEraseOrig, bEndVsStart) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtAddCurveCompoCurve(" + IdToString( nId) + "," +
|
||||
IdToString( nAddCrvId) + "," +
|
||||
( bEraseOrig ? "true" : "false") + ")" +
|
||||
( bEraseOrig ? "true" : "false") + "," +
|
||||
( bEndVsStart ? "true" : "false") + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
@@ -1539,7 +1540,7 @@ ExeAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig)
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoLine( int nId, const Point3d& ptP, int nRefType)
|
||||
ExeAddCurveCompoLine( int nId, const Point3d& ptP, bool bEndVsStart, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
@@ -1553,12 +1554,13 @@ ExeAddCurveCompoLine( int nId, const Point3d& ptP, int nRefType)
|
||||
// porto in locale il nuovo punto
|
||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||
// eseguo la modifica
|
||||
bOk = bOk && pCompo->AddLine( ptPL) ;
|
||||
bOk = bOk && pCompo->AddLine( ptPL, bEndVsStart) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtAddCurveCompoLine(" + ToString( nId) + "," +
|
||||
ToString( ptP) + "}," +
|
||||
( bEndVsStart ? "true" : "false") + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
@@ -1569,7 +1571,7 @@ ExeAddCurveCompoLine( int nId, const Point3d& ptP, int nRefType)
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoArcTg( int nId, const Point3d& ptP, int nRefType)
|
||||
ExeAddCurveCompoArcTg( int nId, const Point3d& ptP, bool bEndVsStart, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
@@ -1583,12 +1585,13 @@ ExeAddCurveCompoArcTg( int nId, const Point3d& ptP, int nRefType)
|
||||
// porto in locale il nuovo punto
|
||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||
// eseguo la modifica
|
||||
bOk = bOk && pCompo->AddArcTg( ptPL) ;
|
||||
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()) ;
|
||||
@@ -1599,7 +1602,7 @@ ExeAddCurveCompoArcTg( int nId, const Point3d& ptP, int nRefType)
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoArc2P( int nId, const Point3d& ptMid, const Point3d& ptP, int nRefType)
|
||||
ExeAddCurveCompoArc2P( int nId, const Point3d& ptMid, const Point3d& ptP, bool bEndVsStart, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
@@ -1614,13 +1617,14 @@ ExeAddCurveCompoArc2P( int nId, const Point3d& ptMid, const Point3d& ptP, int nR
|
||||
Point3d ptMidL = GetPointLocal( pGeomDB, ptMid, nRefType, frLoc) ;
|
||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||
// eseguo la modifica
|
||||
bOk = bOk && pCompo->AddArc2P( ptMidL, ptPL) ;
|
||||
bOk = bOk && pCompo->AddArc2P( ptMidL, ptPL, bEndVsStart) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtAddCurveCompoArc2P(" + ToString( nId) + ",{" +
|
||||
ToString( ptMid) + "},{" +
|
||||
ToString( ptP) + "}," +
|
||||
( bEndVsStart ? "true" : "false") + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
@@ -1640,11 +1644,13 @@ ExeRemoveCurveCompoCurve( int nId, bool bLast)
|
||||
ICurveComposite* pCompo = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
|
||||
bOk = bOk && ( pCompo != nullptr) ;
|
||||
// eseguo la modifica
|
||||
bOk = bOk && pCompo->RemoveFirstOrLastCurve( bLast) ;
|
||||
if ( bOk)
|
||||
delete( pCompo->RemoveFirstOrLastCurve( bLast)) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtRemoveCurveCompoCurve(" + ToString( nId) + ")" +
|
||||
string sLua = "EgtRemoveCurveCompoCurve(" + ToString( nId) + "," +
|
||||
( bLast ? "true" : "false") + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user