Exemple #1
0
QgsSvgCacheEntry* QgsSvgCache::insertSVG( const QString& file, double size, const QColor& fill, const QColor& outline, double outlineWidth,
    double widthScaleFactor, double rasterScaleFactor )
{
  // The file may be relative path (e.g. if path is data defined)
  QString path = QgsSymbolLayerV2Utils::symbolNameToPath( file );

  QgsSvgCacheEntry* entry = new QgsSvgCacheEntry( path, size, outlineWidth, widthScaleFactor, rasterScaleFactor, fill, outline, file );

  replaceParamsAndCacheSvg( entry );

  mEntryLookup.insert( file, entry );

  //insert to most recent place in entry list
  if ( !mMostRecentEntry ) //inserting first entry
  {
    mLeastRecentEntry = entry;
    mMostRecentEntry = entry;
    entry->previousEntry = 0;
    entry->nextEntry = 0;
  }
  else
  {
    entry->previousEntry = mMostRecentEntry;
    entry->nextEntry = 0;
    mMostRecentEntry->nextEntry = entry;
    mMostRecentEntry = entry;
  }

  trimToMaximumSize();
  return entry;
}
Exemple #2
0
QgsSvgCacheEntry* QgsSvgCache::insertSVG( const QString& file, double size, const QColor& fill, const QColor& outline, double outlineWidth,
    double widthScaleFactor, double rasterScaleFactor )
{
  QgsSvgCacheEntry* entry = new QgsSvgCacheEntry( file, size, outlineWidth, widthScaleFactor, rasterScaleFactor, fill, outline );

  replaceParamsAndCacheSvg( entry );

  mEntryLookup.insert( file, entry );

  //insert to most recent place in entry list
  if ( !mMostRecentEntry ) //inserting first entry
  {
    mLeastRecentEntry = entry;
    mMostRecentEntry = entry;
    entry->previousEntry = 0;
    entry->nextEntry = 0;
  }
  else
  {
    entry->previousEntry = mMostRecentEntry;
    entry->nextEntry = 0;
    mMostRecentEntry->nextEntry = entry;
    mMostRecentEntry = entry;
  }

  trimToMaximumSize();
  return entry;
}
Exemple #3
0
QgsSvgCacheEntry *QgsSvgCache::insertSvg( const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth,
    double widthScaleFactor, double fixedAspectRatio )
{
  QgsSvgCacheEntry *entry = new QgsSvgCacheEntry( path, size, strokeWidth, widthScaleFactor, fill, stroke, fixedAspectRatio );

  replaceParamsAndCacheSvg( entry );

  mEntryLookup.insert( path, entry );

  //insert to most recent place in entry list
  if ( !mMostRecentEntry ) //inserting first entry
  {
    mLeastRecentEntry = entry;
    mMostRecentEntry = entry;
    entry->previousEntry = nullptr;
    entry->nextEntry = nullptr;
  }
  else
  {
    entry->previousEntry = mMostRecentEntry;
    entry->nextEntry = nullptr;
    mMostRecentEntry->nextEntry = entry;
    mMostRecentEntry = entry;
  }

  trimToMaximumSize();
  return entry;
}