Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/qgis/Quantum-GIS
  • Loading branch information
volaya committed Oct 2, 2012
2 parents 6548e2e + 8a1ad57 commit 6369196
Show file tree
Hide file tree
Showing 24 changed files with 1,413 additions and 50 deletions.
2 changes: 0 additions & 2 deletions python/core/core.sip
Expand Up @@ -8,8 +8,6 @@
%Include conversions.sip
%Include qgsexception.sip

// TODO: more files to wrap

%Include qgis.sip

%Include qgsapplication.sip
Expand Down
52 changes: 44 additions & 8 deletions python/core/symbology-ng/qgssymbollayerv2.sip
Expand Up @@ -8,18 +8,54 @@ class QgsSymbolLayerV2
switch (sipCpp->type())
{
case QgsSymbolV2::Marker:
if( sipCpp->layerType() == "VectorField" )
{
sipClass = sipClass_QgsVectorFieldSymbolLayer;
}
if (dynamic_cast<QgsEllipseSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsEllipseSymbolLayerV2;
else if (dynamic_cast<QgsFontMarkerSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsFontMarkerSymbolLayerV2;
else if (dynamic_cast<QgsSimpleMarkerSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsSimpleMarkerSymbolLayerV2;
else if (dynamic_cast<QgsSvgMarkerSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsSvgMarkerSymbolLayerV2;
else if (dynamic_cast<QgsVectorFieldSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsVectorFieldSymbolLayer;
else
sipClass = sipClass_QgsMarkerSymbolLayerV2;
break;

case QgsSymbolV2::Line:
if (dynamic_cast<QgsLineDecorationSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsLineDecorationSymbolLayerV2;
else if (dynamic_cast<QgsMarkerLineSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsMarkerLineSymbolLayerV2;
else if (dynamic_cast<QgsSimpleLineSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsSimpleLineSymbolLayerV2;
else
sipClass = sipClass_QgsLineSymbolLayerV2;
break;

case QgsSymbolV2::Fill:
if (dynamic_cast<QgsSimpleFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsSimpleFillSymbolLayerV2;
else if (dynamic_cast<QgsImageFillSymbolLayer*>(sipCpp) != NULL)
{
sipClass = sipClass_QgsMarkerSymbolLayerV2;
if (dynamic_cast<QgsLinePatternFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsLinePatternFillSymbolLayer;
else if (dynamic_cast<QgsPointPatternFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsPointPatternFillSymbolLayer;
else if (dynamic_cast<QgsSVGFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsSVGFillSymbolLayer;
else
sipClass = sipClass_QgsImageFillSymbolLayer;
}
else if (dynamic_cast<QgsCentroidFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsCentroidFillSymbolLayerV2;
else
sipClass = sipClass_QgsFillSymbolLayerV2;
break;

default:
sipClass = 0;
break;
case QgsSymbolV2::Line: sipClass = sipClass_QgsLineSymbolLayerV2; break;
case QgsSymbolV2::Fill: sipClass = sipClass_QgsFillSymbolLayerV2; break;
default: sipClass = 0; break;
}
%End

Expand Down
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgsellipsesymbollayerv2.cpp
Expand Up @@ -274,7 +274,7 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::createFromSld( QDomElement &element )
return NULL;

QString name = "circle";
QColor color, borderColor;
QColor fillColor, borderColor;
double borderWidth, size;
double widthHeightFactor = 1.0;

Expand All @@ -290,7 +290,7 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::createFromSld( QDomElement &element )
}
}

if ( !QgsSymbolLayerV2Utils::wellKnownMarkerFromSld( graphicElem, name, color, borderColor, borderWidth, size ) )
if ( !QgsSymbolLayerV2Utils::wellKnownMarkerFromSld( graphicElem, name, fillColor, borderColor, borderWidth, size ) )
return NULL;

double angle = 0.0;
Expand All @@ -305,7 +305,7 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::createFromSld( QDomElement &element )

QgsEllipseSymbolLayerV2 *m = new QgsEllipseSymbolLayerV2();
m->setSymbolName( name );
m->setColor( color );
m->setFillColor( fillColor );
m->setOutlineColor( borderColor );
m->setOutlineWidth( borderWidth );
m->setSymbolWidth( size );
Expand Down

0 comments on commit 6369196

Please sign in to comment.