QGIS API Documentation  2.99.0-Master (9caa722)
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>
23 #include "TriangleInterpolator.h"
24 #include "qgis_analysis.h"
25 
26 class QgsFeatureSink;
27 class Line3D;
28 class QgsFields;
29 class QgsFeedback;
30 
31 #define SIP_NO_FILE
32 
37 class ANALYSIS_EXPORT Triangulation
38 {
39  public:
42  {
45  InsertVertex
46  };
47  virtual ~Triangulation();
48 
53  virtual void addLine( Line3D *line SIP_TRANSFER, bool breakline ) = 0;
54 
59  virtual int addPoint( QgsPoint *p ) = 0;
60 
65  virtual bool calcNormal( double x, double y, Vector3D *result SIP_OUT ) = 0;
66 
68  virtual void performConsistencyTest() = 0;
69 
74  virtual bool calcPoint( double x, double y, QgsPoint *result SIP_OUT ) = 0;
75 
77  virtual QgsPoint *getPoint( unsigned int i ) const = 0;
78 
82  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 );
83 
85  virtual bool getTriangle( double x, double y, QgsPoint *p1 SIP_OUT, QgsPoint *p2 SIP_OUT, QgsPoint *p3 SIP_OUT ) = 0;
86 
88  virtual int getOppositePoint( int p1, int p2 ) = 0;
89 
91  virtual double getXMax() const = 0;
92 
94  virtual double getXMin() const = 0;
95 
97  virtual double getYMax() const = 0;
98 
100  virtual double getYMin() const = 0;
101 
103  virtual int getNumberOfPoints() const = 0;
104 
112  virtual QList<int> *getSurroundingTriangles( int pointno ) = 0;
113 
119  virtual QList<int> *getPointsAroundEdge( double x, double y ) = 0;
120 
122  //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0;
123 
125  virtual void setForcedCrossBehavior( Triangulation::ForcedCrossBehavior b ) = 0;
126 
128  virtual void setEdgeColor( int r, int g, int b ) = 0;
129 
131  virtual void setForcedEdgeColor( int r, int g, int b ) = 0;
132 
134  virtual void setBreakEdgeColor( int r, int g, int b ) = 0;
135 
137  virtual void setTriangleInterpolator( TriangleInterpolator *interpolator ) = 0;
138 
140  virtual void eliminateHorizontalTriangles() = 0;
141 
143  virtual void ruppertRefinement() = 0;
144 
146  virtual bool pointInside( double x, double y ) = 0;
147 
149  //virtual bool readFromTAFF(QString fileName)=0;
150 
152  //virtual bool saveToTAFF(QString fileName) const=0;
153 
155  virtual bool swapEdge( double x, double y ) = 0;
156 
164  static QgsFields triangulationFields();
165 
177  virtual bool saveTriangulation( QgsFeatureSink *sink, QgsFeedback *feedback = nullptr ) const = 0;
178 };
179 
180 #ifndef SIP_RUN
182 {
183 }
184 #endif
185 
186 #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:44
An interface for objects which accept features via addFeature(s) methods.
Container of fields for a vector layer.
Definition: qgsfields.h:41
This class represents a line.
Definition: Line3D.h:30
Base class for feedback objects to be used for cancelation of something running in a worker thread...
Definition: qgsfeedback.h:43
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:32
This is an interface for interpolator classes for triangulations.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
Interface for Triangulation classes.
Definition: Triangulation.h:37
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:43
#define SIP_OUT
Definition: qgis_sip.h:51
ForcedCrossBehavior
Enumeration describing the behavior, if two forced lines cross.
Definition: Triangulation.h:41
#define SIP_PYNAME(name)
Definition: qgis_sip.h:74