QGIS API Documentation  2.99.0-Master (7d4f81d)
Triangulation.h
Go to the documentation of this file.
1 /***************************************************************************
2  Triangulation.h - description
3  -------------------
4  copyright : (C) 2004 by Marco Hugentobler
5  email : [email protected]
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef TRIANGULATION_H
18 #define TRIANGULATION_H
19 
20 #include <QList>
21 #include "qgis.h"
22 #include <qpainter.h>
23 #include <TriangleInterpolator.h>
24 #include "qgis_analysis.h"
25 
26 class Line3D;
27 
30 class ANALYSIS_EXPORT Triangulation
31 {
32  public:
35  {
38  InsertVertex
39  };
40  virtual ~Triangulation();
41 
46  virtual void addLine( Line3D *line SIP_TRANSFER, bool breakline ) = 0;
47 
52  virtual int addPoint( QgsPoint *p ) = 0;
53 
58  virtual bool calcNormal( double x, double y, Vector3D *result SIP_OUT ) = 0;
59 
61  virtual void performConsistencyTest() = 0;
62 
67  virtual bool calcPoint( double x, double y, QgsPoint *result SIP_OUT ) = 0;
68 
70  virtual QgsPoint *getPoint( unsigned int i ) const = 0;
71 
75  virtual bool getTriangle( double x, double y, QgsPoint *p1 SIP_OUT, int *n1 SIP_OUT, QgsPoint *p2 SIP_OUT, int *n2 SIP_OUT, QgsPoint *p3 SIP_OUT, int *n3 SIP_OUT ) = 0 SIP_PYNAME( getTriangleVertices );
76 
78  virtual bool getTriangle( double x, double y, QgsPoint *p1 SIP_OUT, QgsPoint *p2 SIP_OUT, QgsPoint *p3 SIP_OUT ) = 0;
79 
81  virtual int getOppositePoint( int p1, int p2 ) = 0;
82 
84  virtual double getXMax() const = 0;
85 
87  virtual double getXMin() const = 0;
88 
90  virtual double getYMax() const = 0;
91 
93  virtual double getYMin() const = 0;
94 
96  virtual int getNumberOfPoints() const = 0;
97 
105  virtual QList<int> *getSurroundingTriangles( int pointno ) = 0;
106 
112  virtual QList<int> *getPointsAroundEdge( double x, double y ) = 0;
113 
115  //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0;
116 
118  virtual void setForcedCrossBehavior( Triangulation::ForcedCrossBehavior b ) = 0;
119 
121  virtual void setEdgeColor( int r, int g, int b ) = 0;
122 
124  virtual void setForcedEdgeColor( int r, int g, int b ) = 0;
125 
127  virtual void setBreakEdgeColor( int r, int g, int b ) = 0;
128 
130  virtual void setTriangleInterpolator( TriangleInterpolator *interpolator ) = 0;
131 
133  virtual void eliminateHorizontalTriangles() = 0;
134 
136  virtual void ruppertRefinement() = 0;
137 
139  virtual bool pointInside( double x, double y ) = 0;
140 
142  //virtual bool readFromTAFF(QString fileName)=0;
143 
145  //virtual bool saveToTAFF(QString fileName) const=0;
146 
148  virtual bool swapEdge( double x, double y ) = 0;
149 
154  virtual bool saveAsShapefile( const QString &fileName ) const = 0;
155 };
156 
157 #ifndef SIP_RUN
159 {
160 }
161 #endif
162 
163 #endif
virtual ~Triangulation()
The status of the first inserted forced line is reset to that of a normal edge (so that the second in...
Definition: Triangulation.h:37
This class represents a line.
Definition: Line3D.h:26
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:29
This is an interface for interpolator classes for triangulations.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
Interface for Triangulation classes.
Definition: Triangulation.h:30
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:36
The second inserted forced line is snapped to the closest vertice of the first inserted forced line...
Definition: Triangulation.h:36
#define SIP_OUT
Definition: qgis_sip.h:51
ForcedCrossBehavior
Enumeration describing the behavior, if two forced lines cross.
Definition: Triangulation.h:34
#define SIP_PYNAME(name)
Definition: qgis_sip.h:74