|
29 | 29 | //standard includes |
30 | 30 |
|
31 | 31 | RgLineVectorLayerSettings::RgLineVectorLayerSettings() |
32 | | - : mDefaultDirection( Both ) |
| 32 | + : mDefaultDirection( QgsLineVectorLayerDirector::RoadDirection::RoadBidirectional ) |
33 | 33 | , mDefaultSpeed( 40 ) |
34 | 34 | { |
35 | 35 | } |
@@ -58,31 +58,17 @@ bool RgLineVectorLayerSettings::test() |
58 | 58 |
|
59 | 59 | void RgLineVectorLayerSettings::read( const QgsProject *project ) |
60 | 60 | { |
61 | | - int dd = project->readNumEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/defaultDirection" ) ); |
62 | | - mDirection = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/directionField" ) ); |
| 61 | + mDefaultDirection = static_cast<QgsLineVectorLayerDirector::RoadDirection> ( project->readNumEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/defaultDirection" ) ) ); |
| 62 | + mDirection = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/directionField" ) ); |
63 | 63 | mFirstPointToLastPointDirectionVal = |
64 | 64 | project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/FirstPointToLastPointDirectionVal" ) ); |
65 | 65 | mLastPointToFirstPointDirectionVal = |
66 | 66 | project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/LastPointToFirstPointDirectionVal" ) ); |
67 | 67 | mBothDirectionVal = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/BothDirectionVal" ) ); |
68 | | - mSpeed = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/speedField" ) ); |
| 68 | + mSpeed = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/speedField" ) ); |
69 | 69 | mDefaultSpeed = project->readDoubleEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/defaultSpeed" ) ); |
70 | | - mLayerName = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/layer" ) ); |
| 70 | + mLayerName = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/layer" ) ); |
71 | 71 | mSpeedUnitName = project->readEntry( QStringLiteral( "roadgraphplugin" ), QStringLiteral( "/speedUnitName" ) ); |
72 | | - |
73 | | - if ( dd == 1 ) |
74 | | - { |
75 | | - mDefaultDirection = FirstPointToLastPoint; |
76 | | - } |
77 | | - else if ( dd == 2 ) |
78 | | - { |
79 | | - mDefaultDirection = LastPointToFirstPoint; |
80 | | - } |
81 | | - else if ( dd == 3 ) |
82 | | - { |
83 | | - mDefaultDirection = Both; |
84 | | - } |
85 | | - |
86 | 72 | } // RgLineVectorLayerSettings::read( const QgsProject *project ) |
87 | 73 |
|
88 | 74 | void RgLineVectorLayerSettings::write( QgsProject *project ) |
@@ -115,19 +101,19 @@ void RgLineVectorLayerSettings::setFromGui( QWidget *myGui ) |
115 | 101 | mLastPointToFirstPointDirectionVal = w->mleLastPointToFirstPointDirection->text(); |
116 | 102 | mBothDirectionVal = w->mleBothDirection->text(); |
117 | 103 | mDirection = w->mcbDirection->currentText(); |
118 | | - mLayerName = w->mcbLayers->currentText(); |
| 104 | + mLayerName = w->mcbLayers->currentText(); |
119 | 105 |
|
120 | 106 | if ( w->mcbDirectionDefault->currentIndex() == 0 ) |
121 | 107 | { |
122 | | - mDefaultDirection = Both; |
| 108 | + mDefaultDirection = QgsLineVectorLayerDirector::RoadDirection::RoadBidirectional; |
123 | 109 | } |
124 | 110 | else if ( w->mcbDirectionDefault->currentIndex() == 1 ) |
125 | 111 | { |
126 | | - mDefaultDirection = FirstPointToLastPoint; |
| 112 | + mDefaultDirection = QgsLineVectorLayerDirector::RoadDirection::RoadDirect; |
127 | 113 | } |
128 | 114 | else if ( w->mcbDirectionDefault->currentIndex() == 2 ) |
129 | 115 | { |
130 | | - mDefaultDirection = LastPointToFirstPoint; |
| 116 | + mDefaultDirection = QgsLineVectorLayerDirector::RoadDirection::RoadReversed; |
131 | 117 | } |
132 | 118 |
|
133 | 119 | mSpeed = w->mcbSpeed->currentText(); |
|
0 commit comments