QGIS API Documentation  2.99.0-Master (ae4d26a)
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 
38 class ANALYSIS_EXPORT Triangulation
39 {
40  public:
43  {
46  InsertVertex
47  };
48  virtual ~Triangulation();
49 
54  virtual void addLine( Line3D *line SIP_TRANSFER, bool breakline ) = 0;
55 
60  virtual int addPoint( QgsPoint *p ) = 0;
61 
66  virtual bool calcNormal( double x, double y, Vector3D *result SIP_OUT ) = 0;
67 
69  virtual void performConsistencyTest() = 0;
70 
75  virtual bool calcPoint( double x, double y, QgsPoint *result SIP_OUT ) = 0;
76 
78  virtual QgsPoint *getPoint( unsigned int i ) const = 0;
79 
84  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 );
85 
87  virtual bool getTriangle( double x, double y, QgsPoint *p1 SIP_OUT, QgsPoint *p2 SIP_OUT, QgsPoint *p3 SIP_OUT ) = 0;
88 
90  virtual int getOppositePoint( int p1, int p2 ) = 0;
91 
93  virtual double getXMax() const = 0;
94 
96  virtual double getXMin() const = 0;
97 
99  virtual double getYMax() const = 0;
100 
102  virtual double getYMin() const = 0;
103 
105  virtual int getNumberOfPoints() const = 0;
106 
114  virtual QList<int> *getSurroundingTriangles( int pointno ) = 0;
115 
122  virtual QList<int> *getPointsAroundEdge( double x, double y ) = 0;
123 
125  //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0;
126 
128  virtual void setForcedCrossBehavior( Triangulation::ForcedCrossBehavior b ) = 0;
129 
131  virtual void setEdgeColor( int r, int g, int b ) = 0;
132 
134  virtual void setForcedEdgeColor( int r, int g, int b ) = 0;
135 
137  virtual void setBreakEdgeColor( int r, int g, int b ) = 0;
138 
140  virtual void setTriangleInterpolator( TriangleInterpolator *interpolator ) = 0;
141 
143  virtual void eliminateHorizontalTriangles() = 0;
144 
146  virtual void ruppertRefinement() = 0;
147 
149  virtual bool pointInside( double x, double y ) = 0;
150 
152  //virtual bool readFromTAFF(QString fileName)=0;
153 
155  //virtual bool saveToTAFF(QString fileName) const=0;
156 
158  virtual bool swapEdge( double x, double y ) = 0;
159 
167  static QgsFields triangulationFields();
168 
180  virtual bool saveTriangulation( QgsFeatureSink *sink, QgsFeedback *feedback = nullptr ) const = 0;
181 };
182 
183 #ifndef SIP_RUN
185 {
186 }
187 #endif
188 
189 #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:45
An interface for objects which accept features via addFeature(s) methods.
Container of fields for a vector layer.
Definition: qgsfields.h:42
This class represents a line.
Definition: Line3D.h:31
Base class for feedback objects to be used for cancelation of something running in a worker thread...
Definition: qgsfeedback.h:44
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:33
This is an interface for interpolator classes for triangulations.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
Interface for Triangulation classes.
Definition: Triangulation.h:38
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
The second inserted forced line is snapped to the closest vertice of the first inserted forced line...
Definition: Triangulation.h:44
#define SIP_OUT
Definition: qgis_sip.h:51
ForcedCrossBehavior
Enumeration describing the behavior, if two forced lines cross.
Definition: Triangulation.h:42
#define SIP_PYNAME(name)
Definition: qgis_sip.h:74