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