TerraLib 4.1
Mathematical constants and macro definitions

## Classes

class  TeTinVertex
A basic class for handling vertex of TIN. More...
class  TeTinVertexSet
A basic class for handling a std::set of TeTinVertex. More...
class  TeTinEdge
A basic class for handling edges of a TIN. More...
class  TeTinEdgeSet
A basic class for handling a std::set of TeTinEdge. More...
class  TeTinTriangle
TeTinTriangle: A class for handling a TIN triangle. More...
class  TeTinTriangleSet
TeTinTriangle: A class for handling a std::set of TIN triangles. More...
class  TeTin
A class to handle a TIN. More...

## Defines

#define MAX(a, b)   ( (a>b) ? a : b )
Macro that returns max between two values.
#define MIN(a, b)   ( (a<b) ? a : b )
Macro that returns min between two values.
#define ABS(x)   ( ((x) >= 0) ? (x) : -(x) )
Macro that returns the absolute value.

## Typedefs

typedef TeTinVertexSet::iterator TeTin::TeTinVertexIterator
typedef TeTinEdgeSet::iterator TeTin::TeTinEdgeIterator
typedef TeTinTriangleSet::iterator TeTin::TeTinTriangleIterator

## Enumerations

enum  TeTinVertexType {
DELETEDVERTEX = -1, NORMALVERTEX = 0, ONCONTOURVERTEX = 1, ONBOXVERTEX = 2,
ONBREAKLINEVERTEX = 3, CONTOURFIRSTVERTEX = 4, CONTOURLASTVERTEX = 5, BREAKLINEFIRSTVERTEX = 6,
BREAKLINELASTVERTEX = 7
}
Tin Vertex types. More...
enum  TeTinEdgeType { DELETEDEDGE = -1, NORMALEDGE = 0, ONCONTOUREDGE = 1, ONBREAKLINEEDGE = 2 }
Tin Edges type. More...

## Functions

