41 , mFields( layer->pendingFields() )
46 , mLayerTransparency( 0 )
66 QString markerTypeString = settings.value(
"/qgis/digitizing/marker_style",
"Cross" ).toString();
67 if ( markerTypeString ==
"Cross" )
71 else if ( markerTypeString ==
"SemiTransparentCircle" )
141 bool validTransform =
true;
158 QgsDebugMsg( QString(
"Simplify - SourceTransformRect=%1" ).arg( sourceRect.
toString( 16 ) ) );
159 QgsDebugMsg( QString(
"Simplify - TargetTransformRect=%1" ).arg( targetRect.toString( 16 ) ) );
161 if ( !sourceRect.
isEmpty() && sourceRect.
isFinite() && !targetRect.isEmpty() && targetRect.isFinite() )
165 QgsPoint minimumDstPoint( targetRect.xMinimum(), targetRect.yMinimum() );
166 QgsPoint maximumDstPoint( targetRect.xMaximum(), targetRect.yMaximum() );
168 double sourceHypothenuse = sqrt( minimumSrcPoint.sqrDist( maximumSrcPoint ) );
169 double targetHypothenuse = sqrt( minimumDstPoint.sqrDist( maximumDstPoint ) );
171 QgsDebugMsg( QString(
"Simplify - SourceHypothenuse=%1" ).arg( sourceHypothenuse ) );
172 QgsDebugMsg( QString(
"Simplify - TargetHypothenuse=%1" ).arg( targetHypothenuse ) );
174 if ( targetHypothenuse != 0 )
175 map2pixelTol *= ( sourceHypothenuse / targetHypothenuse );
181 validTransform =
false;
185 if ( validTransform )
214 drawRendererV2Levels( fit );
216 drawRendererV2( fit );
223 QColor transparentFillColor = QColor( 0, 0, 0, 255 - ( 255 *
mLayerTransparency / 100 ) );
225 mContext.
painter()->setCompositionMode( QPainter::CompositionMode_DestinationIn );
275 Q_UNUSED( rendered );
291 QgsDebugMsg( QString(
"Failed to transform a point while drawing a feature with ID '%1'. Ignoring this feature. %2" )
292 .arg( fet.
id() ).arg( cse.
what() ) );
296 stopRendererV2( NULL );
301 QHash< QgsSymbolV2*, QList<QgsFeature> > features;
321 qDebug(
"rendering stop!" );
322 stopRendererV2( selRenderer );
332 if ( !features.contains( sym ) )
334 features.insert( sym, QList<QgsFeature>() );
336 features[sym].append( fet );
360 for (
int i = 0; i < symbols.count(); i++ )
366 if ( level < 0 || level >= 1000 )
369 while ( level >= levels.count() )
371 levels[level].append( item );
376 for (
int l = 0; l < levels.count(); l++ )
379 for (
int i = 0; i < level.count(); i++ )
382 if ( !features.contains( item.
symbol() ) )
387 int layer = item.
layer();
388 QList<QgsFeature>& lst = features[item.
symbol()];
389 QList<QgsFeature>::iterator fit;
390 for ( fit = lst.begin(); fit != lst.end(); ++fit )
394 stopRendererV2( selRenderer );
409 QgsDebugMsg( QString(
"Failed to transform a point while drawing a feature with ID '%1'. Ignoring this feature. %2" )
410 .arg( fet.
id() ).arg( cse.
what() ) );
416 stopRendererV2( selRenderer );
433 void QgsVectorLayerRenderer::prepareLabeling(
QgsVectorLayer* layer, QStringList& attributeNames )
445 #if 0 // TODO: limit of labels, font not found
455 int nFeatsToLabel = 0;
467 mLabelFontNotFoundNotified =
true;
473 void QgsVectorLayerRenderer::prepareDiagrams(
QgsVectorLayer* layer, QStringList& attributeNames )
490 QList<QString>::const_iterator attIt = att.constBegin();
491 for ( ; attIt != att.constEnd(); ++attIt )
495 QStringList::const_iterator columnsIterator = columns.constBegin();
496 for ( ; columnsIterator != columns.constEnd(); ++columnsIterator )
498 if ( !attributeNames.contains( *columnsIterator ) )
499 attributeNames << *columnsIterator;
504 if ( linearlyInterpolatedDiagramRenderer != NULL )
510 QStringList::const_iterator columnsIterator = columns.constBegin();
511 for ( ; columnsIterator != columns.constEnd(); ++columnsIterator )
513 if ( !attributeNames.contains( *columnsIterator ) )
514 attributeNames << *columnsIterator;
520 if ( !attributeNames.contains( name ) )
521 attributeNames << name;