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/PointZ.h"
41 void setEdges(int32_t fLine, int32_t sLine, int32_t tLine)
81 TinLine(int32_t& nodefrom, int32_t &nodeto, int32_t &leftpoly, int32_t &rightpoly,
Ltype type)
103 void Nodes(int32_t nodefrom, int32_t nodeto)
142 bool ExchangeNode(int32_t oldNodeId, int32_t newNodeId);
273 Tin() : m_nodatavalue(std::numeric_limits<double>::max()), m_min(std::numeric_limits<double>::max()), m_max(std::numeric_limits<double>::min()) {}
276 void setSRID(
int srid);
285 bool LoadTin(
te::da::DataSourcePtr &inDsrc, std::string &inDsetName,
double zmin = std::numeric_limits<double>::min(),
double zmax = std::numeric_limits<double>::max());
307 bool NeighborsId(int32_t triangId, int32_t *neighsId);
315 int32_t OppositeNode(int32_t triangId, int32_t linId);
323 int32_t OppositeEdge(int32_t triangId, int32_t nodeId);
331 bool NodeOppositeLines(int32_t v, std::vector<int32_t> &linids);
338 int32_t PreviousNode(int32_t nodeId);
345 int32_t NextNode(int32_t nodeId);
360 std::vector<int32_t> FindLine(int32_t nid);
368 int32_t FindLine(int32_t fnid, int32_t snid);
376 bool NodeLines(int32_t v, std::vector<int32_t> &linids);
384 int32_t NodeId(int32_t triangId,
short vertex);
392 bool NodesId(int32_t triangId, int32_t *nodeIds);
401 bool NodeNodes(int32_t v, std::vector<int32_t>& nodids);
408 int32_t NodeTriangle(int32_t v);
416 bool NodeTriangles(int32_t v, std::vector<int32_t>& triangles);
423 bool ReallocateVectors(
size_t nSize);
429 bool NodeDerivatives();
435 bool TriangleFirstDeriv();
441 bool TriangleSecondDeriv();
447 bool NodeFirstDeriv();
453 bool NodeSecondDeriv();
462 bool NodeTriangles(int32_t nodeid, std::vector<int32_t> &rightri, std::vector<int32_t> &leftri);
471 bool NodeClosestPoints(int32_t nid, int32_t *clstNids,
bool useBrNode =
true);
487 TinNode CalcNodeSecondDeriv(int32_t nodeId, int32_t clstNIds[
CLNODES]);
493 bool BreakNodeFirstDeriv();
499 bool BreakTriangleSecondDeriv();
508 bool BreakNodeClosestPoints(int32_t nid, int32_t *rClstNids, int32_t *lClstNids);
516 bool CalcTriangleSecondDeriv(std::vector<int32_t> &triangles, std::vector<te::gm::PointZ> &fderiv);
522 bool BreakNodeSecondDeriv();
528 bool CheckTopology();
534 bool CheckLines(int32_t trid);
551 bool DefineAkimaCoeficients(int32_t triid,
double *coef);
561 bool DefineAkimaCoeficients(int32_t triid, int32_t *nodesid,
te::gm::PointZ *p3d,
double *coef);
563 bool FillGridValue(int32_t triid, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol,
double zvalue);
573 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)
te::gm::PointZ m_point
Node point.
void setNPoint(te::gm::PointZ npoint)
int32_t m_nodeto
last node number
bool ExchangePolygon(int32_t oldPolyId, int32_t newPolyId)
Method for exchange polygons in the triangulation.
int32_t getRightPolygon()
bool setEdge(int32_t edge)
size_t m_triangsize
Triangulation triangles vector size.
void setNodeTo(int32_t nodeid)
bool operator==(const TinLine &rhs) const
boost::shared_ptr< DataSource > DataSourcePtr
bool operator<(const TinNode &rhs) const
std::vector< te::gm::PointZ > m_nblfderiv
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.
bool ExchangeNode(int32_t oldNodeId, int32_t newNodeId)
Method for exchange nodes in the triangulation.
#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()
bool removeEdge(int32_t edge)
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)
std::vector< TinLine > m_line
Triangulation lines vector.
void setType(Ltype ltype)
bool SwapPolygon()
Method for swap two adjacent polygons.
int32_t m_fbnode
First break node number.
bool operator>(const TinLine &rhs) const
bool SwapNode()
Method for swap two nodes.
TinLine(int32_t &nodefrom, int32_t &nodeto, int32_t &leftpoly, int32_t &rightpoly, Ltype type)
std::vector< TinTriang > m_triang
Triangulation triangles vector.
bool operator==(const TinNode &rhs) const
te::gm::PointZ & getNPoint()
int32_t LineAtEdge(unsigned short edge)
size_t m_linesize
Triangulation lines vector size.
std::vector< te::gm::PointZ > m_nbrfderiv
bool SwapNodePolygon()
Method for swap two nodes and two adjacent polygons.
std::vector< TinNode > m_nbrsderiv
A point with z-coordinate value.
std::vector< TinNode > m_nsderiv
const double & getY() const
It returns the Point y-coordinate value.
const int32_t MAXTRIANGLES
An Envelope defines a 2D rectangular region.
An abstract class for raster data strucutures.
int32_t m_leftpoly
left polygon number
int32_t m_rightpoly
right polygon number
void Init(te::gm::PointZ &npoint, Ntype ntype=Normalnode)
Set node coordinates and height.
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
std::vector< TinNode > m_nblsderiv
bool operator>(const TinNode &rhs) const
const double & getZ() const
It returns the Point z-coordinate value.
std::vector< TinNode > m_tsderiv
Class to define TIN strutures.
void setX(const double &x)
It sets the Point x-coordinate value.
std::vector< TinNode > m_node
Triangulation nodes vector.
void setRightPolygon(int32_t polyid)
std::vector< te::gm::PointZ > m_tfderiv
bool LinesId(int32_t *linesId)
void setY(const double &y)
It sets the Point y-coordinate value.
void Nodes(int32_t nodefrom, int32_t nodeto)
bool operator<(const TinLine &rhs) const
void setZ(const double &z)
It sets the Point z-coordinate value.
int32_t m_nodefrom
initial node number
void setLeftPolygon(int32_t polyid)
int32_t m_ltriang
Triangulation last triangle number.
void setType(Ntype ntype)
const double & getX() const
It returns the Point x-coordinate value.
std::vector< int32_t > m_edge
int32_t m_lnode
Triangulation last node number.
std::vector< te::gm::PointZ > m_nfderiv