本文整理汇总了C++中GeoDataLineString::setTessellationFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoDataLineString::setTessellationFlags方法的具体用法?C++ GeoDataLineString::setTessellationFlags怎么用?C++ GeoDataLineString::setTessellationFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoDataLineString
的用法示例。
在下文中一共展示了GeoDataLineString::setTessellationFlags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toNormalized
GeoDataLineString GeoDataLineString::toNormalized() const
{
GeoDataLineString normalizedLineString;
normalizedLineString.setTessellationFlags( tessellationFlags() );
qreal lon;
qreal lat;
// FIXME: Think about how we can avoid unnecessary copies
// if the linestring stays the same.
QVector<GeoDataCoordinates>::const_iterator end = p()->m_vector.constEnd();
for( QVector<GeoDataCoordinates>::const_iterator itCoords
= p()->m_vector.constBegin();
itCoords != end;
++itCoords ) {
itCoords->geoCoordinates( lon, lat );
qreal alt = itCoords->altitude();
GeoDataCoordinates::normalizeLonLat( lon, lat );
GeoDataCoordinates normalizedCoords( *itCoords );
normalizedCoords.set( lon, lat, alt );
normalizedLineString << normalizedCoords;
}
return normalizedLineString;
}
示例2: toPoleCorrected
void GeoDataLineStringPrivate::toPoleCorrected( const GeoDataLineString& q, GeoDataLineString& poleCorrected )
{
poleCorrected.setTessellationFlags( q.tessellationFlags() );
GeoDataCoordinates previousCoords;
GeoDataCoordinates currentCoords;
if ( q.isClosed() ) {
if ( !( m_vector.first().isPole() ) &&
( m_vector.last().isPole() ) ) {
qreal firstLongitude = ( m_vector.first() ).longitude();
GeoDataCoordinates modifiedCoords( m_vector.last() );
modifiedCoords.setLongitude( firstLongitude );
poleCorrected << modifiedCoords;
}
}
QVector<GeoDataCoordinates>::const_iterator itCoords = m_vector.constBegin();
QVector<GeoDataCoordinates>::const_iterator itEnd = m_vector.constEnd();
for( ; itCoords != itEnd; ++itCoords ) {
currentCoords = *itCoords;
if ( itCoords == m_vector.constBegin() ) {
previousCoords = currentCoords;
}
if ( currentCoords.isPole() ) {
if ( previousCoords.isPole() ) {
continue;
}
else {
qreal previousLongitude = previousCoords.longitude();
GeoDataCoordinates currentModifiedCoords( currentCoords );
currentModifiedCoords.setLongitude( previousLongitude );
poleCorrected << currentModifiedCoords;
}
}
else {
if ( previousCoords.isPole() ) {
qreal currentLongitude = currentCoords.longitude();
GeoDataCoordinates previousModifiedCoords( previousCoords );
previousModifiedCoords.setLongitude( currentLongitude );
poleCorrected << previousModifiedCoords;
poleCorrected << currentCoords;
}
else {
// No poles at all. Nothing special to handle
poleCorrected << currentCoords;
}
}
previousCoords = currentCoords;
}
if ( q.isClosed() ) {
if ( ( m_vector.first().isPole() ) &&
!( m_vector.last().isPole() ) ) {
qreal lastLongitude = ( m_vector.last() ).longitude();
GeoDataCoordinates modifiedCoords( m_vector.first() );
modifiedCoords.setLongitude( lastLongitude );
poleCorrected << modifiedCoords;
}
}
}