QGIS API Documentation  2.99.0-Master (b8fd1fd)
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 <qpainter.h>
22 #include <TriangleInterpolator.h>
23 #include "qgis_analysis.h"
24 
25 class Line3D;
26 
29 class ANALYSIS_EXPORT Triangulation
30 {
31  public:
34  {
37  InsertVertex
38  };
39  virtual ~Triangulation();
40 
45  virtual void addLine( Line3D *line, bool breakline ) = 0;
46 
51  virtual int addPoint( Point3D *p ) = 0;
52 
57  virtual bool calcNormal( double x, double y, Vector3D *result ) = 0;
58 
60  virtual void performConsistencyTest() = 0;
61 
66  virtual bool calcPoint( double x, double y, Point3D *result ) = 0;
67 
69  virtual Point3D *getPoint( unsigned int i ) const = 0;
70 
74  virtual bool getTriangle( double x, double y, Point3D *p1, int *n1, Point3D *p2, int *n2, Point3D *p3, int *n3 ) = 0;
75 
77  virtual bool getTriangle( double x, double y, Point3D *p1, Point3D *p2, Point3D *p3 ) = 0;
78 
80  virtual int getOppositePoint( int p1, int p2 ) = 0;
81 
83  virtual double getXMax() const = 0;
84 
86  virtual double getXMin() const = 0;
87 
89  virtual double getYMax() const = 0;
90 
92  virtual double getYMin() const = 0;
93 
95  virtual int getNumberOfPoints() const = 0;
96 
104  virtual QList<int> *getSurroundingTriangles( int pointno ) = 0;
105 
111  virtual QList<int> *getPointsAroundEdge( double x, double y ) = 0;
112 
114  //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0;
115 
117  virtual void setForcedCrossBehavior( Triangulation::ForcedCrossBehavior b ) = 0;
118 
120  virtual void setEdgeColor( int r, int g, int b ) = 0;
121 
123  virtual void setForcedEdgeColor( int r, int g, int b ) = 0;
124 
126  virtual void setBreakEdgeColor( int r, int g, int b ) = 0;
127 
129  virtual void setTriangleInterpolator( TriangleInterpolator *interpolator ) = 0;
130 
132  virtual void eliminateHorizontalTriangles() = 0;
133 
135  virtual void ruppertRefinement() = 0;
136 
138  virtual bool pointInside( double x, double y ) = 0;
139 
141  //virtual bool readFromTAFF(QString fileName)=0;
142 
144  //virtual bool saveToTAFF(QString fileName) const=0;
145 
147  virtual bool swapEdge( double x, double y ) = 0;
148 
153  virtual bool saveAsShapefile( const QString &fileName ) const = 0;
154 };
155 
157 {
158 
159 }
160 
161 #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:36
This class represents a line.
Definition: Line3D.h:25
Point3D is a class to represent a three dimensional point.
Definition: Point3D.h:25
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.
Interface for Triangulation classes.
Definition: Triangulation.h:29
The second inserted forced line is snapped to the closest vertice of the first inserted forced line...
Definition: Triangulation.h:35
ForcedCrossBehavior
Enumeration describing the behavior, if two forced lines cross.
Definition: Triangulation.h:33