Moved layers visibility synchronization to PCB_DRAW_PANEL_GAL::SyncLayersVisibility().
This commit is contained in:
parent
a24576f3ce
commit
5a428e1957
|
@ -321,3 +321,28 @@ void PCB_DRAW_PANEL_GAL::SetTopLayer( LAYER_ID aLayer )
|
||||||
|
|
||||||
m_view->UpdateAllLayersOrder();
|
m_view->UpdateAllLayersOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PCB_DRAW_PANEL_GAL::SyncLayersVisibility( const BOARD* aBoard )
|
||||||
|
{
|
||||||
|
// Load layer & elements visibility settings
|
||||||
|
for( LAYER_NUM i = 0; i < NB_LAYERS; ++i )
|
||||||
|
{
|
||||||
|
m_view->SetLayerVisible( i, aBoard->IsLayerVisible( i ) );
|
||||||
|
|
||||||
|
// Synchronize netname layers as well
|
||||||
|
if( IsCopperLayer( i ) )
|
||||||
|
m_view->SetLayerVisible( GetNetnameLayer( i ), aBoard->IsLayerVisible( i ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
for( LAYER_NUM i = 0; i < END_PCB_VISIBLE_LIST; ++i )
|
||||||
|
{
|
||||||
|
m_view->SetLayerVisible( ITEM_GAL_LAYER( i ), aBoard->IsElementVisible( i ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable some layers that are GAL specific
|
||||||
|
m_view->SetLayerVisible( ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), true );
|
||||||
|
m_view->SetLayerVisible( ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), true );
|
||||||
|
m_view->SetLayerVisible( ITEM_GAL_LAYER( WORKSHEET ), true );
|
||||||
|
m_view->SetLayerVisible( ITEM_GAL_LAYER( GP_OVERLAY ), true );
|
||||||
|
}
|
||||||
|
|
|
@ -70,6 +70,13 @@ public:
|
||||||
///> @copydoc EDA_DRAW_PANEL_GAL::SetTopLayer()
|
///> @copydoc EDA_DRAW_PANEL_GAL::SetTopLayer()
|
||||||
virtual void SetTopLayer( LAYER_ID aLayer );
|
virtual void SetTopLayer( LAYER_ID aLayer );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function SyncLayersVisibility
|
||||||
|
* Updates "visibility" property of each layer of a given BOARD.
|
||||||
|
* @param aBoard contains layers visibility settings to be applied.
|
||||||
|
*/
|
||||||
|
void SyncLayersVisibility( const BOARD* aBoard );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
///> Currently used worksheet
|
///> Currently used worksheet
|
||||||
KIGFX::WORKSHEET_VIEWITEM* m_worksheet;
|
KIGFX::WORKSHEET_VIEWITEM* m_worksheet;
|
||||||
|
|
|
@ -813,29 +813,7 @@ void PCB_EDIT_FRAME::syncRenderStates()
|
||||||
void PCB_EDIT_FRAME::syncLayerVisibilities()
|
void PCB_EDIT_FRAME::syncLayerVisibilities()
|
||||||
{
|
{
|
||||||
m_Layers->SyncLayerVisibilities();
|
m_Layers->SyncLayerVisibilities();
|
||||||
|
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( m_Pcb );
|
||||||
KIGFX::VIEW* view = GetGalCanvas()->GetView();
|
|
||||||
|
|
||||||
// Load layer & elements visibility settings
|
|
||||||
for( LAYER_NUM i = 0; i < LAYER_ID_COUNT; ++i )
|
|
||||||
{
|
|
||||||
view->SetLayerVisible( i, m_Pcb->IsLayerVisible( LAYER_ID( i ) ) );
|
|
||||||
|
|
||||||
// Synchronize netname layers as well
|
|
||||||
if( IsCopperLayer( i ) )
|
|
||||||
view->SetLayerVisible( GetNetnameLayer( i ), m_Pcb->IsLayerVisible( LAYER_ID( i ) ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
for( LAYER_NUM i = 0; i < END_PCB_VISIBLE_LIST; ++i )
|
|
||||||
{
|
|
||||||
view->SetLayerVisible( ITEM_GAL_LAYER( i ), m_Pcb->IsElementVisible( i ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enable some layers that are GAL specific
|
|
||||||
view->SetLayerVisible( ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), true );
|
|
||||||
view->SetLayerVisible( ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), true );
|
|
||||||
view->SetLayerVisible( ITEM_GAL_LAYER( WORKSHEET ), true );
|
|
||||||
view->SetLayerVisible( ITEM_GAL_LAYER( GP_OVERLAY ), true );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue