Skip to content
Permalink
Browse files

[GRASS] distinguish symbol for left/right broken boundary

  • Loading branch information
blazek committed Oct 16, 2015
1 parent 7f731ae commit 3c85c7ec95c6bb1bbbb48b1963f089babc30ecd4
@@ -38,16 +38,18 @@ QgsGrassEditRenderer::QgsGrassEditRenderer()
QHash<int, QColor> colors;
//colors.insert( QgsGrassVectorMap::TopoUndefined, QColor( 125, 125, 125 ) );
colors.insert( QgsGrassVectorMap::TopoLine, QColor( Qt::black ) );
colors.insert( QgsGrassVectorMap::TopoBoundary0, QColor( Qt::red ) );
colors.insert( QgsGrassVectorMap::TopoBoundary1, QColor( 255, 125, 0 ) );
colors.insert( QgsGrassVectorMap::TopoBoundary2, QColor( Qt::green ) );
colors.insert( QgsGrassVectorMap::TopoBoundaryError, QColor( Qt::red ) );
colors.insert( QgsGrassVectorMap::TopoBoundaryErrorLeft, QColor( 255, 125, 0 ) );
colors.insert( QgsGrassVectorMap::TopoBoundaryErrorRight, QColor( 255, 125, 0 ) );
colors.insert( QgsGrassVectorMap::TopoBoundaryOk, QColor( Qt::green ) );

QHash<int, QString> labels;
//labels.insert( QgsGrassVectorMap::TopoUndefined, "Unknown type" );
labels.insert( QgsGrassVectorMap::TopoLine, "Line" );
labels.insert( QgsGrassVectorMap::TopoBoundary0, "Boundary (isolated)" );
labels.insert( QgsGrassVectorMap::TopoBoundary1, "Boundary (area on one side)" );
labels.insert( QgsGrassVectorMap::TopoBoundary2, "Boundary (areas on both sides)" );
labels.insert( QgsGrassVectorMap::TopoBoundaryError, "Boundary (topological error on both sides)" );
labels.insert( QgsGrassVectorMap::TopoBoundaryErrorLeft, "Boundary (topological error on the left side)" );
labels.insert( QgsGrassVectorMap::TopoBoundaryErrorRight, "Boundary (topological error on the right side)" );
labels.insert( QgsGrassVectorMap::TopoBoundaryOk, "Boundary (correct)" );

QgsCategoryList categoryList;

@@ -129,8 +131,9 @@ QgsSymbolV2* QgsGrassEditRenderer::symbolForFeature( QgsFeature& feature, QgsRen
{
symbol = mMarkerRenderer->symbolForFeature( feature, context );
}
else if ( symbolCode == QgsGrassVectorMap::TopoLine || symbolCode == QgsGrassVectorMap::TopoBoundary0 ||
symbolCode == QgsGrassVectorMap::TopoBoundary1 || symbolCode == QgsGrassVectorMap::TopoBoundary2 )
else if ( symbolCode == QgsGrassVectorMap::TopoLine || symbolCode == QgsGrassVectorMap::TopoBoundaryError ||
symbolCode == QgsGrassVectorMap::TopoBoundaryErrorLeft || symbolCode == QgsGrassVectorMap::TopoBoundaryErrorRight ||
symbolCode == QgsGrassVectorMap::TopoBoundaryOk )
{
symbol = mLineRenderer->symbolForFeature( feature, context );
}
@@ -782,15 +782,19 @@ QgsGrassVectorMap::TopoSymbol QgsGrassVectorMap::topoSymbol( int lid )
Vect_get_line_areas( mMap, lid, &left, &right );
if ( left != 0 && right != 0 )
{
symbol = TopoBoundary2;
symbol = TopoBoundaryOk;
}
else if ( left == 0 && right == 0 )
{
symbol = TopoBoundary0;
symbol = TopoBoundaryError;
}
else
else if ( left == 0 )
{
symbol = TopoBoundaryErrorLeft;
}
else if ( right == 0 )
{
symbol = TopoBoundary1;
symbol = TopoBoundaryErrorRight;
}
}
QgsDebugMsgLevel( QString( "lid = %1 type = %2 symbol = %3" ).arg( lid ).arg( type ).arg( symbol ), 3 );
@@ -34,9 +34,10 @@ class GRASS_LIB_EXPORT QgsGrassVectorMap : public QObject
TopoUndefined = 0,
TopoPoint,
TopoLine,
TopoBoundary0,
TopoBoundary1,
TopoBoundary2,
TopoBoundaryError, // both sides topology broken
TopoBoundaryErrorLeft, // left side topology broken
TopoBoundaryErrorRight, // right side topology broken
TopoBoundaryOk,
TopoCentroidIn,
TopoCentroidOut,
TopoCentroidDupl,

0 comments on commit 3c85c7e

Please sign in to comment.
You can’t perform that action at this time.