Quantum GIS API Documentation  1.8
src/analysis/network/qgsgraphbuilderintr.h
Go to the documentation of this file.
00001 /***************************************************************************
00002   qgsgraphbuilder.h
00003   --------------------------------------
00004   Date                 : 2010-10-22
00005   Copyright            : (C) 2010 by Yakushev Sergey
00006   Email                : YakushevS <at> list.ru
00007 ****************************************************************************
00008 *                                                                          *
00009 *   This program is free software; you can redistribute it and/or modify   *
00010 *   it under the terms of the GNU General Public License as published by   *
00011 *   the Free Software Foundation; either version 2 of the License, or      *
00012 *   (at your option) any later version.                                    *
00013 *                                                                          *
00014 ***************************************************************************/
00015 #ifndef QGSGRAPHBUILDERINTERFACE
00016 #define QGSGRAPHBUILDERINTERFACE
00017 
00018 //QT4 includes
00019 #include <QVector>
00020 #include <QVariant>
00021 
00022 //QGIS includes
00023 #include <qgspoint.h>
00024 #include <qgscoordinatereferencesystem.h>
00025 #include <qgsdistancearea.h>
00026 
00027 //forward declarations
00028 
00034 class ANALYSIS_EXPORT QgsGraphBuilderInterface
00035 {
00036   public:
00044     QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem& crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" ) :
00045         mCrs( crs ), mCtfEnabled( ctfEnabled ), mTopologyTolerance( topologyTolerance )
00046     {
00047       mDa.setSourceCrs( mCrs.srsid() );
00048       mDa.setEllipsoid( ellipsoidID );
00049       mDa.setProjectionsEnabled( ctfEnabled );
00050     }
00051 
00053     virtual ~QgsGraphBuilderInterface()
00054     { }
00055 
00057     QgsCoordinateReferenceSystem& destinationCrs()
00058     {
00059       return mCrs;
00060     }
00061 
00063     bool coordinateTransformationEnabled()
00064     {
00065       return mCtfEnabled;
00066     }
00067 
00069     double topologyTolerance()
00070     {
00071       return mTopologyTolerance;
00072     }
00073 
00075     QgsDistanceArea* distanceArea()
00076     {
00077       return &mDa;
00078     }
00079 
00086     virtual void addVertex( int id, const QgsPoint &pt )
00087     {
00088       Q_UNUSED( id );
00089       Q_UNUSED( pt );
00090     }
00091 
00101     virtual void addArc( int pt1id, const QgsPoint& pt1, int pt2id, const QgsPoint& pt2, const QVector< QVariant >& properties )
00102     {
00103       Q_UNUSED( pt1id );
00104       Q_UNUSED( pt1 );
00105       Q_UNUSED( pt2id );
00106       Q_UNUSED( pt2 );
00107       Q_UNUSED( properties );
00108     }
00109 
00110   private:
00111     QgsCoordinateReferenceSystem mCrs;
00112 
00113     QgsDistanceArea mDa;
00114 
00115     bool mCtfEnabled;
00116 
00117     double mTopologyTolerance;
00118 
00119 };
00120 #endif //QGSGRAPHBUILDERINTERFACE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines