Quantum GIS API Documentation
1.7.4
|
00001 /*************************************************************************** 00002 Triangulation.h - description 00003 ------------------- 00004 copyright : (C) 2004 by Marco Hugentobler 00005 email : mhugent@geo.unizh.ch 00006 ***************************************************************************/ 00007 00008 /*************************************************************************** 00009 * * 00010 * This program is free software; you can redistribute it and/or modify * 00011 * it under the terms of the GNU General Public License as published by * 00012 * the Free Software Foundation; either version 2 of the License, or * 00013 * (at your option) any later version. * 00014 * * 00015 ***************************************************************************/ 00016 00017 #ifndef TRIANGULATION_H 00018 #define TRIANGULATION_H 00019 00020 #include <QList> 00021 #include "Line3D.h" 00022 #include "Vector3D.h" 00023 #include <qpainter.h> 00024 #include "Line3D.h" 00025 #include <TriangleInterpolator.h> 00026 00028 class ANALYSIS_EXPORT Triangulation 00029 { 00030 public: 00032 enum forcedCrossBehaviour {SnappingType_VERTICE, DELETE_FIRST, INSERT_VERTICE}; 00033 virtual ~Triangulation(); 00035 virtual void addLine( Line3D* line, bool breakline ) = 0; 00037 virtual int addPoint( Point3D* p ) = 0; 00039 virtual bool calcNormal( double x, double y, Vector3D* result ) = 0; 00041 virtual void performConsistencyTest() = 0; 00043 virtual bool calcPoint( double x, double y, Point3D* result ) = 0; 00045 virtual Point3D* getPoint( unsigned int i ) const = 0; 00047 virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ) = 0; 00049 virtual bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 ) = 0; 00051 virtual int getOppositePoint( int p1, int p2 ) = 0; 00053 virtual double getXMax() const = 0; 00055 virtual double getXMin() const = 0; 00057 virtual double getYMax() const = 0; 00059 virtual double getYMin() const = 0; 00061 virtual int getNumberOfPoints() const = 0; 00063 virtual QList<int>* getSurroundingTriangles( int pointno ) = 0; 00065 virtual QList<int>* getPointsAroundEdge( double x, double y ) = 0; 00067 //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0; 00069 virtual void setForcedCrossBehaviour( Triangulation::forcedCrossBehaviour b ) = 0; 00071 virtual void setEdgeColor( int r, int g, int b ) = 0; 00073 virtual void setForcedEdgeColor( int r, int g, int b ) = 0; 00075 virtual void setBreakEdgeColor( int r, int g, int b ) = 0; 00077 virtual void setTriangleInterpolator( TriangleInterpolator* interpolator ) = 0; 00079 virtual void eliminateHorizontalTriangles() = 0; 00081 virtual void ruppertRefinement() = 0; 00083 virtual bool pointInside( double x, double y ) = 0; 00085 //virtual bool readFromTAFF(QString fileName)=0; 00087 //virtual bool saveToTAFF(QString fileName) const=0; 00089 virtual bool swapEdge( double x, double y ) = 0; 00092 virtual bool saveAsShapefile( const QString& fileName ) const = 0; 00093 }; 00094 00095 inline Triangulation::~Triangulation() 00096 { 00097 00098 } 00099 00100 #endif