本文整理汇总了C++中GeoDataLineString::setTessellate方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoDataLineString::setTessellate方法的具体用法?C++ GeoDataLineString::setTessellate怎么用?C++ GeoDataLineString::setTessellate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoDataLineString
的用法示例。
在下文中一共展示了GeoDataLineString::setTessellate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculatePaintColor
void
AprsObject::render( GeoPainter *painter, ViewportParams *viewport,
int fadeTime, int hideTime )
{
Q_UNUSED( viewport );
if ( hideTime > 0 && m_history.last().timestamp().elapsed() > hideTime )
return;
QColor baseColor = calculatePaintColor( m_seenFrom,
m_history.last().timestamp(),
fadeTime );
if ( m_history.count() > 1 ) {
QList<GeoAprsCoordinates>::iterator spot = m_history.begin();
QList<GeoAprsCoordinates>::iterator endSpot = m_history.end();
GeoDataLineString lineString;
lineString.setTessellate( true );
lineString << *spot; // *spot exists because m_history.count() > 1
for( ++spot; spot != endSpot; ++spot ) {
if ( hideTime > 0 && ( *spot ).timestamp().elapsed() > hideTime )
break;
lineString << *spot;
// draw the new circle in whatever is appropriate for that point
const QColor penColor = calculatePaintColor( spot->seenFrom(), spot->timestamp(), fadeTime );
painter->setPen( penColor );
painter->drawRect( *spot, 5, 5 );
}
// draw the line in the base color
painter->setPen( baseColor );
painter->drawPolyline( lineString );
}
// Always draw the symbol then the text last so it's on top
if ( m_havePixmap ) {
if ( ! m_pixmap )
m_pixmap = new QPixmap ( m_pixmapFilename );
if ( m_pixmap && ! m_pixmap->isNull() )
painter->drawPixmap( m_history.last(), *m_pixmap );
else
painter->drawRect( m_history.last(), 6, 6 );
}
else
painter->drawRect( m_history.last(), 6, 6 );
painter->setPen( baseColor );
painter->drawText( m_history.last(), m_myName );
}