EgtGeomKernel 1.5g1 :

- alle curve aggiunto il metodo CopyParamRange (per curve chiuse ammatte range che passano dal punto di chiusura)
- trasformato il metodo Copy di tutti gli oggetti geometrici in CopyFrom
- a TSC aggiunte funzioni CopyCurveByParamRange e SplitCurveByClass
- migliorata gestione intersezioni sovrapposte
- aggiunta classificazione parti di curva (IN,OUT,ONP,ONM) da intersezioni con altra curva chiusa.
This commit is contained in:
Dario Sassi
2014-07-05 07:19:12 +00:00
parent 15f819fe31
commit 73fe8e7a89
28 changed files with 739 additions and 147 deletions
+30 -5
View File
@@ -19,6 +19,7 @@
#include "NgeWriter.h"
#include "NgeReader.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
#include <new>
using namespace std ;
@@ -95,7 +96,7 @@ CurveLine::Clone( void) const
// alloco oggetto
CurveLine* pCrv = new(nothrow) CurveLine ;
if ( pCrv != nullptr) {
if ( ! pCrv->Copy( *this)) {
if ( ! pCrv->CopyFrom( *this)) {
delete pCrv ;
return nullptr ;
}
@@ -106,17 +107,17 @@ CurveLine::Clone( void) const
//----------------------------------------------------------------------------
bool
CurveLine::Copy( const IGeoObj* pGObjSrc)
CurveLine::CopyFrom( const IGeoObj* pGObjSrc)
{
const CurveLine* pCL = dynamic_cast<const CurveLine*>( pGObjSrc) ;
if ( pCL == nullptr)
return false ;
return Copy( *pCL) ;
return CopyFrom( *pCL) ;
}
//----------------------------------------------------------------------------
bool
CurveLine::Copy( const CurveLine& clSrc)
CurveLine::CopyFrom( const CurveLine& clSrc)
{
if ( &clSrc == this)
return true ;
@@ -421,10 +422,30 @@ CurveLine::ApproxWithLines( double dLinTol, double dAngTolDeg, PolyLine& PL) con
// inserisco gli estremi
PL.AddUPoint( 0, m_PtStart) ;
PL.AddUPoint( 1, m_PtEnd) ;
return true ;
}
//----------------------------------------------------------------------------
ICurve*
CurveLine::CopyParamRange( double dUStart, double dUEnd) const
{
// i parametri start ed end devono essere compresi nel dominio parametrico della curva
if ( dUStart < - EPS_PARAM || dUStart > 1 + EPS_PARAM ||
dUEnd < - EPS_PARAM || dUEnd > 1 + EPS_PARAM)
return nullptr ;
// se il parametro start supera quello di end, essendo la linea una curva aperta, errore
if ( dUStart > dUEnd - EPS_PARAM)
return nullptr ;
// creo la linea copia
PtrOwner<CurveLine> pCopy( Clone()) ;
if ( ! ::IsValid( pCopy))
return nullptr ;
// eseguo il trim
if ( ! pCopy->TrimStartEndAtParam( dUStart, dUEnd))
return nullptr ;
return ( ::Release( pCopy)) ;
}
//----------------------------------------------------------------------------
bool
CurveLine::Invert( void)
@@ -507,6 +528,10 @@ CurveLine::TrimEndAtParam( double dUTrim)
bool
CurveLine::TrimStartEndAtParam( double dUStartTrim, double dUEndTrim)
{
// i parametri start ed end devono essere compresi nel dominio parametrico della curva
if ( dUStartTrim < - EPS_PARAM || dUStartTrim > 1 + EPS_PARAM ||
dUEndTrim < - EPS_PARAM || dUEndTrim > 1 + EPS_PARAM)
return false ;
// verifico che i trim non cancellino interamente la curva
if ( dUStartTrim > dUEndTrim - EPS_PARAM)
return false ;