本文整理汇总了C++中QVector::takeAt方法的典型用法代码示例。如果您正苦于以下问题:C++ QVector::takeAt方法的具体用法?C++ QVector::takeAt怎么用?C++ QVector::takeAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVector
的用法示例。
在下文中一共展示了QVector::takeAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: densifyByDistance
QgsGeometry QgsInternalGeometryEngine::densifyByDistance( double distance ) const
{
if ( !mGeometry )
{
return QgsGeometry();
}
if ( QgsWkbTypes::geometryType( mGeometry->wkbType() ) == QgsWkbTypes::PointGeometry )
{
return QgsGeometry( mGeometry->clone() ); // point geometry, nothing to do
}
if ( const QgsGeometryCollection *gc = qgsgeometry_cast< const QgsGeometryCollection *>( mGeometry ) )
{
int numGeom = gc->numGeometries();
QVector< QgsAbstractGeometry * > geometryList;
geometryList.reserve( numGeom );
for ( int i = 0; i < numGeom; ++i )
{
geometryList << densifyGeometry( gc->geometryN( i ), -1, distance );
}
QgsGeometry first = QgsGeometry( geometryList.takeAt( 0 ) );
for ( QgsAbstractGeometry *g : qgis::as_const( geometryList ) )
{
first.addPart( g );
}
return first;
}
else
{
return QgsGeometry( densifyGeometry( mGeometry, -1, distance ) );
}
}
示例2: orthogonalize
QgsGeometry QgsInternalGeometryEngine::orthogonalize( double tolerance, int maxIterations, double angleThreshold ) const
{
if ( !mGeometry || ( QgsWkbTypes::geometryType( mGeometry->wkbType() ) != QgsWkbTypes::LineGeometry
&& QgsWkbTypes::geometryType( mGeometry->wkbType() ) != QgsWkbTypes::PolygonGeometry ) )
{
return QgsGeometry();
}
double lowerThreshold = std::cos( ( 90 - angleThreshold ) * M_PI / 180.00 );
double upperThreshold = std::cos( angleThreshold * M_PI / 180.0 );
if ( const QgsGeometryCollection *gc = qgsgeometry_cast< const QgsGeometryCollection *>( mGeometry ) )
{
int numGeom = gc->numGeometries();
QVector< QgsAbstractGeometry * > geometryList;
geometryList.reserve( numGeom );
for ( int i = 0; i < numGeom; ++i )
{
geometryList << orthogonalizeGeom( gc->geometryN( i ), maxIterations, tolerance, lowerThreshold, upperThreshold );
}
QgsGeometry first = QgsGeometry( geometryList.takeAt( 0 ) );
for ( QgsAbstractGeometry *g : qgis::as_const( geometryList ) )
{
first.addPart( g );
}
return first;
}
else
{
return QgsGeometry( orthogonalizeGeom( mGeometry, maxIterations, tolerance, lowerThreshold, upperThreshold ) );
}
}