QGIS API Documentation  2.11.0-Master
Triangulation.h
Go to the documentation of this file.
1 /***************************************************************************
2  Triangulation.h - description
3  -------------------
4  copyright : (C) 2004 by Marco Hugentobler
5  email : mhugent@geo.unizh.ch
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 
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: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