本文整理汇总了C++中QgsVectorLayer::auxiliaryLayer方法的典型用法代码示例。如果您正苦于以下问题:C++ QgsVectorLayer::auxiliaryLayer方法的具体用法?C++ QgsVectorLayer::auxiliaryLayer怎么用?C++ QgsVectorLayer::auxiliaryLayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QgsVectorLayer
的用法示例。
在下文中一共展示了QgsVectorLayer::auxiliaryLayer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: canvasPressEvent
void QgsMapToolShowHideLabels::canvasPressEvent( QgsMapMouseEvent *e )
{
Q_UNUSED( e );
QgsMapLayer *layer = mCanvas->currentLayer();
QgsVectorLayer *vlayer = dynamic_cast<QgsVectorLayer *>( layer );
if ( !vlayer )
return;
int showCol;
if ( !labelCanShowHide( vlayer, showCol )
|| !diagramCanShowHide( vlayer, showCol ) )
{
if ( !vlayer->auxiliaryLayer() )
{
QgsNewAuxiliaryLayerDialog dlg( vlayer );
dlg.exec();
return;
}
}
mSelectRect.setRect( 0, 0, 0, 0 );
mSelectRect.setTopLeft( e->pos() );
mSelectRect.setBottomRight( e->pos() );
mRubberBand = new QgsRubberBand( mCanvas, QgsWkbTypes::PolygonGeometry );
}
示例2: createAuxiliaryFields
bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsPalIndexes &indexes ) const
{
bool newAuxiliaryLayer = false;
QgsVectorLayer *vlayer = details.layer;
QString providerId = details.pos.providerID;
if ( !vlayer || !vlayer->labelsEnabled() )
return false;
if ( !vlayer->auxiliaryLayer() )
{
QgsNewAuxiliaryLayerDialog dlg( vlayer );
dlg.exec();
newAuxiliaryLayer = true;
}
if ( !vlayer->auxiliaryLayer() )
return false;
for ( const QgsPalLayerSettings::Property &p : qgis::as_const( mPalProperties ) )
{
int index = -1;
// always use the default activated property
QgsProperty prop = details.settings.dataDefinedProperties().property( p );
if ( prop.propertyType() == QgsProperty::FieldBasedProperty && prop.isActive() )
{
index = vlayer->fields().lookupField( prop.field() );
}
else
{
index = QgsAuxiliaryLayer::createProperty( p, vlayer );
}
indexes[p] = index;
}
details.settings = vlayer->labeling()->settings( providerId );
return newAuxiliaryLayer;
}