Skip to content

Commit b53e622

Browse files
committed
indentation update - please use prepare-commit.sh
1 parent ee19294 commit b53e622

15 files changed

+178
-176
lines changed

src/analysis/network/qgsarcproperter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
/**
2727
* \ingroup networkanalysis
2828
* \class QgsEdgeProperter
29-
* \brief QgsEdgeProperter is a strategy pattern.
30-
* You can use it for customize arc property. For example look at QgsDistanceArcProperter or src/plugins/roadgraph/speedproperter.h
29+
* \brief QgsEdgeProperter is a strategy pattern.
30+
* You can use it for customize arc property. For example look at QgsDistanceArcProperter or src/plugins/roadgraph/speedproperter.h
3131
*/
3232
class ANALYSIS_EXPORT QgsArcProperter
3333
{
@@ -37,14 +37,14 @@ class ANALYSIS_EXPORT QgsArcProperter
3737
*/
3838
QgsArcProperter()
3939
{ }
40-
40+
4141
/**
4242
* QgsGraphDirector call this method for fetching attribute from source layer
4343
* \return required attributes list
4444
*/
4545
virtual QgsAttributeList requiredAttributes() const
4646
{ return QgsAttributeList(); }
47-
47+
4848
/**
4949
* calculate and return adge property
5050
*/

src/analysis/network/qgsdistancearcproperter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
QVariant QgsDistanceArcProperter::property( double distance, const QgsFeature& f ) const
1616
{
17-
return QVariant( distance );
17+
return QVariant( distance );
1818
}

src/analysis/network/qgsgraph.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ QgsGraph::~QgsGraph()
2929
int QgsGraph::addVertex( const QgsPoint& pt )
3030
{
3131
mGraphVertexes.append( QgsGraphVertex( pt ) );
32-
return mGraphVertexes.size()-1;
32+
return mGraphVertexes.size() - 1;
3333
}
3434

3535
int QgsGraph::addArc( int outVertexIdx, int inVertexIdx, const QVector< QVariant >& properties )
@@ -40,12 +40,12 @@ int QgsGraph::addArc( int outVertexIdx, int inVertexIdx, const QVector< QVariant
4040
e.mOut = outVertexIdx;
4141
e.mIn = inVertexIdx;
4242
mGraphArc.push_back( e );
43-
int edgeIdx = mGraphArc.size()-1;
43+
int edgeIdx = mGraphArc.size() - 1;
4444

4545
mGraphVertexes[ outVertexIdx ].mOutArc.push_back( edgeIdx );
4646
mGraphVertexes[ inVertexIdx ].mInArc.push_back( edgeIdx );
47-
48-
return mGraphArc.size()-1;
47+
48+
return mGraphArc.size() - 1;
4949
}
5050

5151
const QgsGraphVertex& QgsGraph::vertex( int idx ) const
@@ -84,10 +84,10 @@ int QgsGraph::findVertex( const QgsPoint& pt ) const
8484

8585
QgsGraphArc::QgsGraphArc()
8686
{
87-
87+
8888
}
8989

90-
QVariant QgsGraphArc::property(int i) const
90+
QVariant QgsGraphArc::property( int i ) const
9191
{
9292
return mProperties[ i ];
9393
}
@@ -118,7 +118,7 @@ int QgsGraphArc::out() const
118118
}
119119

120120
QgsGraphVertex::QgsGraphVertex( const QgsPoint& point )
121-
: mCoordinate( point )
121+
: mCoordinate( point )
122122
{
123123

124124
}

src/analysis/network/qgsgraph.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
***************************************************************************/
1515

1616
/*
17-
*
17+
*
1818
* \file qgsgraph.h
1919
* Этот файл описывает встроенные в QGIS классы описывающие математический граф. Вершина графа идентифицируется своими географическими координатами, никакие дополнительные свойства ей не могут быть присвоены. Количество свойств графа определяется разработчиком и не ограничено, например длина и время движения по дуге. Граф может быть направленным, иметь инцедентные ребра и петли.
20-
*
20+
*
2121
*/
2222

2323
#ifndef QGSGRAPHH
@@ -48,7 +48,7 @@ class ANALYSIS_EXPORT QgsGraphArc
4848
* @param propertyIndex property index
4949
*/
5050
QVariant property( int propertyIndex ) const;
51-
51+
5252
/**
5353
* get array of proertyes
5454
*/
@@ -73,7 +73,7 @@ class ANALYSIS_EXPORT QgsGraphArc
7373
int mOut;
7474
int mIn;
7575

76-
friend class QgsGraph;
76+
friend class QgsGraph;
7777
};
7878

7979

@@ -97,28 +97,28 @@ class ANALYSIS_EXPORT QgsGraphVertex
9797
*/
9898

9999
QgsGraphVertex( const QgsPoint& point );
100-
100+
101101
/**
102102
* return outgoing edges
103103
*/
104104
QgsGraphArcIdList outArc() const;
105-
105+
106106
/**
107107
* return incoming edges
108108
*/
109109
QgsGraphArcIdList inArc() const;
110-
110+
111111
/**
112112
* return vertex point
113113
*/
114114
QgsPoint point() const;
115-
115+
116116
private:
117117
QgsPoint mCoordinate;
118118
QgsGraphArcIdList mOutArc;
119119
QgsGraphArcIdList mInArc;
120120

121-
friend class QgsGraph;
121+
friend class QgsGraph;
122122
};
123123

124124
/**
@@ -139,28 +139,28 @@ class ANALYSIS_EXPORT QgsGraph
139139
* add vertex to a grap
140140
*/
141141
int addVertex( const QgsPoint& pt );
142-
142+
143143
/**
144144
* add edge to a graph
145145
*/
146146
int addArc( int outVertexIdx, int inVertexIdx, const QVector< QVariant >& properties );
147-
147+
148148
/**
149149
* retrun vertex count
150150
*/
151151
int vertexCount() const;
152-
152+
153153
/**
154154
* return vertex at index
155155
*/
156156
const QgsGraphVertex& vertex( int idx ) const;
157157

158-
/**
159-
* retrun edge count
160-
*/
158+
/**
159+
* retrun edge count
160+
*/
161161
int arcCount() const;
162-
163-
/**
162+
163+
/**
164164
* retrun edge at index
165165
*/
166166
const QgsGraphArc& arc( int idx ) const;
@@ -171,9 +171,9 @@ class ANALYSIS_EXPORT QgsGraph
171171
*/
172172
int findVertex( const QgsPoint& pt ) const;
173173

174-
private:
174+
private:
175175
QVector<QgsGraphVertex> mGraphVertexes;
176-
176+
177177
QVector<QgsGraphArc> mGraphArc;
178178
};
179179

src/analysis/network/qgsgraphanalyzer.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@
2828

