QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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:
44  QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem& crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" )
45  : mCrs( crs )
46  , mCtfEnabled( ctfEnabled )
47  , mTopologyTolerance( topologyTolerance )
48  {
49  mDa.setSourceCrs( mCrs.srsid() );
50  mDa.setEllipsoid( ellipsoidID );
51  mDa.setEllipsoidalMode( ctfEnabled );
52  }
53 
56  { }
57 
60  {
61  return mCrs;
62  }
63 
66  {
67  return mCtfEnabled;
68  }
69 
72  {
73  return mTopologyTolerance;
74  }
75 
78  {
79  return &mDa;
80  }
81 
88  virtual void addVertex( int id, const QgsPoint &pt )
89  {
90  Q_UNUSED( id );
91  Q_UNUSED( pt );
92  }
93 
103  virtual void addArc( int pt1id, const QgsPoint& pt1, int pt2id, const QgsPoint& pt2, const QVector< QVariant >& properties )
104  {
105  Q_UNUSED( pt1id );
106  Q_UNUSED( pt1 );
107  Q_UNUSED( pt2id );
108  Q_UNUSED( pt2 );
109  Q_UNUSED( properties );
110  }
111 
112  private:
114 
115  QgsDistanceArea mDa;
116 
117  bool mCtfEnabled;
118 
119  double mTopologyTolerance;
120 
121 };
122 #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.
QgsCoordinateReferenceSystem & destinationCrs()
get destinaltion Crs
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:117
General purpose distance and area calculator.
Class for storing a coordinate reference system (CRS)
double topologyTolerance()
get topology tolerance
QgsDistanceArea * distanceArea()
get measurement tool