TeTinVertex::TeTinVertex (TeCoord2D xy, double value, TeTinVertexType type, long edge)
Constructor with parameters.
bool TeTinVertex::operator== (const TeTinVertex &other) const
Returns TRUE if a TeTinVertex is equal to other.
long TeTinVertex::oneEdge ()
void TeTinVertex::setOneEdge (long oneEdge)
TeTinVertexType TeTinVertex::type ()
void TeTinVertex::setType (TeTinVertexType type)
void TeTinVertex::value (double value)
double TeTinVertex::value ()
Return the value associated to the measure.
TeGeomRep TeTinVertex::elemType ()
TeGeomRep TeTinVertexSet::elemType ()
TeTinEdge::TeTinEdge (long from, long to, long left, long right, TeTinEdgeType type)
bool TeTinEdge::operator== (const TeTinEdge &other) const
Returns TRUE if a TeTinEdge is equal to other.
long TeTinEdge::from ()
long TeTinEdge::to ()
void TeTinEdge::setVertices (long from, long to)
void TeTinEdge::swapVertices ()
long TeTinEdge::left ()
long TeTinEdge::right ()
void TeTinEdge::setTriangles (long left, long right)
void TeTinEdge::swapTriangles ()
void TeTinEdge::exchangeTriangle (long t1, long t2)
void TeTinEdge::exchangeVertex (long v1, long v2)
TeTinEdgeType TeTinEdge::type ()
void TeTinEdge::setType (TeTinEdgeType type)
TeGeomRep TeTinEdge::elemType ()
TeGeomRep TeTinEdgeSet::elemType ()
TeTinTriangle::TeTinTriangle (long first, long second, long third)
bool TeTinTriangle::operator== (const TeTinTriangle &other) const
Returns TRUE if a TeTinTriangle is equal to other.
void TeTinTriangle::setEdges (long first, long second, long third)
void TeTinTriangle::edges (long &first, long &second, long &third)
Return triangle edges ids.
long TeTinTriangle::edgeAt (short num)
TeGeomRep TeTinTriangle::elemType ()
TeGeomRep TeTinTriangleSet::elemType ()
TeTin::TeTin (TeBox &)
void TeTin::clear ()
TeBox TeTin::box ()
bool TeTin::createInitialTriangles (TeBox &box)
bool TeTin::insertLineSamples (TeContourLine &line)
bool TeTin::getLines (TeLineSet &lineSet)
bool TeTin::isEmpty ()
TeTinEdgeTeTin::edge (long i)
TeTinVertexTeTin::vertex (long i)
TeTinTriangleTeTin::triangle (long i)
TeTinVertexIterator TeTin::vertexBegin ()
TeTinVertexIterator TeTin::vertexEnd ()
TeTinEdgeIterator TeTin::edgeBegin ()
TeTinEdgeIterator TeTin::edgeEnd ()
TeTinTriangleIterator TeTin::triangleBegin ()
TeTinTriangleIterator TeTin::triangleEnd ()
bool TeTin::triangleContainsPoint (TeTinTriangle &t, TeCoord2D &pt)
bool TeTin::triangleContainsPoint (long t, TeCoord2D &pt)
long TeTin::edgeWithVertexDiffFromEdge (long t, long v, long e)
long TeTin::oneTriangleWithVertex (long vertex)
long TeTin::oneEdgeWithVertex (long vertex)
long TeTin::edgeOppVertex (TeTinTriangle &triangle, long vertex)
long TeTin::edgeOppVertex (long triangle, long vertex)
long TeTin::vertexOppEdge (long triangle, long edge)
bool TeTin::vertexEdges (long vertex, std::list< long > &edges)
bool TeTin::vertexOppEdges (long vertex, std::list< long > &edges)
bool TeTin::vertexOppEdges (long v, std::list< long > &triset, std::list< long > &edges)
bool TeTin::vertexOppVertices (long vertex, std::list< long > &vertices)
bool TeTin::vertexSecondNeighVertices (long v, list< long > &vertices)
bool TeTin::vertexTriangles (long vertex, std::list< long > &triangles)
bool TeTin::triangle3Neighbors (long t, long &neighbor0, long &neighbor1, long &neighbor2)
long TeTin::triangleAt (TeCoord2D &pt)
long TeTin::triangleAt (TeBox boxPt)
bool TeTin::triangleVertices (TeTinTriangle &t, long &vertex0, long &vertex1, long &vertex2)
bool TeTin::triangleVertices (long t, long &vertex0, long &vertex1, long &vertex2)
long TeTin::triangleVertexAt (long t, long vertex)
bool TeTin::triangle3DPoints (TeTinTriangle &t, TeCoord2D &pt0, TeCoord2D &pt1, TeCoord2D &pt2, double &val0, double &val1, double &val2)
bool TeTin::triangle3DPoints (long t, TeCoord2D &pt0, TeCoord2D &pt1, TeCoord2D &pt2, double &val0, double &val1, double &val2)
bool TeTin::trianglePoints (TeTinTriangle &t, TeCoord2D &pt0, TeCoord2D &pt1, TeCoord2D &pt2)
bool TeTin::trianglePoints (long t, TeCoord2D &pt0, TeCoord2D &pt1, TeCoord2D &pt2)
bool TeTin::twoNewTriangles (long t, long v, std::set< long > &triangles)
long TeTin::duplicateTriangle (long t, long n, long v, std::set< long > &triangles)
bool TeTin::dupNeighTriangle (long t, long e, long v, std::set< long > &triangles)
void TeTin::testDelaunayForVertex (long v, std::set< long > &triangles)
bool TeTin::testDelaunayAt (long t, long v, std::set< long > &triangles)
bool TeTin::testDelaunay (long e)
bool TeTin::testDelaunay (long t, long v)
bool TeTin::testDelaunay (long t1, long t2, long t3)
bool TeTin::testDelaunay (long t1, long t2, long t3, long t4)
bool TeTin::createDelaunay ()
bool TeTin::generateDelaunay (long nt, long ntbase, long &contr)
void TeTin::vertexExchange (long oldVertex, long newVertex)
long TeTin::oppositeVertex (long t, long e)
Method used to read the identification number of the opposite vertex of a given edge.
bool TeTin::createSmallerAngleTriangulation ()
Creates a triangulation using the Smaller Angle method.
bool TeTin::testSmallerAngleAt (long t, long v)
Test the angle between two normals.
bool TeTin::createIsolinesTriangulation ()
Test isolines.
bool TeTin::swapEdges (long t, long tv, long ai)
bool TeTin::insertPoint (TeSample &xyz)
bool TeTin::insertPoint (double x, double y, double value)
bool TeTin::edgesInterBySegment (TeCoord2D &pf, TeCoord2D &pn, std::list< long > &aiset, std::list< long > &viset)
bool TeTin::insertSegment (TeCoord2D &pf, TeCoord2D &pn)
void TeTin::convexize ()
bool TeTin::isEdgeTriangle (long t)
int TeTin::sizeTriangles ()
int TeTin::sizeVertex ()
TeGeomRep TeTin::elemType ()
bool TeTin::createTIN (TeSampleSet &sampleSet, TeContourLineSet &contourSet)
Creates TIN.
bool TeTin::createTIN (TeLayer *inputLayer_ptr, TePolygonSet &ps)
Creates TIN.
bool TeTin::createTIN (TeLayer *inputLayer_ptr)
Creates TIN from point's layer.
bool TeTin::createAttrTable (TeTable &attTable, TeDatabase *db, TeLayer *layer)
Creates a attributes table.
bool TeTin::createPolygon (TePolygonSet ps, TeTable &attTable, int t, TeCoord2D &pt0, TeCoord2D &pt1, TeCoord2D &pt2, double &val0, double &val1, double &val2)
Creates polygons with points of triangles.
bool TeTin::createPolygon (TePolygonSet ps, TeTable &attTable, int t, TeCoord2D &pt0, TeCoord2D &pt1, TeCoord2D &pt2, double &val0, double &val1, double &val2, double &slope, double &aspect)
Creates polygons with points of triangles.
bool TeTin::createPolygon (TePolygonSet ps, TeTable &attTable, int t, TeTinVertex vert0, TeTinVertex vert1, TeTinVertex vert2, double &slope, double &aspect)
bool TeTin::saveTIN (TeDatabase *db, TeLayer *layer, TePolygonSet &ps, TeTable &attTable)
Add polygons in the layer and save attributes table in the database.
bool TeTin::saveVertexTIN (TeDatabase *db, TeLayer *layer, TePointSet &ps, TeTable &attTable)
Add points in the layer and save attributes table in the database.
bool TeTin::saveTINdb (TeDatabase *db, string &outLayerName, string &tablename)
Saves TIN in the database.
TeLayerTeTin::saveTINdb (TeDatabase *db, TeProjection *proj, string &outLayerName, string &tablename)
Saves TIN in the database.
bool TeTin::saveVertexTINdb (TeDatabase *db, string &outLayerName, string &tablename)
Saves vertex of TIN in the database.
bool TeTin::borderUp ()
Deletes vertex ONBOXVERTEX and re-triangular TIN.
void TeTin::writeTriangleEdgesSPRFile (std::string &name, TeRaster *raster)
Saves TIN in SPRING file format.
void TeTin::areaTriangle (TeTinTriangle &t, float &area)
Calculates the area of triangle.
void TeTin::slopeTriangle (TeTinTriangle &t, double &slope, char slopetype)
Calculates the slope of triangle.
void TeTin::aspectTriangle (TeTinTriangle &t, double &aspect)
Calculates the aspect of triangle.
Method that calculates gradient values for a TIN.
bool TeTin::createPointSet (TePointSet &ps, TeTable &atttable, TeLayer *layer, TeDatabase *db)
Creates a PointSet object with vertex of TIN.
bool TeTin::createSampleSet (TeSampleSet &sample)
Creates a sample object with vertex of TIN.
bool TeTin::normalTriangle (TeTinTriangle &t, std::vector< double > &nvector)
Calculates the normal.
bool TeTin::normalTriangle (std::vector< TeTinVertex > vert, double *nvector)
void TeTin::normalizeVector (std::vector< double > &nvector)
Function that normalize a vector by its size.
void TeTin::normalizeVector (double *nvector)
bool TeTin::defineInterLinesColumns (TeRaster *raster, TeTinTriangle t, int &fline, int &lline, int &fcol, int &lcol)
Calculates the lines and the columns intercepted by a triangle (Used to image)
void TeTin::linearInterpolation (TeRaster *raster, int band, TeTinTriangle t, int fline, int lline, int fcol, int lcol)
Fills the grid locations, inside a triangle, with a zvalue linearly evaluated (Used to image)
bool TeTin::linearInterpolation (TeRaster *&grid)
Fills the grid locations, inside triangles, with a zvalue linearly evaluated (Used to grid)
bool TeTin::quinticInterpolation (TeRaster *&grid, int interpolator)
bool TeTin::interpolationPoint (TeCoord2D &pt, double &z)
This function interpolates the average weighted by the inverse of the distance.
bool TeTin::slopeaspectPoint (TeCoord2D &pt, double &s, double &a)
Calculates the slope and orientation on the point.
bool TeTin::vertexOncontour (long &v)
void TeTin::setTolerances (double minedgesize=0, double isoTol=-1, double ptsdist=-1, double breaklineTol=-1)
Set triangulation tolerances.
double TeTin::pointToSegmentDistance (TeCoord2D fseg, TeCoord2D lseg, TeCoord2D pt, TeCoord2D &pti)
Calculates the distance between a point and a segment.
bool TeTin::insertBreaklines (TeLineSet &breaklineSet, double scale)
Insert breaklines in the triangulation.
void TeTin::copyBreaklines (TeLineSet &breaklines)
Method that perform a copy of breaklines.
bool TeTin::insertBreaklinesPoints (TeLineSet breaklines, double scale)
Insert break vertex in the triangulation.
bool TeTin::vertexClosestPoints (long v, std::vector< long > &clstVert)
Method that search the closest points of a specific vertex.
bool TeTin::breakVertexClosestPoints (long v, std::vector< long > &rclstVert, std::vector< long > &lclstVert)
Method that searches the break vertex closest points.
void TeTin::vertexDerivatives ()
Calculate the first and second derivatives in the vertex of a given triangle.
void TeTin::triangleFirstDeriv ()
Calculate first derivative on triangles.
void TeTin::vertexFirstDeriv ()
Calculate first derivative on vertex.
void TeTin::triangleSecondDeriv ()
Calculate second derivative on triangles.
void TeTin::vertexSecondDeriv ()
Calculate second derivative on vertex.
void TeTin::breakVertexFirstDeriv ()
Calculate the first derivative in the vertex of a given break triangle.
void TeTin::breakTriangleSecondDeriv ()
Calculate the second derivative in the vertex of a given break triangle.
void TeTin::breakVertexSecondDeriv ()
Calculates the second derivative at all triangulation break vertex.
void TeTin::calcVertexFirstDeriv (long v, std::vector< long > clstVertex, TeTinVertex &deriv)
Calculates the first derivative in a given vertex.
void TeTin::calcVertexSecondDeriv (long v, std::vector< long > clstVertex, TeTinVertex &deriv)
Calculates the second derivative in a given vertex.
void TeTin::calcTriangleSecondDeriv (long v, std::list< long > triangles, TeTinVertexSet &fderiv)
Calculates the second derivatives in a vertex of a given triangle.
bool TeTin::findInterPoints (TeCoord2D &pf, TeCoord2D &pn, TeTinVertexSet &pts)
Search the point that intersects two triangles containing points pf and pn.
void TeTin::vertexTriangles (long v, std::list< long > &rtri, std::list< long > &ltri)
Finds the triangle list sharing a given node.
void TeTin::calcZvalueAkima (long t, TeTinVertex &v1, TeTinVertex &v2)
Method that evaluate Z values for pt1 and pt2 using the Akima polynomium fitted in a triangle.
void TeTin::defineAkimaCoeficients (long t, double *coef)
void TeTin::defineAkimaCoeficients (long t, TeTinVertexSet vertSet, double *coef)
Define the coefficients of the Akima polynomium fitted in a given triangle.
bool TeTin::checkTopology ()
Method that check the topology in a triangulation.
void TeTin::checkEdges (long t)
Method that check the edges in a triangulation.
void TeTin::orderEdges ()
Order edges.
long TeTin::findEdge (long v1, long v2)
Finds a edge given two vertex identification.
bool TeTin::onIsolineSegment (long e, TeTinVertex &vert)
Method that checks if a vertex is on the isoline segment.
bool TeTin::onSegment (TeCoord2D pt, TeCoord2D fseg, TeCoord2D lseg, double tol)
Method that checks if a point pt is on a segment.
bool TeTin::isIsolineSegment (long e)
Method that veryfies if the Isoline is a segment.
bool TeTin::isBreaklineSegment (long e)
Method that veryfies if the Breakline is a segment.
void TeTin::writeTriangleSPRFile (std::string nameVert, std::string nameEdge, std::string nameTriang)
bool TeTin::loadTIN (TeLayer *layer, TeDatabase *db)
Load triangles from an input layer with TePOLYGONS representation.
void TeTin::point3dListFilter (TeTinVertexSet vertSet, double tol)
bool TeTin::leastSquareFitting (double *vectx, double *vecty, int np, int degree, double *coef)
Method that performs a least square fitting in a set of points.
bool TeTin::gaussElimination (int nvars, int neqs, double **matrix)
Method used to solve a system of linear equation throught the Gauss elimination method.
bool TeTin::isNeighborOnIsoOrBreakline (long t, long nviz)
Method that veryfies if the neighbour is on an Isoline or on a Breakline.
void TeTin::generateContour (double contour, TeContourLine *&ptline)
Method to generate contour from a TIN.
bool TeTin::defineInterTriangle (TeContourLine *&ptline, TeTinVertex *vert)
Method used to define the intersections between an isoline and a triangle.
bool TeTin::defineInterEdge (TeContourLine *&ptline, TeTinVertex fpt, TeTinVertex spt)
Method used to define the intersection with an edge of a triangle.
long TeTin::onSameSide (TeCoord2D pt1, TeCoord2D pt2, TeCoord2D fseg, TeCoord2D lseg)
string TeTin::errorMessage ()
Returns the error message.

