QGIS API Documentation  2.99.0-Master (2270603)
qgsgraphbuilderintr.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgraphbuilder.h
3  --------------------------------------
4  Date : 2010-10-22
5  Copyright : (C) 2010 by Yakushev Sergey
6  Email : YakushevS <at> list.ru
7 ****************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15 #ifndef QGSGRAPHBUILDERINTERFACE
16 #define QGSGRAPHBUILDERINTERFACE
17 
18 //QT4 includes
19 #include <QVector>
20 #include <QVariant>
21 
22 //QGIS includes
23 #include <qgspoint.h>
25 #include <qgsdistancearea.h>
26 
27 //forward declarations
28 
34 class ANALYSIS_EXPORT QgsGraphBuilderInterface
35 {
36  public:
37 
45  QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem& crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" )
46  : mCrs( crs )
47  , mCtfEnabled( ctfEnabled )
48  , mTopologyTolerance( topologyTolerance )
49  {
50  mDa.setSourceCrs( mCrs.srsid() );
51  mDa.setEllipsoid( ellipsoidID );
52  mDa.setEllipsoidalMode( ctfEnabled );
53  }
54 
57  { }
58 
61  {
62  return mCrs;
63  }
64 
67  {
68  return mCtfEnabled;
69  }
70 
73  {
74  return mTopologyTolerance;
75  }
76 
79  {
80  return &mDa;
81  }
82 
89  virtual void addVertex( int id, const QgsPoint &pt )
90  {
91  Q_UNUSED( id );
92  Q_UNUSED( pt );
93  }
94 
104  virtual void addArc( int pt1id, const QgsPoint& pt1, int pt2id, const QgsPoint& pt2, const QVector< QVariant >& properties )
105  {
106  Q_UNUSED( pt1id );
107  Q_UNUSED( pt1 );
108  Q_UNUSED( pt2id );
109  Q_UNUSED( pt2 );
110  Q_UNUSED( properties );
111  }
112 
113  private:
115 
116  QgsDistanceArea mDa;
117 
118  bool mCtfEnabled;
119 
120  double mTopologyTolerance;
121 
122 };
123 #endif //QGSGRAPHBUILDERINTERFACE
virtual ~QgsGraphBuilderInterface()
Destructor.
virtual void addVertex(int id, const QgsPoint &pt)
add vertex
bool coordinateTransformationEnabled()
get coordinate transformation enabled
Determine interface for creating a graph.
virtual void addArc(int pt1id, const QgsPoint &pt1, int pt2id, const QgsPoint &pt2, const QVector< QVariant > &properties)
add arc
QgsGraphBuilderInterface(const QgsCoordinateReferenceSystem &crs, bool ctfEnabled=true, double topologyTolerance=0.0, const QString &ellipsoidID="WGS84")
QgsGraphBuilderInterface constructor.
A class to represent a point.
Definition: qgspoint.h:111
General purpose distance and area calculator.
This class represents a coordinate reference system (CRS).
double topologyTolerance()
get topology tolerance
QgsCoordinateReferenceSystem destinationCrs() const
get destinaltion Crs
QgsDistanceArea * distanceArea()
get measurement tool