Added implementation of level of details per layer and item type pairs basis (items on every layer have a possibility to define the minimum VIEW scale to be shown).
This commit is contained in:
parent
9c4e02379a
commit
e29a829a70
|
@ -459,7 +459,8 @@ struct VIEW::drawItem
|
||||||
// Draw using cached information or create one
|
// Draw using cached information or create one
|
||||||
int group = aItem->getGroup( currentLayer->id );
|
int group = aItem->getGroup( currentLayer->id );
|
||||||
|
|
||||||
if( group >= 0 && aItem->ViewIsVisible() )
|
if( group >= 0 && aItem->ViewIsVisible() &&
|
||||||
|
aItem->ViewGetLOD( currentLayer->id ) < view->m_scale )
|
||||||
{
|
{
|
||||||
gal->DrawGroup( group );
|
gal->DrawGroup( group );
|
||||||
}
|
}
|
||||||
|
@ -471,7 +472,8 @@ struct VIEW::drawItem
|
||||||
gal->EndGroup();
|
gal->EndGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( aItem->ViewIsVisible() )
|
else if( aItem->ViewIsVisible() &&
|
||||||
|
aItem->ViewGetLOD( currentLayer->id ) < view->m_scale )
|
||||||
{
|
{
|
||||||
// Immediate mode
|
// Immediate mode
|
||||||
view->m_painter->Draw( aItem, currentLayer->id );
|
view->m_painter->Draw( aItem, currentLayer->id );
|
||||||
|
|
|
@ -227,6 +227,17 @@ public:
|
||||||
return m_viewVisible;
|
return m_viewVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function ViewGetLOD()
|
||||||
|
* Returns the level of detail of the item. A level of detail is the minimal VIEW scale that
|
||||||
|
* is sufficient for an item to be shown on a given layer.
|
||||||
|
*/
|
||||||
|
virtual unsigned int ViewGetLOD( int aLayer ) const
|
||||||
|
{
|
||||||
|
// By default always show the item
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ViewUpdate()
|
* Function ViewUpdate()
|
||||||
* For dynamic VIEWs, informs the associated VIEW that the graphical representation of
|
* For dynamic VIEWs, informs the associated VIEW that the graphical representation of
|
||||||
|
|
Loading…
Reference in New Issue