EgtGeomKernel 1.6h4 :

- aggiunto metodo GetCrossOrOverlapIntersCount a SelfIntersCurve
- aggiunti metodi GetCrossIntersCount e GetCrossOrOverlapIntersCount a IntersCurveCurve
- allentati controlli sui loop delle regioni, ora possono toccarsi ma non attraversarsi in punti isolati
- aggiunte funzioni per operazioni booleante tra regioni Add, Subtract e Intersect.
This commit is contained in:
Dario Sassi
2015-08-22 13:48:19 +00:00
parent bab45eb4f3
commit b2db80edc9
12 changed files with 661 additions and 85 deletions
+14 -14
View File
@@ -92,7 +92,7 @@ Intervals::Add( double dMin, double dMax)
//----------------------------------------------------------------------------
void
Intervals::Remove( double dMin, double dMax)
Intervals::Subtract( double dMin, double dMax)
{
// verifico ordine
if ( dMin > dMax)
@@ -142,7 +142,7 @@ Intervals::Remove( double dMin, double dMax)
//----------------------------------------------------------------------------
void
Intervals::Union( const Intervals& Other)
Intervals::Add( const Intervals& Other)
{
// aggiungo tutti gli intervalli dell'altro
for ( auto& Interv : Other.m_lInts)
@@ -151,7 +151,16 @@ Intervals::Union( const Intervals& Other)
//----------------------------------------------------------------------------
void
Intervals::Intersection( const Intervals& Other)
Intervals::Subtract( const Intervals& Other)
{
// sottraggo tutti gli intervalli dell'altro
for ( auto& Interv : Other.m_lInts)
Subtract( Interv.first, Interv.second) ;
}
//----------------------------------------------------------------------------
void
Intervals::Intersect( const Intervals& Other)
{
// se l'insieme è vuoto non devo fare alcunché
if ( m_lInts.empty())
@@ -160,18 +169,9 @@ Intervals::Intersection( const Intervals& Other)
Intervals Aux ;
Aux.Set( m_lInts.front().first, m_lInts.back().second) ;
// Sottraggo Other da Aux
Aux.Difference( Other) ;
Aux.Subtract( Other) ;
// Sottraggo Aux dal corrente
Difference( Aux) ;
}
//----------------------------------------------------------------------------
void
Intervals::Difference( const Intervals& Other)
{
// sottraggo tutti gli intervalli dell'altro
for ( auto& Interv : Other.m_lInts)
Remove( Interv.first, Interv.second) ;
Subtract( Aux) ;
}
//----------------------------------------------------------------------------