Loading include/class_board_design_settings.h +11 −14 Original line number Original line Diff line number Diff line Loading @@ -78,7 +78,7 @@ public: return false; return false; // If a layer is disabled, it is automatically invisible // If a layer is disabled, it is automatically invisible return (bool) ( m_VisibleLayers & m_EnabledLayers & 1 << aLayerIndex ); return (bool) ( m_VisibleLayers & m_EnabledLayers & (1 << aLayerIndex) ); } } Loading Loading @@ -111,28 +111,27 @@ public: m_VisibleElements = aMask; m_VisibleElements = aMask; } } /** /** * Function IsElementVisible * Function IsElementVisible * tests whether a given element category is visible * tests whether a given element category is visible. Keep this as an * @param aCategoryIndex = The index of the element category to be tested. * inline function. * @param aPCB_VISIBLE is from the enum by the same name * @return bool - true if the element is visible. * @return bool - true if the element is visible. * @see enum PCB_VISIBLE */ */ bool IsElementVisible( int aCategoryIndex ) const bool IsElementVisible( int aPCB_VISIBLE ) const { { if( aCategoryIndex < 0 || aCategoryIndex > PAD_CMP_VISIBLE ) return bool( m_VisibleElements & (1 << aPCB_VISIBLE) ); return false; return (bool) ( m_VisibleElements & (1 << aCategoryIndex) ); } } /** /** * Function SetElementVisibility * Function SetElementVisibility * changes the visibility of an element category * changes the visibility of an element category * @param aCategoryIndex = The index of the element category to be changed * @param aPCB_VISIBLE is from the enum by the same name * @param aNewState = The new visibility state of the element category * @param aNewState = The new visibility state of the element category * @see enum PCB_VISIBLE */ */ void SetElementVisibility( int aCategoryIndex, bool aNewState ); void SetElementVisibility( int aPCB_VISIBLE, bool aNewState ); /** /** * Function GetEnabledLayers * Function GetEnabledLayers Loading @@ -144,7 +143,6 @@ public: return m_EnabledLayers; return m_EnabledLayers; } } /** /** * Function SetEnabledLayers * Function SetEnabledLayers * changes the bit-mask of enabled layers * changes the bit-mask of enabled layers Loading @@ -152,7 +150,6 @@ public: */ */ void SetEnabledLayers( int aMask ); void SetEnabledLayers( int aMask ); /** /** * Function IsLayerEnabled * Function IsLayerEnabled * tests whether a given layer is enabled * tests whether a given layer is enabled Loading @@ -161,7 +158,7 @@ public: */ */ bool IsLayerEnabled( int aLayerIndex ) bool IsLayerEnabled( int aLayerIndex ) { { return (bool) ( m_EnabledLayers & 1 << aLayerIndex ); return bool( m_EnabledLayers & (1 << aLayerIndex) ); } } Loading include/pcbstruct.h +33 −17 Original line number Original line Diff line number Diff line Loading @@ -152,21 +152,37 @@ class RATSNEST_ITEM; /* Class to handle a board */ /* Class to handle a board */ #include "class_board.h" #include "class_board.h" enum ELEMENTS_NUMBERS /** * Enum PCB_VISIBLE * is a set of visible PCB elements. * @see BOARD::SetVisibleElementColor() * @see BOARD::SetVisibleElement() */ enum PCB_VISIBLE { { VIAS_VISIBLE = 0, VIAS_VISIBLE, VIA_NOT_DEFINED_VISIBLE = VIAS_VISIBLE, VIA_MICROVIA_VISIBLE, VIA_MICROVIA_VISIBLE, VIA_BLIND_BURIED_VISIBLE, VIA_BBLIND_VISIBLE, VIA_THROUGH_VISIBLE, VIA_THROUGH_VISIBLE, MODULE_TEXT_CMP_VISIBLE, MOD_TEXT_FR_VISIBLE, MODULE_TEXT_CU_VISIBLE, MOD_TEXT_BK_VISIBLE, MODULE_TEXT_NOV_VISIBLE, MOD_TEXT_INVISIBLE, ///< text marked as invisible ANCHOR_VISIBLE, ANCHOR_VISIBLE, PAD_CU_VISIBLE, PAD_FR_VISIBLE, PAD_CMP_VISIBLE PAD_BK_VISIBLE, RATSNEST_VISIBLE, GRID_VISIBLE, // the rest of these do not currently support color changes: NO_CONNECTS_VISIBLE, ///< show a marker on pads with no nets MOD_FR_VISIBLE, ///< show modules on front MOD_BK_VISIBLE, ///< show modules on back END_VISIBLE // sentinel }; }; /** /** * Function IsValidLayerIndex * Function IsValidLayerIndex * tests whether a given integer is a valid layer index * tests whether a given integer is a valid layer index Loading include/wxPcbStruct.h +9 −13 Original line number Original line Diff line number Diff line Loading @@ -67,28 +67,17 @@ protected: { { } } //-----<implement LAYER_WIDGET abstract functions>--- //-----<implement LAYER_WIDGET abstract callback functions>----------- void OnLayerColorChange( int aLayer, int aColor ); void OnLayerColorChange( int aLayer, int aColor ); bool OnLayerSelect( int aLayer ); bool OnLayerSelect( int aLayer ); void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ); void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ); void OnRenderColorChange( int aId, int aColor ); void OnRenderColorChange( int aId, int aColor ); void OnRenderEnable( int aId, bool isEnabled ); void OnRenderEnable( int aId, bool isEnabled ); //-----</implement LAYER_WIDGET abstract functions>--------------- //-----</implement LAYER_WIDGET abstract callback functions>---------- }; }; /// render rows are fixed, layer rows are dynamically determined. static LAYER_WIDGET::ROW renderRows[]; LYRS* m_Layers; // established in constructor LYRS* m_Layers; // established in constructor /** * Function ReFillLayerWidget * changes out all the layers in m_Layers and may be called upon * loading a new BOARD. */ void ReFillLayerWidget(); public: public: WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and // select active layer // select active layer Loading Loading @@ -177,6 +166,13 @@ public: void ReCreateMenuBar(); void ReCreateMenuBar(); WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent ); WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent ); /** * Function ReFillLayerWidget * changes out all the layers in m_Layers and may be called upon * loading a new BOARD. */ void ReFillLayerWidget(); void Show3D_Frame( wxCommandEvent& event ); void Show3D_Frame( wxCommandEvent& event ); void GeneralControle( wxDC* DC, wxPoint Mouse ); void GeneralControle( wxDC* DC, wxPoint Mouse ); Loading pcbnew/basepcbframe.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -277,9 +277,9 @@ GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide() ( (PCB_SCREEN*)GetScreen())->m_Active_Layer ); ( (PCB_SCREEN*)GetScreen())->m_Active_Layer ); // account for the globals // account for the globals guide.SetIgnoreMTextsMarkedNoShow( ! g_DesignSettings.IsElementVisible( MODULE_TEXT_NOV_VISIBLE )); guide.SetIgnoreMTextsMarkedNoShow( ! g_DesignSettings.IsElementVisible( MOD_TEXT_INVISIBLE )); guide.SetIgnoreMTextsOnCopper( ! g_DesignSettings.IsElementVisible( MODULE_TEXT_CU_VISIBLE )); guide.SetIgnoreMTextsOnCopper( ! g_DesignSettings.IsElementVisible( MOD_TEXT_BK_VISIBLE )); guide.SetIgnoreMTextsOnCmp( ! g_DesignSettings.IsElementVisible( MODULE_TEXT_CMP_VISIBLE )); guide.SetIgnoreMTextsOnCmp( ! g_DesignSettings.IsElementVisible( MOD_TEXT_FR_VISIBLE )); guide.SetIgnoreModulesOnCu( !DisplayOpt.Show_Modules_Cu ); guide.SetIgnoreModulesOnCu( !DisplayOpt.Show_Modules_Cu ); guide.SetIgnoreModulesOnCmp( !DisplayOpt.Show_Modules_Cmp ); guide.SetIgnoreModulesOnCmp( !DisplayOpt.Show_Modules_Cmp ); Loading pcbnew/class_board.cpp +52 −0 Original line number Original line Diff line number Diff line Loading @@ -396,11 +396,63 @@ int BOARD::GetVisibleElements() const return m_BoardSettings->GetVisibleElements(); return m_BoardSettings->GetVisibleElements(); } } int BOARD::GetVisibleElementColor( int aPCB_VISIBLE ) { int color = -1; // @todo move these globals into the board. switch( aPCB_VISIBLE ) { case VIAS_VISIBLE: color = m_BoardSettings->m_ViaColor[VIA_THROUGH]; break; case VIA_MICROVIA_VISIBLE: color = m_BoardSettings->m_ViaColor[VIA_MICROVIA]; break; case VIA_BBLIND_VISIBLE: color = m_BoardSettings->m_ViaColor[VIA_BLIND_BURIED]; break; case VIA_THROUGH_VISIBLE: color = g_ModuleTextCUColor; break; case MOD_TEXT_FR_VISIBLE: color = g_ModuleTextCUColor; break; case MOD_TEXT_BK_VISIBLE: color = g_ModuleTextCUColor; break; case MOD_TEXT_INVISIBLE: color = g_ModuleTextNOVColor; break; case ANCHOR_VISIBLE: color = g_AnchorColor; break; case PAD_FR_VISIBLE: color = g_PadCMPColor; break; case PAD_BK_VISIBLE: color = g_PadCUColor; break; case RATSNEST_VISIBLE: color = m_BoardSettings->m_RatsnestColor; break; case GRID_VISIBLE: color = g_GridColor; break; default: wxLogDebug("BOARD::GetVisibleElementColor(): bad arg %d", aPCB_VISIBLE ); } return color; } void BOARD::SetVisibleElementColor( int aPCB_VISIBLE, int aColor ) { // @todo move these globals into the board. switch( aPCB_VISIBLE ) { case VIAS_VISIBLE: m_BoardSettings->m_ViaColor[VIA_THROUGH] = aColor; break; case VIA_MICROVIA_VISIBLE: m_BoardSettings->m_ViaColor[VIA_MICROVIA] = aColor; break; case VIA_BBLIND_VISIBLE: m_BoardSettings->m_ViaColor[VIA_BLIND_BURIED] = aColor; break; case VIA_THROUGH_VISIBLE: g_ModuleTextCUColor = aColor; break; case MOD_TEXT_FR_VISIBLE: g_ModuleTextCUColor = aColor; break; case MOD_TEXT_BK_VISIBLE: g_ModuleTextCUColor = aColor; break; case MOD_TEXT_INVISIBLE: g_ModuleTextNOVColor = aColor; break; case ANCHOR_VISIBLE: g_AnchorColor = aColor; break; case PAD_FR_VISIBLE: g_PadCMPColor = aColor; break; case PAD_BK_VISIBLE: g_PadCUColor = aColor; break; case RATSNEST_VISIBLE: m_BoardSettings->m_RatsnestColor = aColor; break; case GRID_VISIBLE: g_GridColor = aColor; break; default: wxLogDebug("BOARD::SetVisibleElementColor(): bad arg %d", aPCB_VISIBLE ); } } void BOARD::SetLayerColor( int aLayer, int aColor ) void BOARD::SetLayerColor( int aLayer, int aColor ) { { m_BoardSettings->SetLayerColor( aLayer, aColor ); m_BoardSettings->SetLayerColor( aLayer, aColor ); } } int BOARD::GetLayerColor( int aLayer ) int BOARD::GetLayerColor( int aLayer ) { { return m_BoardSettings->GetLayerColor( aLayer ); return m_BoardSettings->GetLayerColor( aLayer ); Loading Loading
include/class_board_design_settings.h +11 −14 Original line number Original line Diff line number Diff line Loading @@ -78,7 +78,7 @@ public: return false; return false; // If a layer is disabled, it is automatically invisible // If a layer is disabled, it is automatically invisible return (bool) ( m_VisibleLayers & m_EnabledLayers & 1 << aLayerIndex ); return (bool) ( m_VisibleLayers & m_EnabledLayers & (1 << aLayerIndex) ); } } Loading Loading @@ -111,28 +111,27 @@ public: m_VisibleElements = aMask; m_VisibleElements = aMask; } } /** /** * Function IsElementVisible * Function IsElementVisible * tests whether a given element category is visible * tests whether a given element category is visible. Keep this as an * @param aCategoryIndex = The index of the element category to be tested. * inline function. * @param aPCB_VISIBLE is from the enum by the same name * @return bool - true if the element is visible. * @return bool - true if the element is visible. * @see enum PCB_VISIBLE */ */ bool IsElementVisible( int aCategoryIndex ) const bool IsElementVisible( int aPCB_VISIBLE ) const { { if( aCategoryIndex < 0 || aCategoryIndex > PAD_CMP_VISIBLE ) return bool( m_VisibleElements & (1 << aPCB_VISIBLE) ); return false; return (bool) ( m_VisibleElements & (1 << aCategoryIndex) ); } } /** /** * Function SetElementVisibility * Function SetElementVisibility * changes the visibility of an element category * changes the visibility of an element category * @param aCategoryIndex = The index of the element category to be changed * @param aPCB_VISIBLE is from the enum by the same name * @param aNewState = The new visibility state of the element category * @param aNewState = The new visibility state of the element category * @see enum PCB_VISIBLE */ */ void SetElementVisibility( int aCategoryIndex, bool aNewState ); void SetElementVisibility( int aPCB_VISIBLE, bool aNewState ); /** /** * Function GetEnabledLayers * Function GetEnabledLayers Loading @@ -144,7 +143,6 @@ public: return m_EnabledLayers; return m_EnabledLayers; } } /** /** * Function SetEnabledLayers * Function SetEnabledLayers * changes the bit-mask of enabled layers * changes the bit-mask of enabled layers Loading @@ -152,7 +150,6 @@ public: */ */ void SetEnabledLayers( int aMask ); void SetEnabledLayers( int aMask ); /** /** * Function IsLayerEnabled * Function IsLayerEnabled * tests whether a given layer is enabled * tests whether a given layer is enabled Loading @@ -161,7 +158,7 @@ public: */ */ bool IsLayerEnabled( int aLayerIndex ) bool IsLayerEnabled( int aLayerIndex ) { { return (bool) ( m_EnabledLayers & 1 << aLayerIndex ); return bool( m_EnabledLayers & (1 << aLayerIndex) ); } } Loading
include/pcbstruct.h +33 −17 Original line number Original line Diff line number Diff line Loading @@ -152,21 +152,37 @@ class RATSNEST_ITEM; /* Class to handle a board */ /* Class to handle a board */ #include "class_board.h" #include "class_board.h" enum ELEMENTS_NUMBERS /** * Enum PCB_VISIBLE * is a set of visible PCB elements. * @see BOARD::SetVisibleElementColor() * @see BOARD::SetVisibleElement() */ enum PCB_VISIBLE { { VIAS_VISIBLE = 0, VIAS_VISIBLE, VIA_NOT_DEFINED_VISIBLE = VIAS_VISIBLE, VIA_MICROVIA_VISIBLE, VIA_MICROVIA_VISIBLE, VIA_BLIND_BURIED_VISIBLE, VIA_BBLIND_VISIBLE, VIA_THROUGH_VISIBLE, VIA_THROUGH_VISIBLE, MODULE_TEXT_CMP_VISIBLE, MOD_TEXT_FR_VISIBLE, MODULE_TEXT_CU_VISIBLE, MOD_TEXT_BK_VISIBLE, MODULE_TEXT_NOV_VISIBLE, MOD_TEXT_INVISIBLE, ///< text marked as invisible ANCHOR_VISIBLE, ANCHOR_VISIBLE, PAD_CU_VISIBLE, PAD_FR_VISIBLE, PAD_CMP_VISIBLE PAD_BK_VISIBLE, RATSNEST_VISIBLE, GRID_VISIBLE, // the rest of these do not currently support color changes: NO_CONNECTS_VISIBLE, ///< show a marker on pads with no nets MOD_FR_VISIBLE, ///< show modules on front MOD_BK_VISIBLE, ///< show modules on back END_VISIBLE // sentinel }; }; /** /** * Function IsValidLayerIndex * Function IsValidLayerIndex * tests whether a given integer is a valid layer index * tests whether a given integer is a valid layer index Loading
include/wxPcbStruct.h +9 −13 Original line number Original line Diff line number Diff line Loading @@ -67,28 +67,17 @@ protected: { { } } //-----<implement LAYER_WIDGET abstract functions>--- //-----<implement LAYER_WIDGET abstract callback functions>----------- void OnLayerColorChange( int aLayer, int aColor ); void OnLayerColorChange( int aLayer, int aColor ); bool OnLayerSelect( int aLayer ); bool OnLayerSelect( int aLayer ); void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ); void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ); void OnRenderColorChange( int aId, int aColor ); void OnRenderColorChange( int aId, int aColor ); void OnRenderEnable( int aId, bool isEnabled ); void OnRenderEnable( int aId, bool isEnabled ); //-----</implement LAYER_WIDGET abstract functions>--------------- //-----</implement LAYER_WIDGET abstract callback functions>---------- }; }; /// render rows are fixed, layer rows are dynamically determined. static LAYER_WIDGET::ROW renderRows[]; LYRS* m_Layers; // established in constructor LYRS* m_Layers; // established in constructor /** * Function ReFillLayerWidget * changes out all the layers in m_Layers and may be called upon * loading a new BOARD. */ void ReFillLayerWidget(); public: public: WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and WinEDAChoiceBox* m_SelLayerBox; // a combo box to display and // select active layer // select active layer Loading Loading @@ -177,6 +166,13 @@ public: void ReCreateMenuBar(); void ReCreateMenuBar(); WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent ); WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent ); /** * Function ReFillLayerWidget * changes out all the layers in m_Layers and may be called upon * loading a new BOARD. */ void ReFillLayerWidget(); void Show3D_Frame( wxCommandEvent& event ); void Show3D_Frame( wxCommandEvent& event ); void GeneralControle( wxDC* DC, wxPoint Mouse ); void GeneralControle( wxDC* DC, wxPoint Mouse ); Loading
pcbnew/basepcbframe.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -277,9 +277,9 @@ GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide() ( (PCB_SCREEN*)GetScreen())->m_Active_Layer ); ( (PCB_SCREEN*)GetScreen())->m_Active_Layer ); // account for the globals // account for the globals guide.SetIgnoreMTextsMarkedNoShow( ! g_DesignSettings.IsElementVisible( MODULE_TEXT_NOV_VISIBLE )); guide.SetIgnoreMTextsMarkedNoShow( ! g_DesignSettings.IsElementVisible( MOD_TEXT_INVISIBLE )); guide.SetIgnoreMTextsOnCopper( ! g_DesignSettings.IsElementVisible( MODULE_TEXT_CU_VISIBLE )); guide.SetIgnoreMTextsOnCopper( ! g_DesignSettings.IsElementVisible( MOD_TEXT_BK_VISIBLE )); guide.SetIgnoreMTextsOnCmp( ! g_DesignSettings.IsElementVisible( MODULE_TEXT_CMP_VISIBLE )); guide.SetIgnoreMTextsOnCmp( ! g_DesignSettings.IsElementVisible( MOD_TEXT_FR_VISIBLE )); guide.SetIgnoreModulesOnCu( !DisplayOpt.Show_Modules_Cu ); guide.SetIgnoreModulesOnCu( !DisplayOpt.Show_Modules_Cu ); guide.SetIgnoreModulesOnCmp( !DisplayOpt.Show_Modules_Cmp ); guide.SetIgnoreModulesOnCmp( !DisplayOpt.Show_Modules_Cmp ); Loading
pcbnew/class_board.cpp +52 −0 Original line number Original line Diff line number Diff line Loading @@ -396,11 +396,63 @@ int BOARD::GetVisibleElements() const return m_BoardSettings->GetVisibleElements(); return m_BoardSettings->GetVisibleElements(); } } int BOARD::GetVisibleElementColor( int aPCB_VISIBLE ) { int color = -1; // @todo move these globals into the board. switch( aPCB_VISIBLE ) { case VIAS_VISIBLE: color = m_BoardSettings->m_ViaColor[VIA_THROUGH]; break; case VIA_MICROVIA_VISIBLE: color = m_BoardSettings->m_ViaColor[VIA_MICROVIA]; break; case VIA_BBLIND_VISIBLE: color = m_BoardSettings->m_ViaColor[VIA_BLIND_BURIED]; break; case VIA_THROUGH_VISIBLE: color = g_ModuleTextCUColor; break; case MOD_TEXT_FR_VISIBLE: color = g_ModuleTextCUColor; break; case MOD_TEXT_BK_VISIBLE: color = g_ModuleTextCUColor; break; case MOD_TEXT_INVISIBLE: color = g_ModuleTextNOVColor; break; case ANCHOR_VISIBLE: color = g_AnchorColor; break; case PAD_FR_VISIBLE: color = g_PadCMPColor; break; case PAD_BK_VISIBLE: color = g_PadCUColor; break; case RATSNEST_VISIBLE: color = m_BoardSettings->m_RatsnestColor; break; case GRID_VISIBLE: color = g_GridColor; break; default: wxLogDebug("BOARD::GetVisibleElementColor(): bad arg %d", aPCB_VISIBLE ); } return color; } void BOARD::SetVisibleElementColor( int aPCB_VISIBLE, int aColor ) { // @todo move these globals into the board. switch( aPCB_VISIBLE ) { case VIAS_VISIBLE: m_BoardSettings->m_ViaColor[VIA_THROUGH] = aColor; break; case VIA_MICROVIA_VISIBLE: m_BoardSettings->m_ViaColor[VIA_MICROVIA] = aColor; break; case VIA_BBLIND_VISIBLE: m_BoardSettings->m_ViaColor[VIA_BLIND_BURIED] = aColor; break; case VIA_THROUGH_VISIBLE: g_ModuleTextCUColor = aColor; break; case MOD_TEXT_FR_VISIBLE: g_ModuleTextCUColor = aColor; break; case MOD_TEXT_BK_VISIBLE: g_ModuleTextCUColor = aColor; break; case MOD_TEXT_INVISIBLE: g_ModuleTextNOVColor = aColor; break; case ANCHOR_VISIBLE: g_AnchorColor = aColor; break; case PAD_FR_VISIBLE: g_PadCMPColor = aColor; break; case PAD_BK_VISIBLE: g_PadCUColor = aColor; break; case RATSNEST_VISIBLE: m_BoardSettings->m_RatsnestColor = aColor; break; case GRID_VISIBLE: g_GridColor = aColor; break; default: wxLogDebug("BOARD::SetVisibleElementColor(): bad arg %d", aPCB_VISIBLE ); } } void BOARD::SetLayerColor( int aLayer, int aColor ) void BOARD::SetLayerColor( int aLayer, int aColor ) { { m_BoardSettings->SetLayerColor( aLayer, aColor ); m_BoardSettings->SetLayerColor( aLayer, aColor ); } } int BOARD::GetLayerColor( int aLayer ) int BOARD::GetLayerColor( int aLayer ) { { return m_BoardSettings->GetLayerColor( aLayer ); return m_BoardSettings->GetLayerColor( aLayer ); Loading