QGIS API Documentation  2.9.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:
31  enum forcedCrossBehaviour {SnappingType_VERTICE, DELETE_FIRST, INSERT_VERTICE};
32  virtual ~Triangulation();
34  virtual void addLine( Line3D* line, bool breakline ) = 0;
36  virtual int addPoint( Point3D* p ) = 0;
38  virtual bool calcNormal( double x, double y, Vector3D* result ) = 0;
40  virtual void performConsistencyTest() = 0;
42  virtual bool calcPoint( double x, double y, Point3D* result ) = 0;
44  virtual Point3D* getPoint( unsigned int i ) const = 0;
46  virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ) = 0;
49  virtual bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 ) = 0;
51  virtual int getOppositePoint( int p1, int p2 ) = 0;
53  virtual double getXMax() const = 0;
55  virtual double getXMin() const = 0;
57  virtual double getYMax() const = 0;
59  virtual double getYMin() const = 0;
61  virtual int getNumberOfPoints() const = 0;
63  virtual QList<int>* getSurroundingTriangles( int pointno ) = 0;
65  virtual QList<int>* getPointsAroundEdge( double x, double y ) = 0;
67  //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0;
69  virtual void setForcedCrossBehaviour( Triangulation::forcedCrossBehaviour b ) = 0;
71  virtual void setEdgeColor( int r, int g, int b ) = 0;
73  virtual void setForcedEdgeColor( int r, int g, int b ) = 0;
75  virtual void setBreakEdgeColor( int r, int g, int b ) = 0;
77  virtual void setTriangleInterpolator( TriangleInterpolator* interpolator ) = 0;
79  virtual void eliminateHorizontalTriangles() = 0;
81  virtual void ruppertRefinement() = 0;
83  virtual bool pointInside( double x, double y ) = 0;
85  //virtual bool readFromTAFF(QString fileName)=0;
87  //virtual bool saveToTAFF(QString fileName) const=0;
89  virtual bool swapEdge( double x, double y ) = 0;
92  virtual bool saveAsShapefile( const QString& fileName ) const = 0;
93 };
94 
96 {
97 
98 }
99 
100 #endif
virtual ~Triangulation()
Definition: Triangulation.h:95
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