QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "Line3D.h"
25 #include <TriangleInterpolator.h>
26 
28 class ANALYSIS_EXPORT Triangulation
29 {
30  public:
32  enum forcedCrossBehaviour {SnappingType_VERTICE, DELETE_FIRST, INSERT_VERTICE};
33  virtual ~Triangulation();
35  virtual void addLine( Line3D* line, bool breakline ) = 0;
37  virtual int addPoint( Point3D* p ) = 0;
39  virtual bool calcNormal( double x, double y, Vector3D* result ) = 0;
41  virtual void performConsistencyTest() = 0;
43  virtual bool calcPoint( double x, double y, Point3D* result ) = 0;
45  virtual Point3D* getPoint( unsigned int i ) const = 0;
47 
48  virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ) = 0;
50  virtual bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 ) = 0;
52  virtual int getOppositePoint( int p1, int p2 ) = 0;
54  virtual double getXMax() const = 0;
56  virtual double getXMin() const = 0;
58  virtual double getYMax() const = 0;
60  virtual double getYMin() const = 0;
62  virtual int getNumberOfPoints() const = 0;
64  virtual QList<int>* getSurroundingTriangles( int pointno ) = 0;
66  virtual QList<int>* getPointsAroundEdge( double x, double y ) = 0;
68  //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0;
70  virtual void setForcedCrossBehaviour( Triangulation::forcedCrossBehaviour b ) = 0;
72  virtual void setEdgeColor( int r, int g, int b ) = 0;
74  virtual void setForcedEdgeColor( int r, int g, int b ) = 0;
76  virtual void setBreakEdgeColor( int r, int g, int b ) = 0;
78  virtual void setTriangleInterpolator( TriangleInterpolator* interpolator ) = 0;
80  virtual void eliminateHorizontalTriangles() = 0;
82  virtual void ruppertRefinement() = 0;
84  virtual bool pointInside( double x, double y ) = 0;
86  //virtual bool readFromTAFF(QString fileName)=0;
88  //virtual bool saveToTAFF(QString fileName) const=0;
90  virtual bool swapEdge( double x, double y ) = 0;
93  virtual bool saveAsShapefile( const QString& fileName ) const = 0;
94 };
95 
97 {
98 
99 }
100 
101 #endif