8 #ifndef __TERRALIB_MNT_INTERNAL_TIN_H
9 #define __TERRALIB_MNT_INTERNAL_TIN_H
15 #include "../../dataaccess/dataset/DataSet.h"
16 #include "../../dataaccess/dataset/DataSetType.h"
17 #include "../../dataaccess/datasource/DataSource.h"
19 #include "../../geometry/Envelope.h"
20 #include "../../geometry/Point.h"
22 #include "../../sam.h"
47 void setEdges(int32_t fLine, int32_t sLine, int32_t tLine)
87 TinLine(int32_t& nodefrom, int32_t &nodeto, int32_t &leftpoly, int32_t &rightpoly,
Ltype type)
109 void Nodes(int32_t nodefrom, int32_t nodeto)
279 Tin() : m_nodatavalue(std::numeric_limits<double>::max()), m_min(std::numeric_limits<double>::max()), m_max(std::numeric_limits<double>::min()) {}
293 bool LoadTin(
te::da::DataSourcePtr &inDsrc, std::string &inDsetName,
double zmin = std::numeric_limits<double>::min(),
double zmax = std::numeric_limits<double>::max());
397 bool NodeLines(int32_t v, std::vector<int32_t> &linids);
405 int32_t
NodeId(int32_t triangId,
short vertex);
413 bool NodesId(int32_t triangId, int32_t *nodeIds);
422 bool NodeNodes(int32_t v, std::vector<int32_t>& nodids);
483 bool NodeTriangles(int32_t nodeid, std::vector<int32_t> &rightri, std::vector<int32_t> &leftri);
584 bool FillGridValue(int32_t triid, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol,
double zvalue);
te::sam::kdtree::Index< KD_NODE > KD_TREE
te::sam::kdtree::Node< te::gm::Coord2D, int32_t, int32_t > KD_NODE
A class that models the description of a dataset.
An Envelope defines a 2D rectangular region.
A LinearRing is a LineString that is both closed and simple.
A point with x and y coordinate values.
void setZ(const double &z)
It sets the Point z-coordinate value.
const double & getZ() const
It returns the Point z-coordinate value, if it has one or DoubleNotANumber otherwise.
const double & getX() const
It returns the Point x-coordinate value.
void setY(const double &y)
It sets the Point y-coordinate value.
const double & getY() const
It returns the Point y-coordinate value.
void setX(const double &x)
It sets the Point x-coordinate value.
void setNodeTo(int32_t nodeid)
void Polygons(int32_t leftpoly, int32_t rightpoly)
bool ExchangePolygon(int32_t oldPolyId, int32_t newPolyId)
Method for exchange polygons in the triangulation.
bool operator==(const TinLine &rhs) const
void setRightPolygon(int32_t polyid)
void Nodes(int32_t nodefrom, int32_t nodeto)
void setNodeFrom(int32_t nodeid)
bool operator>(const TinLine &rhs) const
bool SwapPolygon()
Method for swap two adjacent polygons.
int32_t m_nodeto
last node number
int32_t getRightPolygon()
bool SwapNodePolygon()
Method for swap two nodes and two adjacent polygons.
bool operator<(const TinLine &rhs) const
int32_t m_leftpoly
left polygon number
bool SwapNode()
Method for swap two nodes.
bool ExchangeNode(int32_t oldNodeId, int32_t newNodeId)
Method for exchange nodes in the triangulation.
void setLeftPolygon(int32_t polyid)
void setType(Ltype ltype)
int32_t m_nodefrom
initial node number
TinLine(int32_t &nodefrom, int32_t &nodeto, int32_t &leftpoly, int32_t &rightpoly, Ltype type)
int32_t m_rightpoly
right polygon number
void setNPoint(te::gm::Point npoint)
bool removeEdge(int32_t edge)
void setType(Ntype ntype)
bool setEdge(int32_t edge)
te::gm::Point m_point
Node point.
te::gm::Point & getNPoint()
bool operator>(const TinNode &rhs) const
void Init(double xvalue, double yvalue, double zvalue, Ntype ntype=Normalnode)
Set node coordinates, height and type.
std::vector< int32_t > & getEdge()
bool operator<(const TinNode &rhs) const
TinNode(const TinNode &rhs)
void Init(te::gm::Point &npoint, Ntype ntype=Normalnode)
Set node coordinates and height.
bool operator==(const TinNode &rhs) const
std::vector< int32_t > m_edge
int32_t LineAtEdge(unsigned short edge)
void setEdges(int32_t fLine, int32_t sLine, int32_t tLine)
bool LinesId(int32_t *linesId)
Class to define TIN strutures.
int32_t OppositeEdge(int32_t triangId, int32_t nodeId)
Method that reads the identification number of the opposite edge of a given node.
int32_t NodeTriangle(int32_t v)
Method that search a node in a triangulation.
bool DefineAkimaCoeficients(int32_t triid, double *coef)
Method that defines the coefficients of the Akima polynomium fitted in a given triangle.
int32_t m_fbnode
First break node number.
TinNode CalcNodeSecondDeriv(int32_t nodeId, int32_t clstNIds[CLNODES])
Method that calculates the second derivative in a given node.
bool TriangleSecondDeriv()
Method that calculates the second derivatives in the nodes of a given triangle.
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.
bool BreakNodeClosestPoints(int32_t nid, int32_t *rClstNids, int32_t *lClstNids)
Method that searches the Break node closest points.
bool CheckTopology()
Method that check the topology in a triangulation.
te::gm::Envelope m_env
Attribute used to restrict the area to generate the samples.
bool NodeNodes(int32_t v, std::vector< int32_t > &nodids)
Method that includes a node in the tin node list.
bool NodeSecondDeriv()
Method that calculates the second derivative at all triangulation nodes.
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.
size_t m_nodesize
Triangulation nodes vector size.
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.
te::da::DataSetType * GetDataSetType(std::string &outDsetName)
bool BreakNodeFirstDeriv()
Method that calculates the first derivatives in the nodes of a given break triangle.
int32_t NodeId(int32_t triangId, short vertex)
Method that reads the identification number of the nodes of a given triangle.
std::vector< TinNode > m_nsderiv
bool TriangleFirstDeriv()
Method that calculates the first derivatives in the nodes of a given triangle.
bool NodeFirstDeriv()
Method that calculates the first derivatives in the nodes of a given triangle.
bool NodeTriangles(int32_t v, std::vector< int32_t > &triangles)
Method that includes a node in a triangle list.
bool CheckLines(int32_t trid)
Method that check the lines in a triangulation.
bool NeighborsId(int32_t triangId, int32_t *neighsId)
std::vector< TinNode > m_nblsderiv
size_t m_linesize
Triangulation lines vector size.
std::vector< TinLine > m_line
Triangulation lines vector.
int32_t m_lline
Triangulation last line number.
bool TrianglePoints(int32_t triangId, te::gm::Point *vertex)
Method that reads the vertex (points) of a given triangle.
bool NodeLines(int32_t v, std::vector< int32_t > &linids)
Method that includes a node in the tin line list.
size_t m_triangsize
Triangulation triangles vector size.
std::vector< TinTriang > m_triang
Triangulation triangles vector.
std::vector< TinNode > m_nbrsderiv
std::vector< te::gm::Point > m_nbrfderiv
bool ContainsPoint(int32_t triangId, te::gm::Point &pt)
Method that verifies if a triangle contains a given point.
bool SaveTin(te::da::DataSourcePtr &outDsrc, std::string &outDsetName)
std::vector< te::gm::Point > m_tfderiv
bool NodeClosestPoints(int32_t nid, int32_t *clstNids, bool useBrNode=true)
Method that searches the closest points of a specific node.
bool BreakNodeSecondDeriv()
Method that calculates the second derivative at all triangulation break nodes.
std::vector< TinNode > m_tsderiv
bool ReallocateVectors(size_t nSize)
Method that reallocates Vectors.
int32_t FindLine(int32_t fnid, int32_t snid)
Method that find a line given two nodes identification.
int32_t FindTriangle(te::gm::Point &ptr1)
Method that finds a triangle containing a given point.
bool NodesId(int32_t triangId, int32_t *nodeIds)
Method that reads the identification number of the nodes of a given triangle.
std::vector< int32_t > FindLine(int32_t nid)
Method that find a line containing a specific node.
int32_t m_lnode
Triangulation last node number.
bool NodeOppositeLines(int32_t v, std::vector< int32_t > &linids)
Method that find the oposite lines of a specific node.
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.
std::vector< te::gm::Point > m_nblfderiv
int m_srid
Attribute with spatial reference information.
void setEnvelope(te::gm::Envelope &env)
int32_t OppositeNode(int32_t triangId, int32_t linId)
Method that reads the identification number of the opposite node of a given edge.
bool BreakTriangleSecondDeriv()
Method that calculates the second derivatives in the nodes of a given break triangle.
bool FillGridValue(int32_t triid, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol, double zvalue)
int32_t NextNode(int32_t nodeId)
Method that finds out which is the next node.
std::vector< TinNode > m_node
Triangulation nodes vector.
int32_t m_ltriang
Triangulation last triangle number.
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.
bool LoadTinQGIS(te::da::DataSourcePtr &inDsrc, std::string &inDsetName, double zmin, double zmax)
Method used to load a triangular network (TIN) generated by QGIS.
std::vector< te::gm::Point > m_nfderiv
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)
bool NodeDerivatives()
Method that calculates the first and second derivatives in the nodes of a given triangle.
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)
int32_t PreviousNode(int32_t nodeId)
Method that finds out which is the previous node.
te::gm::Point CalcNodeFirstDeriv(int32_t nodeId, int32_t clstNodes[CLNODES])
Method that calculates the first derivative in a given node.
An abstract class for raster data strucutures.
A class that represents a two dimensional K-d Tree (2-d Tree).
A class that represents an Kd-tree node.
boost::shared_ptr< DataSource > DataSourcePtr
#define TEMNTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).
Enumerations of XML module.