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