## Variables

const int TeNAME_LENGTH = 2000
A default name length.
const double TeMAXFLOAT = 3.4E37
Maximum float value.
const double TeMINFLOAT = 3.4E-37
Minimum float value.
const double TePI = 3.14159265358979323846
The ratio of the circumference to the diameter of a circle.
const double TeCDR = 0.01745329251994329576
const double TeCRD = 57.29577951308232087679
Int. Astronomical Union - 1965.
const double TeTinBIGFLOAT = TeMAXFLOAT / 10.
Near Maximum float value - TeMAXFLOAT / 10.

## Define Documentation

 #define ABS ( x ) ( ((x) >= 0) ? (x) : -(x) )

Macro that returns the absolute value.

 #define MAX ( a, b ) ( (a>b) ? a : b )

Macro that returns max between two values.

 #define MIN ( a, b ) ( (a

Macro that returns min between two values.

## Enumeration Type Documentation

 enum TeTinEdgeType

Tin Edges type.

Enumerator:
 DELETEDEDGE NORMALEDGE ONCONTOUREDGE ONBREAKLINEEDGE
 enum TeTinVertexType

Tin Vertex types.

Enumerator:
 DELETEDVERTEX NORMALVERTEX ONCONTOURVERTEX ONBOXVERTEX ONBREAKLINEVERTEX CONTOURFIRSTVERTEX CONTOURLASTVERTEX BREAKLINEFIRSTVERTEX BREAKLINELASTVERTEX

## Function Documentation

 void TeTin::areaTriangle ( TeTinTriangle & t, float & area )

Calculates the area of triangle.

Parameters:
 t TeTinTriangle object area area of triangle
 void TeTin::aspectTriangle ( TeTinTriangle & t, double & aspect )

Calculates the aspect of triangle.

Parameters:
 t TeTinTriangle object aspect aspect of triangle
 bool TeTin::borderUp ( )

Deletes vertex ONBOXVERTEX and re-triangular TIN.

 TeBox TeTin::box ( ) ` [inline]`
 void TeTin::breakTriangleSecondDeriv ( )

Calculate the second derivative in the vertex of a given break triangle.

 bool TeTin::breakVertexClosestPoints ( long v, std::vector< long > & rclstVert, std::vector< long > & lclstVert )

Method that searches the break vertex closest points.

Parameters:
 v vertex identification rclstVert vector of right vertex lclstVert vector of left vertex
 void TeTin::breakVertexFirstDeriv ( )

Calculate the first derivative in the vertex of a given break triangle.

 void TeTin::breakVertexSecondDeriv ( )

Calculates the second derivative at all triangulation break vertex.

 void TeTin::calcTriangleSecondDeriv ( long v, std::list< long > triangles, TeTinVertexSet & fderiv )

Calculates the second derivatives in a vertex of a given triangle.

Parameters:
 v vertex identification triangles list of triangles identification
Returns:
fderiv second derivative in x and y direction

Method that calculates gradient values for a TIN.

Parameters:
 grid pointer to output grid gradtype type of gradient (slope or aspect) slopetype type os slope (degree or percent)
 void TeTin::calcVertexFirstDeriv ( long v, std::vector< long > clstVertex, TeTinVertex & deriv )

Calculates the first derivative in a given vertex.

Parameters:
 v vertex identification clstVertex vector of a list of vertex
Returns:
deriv first derivative in x and y directions
 void TeTin::calcVertexSecondDeriv ( long v, std::vector< long > clstVertex, TeTinVertex & deriv )

Calculates the second derivative in a given vertex.

