QGIS API Documentation  2.14.0-Essen
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 
27 class ANALYSIS_EXPORT Triangulation
28 {
29  public:
32  {
35  INSERT_VERTICE
36  };
37  virtual ~Triangulation();
38 
43  virtual void addLine( Line3D* line, bool breakline ) = 0;
44 
49  virtual int addPoint( Point3D* p ) = 0;
50 
55  virtual bool calcNormal( double x, double y, Vector3D* result ) = 0;
56 
58  virtual void performConsistencyTest() = 0;
59 
64  virtual bool calcPoint( double x, double y, Point3D* result ) = 0;
65 
67  virtual Point3D* getPoint( unsigned int i ) const = 0;
68 
72  virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ) = 0;
73 
75  virtual bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 ) = 0;
76 
78  virtual int getOppositePoint( int p1, int p2 ) = 0;
79 
81  virtual double getXMax() const = 0;
82 
84  virtual double getXMin() const = 0;
85 
87  virtual double getYMax() const = 0;
88 
90  virtual double getYMin() const = 0;
91 
93  virtual int getNumberOfPoints() const = 0;
94 
102  virtual QList<int>* getSurroundingTriangles( int pointno ) = 0;
103 
109  virtual QList<int>* getPointsAroundEdge( double x, double y ) = 0;
110 
112  //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0;
113 
115  virtual void setForcedCrossBehaviour( Triangulation::forcedCrossBehaviour b ) = 0;
116 
118  virtual void setEdgeColor( int r, int g, int b ) = 0;
119 
121  virtual void setForcedEdgeColor( int r, int g, int b ) = 0;
122 
124  virtual void setBreakEdgeColor( int r, int g, int b ) = 0;
125 
127  virtual void setTriangleInterpolator( TriangleInterpolator* interpolator ) = 0;
128 
130  virtual void eliminateHorizontalTriangles() = 0;
131 
133  virtual void ruppertRefinement() = 0;
134 
136  virtual bool pointInside( double x, double y ) = 0;
137 
139  //virtual bool readFromTAFF(QString fileName)=0;
140 
142  //virtual bool saveToTAFF(QString fileName) const=0;
143 
145  virtual bool swapEdge( double x, double y ) = 0;
146 
151  virtual bool saveAsShapefile( const QString& fileName ) const = 0;
152 };
153 
155 {
156 
157 }
158 
159 #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:34
This class represents a line.
Definition: Line3D.h:24
forcedCrossBehaviour
Enumeration describing the behaviour, if two forced lines cross.
Definition: Triangulation.h:31
Point3D is a class to represent a three dimensional point.
Definition: Point3D.h:23
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:22
This is an interface for interpolator classes for triangulations.
Interface for Triangulation classes.
Definition: Triangulation.h:27
the second inserted forced line is snapped to the closest vertice of the first inserted forced line...
Definition: Triangulation.h:33