mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04:00
rename QgsLineVectorLayerDirector to QgsVectorLayerDirector
This commit is contained in:
parent
d657c77a8c
commit
b421a53675
@ -60,5 +60,5 @@
|
||||
%Include network/qgsgraphbuilderinterface.sip
|
||||
%Include network/qgsgraphbuilder.sip
|
||||
%Include network/qgsgraphdirector.sip
|
||||
%Include network/qgslinevectorlayerdirector.sip
|
||||
%Include network/qgsvectorlayerdirector.sip
|
||||
%Include network/qgsgraphanalyzer.sip
|
||||
|
@ -1,5 +1,5 @@
|
||||
%ModuleHeaderCode
|
||||
#include <qgslinevectorlayerdirector.h>
|
||||
#include <qgsvectorlayerdirector.h>
|
||||
%End
|
||||
|
||||
/**
|
||||
@ -14,8 +14,8 @@ class QgsGraphDirector : QObject
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
if ( dynamic_cast< QgsLineVectorLayerDirector* > ( sipCpp ) != NULL )
|
||||
sipType = sipType_QgsLineVectorLayerDirector;
|
||||
if ( dynamic_cast< QgsVectorLayerDirector* > ( sipCpp ) != NULL )
|
||||
sipType = sipType_QgsVectorLayerDirector;
|
||||
else
|
||||
sipType = NULL;
|
||||
%End
|
||||
|
@ -1,12 +1,12 @@
|
||||
/**
|
||||
* \ingroup analysis
|
||||
* \class QgsLineVectorLayerDirector
|
||||
* \class QgsVectorLayerDirector
|
||||
* \brief Determine making the graph from vector line layer
|
||||
*/
|
||||
class QgsLineVectorLayerDirector : QgsGraphDirector
|
||||
class QgsVectorLayerDirector : QgsGraphDirector
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgslinevectorlayerdirector.h>
|
||||
#include <qgsvectorlayerdirector.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
@ -32,16 +32,16 @@ class QgsLineVectorLayerDirector : QgsGraphDirector
|
||||
* @param defaultDirection default road direction. Will be used if corresponding
|
||||
* attribute value is not set or does not equal to the given values
|
||||
*/
|
||||
QgsLineVectorLayerDirector( QgsVectorLayer* myLayer,
|
||||
int directionFieldId,
|
||||
const QString& directDirectionValue,
|
||||
const QString& reverseDirectionValue,
|
||||
const QString& bothDirectionValue,
|
||||
const Direction defaultDirection
|
||||
);
|
||||
QgsVectorLayerDirector( QgsVectorLayer* myLayer,
|
||||
int directionFieldId,
|
||||
const QString& directDirectionValue,
|
||||
const QString& reverseDirectionValue,
|
||||
const QString& bothDirectionValue,
|
||||
const Direction defaultDirection
|
||||
);
|
||||
|
||||
//! Destructor
|
||||
virtual ~QgsLineVectorLayerDirector();
|
||||
virtual ~QgsVectorLayerDirector();
|
||||
|
||||
/*
|
||||
* MANDATORY DIRECTOR PROPERTY DECLARATION
|
@ -51,7 +51,7 @@ SET(QGIS_ANALYSIS_SRCS
|
||||
network/qgsgraphbuilder.cpp
|
||||
network/qgsnetworkspeedstrategy.cpp
|
||||
network/qgsnetworkdistancestrategy.cpp
|
||||
network/qgslinevectorlayerdirector.cpp
|
||||
network/qgsvectorlayerdirector.cpp
|
||||
network/qgsgraphanalyzer.cpp
|
||||
)
|
||||
|
||||
@ -61,7 +61,7 @@ SET(QGIS_ANALYSIS_MOC_HDRS
|
||||
vector/qgsgeometrysnapper.h
|
||||
|
||||
network/qgsgraphdirector.h
|
||||
network/qgslinevectorlayerdirector.h
|
||||
network/qgsvectorlayerdirector.h
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES(SYSTEM ${SPATIALITE_INCLUDE_DIR})
|
||||
@ -150,7 +150,7 @@ SET(QGIS_ANALYSIS_HDRS
|
||||
network/qgsnetworkspeedstrategy.h
|
||||
network/qgsnetworkdistancestrategy.h
|
||||
network/qgsgraphdirector.h
|
||||
network/qgslinevectorlayerdirector.h
|
||||
network/qgsvectorlayerdirector.h
|
||||
network/qgsgraphanalyzer.h
|
||||
)
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
* \brief implementation of QgsLineVectorLayerDirector
|
||||
*/
|
||||
|
||||
#include "qgslinevectorlayerdirector.h"
|
||||
#include "qgsvectorlayerdirector.h"
|
||||
#include "qgsgraphbuilderinterface.h"
|
||||
|
||||
#include "qgsfeatureiterator.h"
|
||||
@ -102,7 +102,7 @@ bool TiePointInfoCompare( const TiePointInfo& a, const TiePointInfo& b )
|
||||
return a.mFirstPoint.x() == b.mFirstPoint.x() ? a.mFirstPoint.y() < b.mFirstPoint.y() : a.mFirstPoint.x() < b.mFirstPoint.x();
|
||||
}
|
||||
|
||||
QgsLineVectorLayerDirector::QgsLineVectorLayerDirector( QgsVectorLayer *myLayer,
|
||||
QgsVectorLayerDirector::QgsVectorLayerDirector( QgsVectorLayer *myLayer,
|
||||
int directionFieldId,
|
||||
const QString& directDirectionValue,
|
||||
const QString& reverseDirectionValue,
|
||||
@ -118,17 +118,17 @@ QgsLineVectorLayerDirector::QgsLineVectorLayerDirector( QgsVectorLayer *myLayer,
|
||||
mBothDirectionValue = bothDirectionValue;
|
||||
}
|
||||
|
||||
QgsLineVectorLayerDirector::~QgsLineVectorLayerDirector()
|
||||
QgsVectorLayerDirector::~QgsVectorLayerDirector()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString QgsLineVectorLayerDirector::name() const
|
||||
QString QgsVectorLayerDirector::name() const
|
||||
{
|
||||
return QStringLiteral( "Vector line" );
|
||||
}
|
||||
|
||||
void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const QVector< QgsPoint >& additionalPoints,
|
||||
void QgsVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const QVector< QgsPoint >& additionalPoints,
|
||||
QVector< QgsPoint >& snappedPoints ) const
|
||||
{
|
||||
QgsVectorLayer *vl = mVectorLayer;
|
@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
qgslinevectorlayerdirector.h
|
||||
qgsvectorlayerdirector.h
|
||||
--------------------------------------
|
||||
Date : 2010-10-20
|
||||
Copyright : (C) 2010 by Yakushev Sergey
|
||||
@ -13,8 +13,8 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSLINEVECTORLAYERDIRECTOR_H
|
||||
#define QGSLINEVECTORLAYERDIRECTOR_H
|
||||
#ifndef QGSVECTORLAYERDIRECTOR_H
|
||||
#define QGSVECTORLAYERDIRECTOR_H
|
||||
|
||||
#include "qgsgraphdirector.h"
|
||||
|
||||
@ -23,10 +23,10 @@ class QgsVectorLayer;
|
||||
|
||||
/**
|
||||
* \ingroup analysis
|
||||
* \class QgsLineVectorLayerDirector
|
||||
* \class QgsVectorLayerDirector
|
||||
* \brief Determine making the graph from vector line layer
|
||||
*/
|
||||
class ANALYSIS_EXPORT QgsLineVectorLayerDirector : public QgsGraphDirector
|
||||
class ANALYSIS_EXPORT QgsVectorLayerDirector : public QgsGraphDirector
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -55,7 +55,7 @@ class ANALYSIS_EXPORT QgsLineVectorLayerDirector : public QgsGraphDirector
|
||||
* @param defaultDirection default road direction. Will be used if corresponding
|
||||
* attribute value is not set or does not equal to the given values
|
||||
*/
|
||||
QgsLineVectorLayerDirector( QgsVectorLayer* myLayer,
|
||||
QgsVectorLayerDirector( QgsVectorLayer* myLayer,
|
||||
int directionFieldId,
|
||||
const QString& directDirectionValue,
|
||||
const QString& reverseDirectionValue,
|
||||
@ -64,7 +64,7 @@ class ANALYSIS_EXPORT QgsLineVectorLayerDirector : public QgsGraphDirector
|
||||
);
|
||||
|
||||
//! Destructor
|
||||
virtual ~QgsLineVectorLayerDirector();
|
||||
virtual ~QgsVectorLayerDirector();
|
||||
|
||||
/*
|
||||
* MANDATORY DIRECTOR PROPERTY DECLARATION
|
||||
@ -84,4 +84,4 @@ class ANALYSIS_EXPORT QgsLineVectorLayerDirector : public QgsGraphDirector
|
||||
Direction mDefaultDirection;
|
||||
};
|
||||
|
||||
#endif // QGSLINEVECTORLAYERDIRECTOR_H
|
||||
#endif // QGSVECTORLAYERDIRECTOR_H
|
@ -29,7 +29,7 @@
|
||||
//standard includes
|
||||
|
||||
RgLineVectorLayerSettings::RgLineVectorLayerSettings()
|
||||
: mDefaultDirection( QgsLineVectorLayerDirector::Direction::DirectionBoth )
|
||||
: mDefaultDirection( QgsVectorLayerDirector::Direction::DirectionBoth )
|
||||
, mDefaultSpeed( 40 )
|
||||
{
|
||||
}
|
||||
@ -58,7 +58,7 @@ bool RgLineVectorLayerSettings::test()
|
||||
|
||||
void RgLineVectorLayerSettings::read( const QgsProject *project )
|
||||
{
|
||||
mDefaultDirection = static_cast<QgsLineVectorLayerDirector::Direction>( project->readNumEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/defaultDirection" ) ) );
|
||||
mDefaultDirection = static_cast<QgsVectorLayerDirector::Direction>( project->readNumEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/defaultDirection" ) ) );
|
||||
mDirection = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/directionField" ) );
|
||||
mFirstPointToLastPointDirectionVal =
|
||||
project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/FirstPointToLastPointDirectionVal" ) );
|
||||
@ -105,15 +105,15 @@ void RgLineVectorLayerSettings::setFromGui( QWidget *myGui )
|
||||
|
||||
if ( w->mcbDirectionDefault->currentIndex() == 0 )
|
||||
{
|
||||
mDefaultDirection = QgsLineVectorLayerDirector::Direction::DirectionBoth;
|
||||
mDefaultDirection = QgsVectorLayerDirector::Direction::DirectionBoth;
|
||||
}
|
||||
else if ( w->mcbDirectionDefault->currentIndex() == 1 )
|
||||
{
|
||||
mDefaultDirection = QgsLineVectorLayerDirector::Direction::DirectionForward;
|
||||
mDefaultDirection = QgsVectorLayerDirector::Direction::DirectionForward;
|
||||
}
|
||||
else if ( w->mcbDirectionDefault->currentIndex() == 2 )
|
||||
{
|
||||
mDefaultDirection = QgsLineVectorLayerDirector::Direction::DirectionBackward;
|
||||
mDefaultDirection = QgsVectorLayerDirector::Direction::DirectionBackward;
|
||||
}
|
||||
|
||||
mSpeed = w->mcbSpeed->currentText();
|
||||
|
@ -17,7 +17,7 @@
|
||||
// QT includes
|
||||
#include <qstring.h>
|
||||
|
||||
#include <qgslinevectorlayerdirector.h>
|
||||
#include <qgsvectorlayerdirector.h>
|
||||
|
||||
// Qgis includes
|
||||
|
||||
@ -95,7 +95,7 @@ class RgLineVectorLayerSettings: public RgSettings
|
||||
/**
|
||||
* contained Default direction
|
||||
*/
|
||||
QgsLineVectorLayerDirector::Direction mDefaultDirection;
|
||||
QgsVectorLayerDirector::Direction mDefaultDirection;
|
||||
|
||||
/**
|
||||
* contained speed filed name
|
||||
|
@ -143,13 +143,13 @@ RgLineVectorLayerSettingsWidget::RgLineVectorLayerSettingsWidget( RgLineVectorLa
|
||||
|
||||
switch ( s->mDefaultDirection )
|
||||
{
|
||||
case QgsLineVectorLayerDirector::Direction::DirectionBoth:
|
||||
case QgsVectorLayerDirector::Direction::DirectionBoth:
|
||||
mcbDirectionDefault->setCurrentIndex( 0 );
|
||||
break;
|
||||
case QgsLineVectorLayerDirector::Direction::DirectionForward:
|
||||
case QgsVectorLayerDirector::Direction::DirectionForward:
|
||||
mcbDirectionDefault->setCurrentIndex( 1 );
|
||||
break;
|
||||
case QgsLineVectorLayerDirector::Direction::DirectionBackward:
|
||||
case QgsVectorLayerDirector::Direction::DirectionBackward:
|
||||
mcbDirectionDefault->setCurrentIndex( 2 );
|
||||
break;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <qgsvectorlayer.h>
|
||||
#include <qgsvectordataprovider.h>
|
||||
|
||||
#include <qgslinevectorlayerdirector.h>
|
||||
#include <qgsvectorlayerdirector.h>
|
||||
#include <qgsgraphbuilder.h>
|
||||
#include <qgsgraph.h>
|
||||
#include <qgsnetworkdistancestrategy.h>
|
||||
@ -210,14 +210,14 @@ const QgsGraphDirector* RoadGraphPlugin::director() const
|
||||
{
|
||||
SpeedUnit speedUnit = SpeedUnit::byName( mSettings->mSpeedUnitName );
|
||||
|
||||
QgsLineVectorLayerDirector * director =
|
||||
new QgsLineVectorLayerDirector( layer,
|
||||
layer->fields().lookupField( mSettings->mDirection ),
|
||||
mSettings->mFirstPointToLastPointDirectionVal,
|
||||
mSettings->mLastPointToFirstPointDirectionVal,
|
||||
mSettings->mBothDirectionVal,
|
||||
mSettings->mDefaultDirection
|
||||
);
|
||||
QgsVectorLayerDirector * director =
|
||||
new QgsVectorLayerDirector( layer,
|
||||
layer->fields().lookupField( mSettings->mDirection ),
|
||||
mSettings->mFirstPointToLastPointDirectionVal,
|
||||
mSettings->mLastPointToFirstPointDirectionVal,
|
||||
mSettings->mBothDirectionVal,
|
||||
mSettings->mDefaultDirection
|
||||
);
|
||||
director->addStrategy( new QgsNetworkDistanceStrategy() );
|
||||
director->addStrategy( new QgsNetworkSpeedStrategy( layer->fields().lookupField( mSettings->mSpeed ),
|
||||
mSettings->mDefaultSpeed, speedUnit.multipler() ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user