Parameters:
 v vertex identification clstVertex vector of a list of vertex
Returns:
deriv second derivative in x and y direction
 void TeTin::calcZvalueAkima ( long t, TeTinVertex & v1, TeTinVertex & v2 )

Method that evaluate Z values for pt1 and pt2 using the Akima polynomium fitted in a triangle.

Parameters:
 t triangle identification number v1 v2
 void TeTin::checkEdges ( long t )

Method that check the edges in a triangulation.

Parameters:
 t triangle
 bool TeTin::checkTopology ( )

Method that check the topology in a triangulation.

 void TeTin::clear ( void ) ` [inline]`
 void TeTin::convexize ( )
 void TeTin::copyBreaklines ( TeLineSet & breaklines )

Method that perform a copy of breaklines.

Parameters:
 breaklines break lines
 bool TeTin::createAttrTable ( TeTable & attTable, TeDatabase * db, TeLayer * layer )

Creates a attributes table.

Parameters:
 attTable attributes table db current database layer layer
 bool TeTin::createDelaunay ( )
 bool TeTin::createInitialTriangles ( TeBox & box )
 bool TeTin::createIsolinesTriangulation ( )

Test isolines.

 bool TeTin::createPointSet ( TePointSet & ps, TeTable & atttable, TeLayer * layer, TeDatabase * db )

Creates a PointSet object with vertex of TIN.

Parameters:
 ps PointSet object atttable attributes table layer layer db current database
 bool TeTin::createPolygon ( TePolygonSet ps, TeTable & attTable, int t, TeCoord2D & pt0, TeCoord2D & pt1, TeCoord2D & pt2, double & val0, double & val1, double & val2 )

Creates polygons with points of triangles.

Parameters:
 ps PolygonSet attTable attributes table t triangle's number pt0 triangle's point 0 pt1 triangle's point 1 pt2 triangle's point 2 val0 point's 0 value val1 point's 1 value val2 point's 2 value
 bool TeTin::createPolygon ( TePolygonSet ps, TeTable & attTable, int t, TeCoord2D & pt0, TeCoord2D & pt1, TeCoord2D & pt2, double & val0, double & val1, double & val2, double & slope, double & aspect )

Creates polygons with points of triangles.

Parameters:
 ps PolygonSet attTable attributes table t triangle's number pt0 triangle's point 0 pt1 triangle's point 1 pt2 triangle's point 2 val0 point's 0 value val1 point's 1 value val2 point's 2 value slope slope's value of triangle
 bool TeTin::createPolygon ( TePolygonSet ps, TeTable & attTable, int t, TeTinVertex vert0, TeTinVertex vert1, TeTinVertex vert2, double & slope, double & aspect )
 bool TeTin::createSampleSet ( TeSampleSet & sample )

Creates a sample object with vertex of TIN.

Parameters:
 sample SampleSet object
 bool TeTin::createSmallerAngleTriangulation ( )

Creates a triangulation using the Smaller Angle method.

 bool TeTin::createTIN ( TeLayer * inputLayer_ptr, TePolygonSet & ps )

Creates TIN.

Parameters:
 inputLayer_ptr layer ps PolygonSet

Used to store the attribute's values

Used to store the attribute's objects ID

Containers used to store the attributes values and objects ID

 bool TeTin::createTIN ( TeLayer * inputLayer_ptr )

Creates TIN from point's layer.

Parameters:
 inputLayer_ptr layer
 bool TeTin::createTIN ( TeSampleSet & sampleSet, TeContourLineSet & contourSet )

Creates TIN.

Parameters:
 sampleSet SampleSet contourSet ContourLineSet
 void TeTin::defineAkimaCoeficients ( long t, double * coef )
 void TeTin::defineAkimaCoeficients ( long t, TeTinVertexSet vertSet, double * coef )

Define the coefficients of the Akima polynomium fitted in a given triangle.

Parameters:
 t triangle coef pointer to a double vector containing the polynomium coefficients
 bool TeTin::defineInterEdge ( TeContourLine *& ptline, TeTinVertex fpt, TeTinVertex spt )

Method used to define the intersection with an edge of a triangle.

Parameters:
 ptline contour line fpt first point of the edge spt second point of the edge
 bool TeTin::defineInterLinesColumns ( TeRaster * raster, TeTinTriangle t, int & fline, int & lline, int & fcol, int & lcol )

Calculates the lines and the columns intercepted by a triangle (Used to image)

Parameters:
 raster pointer to a raster t current triangle fline first line of the raster lline last line of the raster fcol first column of the raster lcol last column of the raster
 bool TeTin::defineInterTriangle ( TeContourLine *& ptline, TeTinVertex * vert )

Method used to define the intersections between an isoline and a triangle.

 long TeTin::duplicateTriangle ( long t, long n, long v, std::set< long > & triangles )
 bool TeTin::dupNeighTriangle ( long t, long e, long v, std::set< long > & triangles )
 TeTinEdge& TeTin::edge ( long i ) ` [inline]`
 long TeTinTriangle::edgeAt ( short num ) ` [inline]`
 TeTinEdgeIterator TeTin::edgeBegin ( ) ` [inline]`
 TeTinEdgeIterator TeTin::edgeEnd ( ) ` [inline]`
 long TeTin::edgeOppVertex ( TeTinTriangle & triangle, long vertex )
 long TeTin::edgeOppVertex ( long triangle, long vertex ) ` [inline]`
 void TeTinTriangle::edges ( long & first, long & second, long & third ) ` [inline]`

Return triangle edges ids.

Parameters:
 first first edge second second edge third third edge
 bool TeTin::edgesInterBySegment ( TeCoord2D & pf, TeCoord2D & pn, std::list< long > & aiset, std::list< long > & viset )
 long TeTin::edgeWithVertexDiffFromEdge ( long t, long v, long e )
 TeGeomRep TeTinVertexSet::elemType ( ) ` [inline]`
 TeGeomRep TeTinTriangle::elemType ( ) ` [inline]`
 TeGeomRep TeTinVertex::elemType ( ) ` [inline]`
 TeGeomRep TeTinTriangleSet::elemType ( ) ` [inline]`
 TeGeomRep TeTinEdge::elemType ( ) ` [inline]`
 TeGeomRep TeTin::elemType ( ) ` [inline]`
 TeGeomRep TeTinEdgeSet::elemType ( ) ` [inline]`
 string TeTin::errorMessage ( ) ` [inline]`

Returns the error message.

 void TeTinEdge::exchangeTriangle ( long t1, long t2 ) ` [inline]`
 void TeTinEdge::exchangeVertex ( long v1, long v2 ) ` [inline]`
 long TeTin::findEdge ( long v1, long v2 )

Finds a edge given two vertex identification.

Parameters:
 v1 first vertex identification number v2 second vertex identification number
 bool TeTin::findInterPoints ( TeCoord2D & pf, TeCoord2D & pn, TeTinVertexSet & pts )

Search the point that intersects two triangles containing points pf and pn.

Parameters:
 pf first point pn last point pts list of points
 long TeTinEdge::from ( ) ` [inline]`
 bool TeTin::gaussElimination ( int nvars, int neqs, double ** matrix )

Method used to solve a system of linear equation throught the Gauss elimination method.

Parameters:
 nvars number of variables neqs number of equations matrix array with variables
 void TeTin::generateContour ( double contour, TeContourLine *& ptline )

Method to generate contour from a TIN.

 bool TeTin::generateDelaunay ( long nt, long ntbase, long & contr )
 bool TeTin::getLines ( TeLineSet & lineSet )
 bool TeTin::insertBreaklines ( TeLineSet & breaklineSet, double scale )

Insert breaklines in the triangulation.

Parameters:
 breaklineSet break lines
 bool TeTin::insertBreaklinesPoints ( TeLineSet breaklines, double scale )

Insert break vertex in the triangulation.

Parameters:
 breaklines break lines
 bool TeTin::insertLineSamples ( TeContourLine & line )
 bool TeTin::insertPoint ( TeSample & xyz ) ` [inline]`
 bool TeTin::insertPoint ( double x, double y, double value )
 bool TeTin::insertSegment ( TeCoord2D & pf, TeCoord2D & pn )
 bool TeTin::interpolationPoint ( TeCoord2D & pt, double & z )

This function interpolates the average weighted by the inverse of the distance.

Parameters:
 pt point coordinates z point's value
 bool TeTin::isBreaklineSegment ( long e )

Method that veryfies if the Breakline is a segment.

 bool TeTin::isEdgeTriangle ( long t )
 bool TeTin::isEmpty ( void ) ` [inline]`
 bool TeTin::isIsolineSegment ( long e )

Method that veryfies if the Isoline is a segment.

 bool TeTin::isNeighborOnIsoOrBreakline ( long t, long nviz )

Method that veryfies if the neighbour is on an Isoline or on a Breakline.

 bool TeTin::leastSquareFitting ( double * vectx, double * vecty, int np, int degree, double * coef )

Method that performs a least square fitting in a set of points.

Parameters:
 vectx point coordinates vecty point coordinates np number of points degree degree of the polynomium used in the fitting coef pointer to the polynomium coefficients
 long TeTinEdge::left ( ) ` [inline]`
 void TeTin::linearInterpolation ( TeRaster * raster, int band, TeTinTriangle t, int fline, int lline, int fcol, int lcol )

Fills the grid locations, inside a triangle, with a zvalue linearly evaluated (Used to image)

Parameters:
 raster pointer to a raster band current band t current triangle fline first line of the raster lline last line of the raster fcol first column of the raster lcol last column of the raster
 bool TeTin::linearInterpolation ( TeRaster *& grid )

Fills the grid locations, inside triangles, with a zvalue linearly evaluated (Used to grid)

Parameters:
 grid pointer to output grid
 bool TeTinTriangleSet::loadFromFile ( std::string & fileName )
 bool TeTin::loadFromFile ( std::string & fileName )
 bool TeTinVertexSet::loadFromFile ( std::string & fileName )
 bool TeTinEdgeSet::loadFromFile ( std::string & fileName )
 bool TeTin::loadTIN ( TeLayer * layer, TeDatabase * db )

Load triangles from an input layer with TePOLYGONS representation.

Parameters:
 layer input theme db database
 void TeTin::normalizeVector ( double * nvector )
 void TeTin::normalizeVector ( std::vector< double > & nvector )

Function that normalize a vector by its size.

Parameters:
 nvector pointer to the vector coordinates x, y and z
 bool TeTin::normalTriangle ( TeTinTriangle & t, std::vector< double > & nvector )

Calculates the normal.

Parameters:
 t TeTinTriangle object nvector normal vector
 bool TeTin::normalTriangle ( std::vector< TeTinVertex > vert, double * nvector )
 long TeTinVertex::oneEdge ( ) ` [inline]`
 long TeTin::oneEdgeWithVertex ( long vertex )
 long TeTin::oneTriangleWithVertex ( long vertex )
 bool TeTin::onIsolineSegment ( long e, TeTinVertex & vert )

Method that checks if a vertex is on the isoline segment.

 long TeTin::onSameSide ( TeCoord2D pt1, TeCoord2D pt2, TeCoord2D fseg, TeCoord2D lseg )
 bool TeTin::onSegment ( TeCoord2D pt, TeCoord2D fseg, TeCoord2D lseg, double tol )

Method that checks if a point pt is on a segment.

 bool TeTinEdge::operator== ( const TeTinEdge & other ) const` [inline]`

Returns TRUE if a TeTinEdge is equal to other.

 bool TeTinVertex::operator== ( const TeTinVertex & other ) const` [inline]`

Returns TRUE if a TeTinVertex is equal to other.

 bool TeTinTriangle::operator== ( const TeTinTriangle & other ) const` [inline]`

Returns TRUE if a TeTinTriangle is equal to other.

 long TeTin::oppositeVertex ( long t, long e )

Method used to read the identification number of the opposite vertex of a given edge.

 void TeTin::orderEdges ( )

Order edges.

 void TeTin::point3dListFilter ( TeTinVertexSet vertSet, double tol )

Method that filters the points that are closer considering a given tolerance

 double TeTin::pointToSegmentDistance ( TeCoord2D fseg, TeCoord2D lseg, TeCoord2D pt, TeCoord2D & pti )

Calculates the distance between a point and a segment.

Parameters:
 fseg segment first point lseg segment last point pt considered point pti intersection point
Returns:
the distance between the point and the segment
 bool TeTin::quinticInterpolation ( TeRaster *& grid, int interpolator )

Fills the grid locations with a zvalue evaluated by a quintic polynomium. (Used to grid)

Parameters:
 grid pointer to output grid interpolator interpolator
 long TeTinEdge::right ( ) ` [inline]`
 bool TeTin::saveTIN ( TeDatabase * db, TeLayer * layer, TePolygonSet & ps, TeTable & attTable )

Add polygons in the layer and save attributes table in the database.

Parameters:
 db current database layer layer ps PolygonSet attTable attributes table
 TeLayer * TeTin::saveTINdb ( TeDatabase * db, TeProjection * proj, string & outLayerName, string & tablename )

Saves TIN in the database.

Parameters:
 db current database outLayerName layer name that will be created tablename attributes table name that will be created
 bool TeTin::saveTINdb ( TeDatabase * db, string & outLayerName, string & tablename )

Saves TIN in the database.

Parameters:
 db current database outLayerName layer name that will be created tablename attributes table name that will be created
 bool TeTin::saveVertexTIN ( TeDatabase * db, TeLayer * layer, TePointSet & ps, TeTable & attTable )

Add points in the layer and save attributes table in the database.

Parameters:
 db current database layer layer ps PointSet attTable attributes table
 bool TeTin::saveVertexTINdb ( TeDatabase * db, string & outLayerName, string & tablename )

Saves vertex of TIN in the database.

Parameters:
 db current database outLayerName layer name that will be created tablename attributes table name that will be created
 void TeTinTriangle::setEdges ( long first, long second, long third ) ` [inline]`
 void TeTinVertex::setOneEdge ( long oneEdge ) ` [inline]`
 void TeTin::setTolerances ( double minedgesize = `0`, double isoTol = `-1`, double ptsdist = `-1`, double breaklineTol = `-1` )

Set triangulation tolerances.

Parameters:
 minedgesize triangulation edges minimum size isoTol isolines tolerance ptsdist distance of isolines points breaklineTol breaklines tolerance
 void TeTinEdge::setTriangles ( long left, long right ) ` [inline]`
 void TeTinEdge::setType ( TeTinEdgeType type ) ` [inline]`
 void TeTinVertex::setType ( TeTinVertexType type ) ` [inline]`
 void TeTinEdge::setVertices ( long from, long to ) ` [inline]`
 int TeTin::sizeTriangles ( ) ` [inline]`
 int TeTin::sizeVertex ( ) ` [inline]`
 bool TeTin::slopeaspectPoint ( TeCoord2D & pt, double & s, double & a )

Calculates the slope and orientation on the point.

Parameters:
 pt point coordinates s slope on the point a orientation on the point
 void TeTin::slopeTriangle ( TeTinTriangle & t, double & slope, char slopetype )

Calculates the slope of triangle.

Parameters:
 t TeTinTriangle object slope slope of triangle slopetype type of slope (g = degres or r = radian)
 bool TeTin::swapEdges ( long t, long tv, long ai )
 void TeTinEdge::swapTriangles ( ) ` [inline]`
 void TeTinEdge::swapVertices ( ) ` [inline]`
 bool TeTin::testDelaunay ( long t1, long t2, long t3, long t4 )
 bool TeTin::testDelaunay ( long e )
 bool TeTin::testDelaunay ( long t1, long t2, long t3 )
 bool TeTin::testDelaunay ( long t, long v )
 bool TeTin::testDelaunayAt ( long t, long v, std::set< long > & triangles )
 void TeTin::testDelaunayForVertex ( long v, std::set< long > & triangles )
 bool TeTin::testSmallerAngleAt ( long t, long v )

Test the angle between two normals.

Parameters:
 t triangle identification v neighbor triangle
 TeTin::TeTin ( TeBox & ) ` [inline]`
 TeTinEdge::TeTinEdge ( long from, long to, long left, long right, TeTinEdgeType type ) ` [inline]`
 TeTinTriangle::TeTinTriangle ( long first, long second, long third ) ` [inline]`
 TeTinVertex::TeTinVertex ( TeCoord2D xy, double value, TeTinVertexType type, long edge ) ` [inline]`

