QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ), mCtfEnabled( ctfEnabled ), mTopologyTolerance( topologyTolerance )
46  {
47  mDa.setSourceCrs( mCrs.srsid() );
48  mDa.setEllipsoid( ellipsoidID );
49  mDa.setEllipsoidalMode( ctfEnabled );
50  }
51 
54  { }
55 
58  {
59  return mCrs;
60  }
61 
64  {
65  return mCtfEnabled;
66  }
67 
70  {
71  return mTopologyTolerance;
72  }
73 
76  {
77  return &mDa;
78  }
79 
86  virtual void addVertex( int id, const QgsPoint &pt )
87  {
88  Q_UNUSED( id );
89  Q_UNUSED( pt );
90  }
91 
101  virtual void addArc( int pt1id, const QgsPoint& pt1, int pt2id, const QgsPoint& pt2, const QVector< QVariant >& properties )
102  {
103  Q_UNUSED( pt1id );
104  Q_UNUSED( pt1 );
105  Q_UNUSED( pt2id );
106  Q_UNUSED( pt2 );
107  Q_UNUSED( properties );
108  }
109 
110  private:
112 
114 
116 
118 
119 };
120 #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 geometry.
Definition: qgspoint.h:63
General purpose distance and area calculator.
QgsCoordinateReferenceSystem mCrs
Class for storing a coordinate reference system (CRS)
double topologyTolerance()
get topology tolerance
QgsDistanceArea * distanceArea()
get measurement tool