2929
void QgsGraphAnalyzer::shortestpath( const QgsGraph* source, int startPointIdx, int criterionNum, const QVector<int>& destPointCost, QVector<double>& cost, QgsGraph* treeResult )
3030
{
31-
31+
3232
// QMap< cost, vertexIdx > not_begin
3333
// I use it and not create any struct or class.
34-
QMap< double, int > not_begin;
34+
QMap< double, int > not_begin;
3535
QMap< double, int >::iterator it;
3636

3737
// QVector< QPair< cost, arc id > result
3838
QVector< QPair< double, int > > result;
3939

4040
result.reserve( source->vertexCount() );
4141
int i;
42-
for ( i=0; i < source->vertexCount(); ++i )
42+
for ( i = 0; i < source->vertexCount(); ++i )
4343
{
4444
result.push_back( QPair<double, int> ( std::numeric_limits<double>::infinity() , i ) );
4545
}
4646
result[ startPointIdx ] = QPair<double, int> ( 0.0, -1 );
4747

4848
not_begin.insert( 0.0, startPointIdx );
49-
49+
5050
// begin Dijkstra algorithm
5151
while ( !not_begin.empty() )
5252
{
@@ -63,47 +63,47 @@ void QgsGraphAnalyzer::shortestpath( const QgsGraph* source, int startPointIdx,
6363
const QgsGraphArc& arc = source->arc( *arcIt );
6464
double cost = arc.property( criterionNum ).toDouble() + curCost;
6565

66-
if ( cost < result[ arc.in() ].first )
66+
if ( cost < result[ arc.in()].first )
6767
{
68-
result[ arc.in() ] = QPair< double, int >( cost, *arcIt );
68+
result[ arc.in()] = QPair< double, int >( cost, *arcIt );
6969
not_begin.insert( cost, arc.in() );
7070
}
7171
}
7272
}
73-
73+
7474
// fill shortestpath tree
7575
if ( treeResult != NULL )
7676
{
7777
// sourceVertexIdx2resultVertexIdx
7878
QVector<int> source2result( result.size(), -1 );
7979

80-
for ( i=0; i < source->vertexCount(); ++i )
80+
for ( i = 0; i < source->vertexCount(); ++i )
8181
{
8282
if ( result[ i ].first < std::numeric_limits<double>::infinity() )
8383
{
84-
source2result[ i ] = treeResult->addVertex( source->vertex(i).point() );
84+
source2result[ i ] = treeResult->addVertex( source->vertex( i ).point() );
8585
}
8686
}
87-
for ( i=0; i < source->vertexCount(); ++i )
87+
for ( i = 0; i < source->vertexCount(); ++i )
8888
{
89-
if ( result[ i ].first < std::numeric_limits<double>::infinity() && result[i].second != -1)
90-
{
89+
if ( result[ i ].first < std::numeric_limits<double>::infinity() && result[i].second != -1 )
90+
{
9191
const QgsGraphArc& arc = source->arc( result[i].second );
9292

93-
treeResult->addArc( source2result[ arc.out() ], source2result[ i ],
94-
arc.properties() );
93+
treeResult->addArc( source2result[ arc.out()], source2result[ i ],
94+
arc.properties() );
9595
}
9696
}
9797
}
98-
98+
9999
// fill shortestpath's costs
100-
for ( i=0; i < destPointCost.size(); ++i )
100+
for ( i = 0; i < destPointCost.size(); ++i )
101101
{
102102
cost[i] = result[ destPointCost[i] ].first;
103103
}
104104
}
105105

106-
QgsGraph* QgsGraphAnalyzer::shortestTree( const QgsGraph* source, int startVertexIdx, int criterionNum)
106+
QgsGraph* QgsGraphAnalyzer::shortestTree( const QgsGraph* source, int startVertexIdx, int criterionNum )
107107
{
108108
QgsGraph *g = new QgsGraph;
109109
QVector<int> v;

src/analysis/network/qgsgraphbuilder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ANALYSIS_EXPORT QgsGraphBuilder : public QgsGraphBuilderInterface
4040
* default constructor
4141
*/
4242
QgsGraphBuilder( const QgsCoordinateReferenceSystem& crs, bool otfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" );
43-
43+
4444
~QgsGraphBuilder();
4545

4646
/*
@@ -54,8 +54,8 @@ class ANALYSIS_EXPORT QgsGraphBuilder : public QgsGraphBuilderInterface
5454
* return QgsGraph result;
5555
*/
5656
QgsGraph* graph();
57-
58-
private:
57+
58+
private:
5959

6060
QgsGraph *mGraph;
6161
};

src/analysis/network/qgsgraphbuilderintr.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
3737
/**
3838
* QgsGraphBuilderInterface constructor
3939
* @param crs Coordinate reference system for new graph vertex
40-
* @param ctfEnabled enable coordinate transform from source graph CRS to CRS graph
40+
* @param ctfEnabled enable coordinate transform from source graph CRS to CRS graph
4141
* @param topologyTolerance sqrt distance between source point as one graph vertex
4242
* @param ellipsoidID ellipsoid for edge measurement
43-
*/
43+
*/
4444
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem& crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" ) :
45-
mCrs( crs ), mCtfEnabled ( ctfEnabled ), mTopologyTolerance( topologyTolerance )
46-
{
45+
mCrs( crs ), mCtfEnabled( ctfEnabled ), mTopologyTolerance( topologyTolerance )
46+
{
4747
mDa.setSourceCrs( mCrs.srsid() );
4848
mDa.setEllipsoid( ellipsoidID );
4949
mDa.setProjectionsEnabled( ctfEnabled );
@@ -58,7 +58,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
5858
{
5959
return mCrs;
6060
}
61-
61+
6262
//! get coordinate transformation enabled
6363
bool coordinateTransformationEnabled()
6464
{
@@ -70,7 +70,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
7070
{
7171
return mTopologyTolerance;
7272
}
73-
73+
7474
//! get measurement tool
7575
QgsDistanceArea* distanceArea()
7676
{
@@ -97,7 +97,7 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
9797
*/
9898
virtual void addArc( int pt1id, const QgsPoint& pt1, int pt2id, const QgsPoint& pt2, const QVector< QVariant >& properties )
9999
{ }
100-
100+
101101
private:
102102
QgsCoordinateReferenceSystem mCrs;
103103

src/analysis/network/qgsgraphdirector.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ class ANALYSIS_EXPORT QgsGraphDirector : public QObject
5959
const QVector< QgsPoint >& additionalPoints,
6060
QVector< QgsPoint>& tiedPoints ) const
6161
{}
62-
62+
6363
void addProperter( QgsArcProperter* prop )
6464
{
6565
mProperterList.push_back( prop );
6666
}
67-
67+
6868
/**
6969
* return Director name
7070
*/
7171
virtual QString name() const = 0;
72-
72+
7373
protected:
7474
QList<QgsArcProperter*> mProperterList;
7575
};

0 commit comments

Comments
 (0)