Constructor with parameters.

 long TeTinEdge::to ( ) ` [inline]`
 TeTinTriangle& TeTin::triangle ( long i ) ` [inline]`
 bool TeTin::triangle3DPoints ( TeTinTriangle & t, TeCoord2D & pt0, TeCoord2D & pt1, TeCoord2D & pt2, double & val0, double & val1, double & val2 )
 bool TeTin::triangle3DPoints ( long t, TeCoord2D & pt0, TeCoord2D & pt1, TeCoord2D & pt2, double & val0, double & val1, double & val2 ) ` [inline]`
 bool TeTin::triangle3Neighbors ( long t, long & neighbor0, long & neighbor1, long & neighbor2 )
 long TeTin::triangleAt ( TeBox boxPt )
 long TeTin::triangleAt ( TeCoord2D & pt )
 TeTinTriangleIterator TeTin::triangleBegin ( ) ` [inline]`
 bool TeTin::triangleContainsPoint ( long t, TeCoord2D & pt ) ` [inline]`
 bool TeTin::triangleContainsPoint ( TeTinTriangle & t, TeCoord2D & pt )
 TeTinTriangleIterator TeTin::triangleEnd ( ) ` [inline]`
 void TeTin::triangleFirstDeriv ( )

Calculate first derivative on triangles.

Parameters:
 t TeTinTriangle object gradtype type of gradient (s = slope or a = aspect) slopetype type of slope (g = degres or r = radian)
 bool TeTin::trianglePoints ( long t, TeCoord2D & pt0, TeCoord2D & pt1, TeCoord2D & pt2 ) ` [inline]`
 bool TeTin::trianglePoints ( TeTinTriangle & t, TeCoord2D & pt0, TeCoord2D & pt1, TeCoord2D & pt2 )
 void TeTin::triangleSecondDeriv ( )

Calculate second derivative on triangles.

 long TeTin::triangleVertexAt ( long t, long vertex )
 bool TeTin::triangleVertices ( long t, long & vertex0, long & vertex1, long & vertex2 ) ` [inline]`
 bool TeTin::triangleVertices ( TeTinTriangle & t, long & vertex0, long & vertex1, long & vertex2 )
 bool TeTin::twoNewTriangles ( long t, long v, std::set< long > & triangles )
 TeTinEdgeType TeTinEdge::type ( ) ` [inline]`
 TeTinVertexType TeTinVertex::type ( ) ` [inline]`
 double TeTinVertex::value ( ) ` [inline]`

Return the value associated to the measure.

Reimplemented from TeMeasure.

 void TeTinVertex::value ( double value ) ` [inline]`
 TeTinVertex& TeTin::vertex ( long i ) ` [inline]`
 TeTinVertexIterator TeTin::vertexBegin ( ) ` [inline]`
 bool TeTin::vertexClosestPoints ( long v, std::vector< long > & clstVert )

Method that search the closest points of a specific vertex.

Parameters:
 v vertex identification clstVert vector of closest vertex
 void TeTin::vertexDerivatives ( )

Calculate the first and second derivatives in the vertex of a given triangle.

 bool TeTin::vertexEdges ( long vertex, std::list< long > & edges )
 TeTinVertexIterator TeTin::vertexEnd ( ) ` [inline]`
 void TeTin::vertexExchange ( long oldVertex, long newVertex )
 void TeTin::vertexFirstDeriv ( )

Calculate first derivative on vertex.

 bool TeTin::vertexOncontour ( long & v )
 long TeTin::vertexOppEdge ( long triangle, long edge )
 bool TeTin::vertexOppEdges ( long v, std::list< long > & triset, std::list< long > & edges )
 bool TeTin::vertexOppEdges ( long vertex, std::list< long > & edges )
 bool TeTin::vertexOppVertices ( long vertex, std::list< long > & vertices )
 void TeTin::vertexSecondDeriv ( )

Calculate second derivative on vertex.

 bool TeTin::vertexSecondNeighVertices ( long v, list< long > & vertices )
 bool TeTin::vertexTriangles ( long vertex, std::list< long > & triangles )
 void TeTin::vertexTriangles ( long v, std::list< long > & rtri, std::list< long > & ltri )

Finds the triangle list sharing a given node.

Parameters:
 v vertex identification number rtri list with the triangles at right side ltri list with the triangles at left side
 void TeTin::writeTriangleEdgesSPRFile ( std::string & name, TeRaster * raster )

Saves TIN in SPRING file format.

Parameters:
 name File's name
 void TeTin::writeTriangleSPRFile ( std::string nameVert, std::string nameEdge, std::string nameTriang )

## Variable Documentation

 const double TeCDR = 0.01745329251994329576

Examples:
convertCoordinates.cpp, importShape.cpp, and spatialQuery.cpp.
 const double TeCRD = 57.29577951308232087679

Int. Astronomical Union - 1965.

 const double TeMAXFLOAT = 3.4E37

Maximum float value.

 const double TeMINFLOAT = 3.4E-37

Minimum float value.

 const int TeNAME_LENGTH = 2000

A default name length.

A default name length

 const double TePI = 3.14159265358979323846

The ratio of the circumference to the diameter of a circle.

 const double TeTinBIGFLOAT = TeMAXFLOAT / 10.

Near Maximum float value - TeMAXFLOAT / 10.