| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

Classes | Typedefs | Functions
E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeGeometryAlgorithms.h File Reference

This file contains Algorithms for Topological Operations. More...

`#include "TeGeometry.h"`
`#include "TeMultiGeometry.h"`
`#include "TePrecision.h"`
`#include "TeProjection.h"`

Go to the source code of this file.

## Classes

class | TeGeometryAlgorithmsPrecision
| This class implements the Epsilon-tweaking used in calculus. More...

## Typedefs

typedef vector< TeCoord2D > | TeIntersCoordsVec
| Intersection coordinates of two segments.

## Functions

template<class T1 , class T2 >
bool | TeEquals (const T1 &, const T2 &)
| If a specialized function is not used, returns false.
template<>
TL_DLL bool | TeEquals (const TeCoord2D &c1, const TeCoord2D &c2)
| Check if coordinate 1 and coordinate 2 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 TeLine2D &redLine, const TeLine2D &blueLine)
| Check if lineRed and lineBlue 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 TePolygonSet &ps1, const TePolygonSet &ps2)
| Check if polygonset1 and polygonset1 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 TeCell &cell1, const TeCell &cell2)
| Check if cell 1 and cell 2 are equal.
template<class T1 , class T2 >
bool | TeDisjoint (const T1 &o1, const T2 &o2)
TL_DLL bool | TeDisjoint (const TeCoord2D &c1, const TeCoord2D &c2)
| Check if coordinate cl and coordinate c2 are disjoint.
TL_DLL bool | TeDisjoint (const TeCoord2D &c, const TeBox &b)
| Check if coordinate and box are disjoint.
TL_DLL bool | TeDisjoint (const TeBox &bx1, const TeBox &bx2)
| Check if box 1 and box 2 are disjoint.
TL_DLL bool | TeDisjoint (const TeCoord2D &c, const TeLine2D &l)
| Check if coordinate and line are disjoint.
TL_DLL bool | TeDisjoint (const TeCoord2D &c, const TePolygon &pol)
| Check if coordinate and polygon are disjoint.
TL_DLL bool | TeDisjoint (const TePoint &p1, const TePoint &p2)
| Check if point l and point 2 are disjoint.
TL_DLL bool | TeDisjoint (const TePoint &p, const TeLine2D &l)
| Check if point and object are disjoint.
TL_DLL bool | TeDisjoint (const TePoint &p, const TePolygon &pol)
| Check if point and object are disjoint.
TL_DLL bool | TeDisjoint (const TeLine2D &redLine, const TeLine2D &blueLine)
| Check if lines are disjoint.
TL_DLL bool | TeDisjoint (const TeLine2D &l, const TePolygon &pol)
| Check if line and polygon are disjoint.
TL_DLL bool | TeDisjoint (const TePolygon &redPol, const TePolygon &bluePol)
| Check if polygons are disjoint.
TL_DLL bool | TeDisjoint (const TeCell &cell1, const TeCell &cell2)
| Check if cell 1 and cell 2 are disjoint.
TL_DLL bool | TeDisjoint (const TeCell &cell, const TeLine2D &line)
| Check if cell and line are disjoint.
TL_DLL bool | TeDisjoint (const TeCell &cell, const TePolygon &pol)
| Check if cell and polygon are disjoint.
TL_DLL bool | TeDisjoint (const TeCell &cell, const TePoint &point)
| Check if cell and point are disjoint.
template<class T1 , class T2 >
bool | TeIntersects (const T1 &o1, const T2 &o2)
| If a specialized function is not used, returns the disjoint negation.
template<>
TL_DLL bool | TeIntersects (const TeCoord2D &c, const TeBox &b)
| Check if coordinate and box intersects.
template<>
TL_DLL bool | TeIntersects (const TePoint &p, const TeBox &b)
| Check if point and box intersects.
template<>
TL_DLL bool | TeIntersects (const TeBox &bx1, const TeBox &bx2)
| Check if boxes intersects.
TL_DLL bool | TeTouches (const TeCoord2D &c, const TeLine2D &l)
| Check if coordinate and line touches.
TL_DLL bool | TeTouches (const TeCoord2D &c, const TePolygon &pol)
| Check if coordinate and polygon touches.
TL_DLL bool | TeTouches (const TePoint &p, const TeLine2D &l)
| Check if point and object touches.
TL_DLL bool | TeTouches (const TePoint &p, const TePolygon &pol)
| Check if point and object touches.
TL_DLL bool | TeTouches (const TeLine2D &redLine, const TeLine2D &blueLine)
| Check if line and line touches.
TL_DLL bool | TeTouches (const TeLine2D &l, const TePolygon &pol)
| Check if line and polygon.
TL_DLL bool | TeTouches (const TePolygon &redPol, const TePolygon &bluePol)
| Check if polygons touches.
TL_DLL bool | TeTouches (const TeBox &bx1, const TeBox &bx2)
| Check if boxes touches.
TL_DLL bool | TeTouches (const TeCell &c1, const TeCell &c2)
| Check if cells touches.
TL_DLL bool | TeTouches (const TeLine2D &line, const TeCell &cell)
| Check if cell and line touches.
TL_DLL bool | TeTouches (const TeCell &c1, const TePolygon &poly)
| Check if cell and polygon touches.
TL_DLL bool | TeTouches (const TePoint &point, const TeCell &c1)
| Check if cell and point touches.
TL_DLL bool | TeCrosses (const TeLine2D &redLine, const TeLine2D &blueLine)
| Check if red line crosses blue line.
TL_DLL bool | TeCrosses (const TeLine2D &l, const TePolygon &pol)
| Check if line crosses polygon.
TL_DLL bool | TeCrosses (const TeLine2D &l, const TeCell &cell)
| Check if line and cell crosses.
TL_DLL bool | TeWithin (const TeCoord2D &c1, const TeCoord2D &c2)
| Check if coordinate 1 is within coordinate 2.
TL_DLL bool | TeWithin (const TeCoord2D &c, const TeBox &b)
| Check if coordinate is within a box.
TL_DLL bool | TeWithin (const TeCoord2D &c, const TeLine2D &l)
| Check if a cordinate is within a line.
TL_DLL bool | TeWithin (const TeCoord2D &c, const TePolygon &pol)
| Check if a cordinate is within a polygon.
TL_DLL bool | TeWithin (const TePoint &p1, const TePoint &p2)
| Check if point 1 is within point 2.
TL_DLL bool | TeWithin (const TePoint &p, const TeLine2D &l)
| Check if point is within object.
TL_DLL bool | TeWithin (const TePoint &p, const TePolygon &pol)
| Check if point is within object.
TL_DLL bool | TeWithin (const TeLine2D &redLine, const TeLine2D &blueLine)
| Check if red line is within blue line.
TL_DLL bool | TeWithin (const TeLine2D &l, const TePolygon &pol)
| Check if line is within polygon.
TL_DLL bool | TeWithin (const TePolygon &redPol, const TePolygon &bluePol)
| Check if red polygon is within blue polygon.
TL_DLL bool | TeWithin (const TeBox &bx1, const TeBox &bx2)
| Check if box1 is within box2.
TL_DLL bool | TeWithin (const TeCell &cell1, const TeCell &cell2)
| Check if cell1 is within cell2.
TL_DLL bool | TeWithin (const TeLine2D &line, const TeCell &cell)
| Check if line is within cell.
TL_DLL bool | TeWithin (const TeCell &cell, const TePolygon &poly)
| Check if cell is within polygon.
TL_DLL bool | TeWithin (const TePoint &point, const TeCell &cell)
| Check if point is within cell.
template<class T1 , class T2 >
bool | TeContains (const T1 &o1, const T2 &o2)
| If a specialized function is not used, returns false.
TL_DLL bool | TeOverlaps (const TeLine2D &redLine, const TeLine2D &blueLine)
| Check if red red overlaps blue line.
TL_DLL bool | TeOverlaps (const TePolygon &redPol, const TePolygon &bluePol)
| Check if red polygon overlaps blue polygon.
TL_DLL bool | TeOverlaps (const TeCell &cell1, const TeCell &cell2)
| Check if cell1 overlaps cell2.
TL_DLL bool | TeOverlaps (const TeCell &cell, const TePolygon &poly)
| Check if cell overlaps polygon.
TL_DLL bool | TeCoveredBy (const TeLine2D &redLine, const TeLine2D &blueLine)
| Check if red line is covered by blue line.
TL_DLL bool | TeCoveredBy (const TeLine2D &l, const TePolygon &pol)
| Check if line is covered by polygon.
TL_DLL bool | TeCoveredBy (const TePolygon &redPol, const TePolygon &bluePol)
| Check if red polygon is covered by blue polygon.
TL_DLL bool | TeCoveredBy (const TeCell &cell1, const TeCell &cell2)
| Check if cell1 is covered by cell2.
TL_DLL bool | TeCoveredBy (const TePolygon &poly, const TeCell &cell)
| Check if polygon is covered by cell.
TL_DLL bool | TeCoveredBy (const TeLine2D &line, const TeCell &cell)
| Check if line is covered by cell.
template<typename T1 , typename T2 >
bool | TeCovers (T1 &o1, T2 &o2)
| Check if one object covers another object.
TL_DLL short | TeRelation (const TeCoord2D &c, const TeLine2D &l)
| Returns the relation between coordinate c and line l.
TL_DLL short | TeRelation (const TeCoord2D &c, const TeLinearRing &r)
| Point in polygon inside/outside/boundary code.
TL_DLL short | TeRelation (const TeCoord2D &c, const TePolygon &pol)
| Coordinate in polygon inside/outside/boundary code.
TL_DLL short | TeRelation (const TePoint &p, const TePolygon &pol)
| Point in polygon inside/outside/boundary code.
TL_DLL short | TeRelation (const TeCoord2D &c, const TePolygonSet &pSet)
| Point in polygon set inside/outside/boundary code.
TL_DLL short | TeRelation (const TeLine2D &lRed, const TeLine2D &lBlue, const short &relation)
| This function returns the relation between two lines.
TL_DLL short | TeRelation (const TeLine2D &line, const TePolygon &pol)
| This function returns the relation between a line and a polygon.
TL_DLL short | TeRelation (const TePolygon &pRed, const TePolygon &pBlue)
| This function returns the relation between two polygons.
TL_DLL bool | TeDisjointOrTouches (const TeBox &bx1, const TeBox &bx2)
| Check if box1 is DISJOINT or TOUCHes box2.
TL_DLL bool | TeWithinOrTouches (const TeCoord2D &c, const TeCoord2D &c1, const TeCoord2D &c2)
| Check if coordinate c is WITHIN or TOUCHes segments c1 and c2.
template<class T1 , class T2 >
bool | TeWithinOrCoveredByOrEquals (const T1 &geom1, const T2 &geom2)
| Check if geom1 is WITHIN, COVERED BY or EQUAL to geom2.
template<>
TL_DLL bool | TeWithinOrCoveredByOrEquals (const TeBox &bx1, const TeBox &bx2)
| Check if box1 is WITHIN, COVERED BY or EQUAL to box2.
template<>
TL_DLL bool | TeWithinOrCoveredByOrEquals (const TeLine2D &line1, const TeLine2D &line2)
| Check if line1 is WITHIN, COVERED BY or EQUAL to line2.
template<>
TL_DLL bool | TeWithinOrCoveredByOrEquals (const TeLine2D &line1, const TePolygon &pol)
| Check if line1 is WITHIN or COVERED BY to pol.
template<>
TL_DLL bool | TeWithinOrCoveredByOrEquals (const TePolygon &pol1, const TePolygon &pol2)
| Check if pol1 is WITHIN, COVERED BY or EQUAL to pol2.
TL_DLL bool | TeIntersection (const TeBox &bx1, const TeBox &bx2, TeBox &bout)
| Performs the intersection between box b1 and b2, returning the resulting box bout.
TL_DLL TeCoordPairVect | TeGetIntersections (const TePolygon &poly, const double &y)
| Returns the segments that intersept the poly polygon in the line y.
TL_DLL TeBox | TeUnion (const TeBox &bx1, const TeBox &bx2)
| Combine two box, make one that includes both.
TL_DLL bool | TePointInPoly (const TeCoord2D &c, const TeLinearRing &r)
| Point in polygon inside/outside/boundary code.
TL_DLL bool | TeIsOnSegment (const TeCoord2D &c, const TeCoord2D &c1, const TeCoord2D &c2)
| Check if coordinate c is on segment (segment is closed).
TL_DLL bool | TeIsOnLine (const TeCoord2D &c, const TeLine2D &l)
| Check if coordinate c is on line boundary or on line interior (see explanation above for definition of boundary and interior of a line).
TL_DLL bool | TeLocateLineSegment (TeCoord2D &pin, TeLine2D &line, int &segment, double tol=0.0)
| Locate the nearest line segment of a coordinate.
TL_DLL void | removeDuplicatedCoords (vector< TeCoord2D > &coordSet)
| If we have the two end point equals, so we remove it.
TL_DLL TePolygon | TeConvexHull (std::vector< TeCoord2D > &coordSet)
| This is a explicit specialization that returns the convex hull of a TeCoord2D set.
TL_DLL TePolygon | TeConvexHull (const TePolygon &p)
| This is a explicit specialization that returns the convex hull of a TePolygon.
TL_DLL TePolygon | TeConvexHull (const TePolygonSet &ps)
| This is a explicit specialization that returns the convex hull of a TePolygonSet.
TL_DLL TePolygon | TeConvexHull (const TePointSet &ps)
| This is a explicit specialization that returns the convex hull of a TePointSet. Must be defined!
template<class T >
TePolygon | TeConvexHull (const T &coordSet)
| Returns the convexhull of a given list of coords in counterclockwise.
TL_DLL double | TeGetPrecision (TeProjection *proj)
| Given a projection "proj" returns a tolerance value in the same unit of projection to be used in geometric operations.
void | TeRemoveDuplicatedCoordinates (TeLine2D &l)
| Removes the duplicate coordinates of a line.
void | TeRemoveDuplicatedCoordinates (TePolygon &p)
| Removes the duplicate coordinates of a polygon.
void | TeReverseLine (TeLine2D &lin)
| Reverses the orientation of a line.
TL_DLL bool | TeIsConvex (const TeLinearRing &ring)
| Verifies if a simple polygon defined as a linear ring is convex or not.
TL_DLL short | TeOrientation (const TeLinearRing &r)
| Returns the orientation of the ring (CLOCKWISE or COUNTERCLOCKWISE);.
TL_DLL void | TeGetMiddlePoint (const TeCoord2D &first, const TeCoord2D &last, TeCoord2D &middle)
| Returns the middle point of a segment.
TL_DLL double | TeDistance (const TeCoord2D &c1, const TeCoord2D &c2)
| Calculates the Euclidian distance between two points.
TL_DLL double | TeLength (const TeLine2D &l)
| Returns the length of a Line 2D.
TL_DLL double | TePerpendicularDistance (const TeCoord2D &first, const TeCoord2D &last, const TeCoord2D &pin, TeCoord2D &pinter)
| Perpendicular distance from point to segment.
TL_DLL double | TeMinimumDistance (const TeCoord2D &first, const TeCoord2D &last, const TeCoord2D &pin, TeCoord2D &pout, double tol=0.0)
| Minimal distance from point to segment.
template<class T >
double | TeGeometryArea (const T &)
| Template class to compute the area of a geometry.
template<>
TL_DLL double | TeGeometryArea (const TePolygon &p)
| This is a explicit specialization that returns the area of a TePolygon.
template<>
TL_DLL double | TeGeometryArea (const TePolygonSet &ps)
| This is a explicit specialization that returns the area of a TePolygonSet.
template<>
TL_DLL double | TeGeometryArea (const TeBox &b)
| This is a explicit specialization that returns the area of a Box.
template<>
TL_DLL double | TeGeometryArea (const TeMultiGeometry &mGeom)
| This is a explicit specialization that returns the area of a Box.
TL_DLL TePolygon | TeMakePolygon (const TeBox &b)
| Given a box return its polygon representation.
TL_DLL TeLinearRing | TeSimpleClosedPath (const TePointSet &pSet)
| Given N points, finds a path that doesn't self-intersects.
TL_DLL TeCoord2D | TeFindCentroid (TeMultiGeometry &mGeom)
| Calculates the centroid of a multi geometry.
TL_DLL TeCoord2D | TeFindCentroid (const TePolygon &p)
| Calculates the centroid of a polygon.
TL_DLL TeCoord2D | TeFindCentroid (const TeLine2D &l)
| Calculates a reference point.
TL_DLL TeCoord2D | TeFindCentroid (const TeCell &c)
| Calculates the centroid of a cell.
TL_DLL TeCoord2D | TeFindCentroid (const TePoint &p)
| Calculates the centroid of a point.
TL_DLL TeCoord2D | TeFindCentroid (const TeText &t)
| Calculates the centroid of a text.
TL_DLL TeCoord2D | TeFindCentroid (const TePolygonSet &s)
| Calculates the centroid of a polygon set.
TL_DLL TeCoord2D | TeFindCentroid (const TeLineSet &s)
TL_DLL TeCoord2D | TeFindCentroid (const TeCellSet &s)
| Calculates the centroid of a cell set.
TL_DLL TeCoord2D | TeFindCentroid (TePointSet &ps)
| Calculates the centroid of a point set.
TL_DLL TeCoord2D | TeFindCentroid (TeTextSet &ts)
| Calculates the centroid of a text set.
TL_DLL bool | TeFindTriangleCenter (const TeCoord2D &vert0, const TeCoord2D &vert1, const TeCoord2D &vert2, TeCoord2D &pc)
| Calculates the center of a triangle.
TL_DLL bool | TeSegmentsIntersectPoint (const TeCoord2D &fr0, const TeCoord2D &to0, const TeCoord2D &fr1, const TeCoord2D &t1, TeCoord2D &pi)
| Calculates intersection between two segments.
TL_DLL bool | TeNearest (TeCoord2D &pt, TeNodeSet &ns, int &i, const double &tol=0.0)
| Nearest node in set from location pt (i = the node index in the nodeset)
TL_DLL bool | TeNearest (TeCoord2D &pt, TePointSet &ps, int &i, const double &tol=0.0)
| Nearest point in set from location pt (i = the point index in the pointset)
TL_DLL bool | TeNearest (TeCoord2D &pt, TeTextSet &ts, int &i, const double &tol=0.0)
| Nearest text in set from location pt (i = the text index in the textset)
TL_DLL bool | TeNearest (TeCoord2D &pt, TeLineSet &ls, int &i, TeCoord2D &pi, const double &tol=0.0)
TL_DLL bool | TeNearest (TeCoord2D &pt, TeLineSet &ls, int &lindex, TeCoord2D &pout, double &dmin, const double &tol=0.0)
TL_DLL bool | TeNearest (TeCoord2D &pt, TePolygonSet &ps, int &i, const double &tol=0.0)
| Nearest polygon in set from location pt (i = the polygon index in the polygonset).
TL_DLL bool | TeNearestByPoints (TeCoord2D &pt, TeLineSet &ls, int &i, double &dist, const double &tol=0.0)
| Nearest line in set from location pt (i = the line index in lineset) calculated by the vertex of the lines.
TL_DLL bool | TeGetCenter (TePoint p1, TePoint p2, TePoint p3, TePoint &center)
| Given three points of a circunference, returns its center point.
TL_DLL double | TeGetRadius (TePoint &p1, TePoint &p2, TePoint &p3)
| Given three points of a circunference, returns the radius.
TL_DLL bool | TeGenerateArc (TePoint &p1, TePoint &p2, TePoint &p3, TeLine2D &arcOut, const short &NPoints)
| Given three points returns a smooth arc as a TeLine2D that contains a given total number of points.
TL_DLL bool | TeGenerateCircle (const TePoint &center, const double &radius, TeLine2D &circle, const short &NPoints)
| Given a center point and a radius, returns the circle as a TeLine2D interpolated by a given number of points.
TL_DLL bool | TeLineSimplify (TeLine2D &line, double snap, double maxdist)
| Performs a line simplication.
TL_DLL bool | TeAdjustSegment (TeCoord2D P0, TeCoord2D P1, double d0, TeCoord2D &P0out, TeCoord2D &P1out)
| Adjust Segment to specific distance.
TL_DLL bool | TeFindCentroid (const TeLine2D &line, TeCoord2D &p)
| Get middle line Method like find Centroid but this method calculate the correct middle point.

## Detailed Description

This file contains Algorithms for Topological Operations.

Author:
  Gilberto Ribeiro de Queiroz <gribeiro@dpi.inpe.br>

## Typedef Documentation

typedef vector<TeCoord2D> TeIntersCoordsVec

Intersection coordinates of two segments.

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines