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)
85 TinLine() : m_nodefrom(-1), m_nodeto(-1), m_leftpoly(-1), m_rightpoly(-1), m_type(
Normalline) {}
87 TinLine(int32_t& nodefrom, int32_t &nodeto, int32_t &leftpoly, int32_t &rightpoly,
Ltype type)
88 : m_nodefrom(nodefrom), m_nodeto(nodeto), m_leftpoly(leftpoly), m_rightpoly(rightpoly), m_type(type) {}
109 void Nodes(int32_t nodefrom, int32_t nodeto)
111 m_nodefrom = nodefrom;
130 m_leftpoly = leftpoly;
131 m_rightpoly = rightpoly;
140 bool ExchangePolygon(int32_t oldPolyId, int32_t newPolyId);
148 bool ExchangeNode(int32_t oldNodeId, int32_t newNodeId);
172 bool SwapNodePolygon();
203 bool setEdge(int32_t edge);
205 bool removeEdge(int32_t edge);
207 std::vector<int32_t> &
getEdge() {
return m_edge; }
210 void setZ(
double zvalue) { m_point.setZ(zvalue); }
213 double getZ() {
return m_point.getZ(); }
216 void setX(
double xvalue) { m_point.setX(xvalue); }
219 double getX() {
return m_point.getX(); }
222 void setY(
double yvalue) { m_point.setY(yvalue); }
225 double getY() {
return m_point.getY(); }
255 m_point.setX(xvalue);
256 m_point.setY(yvalue);
257 m_point.setZ(zvalue);
279 Tin() : m_nodatavalue(std::numeric_limits<double>::max()), m_min(std::numeric_limits<double>::max()), m_max(std::numeric_limits<double>::min()) {}
284 void setSRID(
int srid);
293 bool LoadTin(
te::da::DataSourcePtr &inDsrc, std::string &inDsetName,
double zmin = std::numeric_limits<double>::min(),
double zmax = std::numeric_limits<double>::max());
326 bool TrianglePoints(int32_t triangId,
te::gm::Point *vertex);
328 bool NeighborsId(int32_t triangId, int32_t *neighsId);
336 int32_t OppositeNode(int32_t triangId, int32_t linId);
344 int32_t OppositeEdge(int32_t triangId, int32_t nodeId);
352 bool NodeOppositeLines(int32_t v, std::vector<int32_t> &linids);
359 int32_t PreviousNode(int32_t nodeId);
366 int32_t NextNode(int32_t nodeId);
381 std::vector<int32_t> FindLine(int32_t nid);
389 int32_t FindLine(int32_t fnid, int32_t snid);
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);
429 int32_t NodeTriangle(int32_t v);
437 bool NodeTriangles(int32_t v, std::vector<int32_t>& triangles);
444 bool ReallocateVectors(
size_t nSize);
450 bool NodeDerivatives();
456 bool TriangleFirstDeriv();
462 bool TriangleSecondDeriv();
468 bool NodeFirstDeriv();
474 bool NodeSecondDeriv();
483 bool NodeTriangles(int32_t nodeid, std::vector<int32_t> &rightri, std::vector<int32_t> &leftri);
492 bool NodeClosestPoints(int32_t nid, int32_t *clstNids,
bool useBrNode =
true);
508 TinNode CalcNodeSecondDeriv(int32_t nodeId, int32_t clstNIds[CLNODES]);
514 bool BreakNodeFirstDeriv();
520 bool BreakTriangleSecondDeriv();
529 bool BreakNodeClosestPoints(int32_t nid, int32_t *rClstNids, int32_t *lClstNids);
537 bool CalcTriangleSecondDeriv(std::vector<int32_t> &triangles, std::vector<te::gm::Point> &fderiv);
543 bool BreakNodeSecondDeriv();
549 bool CheckTopology();
555 bool CheckLines(int32_t trid);
572 bool DefineAkimaCoeficients(int32_t triid,
double *coef);
582 bool DefineAkimaCoeficients(int32_t triid, int32_t *nodesid,
te::gm::Point *p3d,
double *coef);
584 bool FillGridValue(int32_t triid, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol,
double zvalue);
594 bool DefineInterLinesColumns(int32_t *nodesid, int32_t &flin, int32_t &llin, int32_t &fcol, int32_t &lcol);
int m_srid
Attribute with spatial reference information.
void Polygons(int32_t leftpoly, int32_t rightpoly)
int32_t m_nodeto
last node number
int32_t getRightPolygon()
TEDATAACCESSEXPORT te::da::Expression * operator<(const te::da::Expression &e1, const te::da::Expression &e2)
te::sam::kdtree::Index< KD_NODE > KD_TREE
size_t m_triangsize
Triangulation triangles vector size.
void setNodeTo(int32_t nodeid)
void setNPoint(te::gm::Point npoint)
boost::shared_ptr< DataSource > DataSourcePtr
A class that represents an R-tree.
A class that models the description of a dataset.
te::gm::Envelope m_env
Attribute used to restrict the area to generate the samples.
size_t m_nodesize
Triangulation nodes vector size.
#define TEMNTEXPORT
You can use this macro in order to export/import classes and functions from this module.
int32_t m_lline
Triangulation last line number.
void setEdges(int32_t fLine, int32_t sLine, int32_t tLine)
std::vector< int32_t > & getEdge()
void Init(double xvalue, double yvalue, double zvalue, Ntype ntype=Normalnode)
Set node coordinates, height and type.
TinNode(const TinNode &rhs)
void setNodeFrom(int32_t nodeid)
TEDATAACCESSEXPORT te::da::Expression * operator==(const te::da::Expression &e1, const te::da::Expression &e2)
std::vector< TinLine > m_line
Triangulation lines vector.
void setType(Ltype ltype)
int32_t m_fbnode
First break node number.
TinLine(int32_t &nodefrom, int32_t &nodeto, int32_t &leftpoly, int32_t &rightpoly, Ltype type)
std::vector< TinTriang > m_triang
Triangulation triangles vector.
int32_t LineAtEdge(unsigned short edge)
size_t m_linesize
Triangulation lines vector size.
A LinearRing is a LineString that is both closed and simple.
std::vector< TinNode > m_nbrsderiv
std::vector< TinNode > m_nsderiv
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
An abstract class for raster data strucutures.
void Init(te::gm::Point &npoint, Ntype ntype=Normalnode)
Set node coordinates and height.
int32_t m_leftpoly
left polygon number
int32_t m_rightpoly
right polygon number
std::vector< te::gm::Point > m_nblfderiv
std::vector< te::gm::Point > m_nfderiv
TEDATAACCESSEXPORT te::da::Expression * operator>(const te::da::Expression &e1, const te::da::Expression &e2)
A class that represents a two dimensional K-d Tree (2-d Tree).
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
std::vector< TinNode > m_nblsderiv
std::vector< TinNode > m_tsderiv
Class to define TIN strutures.
std::vector< TinNode > m_node
Triangulation nodes vector.
A class that represents an Kd-tree node.
std::vector< te::gm::Point > m_nbrfderiv
void setRightPolygon(int32_t polyid)
std::vector< te::gm::Point > m_tfderiv
bool LinesId(int32_t *linesId)
te::gm::Point m_point
Node point.
void Nodes(int32_t nodefrom, int32_t nodeto)
int32_t m_nodefrom
initial node number
void setLeftPolygon(int32_t polyid)
int32_t m_ltriang
Triangulation last triangle number.
void setType(Ntype ntype)
te::gm::Point & getNPoint()
te::sam::kdtree::Node< te::gm::Coord2D, int32_t, int32_t > KD_NODE
std::vector< int32_t > m_edge
int32_t m_lnode
Triangulation last node number.