EgtMachKernel :
- semplificazioni con utilizzo di ConvertCurveToComposite.
This commit is contained in:
+2
-2
@@ -1036,8 +1036,8 @@ Chiseling::GetCurves( SelData Id, ICURVEPLIST& lstPC)
|
||||
for ( int nC = nCstart ; nC < nCend ; ++ nC) {
|
||||
// recupero i contorni del chunk
|
||||
for ( int nL = 0 ; nL < pReg->GetLoopCount( nC) ; ++ nL) {
|
||||
PtrOwner<ICurveComposite> pCrvCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nC, nL)))
|
||||
PtrOwner<ICurveComposite> pCrvCompo ;
|
||||
if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nC, nL))))
|
||||
return false ;
|
||||
// assegno l'estrusione dalla normale alla regione
|
||||
pCrvCompo->SetExtrusion( vtN) ;
|
||||
|
||||
+10
-10
@@ -1385,8 +1385,8 @@ Milling::GetCurves( SelData Id, ICURVEPLIST& lstPC)
|
||||
for ( int nC = nCstart ; nC < nCend ; ++ nC) {
|
||||
// recupero i contorni del chunk
|
||||
for ( int nL = 0 ; nL < pReg->GetLoopCount( nC) ; ++ nL) {
|
||||
PtrOwner<ICurveComposite> pCrvCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nC, nL)))
|
||||
PtrOwner<ICurveComposite> pCrvCompo ;
|
||||
if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nC, nL))))
|
||||
return false ;
|
||||
// assegno l'estrusione dalla normale alla regione
|
||||
pCrvCompo->SetExtrusion( vtN) ;
|
||||
@@ -4441,7 +4441,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
|
||||
if ( pCompo->GetLength( dLen) && pCompo->GetParamAtLength( dLen - m_dAddedOverlap - dTang, dU)) {
|
||||
double dParS, dParE ;
|
||||
pCompo->GetDomain( dParS, dParE) ;
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dU, dParE)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dU, dParE))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
@@ -4457,7 +4457,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
|
||||
else {
|
||||
double dU ;
|
||||
if ( pCompo->GetParamAtLength( m_dAddedOverlap + dTang, dU)) {
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( 0, dU)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( 0, dU))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
@@ -4492,7 +4492,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
|
||||
if ( pCompo->GetParamAtLength( dTang, dU)) {
|
||||
double dParS, dParE ;
|
||||
pCompo->GetDomain( dParS, dParE) ;
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dParS, dU)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dParS, dU))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
@@ -4505,7 +4505,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
|
||||
if ( pCompo->GetLength( dLen) && pCompo->GetParamAtLength( dLen - dTang, dU)) {
|
||||
double dParS, dParE ;
|
||||
pCompo->GetDomain( dParS, dParE) ;
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dU, dParE)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dU, dParE))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
@@ -4666,7 +4666,7 @@ Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vect
|
||||
if ( ! bInvert) {
|
||||
double dU ;
|
||||
if ( pCompo->GetParamAtLength( m_dAddedOverlap + dTang, dU)) {
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( 0, dU)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( 0, dU))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
@@ -4681,7 +4681,7 @@ Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vect
|
||||
if ( pCompo->GetLength( dLen) && pCompo->GetParamAtLength( dLen - m_dAddedOverlap - dTang, dU)) {
|
||||
double dParS, dParE ;
|
||||
pCompo->GetDomain( dParS, dParE) ;
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dU, dParE)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dU, dParE))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
@@ -4797,7 +4797,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
if ( ! bInvert) {
|
||||
double dU ;
|
||||
if ( pCompo->GetParamAtLength( m_dAddedOverlap + dTang, dU)) {
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( 0, dU)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( 0, dU))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
@@ -4812,7 +4812,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
if ( pCompo->GetLength( dLen) && pCompo->GetParamAtLength( dLen - m_dAddedOverlap - dTang, dU)) {
|
||||
double dParS, dParE ;
|
||||
pCompo->GetDomain( dParS, dParE) ;
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dU, dParE)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dU, dParE))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
|
||||
+14
-14
@@ -1226,8 +1226,8 @@ Pocketing::GetCurves( SelData Id, ICURVEPLIST& lstPC)
|
||||
for ( int nC = nCstart ; nC < nCend ; ++ nC) {
|
||||
// recupero i contorni del chunk
|
||||
for ( int nL = 0 ; nL < pReg->GetLoopCount( nC) ; ++ nL) {
|
||||
PtrOwner<ICurveComposite> pCrvCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nC, nL)))
|
||||
PtrOwner<ICurveComposite> pCrvCompo ;
|
||||
if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nC, nL))))
|
||||
return false ;
|
||||
// reset proprietà temporanee
|
||||
ResetCurveAllTempProp( pCrvCompo) ;
|
||||
@@ -2044,8 +2044,8 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con
|
||||
nOffsCrvNbr = 0 ; // setto a zero per non rientrare nel while
|
||||
else {
|
||||
// recupero la prima curva di offset
|
||||
PtrOwner<ICurveComposite> pOffs( CreateCurveComposite()) ;
|
||||
if ( IsNull( pOffs) || ! pOffs->AddCurve( OffsCrv.GetLongerCurve())) {
|
||||
PtrOwner<ICurveComposite> pOffs ;
|
||||
if ( ! pOffs.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve()))) {
|
||||
m_pMchMgr->SetLastError( 2413, "Error in Pocketing : Toolpath not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -2227,8 +2227,8 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con
|
||||
while ( OffsCrv2.GetCurveCount() > 0) {
|
||||
|
||||
// recupero la prima curva di offset
|
||||
PtrOwner<ICurveComposite> pOffs2( CreateCurveComposite()) ;
|
||||
if ( IsNull( pOffs2) || ! pOffs2->AddCurve( OffsCrv2.GetLongerCurve())) {
|
||||
PtrOwner<ICurveComposite> pOffs2 ;
|
||||
if ( ! pOffs2.Set( ConvertCurveToComposite( OffsCrv2.GetLongerCurve()))) {
|
||||
m_pMchMgr->SetLastError( 2413, "Error in Pocketing : Toolpath not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -3061,8 +3061,8 @@ Pocketing::AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, con
|
||||
while ( OffsCrv.GetCurveCount() > 0) {
|
||||
|
||||
// recupero la prima curva di offset
|
||||
PtrOwner<ICurveComposite> pOffs( CreateCurveComposite()) ;
|
||||
if ( IsNull( pOffs) || ! pOffs->AddCurve( OffsCrv.GetLongerCurve())) {
|
||||
PtrOwner<ICurveComposite> pOffs ;
|
||||
if ( ! pOffs.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve()))) {
|
||||
m_pMchMgr->SetLastError( 2413, "Error in Pocketing : Toolpath not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -3206,8 +3206,8 @@ Pocketing::AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, con
|
||||
// ciclo sulle curve risultanti
|
||||
while ( OffsCrv2.GetCurveCount() > 0) {
|
||||
|
||||
PtrOwner<ICurveComposite> pOffs2( CreateCurveComposite()) ;
|
||||
if ( IsNull( pOffs2) || ! pOffs2->AddCurve( OffsCrv2.GetLongerCurve())) {
|
||||
PtrOwner<ICurveComposite> pOffs2 ;
|
||||
if ( ! pOffs2.Set( ConvertCurveToComposite( OffsCrv2.GetLongerCurve()))) {
|
||||
m_pMchMgr->SetLastError( 2413, "Error in Pocketing : Toolpath not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -5262,8 +5262,8 @@ Pocketing::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3
|
||||
return false ;
|
||||
// eventuale spezzatura
|
||||
if ( bSplitArcs) {
|
||||
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pArc)) || ! ApproxWithLines( pCompo))
|
||||
PtrOwner<ICurveComposite> pCompo ;
|
||||
if ( ! pCompo.Set( ConvertCurveToComposite( Release( pArc))) || ! ApproxWithLines( pCompo))
|
||||
return false ;
|
||||
return ( AddCurveMove( pCompo, MCH_CL_LEADIN) != GDB_ID_NULL) ;
|
||||
}
|
||||
@@ -5310,7 +5310,7 @@ Pocketing::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3
|
||||
if ( pRCrv->GetLength( dLen) && pRCrv->GetParamAtLength( dLen - m_Params.m_dLiTang, dU)) {
|
||||
double dParS, dParE ;
|
||||
pRCrv->GetDomain( dParS, dParE) ;
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pRCrv->CopyParamRange( dU, dParE)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pRCrv->CopyParamRange( dU, dParE))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
@@ -5398,7 +5398,7 @@ Pocketing::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector
|
||||
PtrOwner<ICurveComposite> pCrv ;
|
||||
double dU ;
|
||||
if ( pRCrv->GetParamAtLength( m_Params.m_dLoTang, dU)) {
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pRCrv->CopyParamRange( 0, dU)))
|
||||
if ( ! pCrv.Set( ConvertCurveToComposite( pRCrv->CopyParamRange( 0, dU))))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
|
||||
+6
-6
@@ -982,8 +982,8 @@ SawFinishing::AdjustGeometry( int nAuxId)
|
||||
if ( ! pGuide->IsFlat( plPlane, false, 10 * EPS_SMALL) || ! AreSameOrOppositeVectorApprox( plPlane.GetVersN(), Z_AX))
|
||||
return false ;
|
||||
// verifiche sulla curva (che trasformo in composita)
|
||||
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pGuide)))
|
||||
PtrOwner<ICurveComposite> pCompo ;
|
||||
if ( ! pCompo.Set( ConvertCurveToComposite( Release( pGuide))))
|
||||
return false ;
|
||||
// converto in archi e rette
|
||||
pCompo->ArcsBezierCurvesToArcsPerpExtr( LIN_TOL_MID, ANG_TOL_STD_DEG) ;
|
||||
@@ -2403,8 +2403,8 @@ SawFinishing::CalcCurvedAlongVerticalCuts( ICurve* pSect, int nUmin, int nUmax,
|
||||
Vector3d vtMove = ( dY - m_TParams.m_dThick / 2) * Z_AX ;
|
||||
OffsetCurve OffsCrv ;
|
||||
OffsCrv.Make( pGuide, dOffs, ICurve::OFF_FILLET) ;
|
||||
PtrOwner<ICurveComposite> pCut( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve()))
|
||||
PtrOwner<ICurveComposite> pCut ;
|
||||
if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve())))
|
||||
return false ;
|
||||
VerifyArcs( pCut) ;
|
||||
pCut->SimpleOffset( SAWRF_OFFS, ICurve::OFF_FORCE_OPEN) ;
|
||||
@@ -2478,8 +2478,8 @@ SawFinishing::CalcCurvedAlongStdCuts( ICurve* pSect, double dUmin, double dUmax,
|
||||
Vector3d vtMove = ( ptP.y - m_TParams.m_dThick / 2) * Z_AX ;
|
||||
OffsetCurve OffsCrv ;
|
||||
OffsCrv.Make( pGuide, dOffs, ICurve::OFF_FILLET) ;
|
||||
PtrOwner<ICurveComposite> pCut( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve()))
|
||||
PtrOwner<ICurveComposite> pCut ;
|
||||
if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve())))
|
||||
return false ;
|
||||
VerifyArcs( pCut) ;
|
||||
pCut->SimpleOffset( SAWRF_OFFS, ICurve::OFF_FORCE_OPEN) ;
|
||||
|
||||
+4
-4
@@ -940,8 +940,8 @@ SawRoughing::AdjustGeometry( int nAuxId)
|
||||
if ( ! pGuide->IsFlat( plPlane, false, 10 * EPS_SMALL) || ! AreSameOrOppositeVectorApprox( plPlane.GetVersN(), Z_AX))
|
||||
return false ;
|
||||
// verifiche sulla curva (che trasformo in composita)
|
||||
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pGuide)))
|
||||
PtrOwner<ICurveComposite> pCompo ;
|
||||
if ( ! pCompo.Set( ConvertCurveToComposite( Release( pGuide))))
|
||||
return false ;
|
||||
// converto in archi e rette
|
||||
pCompo->ArcsBezierCurvesToArcsPerpExtr( LIN_TOL_MID, ANG_TOL_STD_DEG) ;
|
||||
@@ -1330,8 +1330,8 @@ SawRoughing::CalculateCurvedToolPath( int nAuxId, int nClId)
|
||||
// creo la curva di taglio
|
||||
OffsetCurve OffsCrv ;
|
||||
OffsCrv.Make( pGuide, dX, ICurve::OFF_FILLET) ;
|
||||
PtrOwner<ICurveComposite> pCut( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve()))
|
||||
PtrOwner<ICurveComposite> pCut ;
|
||||
if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve())))
|
||||
return false ;
|
||||
VerifyArcs( pCut) ;
|
||||
Vector3d vtMove = ( dY - m_TParams.m_dThick / 2) * Z_AX ;
|
||||
|
||||
+2
-2
@@ -1279,8 +1279,8 @@ Sawing::GetCurve( SelData Id)
|
||||
// recupero l'indice del chunk
|
||||
int nChunk = ( ( Id.nSub == SEL_SUB_ALL) ? 0 : Id.nSub) ;
|
||||
// recupero il contorno esterno del chunk
|
||||
PtrOwner<ICurveComposite> pCrvCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nChunk, 0)))
|
||||
PtrOwner<ICurveComposite> pCrvCompo ;
|
||||
if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nChunk, 0))))
|
||||
return nullptr ;
|
||||
// recupero la normale della regione
|
||||
Vector3d vtN = pReg->GetNormVersor() ;
|
||||
|
||||
+2
-2
@@ -1331,8 +1331,8 @@ SurfFinishing::AddZigZag( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf,
|
||||
bool bStart = true ;
|
||||
while ( OffsCrv.GetCurveCount() > 0) {
|
||||
// recupero la prima curva di offset
|
||||
PtrOwner<ICurveComposite> pOffs( CreateCurveComposite()) ;
|
||||
if ( IsNull( pOffs) || ! pOffs->AddCurve( OffsCrv.GetLongerCurve())) {
|
||||
PtrOwner<ICurveComposite> pOffs ;
|
||||
if ( ! pOffs.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve()))) {
|
||||
m_pMchMgr->SetLastError( 3110, "Error in SurfFinishing : Toolpath not computable") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
+4
-4
@@ -2610,8 +2610,8 @@ WaterJetting::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vect
|
||||
pCrv->Invert() ;
|
||||
// eventuale spezzatura
|
||||
if ( bSplitArcs) {
|
||||
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pCrv)) || ! ApproxWithLines( pCompo))
|
||||
PtrOwner<ICurveComposite> pCompo ;
|
||||
if ( ! pCompo.Set( ConvertCurveToComposite( Release( pCrv))) || ! ApproxWithLines( pCompo))
|
||||
return false ;
|
||||
return ( AddCurveMove( pCompo, MCH_CL_LEADIN) != GDB_ID_NULL) ;
|
||||
}
|
||||
@@ -2681,8 +2681,8 @@ WaterJetting::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vec
|
||||
return false ;
|
||||
// eventuale spezzatura
|
||||
if ( bSplitArcs) {
|
||||
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
|
||||
if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pCrv)) || ! ApproxWithLines( pCompo))
|
||||
PtrOwner<ICurveComposite> pCompo ;
|
||||
if ( ! pCompo.Set( ConvertCurveToComposite( Release( pCrv))) || ! ApproxWithLines( pCompo))
|
||||
return false ;
|
||||
return ( AddCurveMove( pCompo, MCH_CL_LEADOUT) != GDB_ID_NULL) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user