Equals test
[Topological operators]


Detailed Description

 Applies to: P/P, L/L and A/A.
 TeEquals(x, y) => (x inter y = x) ^ (y inter x = y)
                   (B(x) inter I(y) = false) ^ (B(x) inter E(y) = false) 


Functions

template<>
TL_DLL bool TeEquals (const TeCell &cell1, const TeCell &cell2)
 Check if cell 1 and cell 2 are equal.
template<>
TL_DLL bool TeEquals (const TeBox &bx1, const TeBox &bx2)
 Check if box 1 and box 2 are equal.
template<>
TL_DLL bool TeEquals (const TePolygonSet &ps1, const TePolygonSet &ps2)
 Check if polygonset1 and polygonset1 are equal.
template<>
TL_DLL bool TeEquals (const TePolygon &redPol, const TePolygon &bluePol)
 Check if polygon red and polygon blue are equal.
template<>
TL_DLL bool TeEquals (const TeLine2D &redLine, const TeLine2D &blueLine)
 Check if lineRed and lineBlue are equal.
template<>
TL_DLL bool TeEquals (const TePoint &p1, const TePoint &p2)
 Check if point 1 and point 2 are equal.
template<>
TL_DLL bool TeEquals (const TeCoord2D &c1, const TeCoord2D &c2)
 Check if coordinate 1 and coordinate 2 are equal.
template<class T1, class T2>
bool TeEquals (const T1 &, const T2 &)
 If a specialized function is not used, returns false.


Function Documentation

template<>
TL_DLL bool TeEquals ( const TeCell cell1,
const TeCell cell2 
) [inline]

Definition at line 674 of file TeGeometryAlgorithms.cpp.

References TeGeometry::box(), and TeEquals().

00675 {
00676         return TeEquals(cell1.box(), cell2.box());
00677 }

template<>
TL_DLL bool TeEquals ( const TeBox bx1,
const TeBox bx2 
) [inline]

Definition at line 657 of file TeGeometryAlgorithms.cpp.

References TeGeometryAlgorithmsPrecision::IsDifferent(), TeBox::x1(), TeBox::x2(), TeBox::y1(), and TeBox::y2().

00658 {
00659         if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.x1(), bx2.x1()))
00660                 return false;
00661 
00662         if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.y1(), bx2.y1()))
00663                 return false;
00664 
00665         if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.x2(), bx2.x2()))
00666                 return false;
00667         
00668         if(TeGeometryAlgorithmsPrecision::IsDifferent(bx1.y2(), bx2.y2()))
00669                 return false;
00670 
00671         return true;
00672 }

template<>
TL_DLL bool TeEquals ( const TePolygonSet ps1,
const TePolygonSet ps2 
) [inline]

Definition at line 635 of file TeGeometryAlgorithms.cpp.

References TeGeomComposite< T >::begin(), TeGeomComposite< T >::end(), TeGeomComposite< T >::size(), and TeEquals().

00636 {
00637   if( ps1.size() == ps2.size() ) {
00638     TePolygonSet::iterator it1 = ps1.begin();
00639     TePolygonSet::iterator it1_end = ps1.end();
00640     TePolygonSet::iterator it2 = ps2.begin();
00641     
00642     while( it1 != it1_end ) {
00643       if( ! TeEquals( (*it1), (*it2) ) ) {
00644         return false;
00645       }
00646       
00647       ++it1;
00648       ++it2;
00649     }
00650   
00651     return true;
00652   } else {
00653     return false;
00654   }
00655 }

template<>
TL_DLL bool TeEquals ( const TePolygon redPol,
const TePolygon bluePol 
) [inline]

Definition at line 622 of file TeGeometryAlgorithms.cpp.

References TeGeometry::box(), TeGeomComposite< T >::size(), TeEQUALS, TeEquals(), and TeRelation().

00623 {
00624         if(TeEquals(redPol.box(), bluePol.box()))
00625         {
00626                 if(redPol.size() != bluePol.size())
00627                         return false;
00628 
00629                 return TeRelation(redPol, bluePol) == TeEQUALS;
00630         }
00631         else
00632                 return false;
00633 }

template<>
TL_DLL bool TeEquals ( const TeLine2D redLine,
const TeLine2D blueLine 
) [inline]

Definition at line 614 of file TeGeometryAlgorithms.cpp.

References TeGeometry::box(), TeEQUALS, TeEquals(), and TeRelation().

00615 {
00616         if(TeEquals(redLine.box(), blueLine.box()))
00617                 return TeRelation(redLine, blueLine, TeEQUALS) == TeEQUALS;
00618         else
00619                 return false;
00620 }

template<>
TL_DLL bool TeEquals ( const TePoint p1,
const TePoint p2 
) [inline]

Definition at line 609 of file TeGeometryAlgorithms.cpp.

References TeGeomSingle< T >::location(), and TeEquals().

00610 {
00611         return TeEquals(p1.location(), p2.location());
00612 }

template<>
TL_DLL bool TeEquals ( const TeCoord2D c1,
const TeCoord2D c2 
) [inline]

Definition at line 598 of file TeGeometryAlgorithms.cpp.

References TeGeometryAlgorithmsPrecision::IsDifferent(), TeCoord2D::x(), and TeCoord2D::y().

00599 {
00600         if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.x(), c2.x()))
00601                 return false;
00602 
00603         if(TeGeometryAlgorithmsPrecision::IsDifferent(c1.y(), c2.y()))
00604                 return false;
00605 
00606         return true;
00607 }

template<class T1, class T2>
bool TeEquals ( const T1 &  ,
const T2 &   
) [inline]

Definition at line 85 of file TeGeometryAlgorithms.h.

00086 {
00087         return false;
00088 }


Generated on Sun Jul 29 04:04:39 2012 for TerraLib - Development Source by  doxygen 1.5.3