Tin.h
Go to the documentation of this file.
1 /*!
2 \file terralib/mnt/core/Tin.h
3 
4 \brief This file contains a class to define a TIN.
5 Adapted from SPRING
6 */
7 
8 #ifndef __TERRALIB_MNT_INTERNAL_TIN_H
9 #define __TERRALIB_MNT_INTERNAL_TIN_H
10 
11 // Terralib Includes
12 #include "Config.h"
13 #include "Enums.h"
14 
15 #include "../../dataaccess/dataset/DataSet.h"
16 #include "../../dataaccess/dataset/DataSetType.h"
17 #include "../../dataaccess/datasource/DataSource.h"
18 
19 #include "../../geometry/Envelope.h"
20 #include "../../geometry/Point.h"
21 
22 #include "../../sam.h"
23 
24 #include <vector>
25 
26 const int32_t MAXTRIANGLES = 50;
27 const int32_t CLNODES = 10;
28 
31 
32 
33 namespace te
34 {
35  namespace mnt
36  {
37  class TinTriang
38  {
39  public:
41  m_line[0] = -1;
42  m_line[1] = -1;
43  m_line[2] = -1;
44  }
45 
46  /*! Set triangle edges.*/
47  void setEdges(int32_t fLine, int32_t sLine, int32_t tLine)
48  {
49  m_line[0] = fLine;
50  m_line[1] = sLine;
51  m_line[2] = tLine;
52  }
53 
54  //....Fill in vector of triangle lines Ids.
55  bool LinesId(int32_t *linesId)
56  {
57  if (m_line[0] < 0 || m_line[1] < 0 || m_line[2] < 0)
58  return false;
59  linesId[0] = m_line[0];
60  linesId[1] = m_line[1];
61  linesId[2] = m_line[2];
62  return true;
63  }
64 
65  //....Get the line at an edge of the triangle.
66  //....Input:
67  //......edge: edge number (0, 1 or 2).
68  //....Return:
69  //......Line at edge number.
70  int32_t LineAtEdge(unsigned short edge)
71  {
72  if (edge < 3)
73  return m_line[edge];
74  else
75  return -1;
76  }
77  protected:
78  int32_t m_line[3];// line numbers vector
79  };
80 
81 
82  class TinLine
83  {
84  public:
86 
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) {}
89 
90  bool operator==(const TinLine &rhs) const;
91 
92  bool operator>(const TinLine &rhs) const;
93 
94  bool operator<(const TinLine &rhs) const;
95 
96  /*! Set initial node number.*/
97  void setNodeFrom(int32_t nodeid) { m_nodefrom = nodeid; }
98 
99  /*! Get initial node number.*/
100  int32_t getNodeFrom() { return m_nodefrom; }
101 
102  /*! Set last node number.*/
103  void setNodeTo(int32_t nodeid) { m_nodeto = nodeid; }
104 
105  /*! Get last node number.*/
106  int32_t getNodeTo() { return m_nodeto; }
107 
108  /*! Set initial and last node numbers.*/
109  void Nodes(int32_t nodefrom, int32_t nodeto)
110  {
111  m_nodefrom = nodefrom;
112  m_nodeto = nodeto;
113  }
114 
115  /*! Set left polygon number.*/
116  void setLeftPolygon(int32_t polyid) { m_leftpoly = polyid; }
117 
118  /*! Get left polygon number.*/
119  int32_t getLeftPolygon() { return m_leftpoly; }
120 
121  /*! Set right polygon number.*/
122  void setRightPolygon(int32_t polyid) { m_rightpoly = polyid; }
123 
124  /*! Get right polygon number.*/
125  int32_t getRightPolygon() { return m_rightpoly; }
126 
127  /*! Set left and right polygon numbers*/
128  void Polygons(int32_t leftpoly, int32_t rightpoly)
129  {
130  m_leftpoly = leftpoly;
131  m_rightpoly = rightpoly;
132  }
133 
134  /*!
135  \brief Method for exchange polygons in the triangulation
136  \param oldPolyId is the identification number of the old polygon
137  \param newPolyId is the identification number of the new polygon
138  \return TRUE if the polygons are the polygons are exchanged or FALSE otherwise
139  */
140  bool ExchangePolygon(int32_t oldPolyId, int32_t newPolyId);
141 
142  /*!
143  \brief Method for exchange nodes in the triangulation
144  \param oldNodeId is the identification number of the old node
145  \param newNodeId is the identification number of the new node
146  \return TRUE if the nodes are the polygons are exchanged or FALSE otherwise
147  */
148  bool ExchangeNode(int32_t oldNodeId, int32_t newNodeId);
149 
150  /*! Set line type.*/
151  void setType(Ltype ltype) { m_type = ltype; }
152 
153  /*! Get line type.*/
154  Ltype getType() { return m_type; }
155 
156  /*!
157  \brief Method for swap two nodes
158  \return TRUE always
159  */
160  bool SwapNode();
161 
162  /*!
163  \brief Method for swap two adjacent polygons
164  \return TRUE always
165  */
166  bool SwapPolygon();
167 
168  /*!
169  \brief Method for swap two nodes and two adjacent polygons
170  \return TRUE always
171  */
172  bool SwapNodePolygon();
173 
174  protected:
175  int32_t m_nodefrom; //!< initial node number
176  int32_t m_nodeto; //!< last node number
177  int32_t m_leftpoly; //!< left polygon number
178  int32_t m_rightpoly; //!< right polygon number
179  Ltype m_type; //!< line type
180 
181  };
182 
183 
184  /*!
185  \class TinNode
186  Class that defines a node for triangular irregular network
187  */
188 
189  class TinNode
190  {
191 
192  public:
194 
195  TinNode(const TinNode &rhs){ m_type = rhs.m_type; m_edge = rhs.m_edge; m_point = rhs.m_point; }
196 
197  bool operator== (const TinNode &rhs) const;
198 
199  bool operator> (const TinNode &rhs) const;
200 
201  bool operator< (const TinNode &rhs) const;
202 
203  bool setEdge(int32_t edge);
204 
205  bool removeEdge(int32_t edge);
206 
207  std::vector<int32_t> &getEdge() { return m_edge; }
208 
209  /*! Set node height value.*/
210  void setZ(double zvalue) { m_point.setZ(zvalue); }
211 
212  /*! Get node height value.*/
213  double getZ() { return m_point.getZ(); }
214 
215  /*! Set node X axis coordinate. */
216  void setX(double xvalue) { m_point.setX(xvalue); }
217 
218  /*! Get node X axis coordinate.*/
219  double getX() { return m_point.getX(); }
220 
221  /*! Set node Y axis coordinate.*/
222  void setY(double yvalue) { m_point.setY(yvalue); }
223 
224  /*! Get node Y axis coordinate.*/
225  double getY() { return m_point.getY(); }
226 
227  /*! Set node coordinates. */
228  void setNPoint(te::gm::Point npoint) { m_point = npoint; }
229 
230  /*! Get node coordinates.*/
232 
233  /*!Set node type. */
234  void setType(Ntype ntype) { m_type = ntype; }
235 
236  /*!Get node type. */
237  Ntype getType() { return m_type; }
238 
239  //!\brief Set node coordinates and height.
240  //!\param npoint: Point with coordinates.
241  //!\param ntype: Type (default value = NORMAL).
242  void Init(te::gm::Point& npoint, Ntype ntype = Normalnode)
243  {
244  m_point = npoint;
245  m_type = ntype;
246  }
247 
248  //!\brief Set node coordinates, height and type.
249  //!\param xvalue: X axis coordinate.
250  //!\param yvalue: Y axis coordinate.
251  //!\param zvalue: Height value.
252  //!\param ntype: Type (default value = NORMAL).
253  void Init(double xvalue, double yvalue, double zvalue, Ntype ntype = Normalnode)
254  {
255  m_point.setX(xvalue);
256  m_point.setY(yvalue);
257  m_point.setZ(zvalue);
258  m_type = ntype;
259  }
260  protected:
261  Ntype m_type; //!< node type
262  te::gm::Point m_point; //!< Node point
263 
264  public:
265  std::vector<int32_t> m_edge;
266  };
267 
268  /*!
269  \class Tin
270 
271  \brief Class to define TIN strutures.
272 
273  \ingroup mnt
274 
275  */
277  {
278  public:
279  Tin() : m_nodatavalue(std::numeric_limits<double>::max()), m_min(std::numeric_limits<double>::max()), m_max(std::numeric_limits<double>::min()) {}
280 
281  /*! Function used to set the Spatial Reference System ID */
282  void setSRID(int srid);
283 
284  /*! Function used to set the envelope parameter */
285  void setEnvelope(te::gm::Envelope &env);
286 
287  /*!
288  \brief Method used to load a triangular network (TIN)
289  \return true if the TIN is loaded with no errors or false otherwise
290  */
291  bool LoadTin(te::da::DataSourcePtr &inDsrc, std::string &inDsetName, double zmin = std::numeric_limits<double>::min(), double zmax = std::numeric_limits<double>::max());
292 
293  /*!
294  \brief Method used to load a triangular network (TIN) generated by QGIS
295  \return true if the TIN is loaded with no errors or false otherwise
296  */
297  bool LoadTinQGIS(te::da::DataSourcePtr &inDsrc, std::string &inDsetName, double zmin, double zmax);
298 
299  bool SaveTin(te::da::DataSourcePtr &outDsrc, std::string &outDsetName);
300 
301  bool BuildTriangle(int32_t id, te::gm::LinearRing* lr, double *val, int32_t *right, int32_t *left, te::mnt::Ntype *type, \
302  double zmin, double zmax, bool &first, KD_TREE &nodetree, te::sam::rtree::Index<std::size_t>& linetree);
303 
304  protected:
305 
306  te::da::DataSetType* GetDataSetType(std::string &outDsetName);
307 
308  /*!
309  \brief Method that finds a triangle containing a given point
310  \param ptr1 is a pointer to a Point object
311  \return true if the triangle was found or false (-1L)otherwise
312  */
313  int32_t FindTriangle(te::gm::Point &ptr1);
314 
315  /*!
316  \brief Method that reads the vertex (points) of a given triangle
317  \param triangId is the triangle identification number
318  \param vertex is a pointer to a list of Point object, the triangle vertices
319  \return true always
320  */
321  bool TrianglePoints(int32_t triangId, te::gm::Point *vertex);
322 
323  bool NeighborsId(int32_t triangId, int32_t *neighsId);
324 
325  /*!
326  \brief Method that reads the identification number of the opposite node of a given edge
327  \param triangId is the triangle identification number
328  \param linId is the line identification number
329  \return the opposite node identification considering the linId
330  */
331  int32_t OppositeNode(int32_t triangId, int32_t linId);
332 
333  /*!
334  \brief Method that reads the identification number of the opposite edge of a given node
335  \param triangId is the triangle identification number
336  \param nodeId is the node identification number
337  \return the opposite edge identification considering the nodeId or -1 if error
338  */
339  int32_t OppositeEdge(int32_t triangId, int32_t nodeId);
340 
341  /*!
342  \brief Method that find the oposite lines of a specific node
343  \param v is the node identification number
344  \param linids is pointer to a list of line identificators
345  \return true if the line is found with no errors or false otherwise
346  */
347  bool NodeOppositeLines(int32_t v, std::vector<int32_t> &linids);
348 
349  /*!
350  \brief Method that finds out which is the previous node
351  \param nodeId is the node identification number
352  \return the number of the previous node
353  */
354  int32_t PreviousNode(int32_t nodeId);
355 
356  /*!
357  \brief Method that finds out which is the next node
358  \param nodeId is the node identification number
359  \return the number of the next node
360  */
361  int32_t NextNode(int32_t nodeId);
362 
363  /*!
364  \brief Method that verifies if a triangle contains a given point
365  \param triangId is the triangle identification number
366  \param pt is a pointer to a te::gm::PointZ object
367  \return TRUE if the point is in the triangle or FALSE (-1L)otherwise
368  */
369  bool ContainsPoint(int32_t triangId, te::gm::Point &pt);
370 
371  /*!
372  \brief Method that find a line containing a specific node
373  \param nid is the node identification number
374  \return the number of the line if it was found with no errors or FALSE (-1L) otherwise
375  */
376  std::vector<int32_t> FindLine(int32_t nid);
377 
378  /*!
379  \brief Method that find a line given two nodes identification
380  \param fnid is the first node identification number
381  \param snid is the second node identification number
382  \return the number of the line if it was found with no errors or FALSE (-1L) otherwise
383  */
384  int32_t FindLine(int32_t fnid, int32_t snid);
385 
386  /*!
387  \brief Method that includes a node in the tin line list
388  \param v is the node identificator number
389  \param linids is a pointer to a list of line identificators
390  \return TRUE if the node is included with no errors or FALSE otherwise
391  */
392  bool NodeLines(int32_t v, std::vector<int32_t> &linids);
393 
394  /*!
395  \brief Method that reads the identification number of the nodes of a given triangle
396  \param triangId is the triangle identification number
397  \param vertex is the number of the vertex to be considered
398  \return the node identification related to the vertex
399  */
400  int32_t NodeId(int32_t triangId, short vertex);
401 
402  /*!
403  \brief Method that reads the identification number of the nodes of a given triangle
404  \param triangId is the triangle identification number
405  \param nodesIds is a pointer to a list of node identification numbers
406  \return TRUE always
407  */
408  bool NodesId(int32_t triangId, int32_t *nodeIds);
409 
410 
411  /*!
412  \brief Method that includes a node in the tin node list
413  \param v is the node identification number
414  \param nodids is a pointer to a list of node identificators
415  \return TRUE if the node is included with no errors or FALSE otherwise
416  */
417  bool NodeNodes(int32_t v, std::vector<int32_t>& nodids);
418 
419  /*!
420  \brief Method that search a node in a triangulation
421  \param v is the node identification number
422  \return the right or left polygon of a line containing v or FALSE (-1L) otherwise
423  */
424  int32_t NodeTriangle(int32_t v);
425 
426  /*!
427  \brief Method that includes a node in a triangle list
428  \param v is the node identification number
429  \param triangles is pointer to a vetor of triangles
430  \return TRUE if the node is included with no errors or FALSE otherwise
431  */
432  bool NodeTriangles(int32_t v, std::vector<int32_t>& triangles);
433 
434  /*!
435  \brief Method that reallocates Vectors
436  \param nSize is the vector size
437  \return true always
438  */
439  bool ReallocateVectors(size_t nSize);
440 
441  /*!
442  \brief Method that calculates the first and second derivatives in the nodes of a given triangle
443  \return TRUE if the derivatives are calculate with no errors or FALSE otherwise
444  */
445  bool NodeDerivatives();
446 
447  /*!
448  \brief Method that calculates the first derivatives in the nodes of a given triangle
449  \return TRUE if the derivatives are calculate with no errors or FALSE otherwise
450  */
451  bool TriangleFirstDeriv();
452 
453  /*!
454  \brief Method that calculates the second derivatives in the nodes of a given triangle
455  \return TRUE if the derivatives are calculate with no errors or FALSE otherwise
456  */
457  bool TriangleSecondDeriv();
458 
459  /*!
460  \brief Method that calculates the first derivatives in the nodes of a given triangle
461  \return TRUE if the derivatives are calculate with no errors or FALSE otherwise
462  */
463  bool NodeFirstDeriv();
464 
465  /*!
466  \brief Method that calculates the second derivative at all triangulation nodes
467  \return TRUE if the derivatives are calculated with no errors or False otherwise
468  */
469  bool NodeSecondDeriv();
470 
471  /*!
472  \brief Method that find the triangle list sharing a given node
473  \param nodeid is the node identification number
474  \param rightri is a pointer to the triangles at right side
475  \param lefttri is a pointer to the triangles at left side
476  \return TRUE if the lists are find with no errors or FALSE otherwise
477  */
478  bool NodeTriangles(int32_t nodeid, std::vector<int32_t> &rightri, std::vector<int32_t> &leftri);
479 
480  /*!
481  \brief Method that searches the closest points of a specific node
482  \param nid is the node identification number
483  \param clstNids is a pointer to a list of closest node identificators
484  \param useBrNode is the break nodeidentification
485  \return TRUE if the points are found with no errors or FALSE otherwise
486  */
487  bool NodeClosestPoints(int32_t nid, int32_t *clstNids, bool useBrNode = true);
488 
489  /*!
490  \brief Method that calculates the first derivative in a given node
491  \param nodeid is the node identification number
492  \param clstNodes is the vector of a list of nodes)
493  \return a Point object containing the first derivative in x and y directions
494  */
495  te::gm::Point CalcNodeFirstDeriv(int32_t nodeId, int32_t clstNodes[CLNODES]);
496 
497  /*!
498  \brief Method that calculates the second derivative in a given node
499  \param nodeid is the node identification number
500  \param clstNIds is the vector of a list of nodes identification
501  \return a Point object containing the first derivative in x and y directions
502  */
503  TinNode CalcNodeSecondDeriv(int32_t nodeId, int32_t clstNIds[CLNODES]);
504 
505  /*!
506  \brief Method that calculates the first derivatives in the nodes of a given break triangle
507  \return TRUE if the derivatives are calculate with no errors or FALSE otherwise
508  */
509  bool BreakNodeFirstDeriv();
510 
511  /*!
512  \brief Method that calculates the second derivatives in the nodes of a given break triangle
513  \return TRUE if the derivatives are calculate with no errors or FALSE otherwise
514  */
515  bool BreakTriangleSecondDeriv();
516 
517  /*!
518  \brief Method that searches the Break node closest points
519  \param nid is the node identification number
520  \param rClstNids is a pointer to a list of right node identificators
521  \param lClstNids is a pointer to a list of left node identificators
522  \return TRUE if the points are found with no errors or FALSE otherwise
523  */
524  bool BreakNodeClosestPoints(int32_t nid, int32_t *rClstNids, int32_t *lClstNids);
525 
526  /*!
527  \brief Method that calculates the second derivatives in a node of a given triangle
528  \param triangles is a pointer to a list of triangle identificators (SIDList object)
529  \param fderiv is a pointer to a Point object representing the first derivative in x and y directions
530  \return TRUE if the derivatives are calculate with no errors or FALSE otherwise
531  */
532  bool CalcTriangleSecondDeriv(std::vector<int32_t> &triangles, std::vector<te::gm::Point> &fderiv);
533 
534  /*!
535  \brief Method that calculates the second derivative at all triangulation break nodes
536  \return TRUE if the derivatives are calculated with no errors or False otherwise
537  */
538  bool BreakNodeSecondDeriv();
539 
540  /*!
541  \brief Method that check the topology in a triangulation
542  \return TRUE if the topology was checked with no errors or FALSE otherwise
543  */
544  bool CheckTopology();
545 
546  /*!
547  \brief Method that check the lines in a triangulation
548  \return TRUE if the lines was checked with no errors or FALSE otherwise
549  */
550  bool CheckLines(int32_t trid);
551 
552  /*!
553  \brief Method that evaluates Z values for pt1 and pt2 using the Akima polynomium fitted in a triangle
554  \param triid is the triangle identificator number
555  \param pt1 is a pointer to a Point3d object
556  \param pt2 is a pointer to a Point3d object
557  \return TRUE always
558  */
559  bool CalcZvalueAkima(int32_t triid, te::gm::Point &pt1, te::gm::Point &pt2);
560 
561  /*!
562  \brief Method that defines the coefficients of the Akima polynomium fitted in a given triangle
563  \param triid is the triangle identification number
564  \param coef is a pointer to a double vector containing the polynomium coefficients
565  \return TRUE if the coefficients are determined with no errors or FALSE otherwise
566  */
567  bool DefineAkimaCoeficients(int32_t triid, double *coef);
568 
569  /*!
570  \brief Method that defines the coefficients of the Akima polynomium fitted in a given triangle
571  \param triid is the triangle identification number
572  \param nodesid is the list of triangle nodes identification
573  \param p3d is a pointer to a Point3d object
574  \param coef is a pointer to a double vector containing the polynomium coefficients
575  \return TRUE if the coefficients are determined with no errors or FALSE otherwise
576  */
577  bool DefineAkimaCoeficients(int32_t triid, int32_t *nodesid, te::gm::Point *p3d, double *coef);
578 
579  bool FillGridValue(int32_t triid, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol, double zvalue);
580 
581  /*!
582  \brief Method that calculates the lines and the columns intercepted by a triangle
583  \param grid is a pointer to a grid object that will be created
584  \param nodesid is a vector with nodes identification of the current triangle
585  \param flin and llin are the first and the last lines (rows) of the grid
586  \param fcol and lcol are the first and the last columns of the grid
587  \return TRUE if the gradient grid is filled or FALSE otherwise
588  */
589  bool DefineInterLinesColumns(int32_t *nodesid, int32_t &flin, int32_t &llin, int32_t &fcol, int32_t &lcol);
590 
591  int m_srid; //!< Attribute with spatial reference information
592 
593  te::gm::Envelope m_env; //!< Attribute used to restrict the area to generate the samples.
594 
595  size_t m_linesize; //!< Triangulation lines vector size.
596  size_t m_triangsize; //!< Triangulation triangles vector size.
597  size_t m_nodesize; //!< Triangulation nodes vector size.
598 
599  std::vector<TinLine> m_line; //!< Triangulation lines vector.
600  std::vector<TinTriang> m_triang; //!< Triangulation triangles vector.
601  std::vector<TinNode> m_node; //!< Triangulation nodes vector.
602 
603  std::vector<te::gm::Point> m_tfderiv; //Pointer to triangles first derivatives vector.
604  std::vector<te::gm::Point> m_nfderiv; //Pointer to nodes first derivatives vector.
605  std::vector<te::gm::Point> m_nbrfderiv; //Pointer to right side nodes first derivatives vector.
606  std::vector<te::gm::Point> m_nblfderiv; //Pointer to left side nodes first derivatives vector.
607  std::vector<TinNode> m_tsderiv; //Pointer to triangles second derivatives vector.
608  std::vector<TinNode> m_nsderiv; //Pointer to nodes second derivatives vector.
609  std::vector<TinNode> m_nbrsderiv; //Pointer to right side nodes second derivatives vector.
610  std::vector<TinNode> m_nblsderiv; //Pointer to left side nodes second derivatives vector.
611 
612  int32_t m_fbnode; //!<First break node number.
613  int32_t m_lnode; //!<Triangulation last node number.
614  int32_t m_ltriang; //!<Triangulation last triangle number.
615  int32_t m_lline; //!<Triangulation last line number.
616 
618  double m_min;
619  double m_max;
620 
622  double m_resx, m_resy;
623 
624  };
625 
626  } // end namespace mnt
627 } // end namespace te
628 
629 #endif
int m_srid
Attribute with spatial reference information.
Definition: Tin.h:591
void Polygons(int32_t leftpoly, int32_t rightpoly)
Definition: Tin.h:128
int32_t m_nodeto
last node number
Definition: Tin.h:176
bool ExchangePolygon(int32_t oldPolyId, int32_t newPolyId)
Method for exchange polygons in the triangulation.
int32_t getRightPolygon()
Definition: Tin.h:125
bool setEdge(int32_t edge)
te::sam::kdtree::Index< KD_NODE > KD_TREE
Definition: Tin.h:30
size_t m_triangsize
Triangulation triangles vector size.
Definition: Tin.h:596
void setNodeTo(int32_t nodeid)
Definition: Tin.h:103
int32_t m_line[3]
Definition: Tin.h:78
bool operator==(const TinLine &rhs) const
int32_t getNodeFrom()
Definition: Tin.h:100
void setNPoint(te::gm::Point npoint)
Definition: Tin.h:228
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1438
bool operator<(const TinNode &rhs) const
A class that represents an R-tree.
Definition: Index.h:56
double getX()
Definition: Tin.h:219
A class that models the description of a dataset.
Definition: DataSetType.h:72
te::gm::Envelope m_env
Attribute used to restrict the area to generate the samples.
Definition: Tin.h:593
Ltype m_type
line type
Definition: Tin.h:179
size_t m_nodesize
Triangulation nodes vector size.
Definition: Tin.h:597
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.
Definition: Config.h:41
int32_t m_lline
Triangulation last line number.
Definition: Tin.h:615
void setEdges(int32_t fLine, int32_t sLine, int32_t tLine)
Definition: Tin.h:47
std::vector< int32_t > & getEdge()
Definition: Tin.h:207
void setZ(double zvalue)
Definition: Tin.h:210
bool removeEdge(int32_t edge)
double m_max
Definition: Tin.h:619
void Init(double xvalue, double yvalue, double zvalue, Ntype ntype=Normalnode)
Set node coordinates, height and type.
Definition: Tin.h:253
TinNode(const TinNode &rhs)
Definition: Tin.h:195
void setNodeFrom(int32_t nodeid)
Definition: Tin.h:97
std::vector< TinLine > m_line
Triangulation lines vector.
Definition: Tin.h:599
void setType(Ltype ltype)
Definition: Tin.h:151
bool SwapPolygon()
Method for swap two adjacent polygons.
int32_t m_fbnode
First break node number.
Definition: Tin.h:612
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)
Definition: Tin.h:87
std::vector< TinTriang > m_triang
Triangulation triangles vector.
Definition: Tin.h:600
bool operator==(const TinNode &rhs) const
int32_t LineAtEdge(unsigned short edge)
Definition: Tin.h:70
size_t m_linesize
Triangulation lines vector size.
Definition: Tin.h:595
double m_nodatavalue
Definition: Tin.h:617
double m_min
Definition: Tin.h:618
A LinearRing is a LineString that is both closed and simple.
Definition: LinearRing.h:53
bool SwapNodePolygon()
Method for swap two nodes and two adjacent polygons.
std::vector< TinNode > m_nbrsderiv
Definition: Tin.h:609
Ntype
Definition: Enums.h:31
int32_t getNodeTo()
Definition: Tin.h:106
std::vector< TinNode > m_nsderiv
Definition: Tin.h:608
const double & getY() const
It returns the Point y-coordinate value.
Definition: Point.h:152
A point with x and y coordinate values.
Definition: Point.h:50
const int32_t MAXTRIANGLES
Definition: Tin.h:26
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
An abstract class for raster data strucutures.
Definition: Raster.h:71
void Init(te::gm::Point &npoint, Ntype ntype=Normalnode)
Set node coordinates and height.
Definition: Tin.h:242
int32_t m_leftpoly
left polygon number
Definition: Tin.h:177
URI C++ Library.
int32_t m_rightpoly
right polygon number
Definition: Tin.h:178
int32_t getLeftPolygon()
Definition: Tin.h:119
std::vector< te::gm::Point > m_nblfderiv
Definition: Tin.h:606
const int32_t CLNODES
Definition: Tin.h:27
std::vector< te::gm::Point > m_nfderiv
Definition: Tin.h:604
A class that represents a two dimensional K-d Tree (2-d Tree).
Definition: Index.h:68
double m_resy
Definition: Tin.h:622
Ntype getType()
Definition: Tin.h:237
Ltype
Definition: Enums.h:20
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
const double & getZ() const
It returns the Point z-coordinate value, if it has one or DoubleNotANumber otherwise.
Definition: Point.h:166
te::rst::Raster * m_rst
Definition: Tin.h:621
std::vector< TinNode > m_nblsderiv
Definition: Tin.h:610
bool operator>(const TinNode &rhs) const
void setX(double xvalue)
Definition: Tin.h:216
std::vector< TinNode > m_tsderiv
Definition: Tin.h:607
Class to define TIN strutures.
Definition: Tin.h:276
double getY()
Definition: Tin.h:225
void setX(const double &x)
It sets the Point x-coordinate value.
Definition: Point.h:145
std::vector< TinNode > m_node
Triangulation nodes vector.
Definition: Tin.h:601
A class that represents an Kd-tree node.
Definition: Node.h:61
std::vector< te::gm::Point > m_nbrfderiv
Definition: Tin.h:605
void setY(double yvalue)
Definition: Tin.h:222
void setRightPolygon(int32_t polyid)
Definition: Tin.h:122
std::vector< te::gm::Point > m_tfderiv
Definition: Tin.h:603
bool LinesId(int32_t *linesId)
Definition: Tin.h:55
Ltype getType()
Definition: Tin.h:154
void setY(const double &y)
It sets the Point y-coordinate value.
Definition: Point.h:159
te::gm::Point m_point
Node point.
Definition: Tin.h:262
void Nodes(int32_t nodefrom, int32_t nodeto)
Definition: Tin.h:109
bool operator<(const TinLine &rhs) const
int32_t m_nodefrom
initial node number
Definition: Tin.h:175
void setLeftPolygon(int32_t polyid)
Definition: Tin.h:116
int32_t m_ltriang
Triangulation last triangle number.
Definition: Tin.h:614
double getZ()
Definition: Tin.h:213
void setType(Ntype ntype)
Definition: Tin.h:234
te::gm::Point & getNPoint()
Definition: Tin.h:231
te::sam::kdtree::Node< te::gm::Coord2D, int32_t, int32_t > KD_NODE
Definition: Tin.h:29
Ntype m_type
node type
Definition: Tin.h:261
const double & getX() const
It returns the Point x-coordinate value.
Definition: Point.h:138
std::vector< int32_t > m_edge
Definition: Tin.h:265
int32_t m_lnode
Triangulation last node number.
Definition: Tin.h:613
void setZ(const double &z)
It sets the Point z-coordinate value.
Definition: Point.h:173
General enumerations.