QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 "Line3D.h"
22 #include "Vector3D.h"
23 #include <qpainter.h>
24 #include <TriangleInterpolator.h>
25 
28 class ANALYSIS_EXPORT Triangulation
29 {
30  public:
33  {
36  INSERT_VERTICE
37  };
38  virtual ~Triangulation();
39 
44  virtual void addLine( Line3D* line, bool breakline ) = 0;
45 
50  virtual int addPoint( Point3D* p ) = 0;
51 
56  virtual bool calcNormal( double x, double y, Vector3D* result ) = 0;
57 
59  virtual void performConsistencyTest() = 0;
60 
65  virtual bool calcPoint( double x, double y, Point3D* result ) = 0;
66 
68  virtual Point3D* getPoint( unsigned int i ) const = 0;
69 
73  virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ) = 0;
74 
76  virtual bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 ) = 0;
77 
79  virtual int getOppositePoint( int p1, int p2 ) = 0;
80 
82  virtual double getXMax() const = 0;
83 
85  virtual double getXMin() const = 0;
86 
88  virtual double getYMax() const = 0;
89 
91  virtual double getYMin() const = 0;
92 
94  virtual int getNumberOfPoints() const = 0;
95 
103  virtual QList<int>* getSurroundingTriangles( int pointno ) = 0;
104 
110  virtual QList<int>* getPointsAroundEdge( double x, double y ) = 0;
111 
113  //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0;
114 
116  virtual void setForcedCrossBehaviour( Triangulation::forcedCrossBehaviour b ) = 0;
117 
119  virtual void setEdgeColor( int r, int g, int b ) = 0;
120 
122  virtual void setForcedEdgeColor( int r, int g, int b ) = 0;
123 
125  virtual void setBreakEdgeColor( int r, int g, int b ) = 0;
126 
128  virtual void setTriangleInterpolator( TriangleInterpolator* interpolator ) = 0;
129 
131  virtual void eliminateHorizontalTriangles() = 0;
132 
134  virtual void ruppertRefinement() = 0;
135 
137  virtual bool pointInside( double x, double y ) = 0;
138 
140  //virtual bool readFromTAFF(QString fileName)=0;
141 
143  //virtual bool saveToTAFF(QString fileName) const=0;
144 
146  virtual bool swapEdge( double x, double y ) = 0;
147 
152  virtual bool saveAsShapefile( const QString& fileName ) const = 0;
153 };
154 
156 {
157 
158 }
159 
160 #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:35
This class represents a line.
Definition: Line3D.h:25
forcedCrossBehaviour
Enumeration describing the behaviour, if two forced lines cross.
Definition: Triangulation.h:32
Point3D is a class to represent a three dimensional point.
Definition: Point3D.h:24
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:28
This is an interface for interpolator classes for triangulations.
Interface for Triangulation classes.
Definition: Triangulation.h:28
the second inserted forced line is snapped to the closest vertice of the first inserted forced line...
Definition: Triangulation.h:34