te::mnt::TINCalculateGrid Class Reference

Class to calculate grid from TIN. More...

#include <TINCalculateGrid.h>

Inheritance diagram for te::mnt::TINCalculateGrid:
te::mnt::Tin

Public Member Functions

bool BuildTriangle (int32_t id, te::gm::LinearRing *lr, double *val, int32_t *right, int32_t *left, te::mnt::Ntype *type, double zmin, double zmax, bool &first, KD_TREE &nodetree, te::sam::rtree::Index< std::size_t > &linetree)
 
double getMax ()
 
double getMin ()
 
bool LoadTin (te::da::DataSourcePtr &inDsrc, std::string &inDsetName, double zmin=std::numeric_limits< double >::min(), double zmax=std::numeric_limits< double >::max())
 Method used to load a triangular network (TIN) More...
 
bool LoadTinQGIS (te::da::DataSourcePtr &inDsrc, std::string &inDsetName, double zmin, double zmax)
 Method used to load a triangular network (TIN) generated by QGIS. More...
 
bool run ()
 Method that generates a regular Grid from a given TIN. More...
 
bool SaveTin (te::da::DataSourcePtr &outDsrc, std::string &outDsetName)
 
void setEnvelope (te::gm::Envelope &env)
 
void setInput (te::da::DataSourcePtr inDsrc, std::string inDsetName, std::unique_ptr< te::da::DataSetType > inDsetType)
 It sets the Datasource that is being used to generate TIN. More...
 
void setOutput (std::map< std::string, std::string > &dsinfo)
 It sets the Datasource that is being used to save TIN. More...
 
void setParams (double resx, double resy, Interpolator gt)
 It sets the parameters that is being used to save TIN. More...
 
void setSRID (int srid)
 
 TINCalculateGrid ()
 
 ~TINCalculateGrid ()
 

Protected Member Functions

bool BreakNodeClosestPoints (int32_t nid, int32_t *rClstNids, int32_t *lClstNids)
 Method that searches the Break node closest points. More...
 
bool BreakNodeFirstDeriv ()
 Method that calculates the first derivatives in the nodes of a given break triangle. More...
 
bool BreakNodeSecondDeriv ()
 Method that calculates the second derivative at all triangulation break nodes. More...
 
bool BreakTriangleSecondDeriv ()
 Method that calculates the second derivatives in the nodes of a given break triangle. More...
 
te::gm::Point CalcNodeFirstDeriv (int32_t nodeId, int32_t clstNodes[CLNODES])
 Method that calculates the first derivative in a given node. More...
 
TinNode CalcNodeSecondDeriv (int32_t nodeId, int32_t clstNIds[CLNODES])
 Method that calculates the second derivative in a given node. More...
 
bool CalcTriangleSecondDeriv (std::vector< int32_t > &triangles, std::vector< te::gm::Point > &fderiv)
 Method that calculates the second derivatives in a node of a given triangle. More...
 
bool CalcZvalueAkima (int32_t triid, te::gm::Point &pt1, te::gm::Point &pt2)
 Method that evaluates Z values for pt1 and pt2 using the Akima polynomium fitted in a triangle. More...
 
bool CheckLines (int32_t trid)
 Method that check the lines in a triangulation. More...
 
bool CheckTopology ()
 Method that check the topology in a triangulation. More...
 
bool ContainsPoint (int32_t triangId, te::gm::Point &pt)
 Method that verifies if a triangle contains a given point. More...
 
bool DefineAkimaCoeficients (int32_t triid, double *coef)
 Method that defines the coefficients of the Akima polynomium fitted in a given triangle. More...
 
bool DefineAkimaCoeficients (int32_t triid, int32_t *nodesid, te::gm::Point *p3d, double *coef)
 Method that defines the coefficients of the Akima polynomium fitted in a given triangle. More...
 
bool DefineInterLinesColumns (int32_t *nodesid, int32_t &flin, int32_t &llin, int32_t &fcol, int32_t &lcol)
 Method that calculates the lines and the columns intercepted by a triangle. More...
 
bool FillGridLinear (int32_t triid, te::gm::Point *p3da, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol)
 Method that fills the grid locations, inside a triangle, with a zvalue linearly evaluated. More...
 
bool FillGridQuintic (int32_t triid, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol, double *coef)
 Method that fills the grid locations, inside a triangle, with a zvalue evaluated by a quintic polynomium. More...
 
bool FillGridValue (int32_t triid, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol, double zvalue)
 Method that fills the grid locations, inside a triangle, with a zvalue. More...
 
std::vector< int32_t > FindLine (int32_t nid)
 Method that find a line containing a specific node. More...
 
int32_t FindLine (int32_t fnid, int32_t snid)
 Method that find a line given two nodes identification. More...
 
int32_t FindTriangle (te::gm::Point &ptr1)
 Method that finds a triangle containing a given point. More...
 
te::da::DataSetTypeGetDataSetType (std::string &outDsetName)
 
bool NeighborsId (int32_t triangId, int32_t *neighsId)
 
int32_t NextNode (int32_t nodeId)
 Method that finds out which is the next node. More...
 
bool NodeClosestPoints (int32_t nid, int32_t *clstNids, bool useBrNode=true)
 Method that searches the closest points of a specific node. More...
 
bool NodeDerivatives ()
 Method that calculates the first and second derivatives in the nodes of a given triangle. More...
 
bool NodeFirstDeriv ()
 Method that calculates the first derivatives in the nodes of a given triangle. More...
 
int32_t NodeId (int32_t triangId, short vertex)
 Method that reads the identification number of the nodes of a given triangle. More...
 
bool NodeLines (int32_t v, std::vector< int32_t > &linids)
 Method that includes a node in the tin line list. More...
 
bool NodeNodes (int32_t v, std::vector< int32_t > &nodids)
 Method that includes a node in the tin node list. More...
 
bool NodeOppositeLines (int32_t v, std::vector< int32_t > &linids)
 Method that find the oposite lines of a specific node. More...
 
bool NodeSecondDeriv ()
 Method that calculates the second derivative at all triangulation nodes. More...
 
bool NodesId (int32_t triangId, int32_t *nodeIds)
 Method that reads the identification number of the nodes of a given triangle. More...
 
int32_t NodeTriangle (int32_t v)
 Method that search a node in a triangulation. More...
 
bool NodeTriangles (int32_t v, std::vector< int32_t > &triangles)
 Method that includes a node in a triangle list. More...
 
bool NodeTriangles (int32_t nodeid, std::vector< int32_t > &rightri, std::vector< int32_t > &leftri)
 Method that find the triangle list sharing a given node. More...
 
int32_t OppositeEdge (int32_t triangId, int32_t nodeId)
 Method that reads the identification number of the opposite edge of a given node. More...
 
int32_t OppositeNode (int32_t triangId, int32_t linId)
 Method that reads the identification number of the opposite node of a given edge. More...
 
int32_t PreviousNode (int32_t nodeId)
 Method that finds out which is the previous node. More...
 
bool ReallocateVectors (size_t nSize)
 Method that reallocates Vectors. More...
 
bool TriangleFirstDeriv ()
 Method that calculates the first derivatives in the nodes of a given triangle. More...
 
bool TrianglePoints (int32_t triangId, te::gm::Point *vertex)
 Method that reads the vertex (points) of a given triangle. More...
 
bool TriangleSecondDeriv ()
 Method that calculates the second derivatives in the nodes of a given triangle. More...
 

Protected Attributes

std::map< std::string, std::string > m_dsinfo
 
te::gm::Envelope m_env
 Attribute used to restrict the area to generate the samples. More...
 
int32_t m_fbnode
 First break node number. More...
 
Interpolator m_gridtype
 
std::string m_inDsetName
 
std::unique_ptr< te::da::DataSetTypem_inDsetType
 
te::da::DataSourcePtr m_inDsrc
 
std::vector< TinLinem_line
 Triangulation lines vector. More...
 
size_t m_linesize
 Triangulation lines vector size. More...
 
int32_t m_lline
 Triangulation last line number. More...
 
int32_t m_lnode
 Triangulation last node number. More...
 
int32_t m_ltriang
 Triangulation last triangle number. More...
 
double m_max
 
double m_min
 
std::vector< te::gm::Pointm_nblfderiv
 
std::vector< TinNodem_nblsderiv
 
std::vector< te::gm::Pointm_nbrfderiv
 
std::vector< TinNodem_nbrsderiv
 
std::vector< te::gm::Pointm_nfderiv
 
double m_nodatavalue
 
std::vector< TinNodem_node
 Triangulation nodes vector. More...
 
size_t m_nodesize
 Triangulation nodes vector size. More...
 
std::vector< TinNodem_nsderiv
 
double m_resx
 
double m_resy
 
te::rst::Rasterm_rst
 
int m_srid
 Attribute with spatial reference information. More...
 
std::vector< te::gm::Pointm_tfderiv
 
std::vector< TinTriangm_triang
 Triangulation triangles vector. More...
 
size_t m_triangsize
 Triangulation triangles vector size. More...
 
std::vector< TinNodem_tsderiv
 

Detailed Description

Class to calculate grid from TIN.

Definition at line 35 of file TINCalculateGrid.h.

Constructor & Destructor Documentation

te::mnt::TINCalculateGrid::TINCalculateGrid ( )
inline

Definition at line 38 of file TINCalculateGrid.h.

te::mnt::TINCalculateGrid::~TINCalculateGrid ( )

Definition at line 20 of file TINCalculateGrid.cpp.

References te::mnt::Tin::m_rst.

Member Function Documentation

bool te::mnt::Tin::BreakNodeClosestPoints ( int32_t  nid,
int32_t *  rClstNids,
int32_t *  lClstNids 
)
protectedinherited

Method that searches the Break node closest points.

Parameters
nidis the node identification number
rClstNidsis a pointer to a list of right node identificators
lClstNidsis a pointer to a list of left node identificators
Returns
TRUE if the points are found with no errors or FALSE otherwise

Definition at line 2547 of file Tin.cpp.

References CLNODES, te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), and te::mnt::TinLine::getRightPolygon().

bool te::mnt::Tin::BreakNodeFirstDeriv ( )
protectedinherited

Method that calculates the first derivatives in the nodes of a given break triangle.

Returns
TRUE if the derivatives are calculate with no errors or FALSE otherwise
bool te::mnt::Tin::BreakNodeSecondDeriv ( )
protectedinherited

Method that calculates the second derivative at all triangulation break nodes.

Returns
TRUE if the derivatives are calculated with no errors or False otherwise

Definition at line 2768 of file Tin.cpp.

References te::mnt::Breaklinenormal, CLNODES, te::mnt::Deletednode, te::mnt::TinLine::getType(), te::mnt::TinNode::getX(), te::mnt::TinNode::getY(), and te::mnt::TinNode::getZ().

bool te::mnt::Tin::BreakTriangleSecondDeriv ( )
protectedinherited

Method that calculates the second derivatives in the nodes of a given break triangle.

Returns
TRUE if the derivatives are calculate with no errors or FALSE otherwise

Definition at line 2417 of file Tin.cpp.

References te::mnt::Breaklinefirst, te::mnt::Breaklinelast, te::mnt::Deletednode, te::mnt::TinLine::getType(), te::common::TaskProgress::isActive(), te::common::TaskProgress::pulse(), and te::common::TaskProgress::UNDEFINED.

te::gm::Point te::mnt::Tin::CalcNodeFirstDeriv ( int32_t  nodeId,
int32_t  clstNodes[CLNODES] 
)
protectedinherited

Method that calculates the first derivative in a given node.

Parameters
nodeidis the node identification number
clstNodesis the vector of a list of nodes)
Returns
a Point object containing the first derivative in x and y directions

Definition at line 2132 of file Tin.cpp.

References CLNODES, te::gm::Point::getX(), te::gm::Point::getY(), te::gm::Point::getZ(), te::gm::PointZType, te::gm::Point::setX(), te::gm::Point::setY(), te::gm::Point::setZ(), and te::mnt::triangleNormalVector().

te::mnt::TinNode te::mnt::Tin::CalcNodeSecondDeriv ( int32_t  nodeId,
int32_t  clstNIds[CLNODES] 
)
protectedinherited

Method that calculates the second derivative in a given node.

Parameters
nodeidis the node identification number
clstNIdsis the vector of a list of nodes identification
Returns
a Point object containing the first derivative in x and y directions

Definition at line 2206 of file Tin.cpp.

References te::mnt::Breaklinenormal, CLNODES, te::mnt::Deletednode, te::mnt::TinLine::getType(), te::gm::Point::getX(), te::gm::Point::getY(), te::gm::Point::getZ(), te::common::TaskProgress::isActive(), te::gm::PointZType, te::common::TaskProgress::pulse(), te::gm::Point::setX(), te::mnt::TinNode::setX(), te::gm::Point::setY(), te::mnt::TinNode::setY(), te::gm::Point::setZ(), te::mnt::TinNode::setZ(), te::mnt::triangleNormalVector(), and te::common::TaskProgress::UNDEFINED.

bool te::mnt::Tin::CalcTriangleSecondDeriv ( std::vector< int32_t > &  triangles,
std::vector< te::gm::Point > &  fderiv 
)
protectedinherited

Method that calculates the second derivatives in a node of a given triangle.

Parameters
trianglesis a pointer to a list of triangle identificators (SIDList object)
fderivis a pointer to a Point object representing the first derivative in x and y directions
Returns
TRUE if the derivatives are calculate with no errors or FALSE otherwise

Definition at line 2672 of file Tin.cpp.

References te::mnt::TinLine::getType(), te::mnt::Last, te::gm::PointZType, te::mnt::Sample, and te::mnt::triangleNormalVector().

bool te::mnt::Tin::CalcZvalueAkima ( int32_t  triid,
te::gm::Point pt1,
te::gm::Point pt2 
)
protectedinherited

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

Parameters
triidis the triangle identificator number
pt1is a pointer to a Point3d object
pt2is a pointer to a Point3d object
Returns
TRUE always

Definition at line 2933 of file Tin.cpp.

References te::gm::Point::getX(), te::gm::Point::getY(), and te::gm::Point::setZ().

Referenced by te::mnt::TINGeneration::FindInterPoints(), and te::mnt::TINGeneration::TestFlatTriangles().

bool te::mnt::Tin::CheckLines ( int32_t  trid)
protectedinherited

Method that check the lines in a triangulation.

Returns
TRUE if the lines was checked with no errors or FALSE otherwise

Definition at line 2886 of file Tin.cpp.

References b, d, te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), te::mnt::TinLine::getRightPolygon(), and te::mnt::TinLine::SwapPolygon().

bool te::mnt::Tin::CheckTopology ( )
protectedinherited

Method that check the topology in a triangulation.

Returns
TRUE if the topology was checked with no errors or FALSE otherwise

Definition at line 2873 of file Tin.cpp.

Referenced by te::mnt::TINGeneration::RegeneratewithNewPoints().

bool te::mnt::Tin::ContainsPoint ( int32_t  triangId,
te::gm::Point pt 
)
protectedinherited

Method that verifies if a triangle contains a given point.

Parameters
triangIdis the triangle identification number
ptis a pointer to a te::gm::PointZ object
Returns
TRUE if the point is in the triangle or FALSE (-1L)otherwise

Definition at line 461 of file Tin.cpp.

References te::gm::Point::getX(), te::gm::Point::getY(), and te::gm::PointZType.

Referenced by FillGridLinear(), and FillGridQuintic().

bool te::mnt::Tin::DefineAkimaCoeficients ( int32_t  triid,
double *  coef 
)
protectedinherited

Method that defines the coefficients of the Akima polynomium fitted in a given triangle.

Parameters
triidis the triangle identification number
coefis a pointer to a double vector containing the polynomium coefficients
Returns
TRUE if the coefficients are determined with no errors or FALSE otherwise

Definition at line 2991 of file Tin.cpp.

References te::gm::PointZType, te::gm::Point::setX(), te::gm::Point::setY(), and te::gm::Point::setZ().

Referenced by run().

bool te::mnt::Tin::DefineAkimaCoeficients ( int32_t  triid,
int32_t *  nodesid,
te::gm::Point p3d,
double *  coef 
)
protectedinherited

Method that defines the coefficients of the Akima polynomium fitted in a given triangle.

Parameters
triidis the triangle identification number
nodesidis the list of triangle nodes identification
p3dis a pointer to a Point3d object
coefis a pointer to a double vector containing the polynomium coefficients
Returns
TRUE if the coefficients are determined with no errors or FALSE otherwise

Definition at line 3012 of file Tin.cpp.

References b, d, te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), te::mnt::TinLine::getRightPolygon(), te::gm::Point::getX(), te::gm::Point::getY(), and te::gm::Point::getZ().

bool te::mnt::Tin::DefineInterLinesColumns ( int32_t *  nodesid,
int32_t &  flin,
int32_t &  llin,
int32_t &  fcol,
int32_t &  lcol 
)
protectedinherited

Method that calculates the lines and the columns intercepted by a triangle.

Parameters
gridis a pointer to a grid object that will be created
nodesidis a vector with nodes identification of the current triangle
flinand llin are the first and the last lines (rows) of the grid
fcoland lcol are the first and the last columns of the grid
Returns
TRUE if the gradient grid is filled or FALSE otherwise

Definition at line 3279 of file Tin.cpp.

References te::gm::Coord2D::getX(), te::gm::Point::getX(), te::gm::Coord2D::getY(), te::gm::Point::getY(), te::mnt::Max(), te::mnt::Min(), and te::rst::Round().

Referenced by te::mnt::Slope::run(), and run().

bool te::mnt::TINCalculateGrid::FillGridLinear ( int32_t  triid,
te::gm::Point p3da,
int32_t  flin,
int32_t  llin,
int32_t  fcol,
int32_t  lcol 
)
protected

Method that fills the grid locations, inside a triangle, with a zvalue linearly evaluated.

Parameters
gridis a pointer to a grid object
triidis the triangle identification number
flinand llin are the first and the last lines (rows) of the grid
fcoland lcol are the first and the last columns of the grid
zvalueis the z value to be stored in the grid inside the triangle region
Returns
TRUE always

Definition at line 174 of file TINCalculateGrid.cpp.

References te::mnt::Tin::ContainsPoint(), te::rst::Raster::getGrid(), te::gm::Coord2D::getX(), te::gm::Point::getX(), te::gm::Coord2D::getY(), te::gm::Point::getY(), te::gm::Point::getZ(), te::rst::Grid::gridToGeo(), te::mnt::Tin::m_rst, te::gm::PointZType, te::rst::Raster::setValue(), te::gm::Point::setX(), and te::gm::Point::setY().

Referenced by run().

bool te::mnt::TINCalculateGrid::FillGridQuintic ( int32_t  triid,
int32_t  flin,
int32_t  llin,
int32_t  fcol,
int32_t  lcol,
double *  coef 
)
protected

Method that fills the grid locations, inside a triangle, with a zvalue evaluated by a quintic polynomium.

Parameters
gridis a pointer to a grid object
triidis the triangle identification number
p3dais a pointer to a Point3d object, vector with 3D samples (not used in this method)
flinand llin are the first and the last lines (rows) of the grid
fcoland lcol are the first and the last columns of the grid
zvalueis the z value to be stored in the grid inside the triangle region
Returns
TRUE always

Definition at line 222 of file TINCalculateGrid.cpp.

References te::mnt::Tin::ContainsPoint(), te::rst::Raster::getGrid(), te::gm::Coord2D::getX(), te::gm::Point::getX(), te::gm::Coord2D::getY(), te::gm::Point::getY(), te::rst::Grid::gridToGeo(), te::mnt::Tin::m_rst, te::gm::PointZType, te::rst::Raster::setValue(), te::gm::Point::setX(), and te::gm::Point::setY().

Referenced by run().

bool te::mnt::Tin::FillGridValue ( int32_t  triid,
int32_t  flin,
int32_t  llin,
int32_t  fcol,
int32_t  lcol,
double  zvalue 
)
protectedinherited

Method that fills the grid locations, inside a triangle, with a zvalue.

Parameters
triidis the triangle identification number
flinand llin are the first and the last lines (rows) of the grid
fcoland lcol are the first and the last columns of the grid
zvalueis the z value to be stored in the grid inside the triangle region
Returns
true always

Definition at line 3256 of file Tin.cpp.

References te::gm::Coord2D::getX(), te::gm::Coord2D::getY(), te::gm::PointZType, te::gm::Point::setX(), and te::gm::Point::setY().

Referenced by te::mnt::Slope::run(), and run().

std::vector< int32_t > te::mnt::Tin::FindLine ( int32_t  nid)
protectedinherited

Method that find a line containing a specific node.

Parameters
nidis the node identification number
Returns
the number of the line if it was found with no errors or FALSE (-1L) otherwise

Definition at line 641 of file Tin.cpp.

References te::mnt::TinLine::getNodeFrom(), and te::mnt::TinLine::getNodeTo().

Referenced by te::mnt::TINGeneration::OrderLines().

int32_t te::mnt::Tin::FindLine ( int32_t  fnid,
int32_t  snid 
)
protectedinherited

Method that find a line given two nodes identification.

Parameters
fnidis the first node identification number
snidis the second node identification number
Returns
the number of the line if it was found with no errors or FALSE (-1L) otherwise

Definition at line 724 of file Tin.cpp.

References te::mnt::TinLine::getNodeFrom(), and te::mnt::TinLine::getNodeTo().

int32_t te::mnt::Tin::FindTriangle ( te::gm::Point ptr1)
protectedinherited

Method that finds a triangle containing a given point.

Parameters
ptr1is a pointer to a Point object
Returns
true if the triangle was found or false (-1L)otherwise

Definition at line 190 of file Tin.cpp.

References te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), te::mnt::TinLine::getRightPolygon(), te::gm::Point::getX(), te::gm::Point::getY(), te::mnt::pointToSegmentDistance(), and te::mnt::segIntersect().

Referenced by te::mnt::TINGeneration::FindInterPoints(), and te::mnt::TINGeneration::InsertNode().

double te::mnt::Tin::getMax ( )
inlineinherited

Definition at line 307 of file Tin.h.

References CLNODES, te::da::GetDataSetType(), pt1, and pt2.

Referenced by te::mnt::MNTGenerationDialog::onOkPushButtonClicked().

double te::mnt::Tin::getMin ( )
inlineinherited

Definition at line 306 of file Tin.h.

Referenced by te::mnt::MNTGenerationDialog::onOkPushButtonClicked().

bool te::mnt::Tin::LoadTin ( te::da::DataSourcePtr inDsrc,
std::string &  inDsetName,
double  zmin = std::numeric_limits<double>::min(),
double  zmax = std::numeric_limits<double>::max() 
)
inherited

Method used to load a triangular network (TIN)

Returns
true if the TIN is loaded with no errors or false otherwise
TRUE if the TIN is loaded with no errors or FALSE otherwise

Definition at line 1624 of file Tin.cpp.

References te::dt::GEOMETRY_TYPE, te::da::GetFirstPropertyPos(), te::gm::GeometryCollection::getGeometryN(), te::gm::CurvePolygon::getRingN(), te::common::TaskProgress::isActive(), te::common::TaskProgress::pulse(), and te::common::TaskProgress::UNDEFINED.

Referenced by te::mnt::TINCreateIsolines::run(), te::mnt::Slope::run(), and run().

bool te::mnt::Tin::LoadTinQGIS ( te::da::DataSourcePtr inDsrc,
std::string &  inDsetName,
double  zmin,
double  zmax 
)
inherited

Method used to load a triangular network (TIN) generated by QGIS.

Returns
true if the TIN is loaded with no errors or false otherwise
TRUE if the TIN is loaded with no errors or FALSE otherwise

Definition at line 1540 of file Tin.cpp.

References te::dt::GEOMETRY_TYPE, te::da::GetFirstGeomProperty(), te::da::GetFirstPropertyPos(), te::gm::GeometryCollection::getGeometryN(), te::gm::GeometryCollection::getNumGeometries(), te::gm::CurvePolygon::getRingN(), te::gm::LineString::getZ(), te::gm::MultiPolygonType, te::mnt::Normalnode, te::gm::PolygonType, TE_TR, and te::common::Exception::what().

int32_t te::mnt::Tin::NextNode ( int32_t  nodeId)
protectedinherited

Method that finds out which is the next node.

Parameters
nodeIdis the node identification number
Returns
the number of the next node

Definition at line 999 of file Tin.cpp.

References te::mnt::Deletednode, and te::mnt::TinLine::getType().

Referenced by te::mnt::TINGeneration::DeleteNode(), te::mnt::TINGeneration::IsBreaklineSegment(), te::mnt::TINGeneration::IsIsolineSegment(), te::mnt::TINGeneration::OrderLines(), and te::mnt::TINGeneration::TestIsolines().

bool te::mnt::Tin::NodeClosestPoints ( int32_t  nid,
int32_t *  clstNids,
bool  useBrNode = true 
)
protectedinherited

Method that searches the closest points of a specific node.

Parameters
nidis the node identification number
clstNidsis a pointer to a list of closest node identificators
useBrNodeis the break nodeidentification
Returns
TRUE if the points are found with no errors or FALSE otherwise

Definition at line 2073 of file Tin.cpp.

References CLNODES, te::mnt::TinLine::getNodeFrom(), and te::mnt::TinLine::getNodeTo().

bool te::mnt::Tin::NodeDerivatives ( )
protectedinherited

Method that calculates the first and second derivatives in the nodes of a given triangle.

Returns
TRUE if the derivatives are calculate with no errors or FALSE otherwise

Definition at line 1743 of file Tin.cpp.

Referenced by te::mnt::TINGeneration::InsertBreakNodes(), te::mnt::Slope::run(), run(), and te::mnt::TINGeneration::TestFlatTriangles().

bool te::mnt::Tin::NodeFirstDeriv ( )
protectedinherited

Method that calculates the first derivatives in the nodes of a given triangle.

Returns
TRUE if the derivatives are calculate with no errors or FALSE otherwise

Definition at line 1983 of file Tin.cpp.

References CLNODES, te::mnt::Deletednode, te::mnt::TinLine::getType(), te::common::TaskProgress::isActive(), te::gm::PointZType, te::common::TaskProgress::pulse(), te::gm::Point::setX(), te::gm::Point::setY(), te::gm::Point::setZ(), and te::common::TaskProgress::UNDEFINED.

int32_t te::mnt::Tin::NodeId ( int32_t  triangId,
short  vertex 
)
protectedinherited

Method that reads the identification number of the nodes of a given triangle.

Parameters
triangIdis the triangle identification number
vertexis the number of the vertex to be considered
Returns
the node identification related to the vertex

Definition at line 903 of file Tin.cpp.

Referenced by te::mnt::TINGeneration::DuplicateTriangle(), te::mnt::TINGeneration::TestIsolines(), and te::mnt::TINGeneration::TwoNewTriangles().

bool te::mnt::Tin::NodeLines ( int32_t  v,
std::vector< int32_t > &  linids 
)
protectedinherited

Method that includes a node in the tin line list.

Parameters
vis the node identificator number
linidsis a pointer to a list of line identificators
Returns
TRUE if the node is included with no errors or FALSE otherwise

Definition at line 810 of file Tin.cpp.

References te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), te::mnt::TinLine::getRightPolygon(), and td.

Referenced by te::mnt::TINGeneration::borderUp(), te::mnt::TINGeneration::ModifyBoundTriangles(), and te::mnt::TINGeneration::NodeExchange().

bool te::mnt::Tin::NodeNodes ( int32_t  v,
std::vector< int32_t > &  nodids 
)
protectedinherited

Method that includes a node in the tin node list.

Parameters
vis the node identification number
nodidsis a pointer to a list of node identificators
Returns
TRUE if the node is included with no errors or FALSE otherwise

Definition at line 1038 of file Tin.cpp.

References te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), te::mnt::TinLine::getRightPolygon(), and td.

bool te::mnt::Tin::NodeOppositeLines ( int32_t  v,
std::vector< int32_t > &  linids 
)
protectedinherited

Method that find the oposite lines of a specific node.

Parameters
vis the node identification number
linidsis pointer to a list of line identificators
Returns
true if the line is found with no errors or false otherwise

Definition at line 492 of file Tin.cpp.

References te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), te::mnt::TinLine::getRightPolygon(), and td.

Referenced by te::mnt::TINGeneration::TestIsolines().

bool te::mnt::Tin::NodeSecondDeriv ( )
protectedinherited

Method that calculates the second derivative at all triangulation nodes.

Returns
TRUE if the derivatives are calculated with no errors or False otherwise

Definition at line 2027 of file Tin.cpp.

References CLNODES, te::mnt::Deletednode, te::mnt::TinLine::getType(), te::mnt::TinNode::getX(), te::mnt::TinNode::getY(), te::mnt::TinNode::getZ(), te::mnt::TinNode::Init(), te::common::TaskProgress::isActive(), te::common::TaskProgress::pulse(), and te::common::TaskProgress::UNDEFINED.

bool te::mnt::Tin::NodesId ( int32_t  triangId,
int32_t *  nodeIds 
)
protectedinherited

Method that reads the identification number of the nodes of a given triangle.

Parameters
triangIdis the triangle identification number
nodesIdsis a pointer to a list of node identification numbers
Returns
TRUE always

Definition at line 913 of file Tin.cpp.

References te::mnt::TinLine::getNodeFrom(), and te::mnt::TinLine::getNodeTo().

Referenced by te::mnt::TINGeneration::InsertNode(), te::mnt::TINCreateIsolines::run(), te::mnt::Slope::run(), run(), and te::mnt::TINGeneration::UpdateTriangles().

int32_t te::mnt::Tin::NodeTriangle ( int32_t  v)
protectedinherited

Method that search a node in a triangulation.

Parameters
vis the node identification number
Returns
the right or left polygon of a line containing v or FALSE (-1L) otherwise

Definition at line 1140 of file Tin.cpp.

References te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getRightPolygon(), and td.

bool te::mnt::Tin::NodeTriangles ( int32_t  v,
std::vector< int32_t > &  triangles 
)
protectedinherited

Method that includes a node in a triangle list.

Parameters
vis the node identification number
trianglesis pointer to a vetor of triangles
Returns
TRUE if the node is included with no errors or FALSE otherwise

Definition at line 1159 of file Tin.cpp.

References te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), te::mnt::TinLine::getRightPolygon(), and td.

bool te::mnt::Tin::NodeTriangles ( int32_t  nodeid,
std::vector< int32_t > &  rightri,
std::vector< int32_t > &  leftri 
)
protectedinherited

Method that find the triangle list sharing a given node.

Parameters
nodeidis the node identification number
rightriis a pointer to the triangles at right side
lefttriis a pointer to the triangles at left side
Returns
TRUE if the lists are find with no errors or FALSE otherwise

Definition at line 2460 of file Tin.cpp.

References te::mnt::TinLine::getLeftPolygon(), te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), and te::mnt::TinLine::getRightPolygon().

int32_t te::mnt::Tin::OppositeEdge ( int32_t  triangId,
int32_t  nodeId 
)
protectedinherited

Method that reads the identification number of the opposite edge of a given node.

Parameters
triangIdis the triangle identification number
nodeIdis the node identification number
Returns
the opposite edge identification considering the nodeId or -1 if error

Definition at line 619 of file Tin.cpp.

References te::mnt::TinLine::getNodeFrom(), and te::mnt::TinLine::getNodeTo().

int32_t te::mnt::Tin::OppositeNode ( int32_t  triangId,
int32_t  linId 
)
protectedinherited

Method that reads the identification number of the opposite node of a given edge.

Parameters
triangIdis the triangle identification number
linIdis the line identification number
Returns
the opposite node identification considering the linId

Definition at line 975 of file Tin.cpp.

References te::mnt::TinLine::getNodeFrom(), and te::mnt::TinLine::getNodeTo().

Referenced by te::mnt::TINGeneration::InsertNode(), te::mnt::TINGeneration::TestAngleBetweenNormals(), te::mnt::TINGeneration::TestDelaunay(), te::mnt::TINGeneration::TestIsolines(), and te::mnt::TINGeneration::UpdateTriangles().

int32_t te::mnt::Tin::PreviousNode ( int32_t  nodeId)
protectedinherited

Method that finds out which is the previous node.

Parameters
nodeIdis the node identification number
Returns
the number of the previous node

Definition at line 1018 of file Tin.cpp.

References te::mnt::Deletednode, and te::mnt::TinLine::getType().

Referenced by te::mnt::TINGeneration::DeleteNode(), and te::mnt::TINGeneration::RegeneratewithNewPoints().

bool te::mnt::Tin::ReallocateVectors ( size_t  nSize)
protectedinherited

Method that reallocates Vectors.

Parameters
nSizeis the vector size
Returns
true always

Definition at line 1267 of file Tin.cpp.

References te::mnt::TinLine::TinLine().

Referenced by te::mnt::TINGeneration::RegeneratewithNewPoints(), and te::mnt::TINGeneration::TestIsolines().

bool te::mnt::TINCalculateGrid::run ( )

Method that generates a regular Grid from a given TIN.

Parameters
gridis a pointer to the grid that will be created
gridtypeis the type of interpolator fitted to each triangle
Returns
TRUE if the regular grid is created or FALSE otherwise

Definition at line 32 of file TINCalculateGrid.cpp.

References compose::bands, te::mnt::Tin::DefineAkimaCoeficients(), te::mnt::Tin::DefineInterLinesColumns(), te::dt::DOUBLE_TYPE, FillGridLinear(), FillGridQuintic(), te::mnt::Tin::FillGridValue(), te::rst::Raster::getBand(), te::gm::Envelope::getHeight(), te::gm::Envelope::getLowerLeftX(), te::rst::Band::getProperty(), te::gm::Envelope::getUpperRightY(), te::gm::Envelope::getWidth(), te::rst::GrayIdxCInt, te::sa::Grid, te::mnt::Linear, te::mnt::Tin::LoadTin(), m_dsinfo, te::mnt::Tin::m_env, te::mnt::Tin::m_fbnode, m_gridtype, m_inDsetName, m_inDsrc, te::rst::BandProperty::m_noDataValue, te::mnt::Tin::m_nodatavalue, te::mnt::Tin::m_node, te::mnt::Tin::m_nsderiv, te::mnt::Tin::m_resx, te::mnt::Tin::m_resy, te::mnt::Tin::m_rst, te::mnt::Tin::m_srid, te::mnt::Tin::m_triang, te::rst::RasterFactory::make(), te::mnt::Tin::NeighborsId(), te::mnt::Tin::NodeDerivatives(), te::mnt::Tin::NodesId(), te::gm::PointZType, te::common::TaskProgress::pulse(), te::mnt::Quintico, te::mnt::QuinticoBrkLine, mixture::rst, te::gm::Point::setX(), te::gm::Point::setY(), te::gm::Point::setZ(), and te::common::TaskProgress::UNDEFINED.

Referenced by te::mnt::MNTGenerationDialog::onOkPushButtonClicked(), and TINCalculateGrid().

void te::mnt::Tin::setEnvelope ( te::gm::Envelope env)
inherited

Function used to set the envelope parameter

Definition at line 182 of file Tin.cpp.

Referenced by te::mnt::TINGeneration::ReadBreakLines(), and te::mnt::TINGeneration::run().

void te::mnt::TINCalculateGrid::setInput ( te::da::DataSourcePtr  inDsrc,
std::string  inDsetName,
std::unique_ptr< te::da::DataSetType inDsetType 
)

It sets the Datasource that is being used to generate TIN.

Parameters
inDsrcThe datasource being used.
inDsetNamedatasource name
inDsetTypeinput DataSetType

Definition at line 141 of file TINCalculateGrid.cpp.

References m_inDsetName, m_inDsetType, and m_inDsrc.

Referenced by te::mnt::MNTGenerationDialog::onOkPushButtonClicked(), and TINCalculateGrid().

void te::mnt::TINCalculateGrid::setOutput ( std::map< std::string, std::string > &  dsinfo)

It sets the Datasource that is being used to save TIN.

Definition at line 150 of file TINCalculateGrid.cpp.

References m_dsinfo.

Referenced by te::mnt::MNTGenerationDialog::onOkPushButtonClicked(), and TINCalculateGrid().

void te::mnt::TINCalculateGrid::setParams ( double  resx,
double  resy,
Interpolator  gt 
)

It sets the parameters that is being used to save TIN.

Parameters
resx,resyresolution X and Y.
gtinterpolator

Definition at line 155 of file TINCalculateGrid.cpp.

References m_gridtype, te::mnt::Tin::m_resx, and te::mnt::Tin::m_resy.

Referenced by te::mnt::MNTGenerationDialog::onOkPushButtonClicked(), and TINCalculateGrid().

void te::mnt::Tin::setSRID ( int  srid)
inherited
bool te::mnt::Tin::TriangleFirstDeriv ( )
protectedinherited

Method that calculates the first derivatives in the nodes of a given triangle.

Returns
TRUE if the derivatives are calculate with no errors or FALSE otherwise

Definition at line 1780 of file Tin.cpp.

References te::gm::Point::getX(), te::gm::Point::getY(), te::common::TaskProgress::isActive(), te::gm::PointZType, te::common::TaskProgress::pulse(), te::gm::Point::setX(), te::gm::Point::setY(), te::gm::Point::setZ(), te::mnt::triangleNormalVector(), and te::common::TaskProgress::UNDEFINED.

bool te::mnt::Tin::TrianglePoints ( int32_t  triangId,
te::gm::Point vertex 
)
protectedinherited

Method that reads the vertex (points) of a given triangle.

Parameters
triangIdis the triangle identification number
vertexis a pointer to a list of Point object, the triangle vertices
Returns
true always

Definition at line 400 of file Tin.cpp.

References te::mnt::TinLine::getNodeFrom(), te::mnt::TinLine::getNodeTo(), te::gm::Point::setX(), te::gm::Point::setY(), and te::gm::Point::setZ().

Referenced by te::mnt::TINGeneration::InsertNode(), te::mnt::TINGeneration::neigh_union(), te::mnt::TINGeneration::TestAngleBetweenNormals(), te::mnt::TINGeneration::TestDelaunay(), and te::mnt::TINGeneration::TestFlatTriangles().

bool te::mnt::Tin::TriangleSecondDeriv ( )
protectedinherited

Method that calculates the second derivatives in the nodes of a given triangle.

Returns
TRUE if the derivatives are calculate with no errors or FALSE otherwise

Definition at line 1867 of file Tin.cpp.

References te::gm::Point::getZ(), te::common::TaskProgress::isActive(), te::gm::PointZType, te::common::TaskProgress::pulse(), te::gm::Point::setX(), te::gm::Point::setY(), te::gm::Point::setZ(), te::mnt::triangleNormalVector(), and te::common::TaskProgress::UNDEFINED.

Member Data Documentation

std::map<std::string, std::string> te::mnt::TINCalculateGrid::m_dsinfo
protected

Definition at line 85 of file TINCalculateGrid.h.

Referenced by run(), and setOutput().

te::gm::Envelope te::mnt::Tin::m_env
protectedinherited

Attribute used to restrict the area to generate the samples.

Definition at line 598 of file Tin.h.

Referenced by te::mnt::TINGeneration::CreateInitialTriangles(), te::mnt::TINGeneration::InsertNode(), te::mnt::Slope::run(), and run().

int32_t te::mnt::Tin::m_fbnode
protectedinherited
Interpolator te::mnt::TINCalculateGrid::m_gridtype
protected

Definition at line 87 of file TINCalculateGrid.h.

Referenced by run(), and setParams().

std::string te::mnt::TINCalculateGrid::m_inDsetName
protected

Definition at line 82 of file TINCalculateGrid.h.

Referenced by run(), and setInput().

std::unique_ptr<te::da::DataSetType> te::mnt::TINCalculateGrid::m_inDsetType
protected

Definition at line 83 of file TINCalculateGrid.h.

Referenced by setInput().

te::da::DataSourcePtr te::mnt::TINCalculateGrid::m_inDsrc
protected

Definition at line 81 of file TINCalculateGrid.h.

Referenced by run(), and setInput().

int32_t te::mnt::Tin::m_lline
protectedinherited
double te::mnt::Tin::m_max
protectedinherited

Definition at line 624 of file Tin.h.

double te::mnt::Tin::m_min
protectedinherited

Definition at line 623 of file Tin.h.

std::vector<te::gm::Point> te::mnt::Tin::m_nblfderiv
protectedinherited

Definition at line 611 of file Tin.h.

std::vector<TinNode> te::mnt::Tin::m_nblsderiv
protectedinherited

Definition at line 615 of file Tin.h.

std::vector<te::gm::Point> te::mnt::Tin::m_nbrfderiv
protectedinherited

Definition at line 610 of file Tin.h.

std::vector<TinNode> te::mnt::Tin::m_nbrsderiv
protectedinherited

Definition at line 614 of file Tin.h.

std::vector<te::gm::Point> te::mnt::Tin::m_nfderiv
protectedinherited

Definition at line 609 of file Tin.h.

std::vector<TinNode> te::mnt::Tin::m_nsderiv
protectedinherited
double te::mnt::Tin::m_resx
protectedinherited

Definition at line 627 of file Tin.h.

Referenced by te::mnt::Slope::run(), run(), te::mnt::Slope::setParams(), and setParams().

double te::mnt::Tin::m_resy
protectedinherited

Definition at line 627 of file Tin.h.

Referenced by te::mnt::Slope::run(), run(), te::mnt::Slope::setParams(), and setParams().

te::rst::Raster* te::mnt::Tin::m_rst
protectedinherited

Definition at line 626 of file Tin.h.

Referenced by FillGridLinear(), FillGridQuintic(), te::mnt::Slope::run(), run(), and ~TINCalculateGrid().

std::vector<te::gm::Point> te::mnt::Tin::m_tfderiv
protectedinherited

Definition at line 608 of file Tin.h.

std::vector<TinNode> te::mnt::Tin::m_tsderiv
protectedinherited

Definition at line 612 of file Tin.h.


The documentation for this class was generated from the following files: