Flags cleanup.
Remove extraneous use of FLAG0 from tracks cleaner (it was checked but never set). Fix issue in expand connections where two parts of it couldn't agree on the same flag (BUSY vs SKIP_STRUCT), and where the second part was clearing the flag instead of setting it. Remove obsolete HIGHLIGHT infrastructure (we now use selection). Remove extraneous use of BUSY flag in several places (it was never set).
This commit is contained in:
parent
da2b7071b4
commit
32c3ea4edd
|
@ -33,7 +33,6 @@ RENDER_SETTINGS::RENDER_SETTINGS() :
|
||||||
// Set the default initial values
|
// Set the default initial values
|
||||||
m_highlightFactor = 0.5f;
|
m_highlightFactor = 0.5f;
|
||||||
m_selectFactor = 0.5f;
|
m_selectFactor = 0.5f;
|
||||||
m_highlightItems = false;
|
|
||||||
m_highlightEnabled = false;
|
m_highlightEnabled = false;
|
||||||
m_hiContrastEnabled = false;
|
m_hiContrastEnabled = false;
|
||||||
m_hiContrastFactor = 0.2f; //TODO: Make this user-configurable
|
m_hiContrastFactor = 0.2f; //TODO: Make this user-configurable
|
||||||
|
|
|
@ -182,12 +182,7 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
||||||
|
|
||||||
if( strcmp( idcmd, "$CLEAR:" ) == 0 )
|
if( strcmp( idcmd, "$CLEAR:" ) == 0 )
|
||||||
{
|
{
|
||||||
if( text && strcmp( text, "HIGHLIGHTED" ) == 0 )
|
// Cross-probing is now done through selection so we no longer need a clear command
|
||||||
{
|
|
||||||
GetCanvas()->GetView()->HighlightItem( nullptr, nullptr );
|
|
||||||
GetCanvas()->Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -821,10 +821,6 @@ DIALOG_FIELDS_EDITOR_GLOBAL::~DIALOG_FIELDS_EDITOR_GLOBAL()
|
||||||
m_grid->PopEventHandler( true );
|
m_grid->PopEventHandler( true );
|
||||||
|
|
||||||
// we gave ownership of m_dataModel to the wxGrid...
|
// we gave ownership of m_dataModel to the wxGrid...
|
||||||
|
|
||||||
// Clear highlighted symbols, if any
|
|
||||||
m_parent->GetCanvas()->GetView()->HighlightItem( nullptr, nullptr );
|
|
||||||
m_parent->GetCanvas()->Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1130,10 +1126,6 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick( wxGridEvent& event )
|
||||||
m_grid->ClearSelection();
|
m_grid->ClearSelection();
|
||||||
m_grid->SetGridCursor( event.GetRow(), event.GetCol() );
|
m_grid->SetGridCursor( event.GetRow(), event.GetCol() );
|
||||||
|
|
||||||
// Clear highlighted symbols, if any
|
|
||||||
m_parent->GetCanvas()->GetView()->HighlightItem( nullptr, nullptr );
|
|
||||||
m_parent->GetCanvas()->Refresh();
|
|
||||||
|
|
||||||
m_dataModel->ExpandCollapseRow( event.GetRow() );
|
m_dataModel->ExpandCollapseRow( event.GetRow() );
|
||||||
std::vector<SCH_REFERENCE> refs = m_dataModel->GetRowReferences( event.GetRow() );
|
std::vector<SCH_REFERENCE> refs = m_dataModel->GetRowReferences( event.GetRow() );
|
||||||
|
|
||||||
|
|
|
@ -1756,58 +1756,3 @@ void SCH_COMPONENT::BrightenPin( LIB_PIN* aPin )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_COMPONENT::ClearHighlightedPins()
|
|
||||||
{
|
|
||||||
for( auto& pin : m_pins )
|
|
||||||
pin->ClearHighlighted();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool SCH_COMPONENT::HasHighlightedPins()
|
|
||||||
{
|
|
||||||
for( const auto& pin : m_pins )
|
|
||||||
{
|
|
||||||
if( pin->IsHighlighted() )
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SCH_COMPONENT::HighlightPin( LIB_PIN* aPin )
|
|
||||||
{
|
|
||||||
if( m_pinMap.count( aPin ) )
|
|
||||||
m_pins[ m_pinMap.at( aPin ) ]->SetHighlighted();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool SCH_COMPONENT::ClearAllHighlightFlags()
|
|
||||||
{
|
|
||||||
bool retVal = false;
|
|
||||||
|
|
||||||
if( IsHighlighted() )
|
|
||||||
{
|
|
||||||
ClearFlags( HIGHLIGHTED );
|
|
||||||
retVal = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear the HIGHLIGHTED flag of pins
|
|
||||||
if( HasHighlightedPins() )
|
|
||||||
{
|
|
||||||
ClearHighlightedPins();
|
|
||||||
retVal = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear the HIGHLIGHTED flag of other items, currently only fields
|
|
||||||
for( SCH_FIELD& each_field : m_Fields )
|
|
||||||
{
|
|
||||||
if( each_field.IsHighlighted() )
|
|
||||||
{
|
|
||||||
each_field.ClearFlags( HIGHLIGHTED );
|
|
||||||
retVal = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
|
@ -674,12 +674,6 @@ public:
|
||||||
|
|
||||||
void BrightenPin( LIB_PIN* aPin );
|
void BrightenPin( LIB_PIN* aPin );
|
||||||
|
|
||||||
void ClearHighlightedPins();
|
|
||||||
|
|
||||||
bool HasHighlightedPins();
|
|
||||||
|
|
||||||
void HighlightPin( LIB_PIN* aPin );
|
|
||||||
|
|
||||||
bool GetIncludeInBom() const { return m_inBom; }
|
bool GetIncludeInBom() const { return m_inBom; }
|
||||||
void SetIncludeInBom( bool aIncludeInBom ) { m_inBom = aIncludeInBom; }
|
void SetIncludeInBom( bool aIncludeInBom ) { m_inBom = aIncludeInBom; }
|
||||||
|
|
||||||
|
|
|
@ -82,17 +82,17 @@ SCH_ITEM* SCH_ITEM::Duplicate( bool doClone ) const
|
||||||
if( !doClone )
|
if( !doClone )
|
||||||
const_cast<KIID&>( newItem->m_Uuid ) = KIID();
|
const_cast<KIID&>( newItem->m_Uuid ) = KIID();
|
||||||
|
|
||||||
newItem->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
|
newItem->ClearFlags( SELECTED | BRIGHTENED );
|
||||||
|
|
||||||
if( newItem->Type() == SCH_COMPONENT_T )
|
if( newItem->Type() == SCH_COMPONENT_T )
|
||||||
{
|
{
|
||||||
SCH_COMPONENT* component = (SCH_COMPONENT*) newItem;
|
SCH_COMPONENT* component = (SCH_COMPONENT*) newItem;
|
||||||
|
|
||||||
for( SCH_PIN* pin : component->GetSchPins() )
|
for( SCH_PIN* pin : component->GetSchPins() )
|
||||||
pin->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
|
pin->ClearFlags( SELECTED | BRIGHTENED );
|
||||||
|
|
||||||
for( SCH_FIELD& field : component->GetFields() )
|
for( SCH_FIELD& field : component->GetFields() )
|
||||||
field.ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
|
field.ClearFlags( SELECTED | BRIGHTENED );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( newItem->Type() == SCH_SHEET_T )
|
if( newItem->Type() == SCH_SHEET_T )
|
||||||
|
@ -100,10 +100,10 @@ SCH_ITEM* SCH_ITEM::Duplicate( bool doClone ) const
|
||||||
SCH_SHEET* sheet = (SCH_SHEET*) newItem;
|
SCH_SHEET* sheet = (SCH_SHEET*) newItem;
|
||||||
|
|
||||||
for( SCH_FIELD& field : sheet->GetFields() )
|
for( SCH_FIELD& field : sheet->GetFields() )
|
||||||
field.ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
|
field.ClearFlags( SELECTED | BRIGHTENED );
|
||||||
|
|
||||||
for( SCH_SHEET_PIN* pin : sheet->GetPins() )
|
for( SCH_SHEET_PIN* pin : sheet->GetPins() )
|
||||||
pin->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
|
pin->ClearFlags( SELECTED | BRIGHTENED );
|
||||||
}
|
}
|
||||||
|
|
||||||
return newItem;
|
return newItem;
|
||||||
|
|
|
@ -1783,7 +1783,7 @@ void SCH_PAINTER::draw( SCH_BITMAP *aBitmap, int aLayer )
|
||||||
|
|
||||||
if( aLayer == LAYER_SELECTION_SHADOWS )
|
if( aLayer == LAYER_SELECTION_SHADOWS )
|
||||||
{
|
{
|
||||||
if( aBitmap->IsSelected() || aBitmap->IsBrightened() || aBitmap->IsHighlighted() )
|
if( aBitmap->IsSelected() || aBitmap->IsBrightened() )
|
||||||
{
|
{
|
||||||
COLOR4D color = getRenderColor( aBitmap, LAYER_DRAW_BITMAPS, true );
|
COLOR4D color = getRenderColor( aBitmap, LAYER_DRAW_BITMAPS, true );
|
||||||
m_gal->SetIsStroke( true );
|
m_gal->SetIsStroke( true );
|
||||||
|
|
|
@ -225,42 +225,4 @@ void SCH_VIEW::HideWorksheet()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_VIEW::HighlightItem( EDA_ITEM *aItem, LIB_PIN* aPin )
|
|
||||||
{
|
|
||||||
if( aItem && aItem->Type() == SCH_COMPONENT_T && aPin )
|
|
||||||
{
|
|
||||||
static_cast<SCH_COMPONENT*>( aItem )->HighlightPin( aPin );
|
|
||||||
Update( aItem, REPAINT );
|
|
||||||
}
|
|
||||||
else if( aItem )
|
|
||||||
{
|
|
||||||
aItem->SetFlags( HIGHLIGHTED );
|
|
||||||
Update( aItem, REPAINT );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for( auto item : *m_allItems )
|
|
||||||
{
|
|
||||||
// Not all view items can be highlighted, only EDA_ITEMs
|
|
||||||
// So clear flag of only EDA_ITEMs.
|
|
||||||
EDA_ITEM* eitem = dynamic_cast<EDA_ITEM*>( item );
|
|
||||||
|
|
||||||
if( eitem )
|
|
||||||
{
|
|
||||||
if( eitem->IsHighlighted() )
|
|
||||||
{
|
|
||||||
eitem->ClearFlags( HIGHLIGHTED );
|
|
||||||
Update( eitem, REPAINT );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( eitem->Type() == SCH_COMPONENT_T )
|
|
||||||
{
|
|
||||||
// Items inside a component (pins, fields can be highlighted.
|
|
||||||
static_cast<SCH_COMPONENT*>( eitem )->ClearAllHighlightFlags();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}; // namespace KIGFX
|
}; // namespace KIGFX
|
||||||
|
|
|
@ -100,8 +100,6 @@ public:
|
||||||
|
|
||||||
WS_PROXY_VIEW_ITEM* GetWorksheet() const { return m_worksheet.get(); }
|
WS_PROXY_VIEW_ITEM* GetWorksheet() const { return m_worksheet.get(); }
|
||||||
|
|
||||||
void HighlightItem( EDA_ITEM *aItem, LIB_PIN* aPin = nullptr );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SCH_BASE_FRAME* m_frame; // The frame using this view. Can be null. Used mainly
|
SCH_BASE_FRAME* m_frame; // The frame using this view. Can be null. Used mainly
|
||||||
// to know the sheet path name when drawing the page layout
|
// to know the sheet path name when drawing the page layout
|
||||||
|
|
|
@ -130,13 +130,12 @@ typedef const INSPECTOR_FUNC& INSPECTOR; /// std::function passed to nested u
|
||||||
#define IS_PASTED (1 << 17) ///< Modifier on IS_NEW which indicates it came from clipboard
|
#define IS_PASTED (1 << 17) ///< Modifier on IS_NEW which indicates it came from clipboard
|
||||||
#define TRACK_LOCKED (1 << 18) ///< Pcbnew: track locked: protected from global deletion
|
#define TRACK_LOCKED (1 << 18) ///< Pcbnew: track locked: protected from global deletion
|
||||||
#define TRACK_AR (1 << 19) ///< Pcbnew: autorouted track
|
#define TRACK_AR (1 << 19) ///< Pcbnew: autorouted track
|
||||||
#define FLAG1 (1 << 20) ///< Pcbnew: flag used in local computations
|
#define OBSOLETE_1 (1 << 20) ///< Not presently used
|
||||||
#define FLAG0 (1 << 21) ///< Pcbnew: flag used in local computations
|
#define OBSOLETE_2 (1 << 21) ///< Not presently used
|
||||||
#define BEGIN_ONPAD (1 << 22) ///< Pcbnew: flag set for track segment starting on a pad
|
#define BEGIN_ONPAD (1 << 22) ///< Pcbnew: flag set for track segment starting on a pad
|
||||||
#define END_ONPAD (1 << 23) ///< Pcbnew: flag set for track segment ending on a pad
|
#define END_ONPAD (1 << 23) ///< Pcbnew: flag set for track segment ending on a pad
|
||||||
#define BUSY (1 << 24) ///< Pcbnew: flag indicating that the structure has
|
#define OBSOLETE_3 (1 << 24) ///< Not presently used
|
||||||
///< already been edited, in some functions
|
#define OBSOLETE_4 (1 << 25) ///< Not presently used
|
||||||
#define HIGHLIGHTED (1 << 25) ///< item is drawn in normal colors, when the rest is darkened
|
|
||||||
#define BRIGHTENED (1 << 26) ///< item is drawn with a bright contour
|
#define BRIGHTENED (1 << 26) ///< item is drawn with a bright contour
|
||||||
|
|
||||||
#define DP_COUPLED (1 << 27) ///< item is coupled with another item making a differential pair
|
#define DP_COUPLED (1 << 27) ///< item is coupled with another item making a differential pair
|
||||||
|
@ -148,9 +147,6 @@ typedef const INSPECTOR_FUNC& INSPECTOR; /// std::function passed to nested u
|
||||||
// WARNING: if you add flags, you'll probably need to adjust the masks in GetEditFlags() and
|
// WARNING: if you add flags, you'll probably need to adjust the masks in GetEditFlags() and
|
||||||
// ClearTempFlags().
|
// ClearTempFlags().
|
||||||
|
|
||||||
// NOTE: The HIGHLIGHTED flag is basically deprecated, it was used for cross-probing before eeschema
|
|
||||||
// supported real object selection.
|
|
||||||
|
|
||||||
#define EDA_ITEM_ALL_FLAGS -1
|
#define EDA_ITEM_ALL_FLAGS -1
|
||||||
|
|
||||||
typedef unsigned STATUS_FLAGS;
|
typedef unsigned STATUS_FLAGS;
|
||||||
|
@ -206,16 +202,13 @@ public:
|
||||||
inline bool IsWireImage() const { return m_Flags & IS_WIRE_IMAGE; }
|
inline bool IsWireImage() const { return m_Flags & IS_WIRE_IMAGE; }
|
||||||
inline bool IsSelected() const { return m_Flags & SELECTED; }
|
inline bool IsSelected() const { return m_Flags & SELECTED; }
|
||||||
inline bool IsResized() const { return m_Flags & IS_RESIZED; }
|
inline bool IsResized() const { return m_Flags & IS_RESIZED; }
|
||||||
inline bool IsHighlighted() const { return m_Flags & HIGHLIGHTED; }
|
|
||||||
inline bool IsBrightened() const { return m_Flags & BRIGHTENED; }
|
inline bool IsBrightened() const { return m_Flags & BRIGHTENED; }
|
||||||
|
|
||||||
inline void SetWireImage() { SetFlags( IS_WIRE_IMAGE ); }
|
inline void SetWireImage() { SetFlags( IS_WIRE_IMAGE ); }
|
||||||
inline void SetSelected() { SetFlags( SELECTED ); }
|
inline void SetSelected() { SetFlags( SELECTED ); }
|
||||||
inline void SetHighlighted() { SetFlags( HIGHLIGHTED ); }
|
|
||||||
inline void SetBrightened() { SetFlags( BRIGHTENED ); }
|
inline void SetBrightened() { SetFlags( BRIGHTENED ); }
|
||||||
|
|
||||||
inline void ClearSelected() { ClearFlags( SELECTED ); }
|
inline void ClearSelected() { ClearFlags( SELECTED ); }
|
||||||
inline void ClearHighlighted() { ClearFlags( HIGHLIGHTED ); }
|
|
||||||
inline void ClearBrightened() { ClearFlags( BRIGHTENED ); }
|
inline void ClearBrightened() { ClearFlags( BRIGHTENED ); }
|
||||||
|
|
||||||
void SetModified();
|
void SetModified();
|
||||||
|
@ -252,7 +245,7 @@ public:
|
||||||
void ClearTempFlags()
|
void ClearTempFlags()
|
||||||
{
|
{
|
||||||
ClearFlags( STARTPOINT | ENDPOINT | CANDIDATE | TEMP_SELECTED | IS_LINKED | SKIP_STRUCT |
|
ClearFlags( STARTPOINT | ENDPOINT | CANDIDATE | TEMP_SELECTED | IS_LINKED | SKIP_STRUCT |
|
||||||
DO_NOT_DRAW | FLAG0 | FLAG1 | BUSY );
|
DO_NOT_DRAW );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearEditFlags()
|
void ClearEditFlags()
|
||||||
|
|
|
@ -123,14 +123,12 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function SetHighlight
|
* Function SetHighlight
|
||||||
* Turns on/off highlighting - it may be done for the active layer, the specified net, or
|
* Turns on/off highlighting - it may be done for the active layer or the specified net(s).
|
||||||
* items with their HIGHLIGHTED flags set.
|
|
||||||
* @param aEnabled tells if highlighting should be enabled.
|
* @param aEnabled tells if highlighting should be enabled.
|
||||||
* @param aNetcode is optional and if specified, turns on higlighting only for the net with
|
* @param aNetcode is optional and if specified, turns on higlighting only for the net with
|
||||||
* number given as the parameter.
|
* number given as the parameter.
|
||||||
*/
|
*/
|
||||||
inline void SetHighlight( bool aEnabled, int aNetcode = -1, bool aHighlightItems = false,
|
inline void SetHighlight( bool aEnabled, int aNetcode = -1, bool aMulti = false )
|
||||||
bool aMulti = false )
|
|
||||||
{
|
{
|
||||||
m_highlightEnabled = aEnabled;
|
m_highlightEnabled = aEnabled;
|
||||||
|
|
||||||
|
@ -143,8 +141,6 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_highlightNetcodes.clear();
|
m_highlightNetcodes.clear();
|
||||||
|
|
||||||
m_highlightItems = aEnabled ? aHighlightItems : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -257,24 +253,21 @@ protected:
|
||||||
COLOR4D m_backgroundColor; // The background color
|
COLOR4D m_backgroundColor; // The background color
|
||||||
|
|
||||||
/// Parameters for display modes
|
/// Parameters for display modes
|
||||||
bool m_hiContrastEnabled; // High contrast display mode on/off
|
bool m_hiContrastEnabled; // High contrast display mode on/off
|
||||||
float m_hiContrastFactor; // Factor used for computing high contrast color
|
float m_hiContrastFactor; // Factor used for computing high contrast color
|
||||||
|
|
||||||
bool m_highlightEnabled; // Highlight display mode on/off
|
bool m_highlightEnabled; // Highlight display mode on/off
|
||||||
|
std::set<int> m_highlightNetcodes; // Set of net cods to be highlighted
|
||||||
|
float m_highlightFactor; // Factor used for computing highlight color
|
||||||
|
|
||||||
std::set<int> m_highlightNetcodes; // Set of net cods to be highlighted
|
float m_selectFactor; // Specifies how color of selected items is changed
|
||||||
|
float m_outlineWidth; // Line width used when drawing outlines
|
||||||
|
float m_worksheetLineWidth; // Line width used when drawing worksheet
|
||||||
|
|
||||||
bool m_highlightItems; // Highlight items with their HIGHLIGHT flags set
|
int m_defaultPenWidth;
|
||||||
float m_highlightFactor; // Factor used for computing highlight color
|
bool m_showPageLimits;
|
||||||
|
|
||||||
float m_selectFactor; // Specifies how color of selected items is changed
|
wxDC* m_printDC; // This can go away once we have Cairo-based printing.
|
||||||
float m_outlineWidth; // Line width used when drawing outlines
|
|
||||||
float m_worksheetLineWidth; // Line width used when drawing worksheet
|
|
||||||
|
|
||||||
int m_defaultPenWidth;
|
|
||||||
bool m_showPageLimits;
|
|
||||||
|
|
||||||
wxDC* m_printDC; // This can go away once we have Cairo-based printing.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1226,8 +1226,8 @@ int BOARD::SortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ZONE_CONTAINER* BOARD::HitTestForAnyFilledArea( const wxPoint& aRefPos,
|
ZONE_CONTAINER* BOARD::HitTestForAnyFilledArea( const wxPoint& aRefPos, PCB_LAYER_ID aStartLayer,
|
||||||
PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer, int aNetCode )
|
PCB_LAYER_ID aEndLayer, int aNetCode )
|
||||||
{
|
{
|
||||||
if( aEndLayer < 0 )
|
if( aEndLayer < 0 )
|
||||||
aEndLayer = aStartLayer;
|
aEndLayer = aStartLayer;
|
||||||
|
@ -1240,10 +1240,6 @@ ZONE_CONTAINER* BOARD::HitTestForAnyFilledArea( const wxPoint& aRefPos,
|
||||||
if( area->GetLayer() < aStartLayer || area->GetLayer() > aEndLayer )
|
if( area->GetLayer() < aStartLayer || area->GetLayer() > aEndLayer )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// In locate functions we must skip tagged items with BUSY flag set.
|
|
||||||
if( area->GetState( BUSY ) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if( aNetCode >= 0 && area->GetNetCode() != aNetCode )
|
if( aNetCode >= 0 && area->GetNetCode() != aNetCode )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -859,7 +859,6 @@ public:
|
||||||
* Function HitTestForAnyFilledArea
|
* Function HitTestForAnyFilledArea
|
||||||
* tests if the given wxPoint is within the bounds of a filled area of this zone.
|
* tests if the given wxPoint is within the bounds of a filled area of this zone.
|
||||||
* the test is made on zones on layer from aStartLayer to aEndLayer
|
* the test is made on zones on layer from aStartLayer to aEndLayer
|
||||||
* Note: if a zone has its flag BUSY (in .m_State) is set, it is ignored.
|
|
||||||
* @param aRefPos A wxPoint to test
|
* @param aRefPos A wxPoint to test
|
||||||
* @param aStartLayer the first layer to test
|
* @param aStartLayer the first layer to test
|
||||||
* @param aEndLayer the last layer to test
|
* @param aEndLayer the last layer to test
|
||||||
|
|
|
@ -972,21 +972,12 @@ wxString TRACK::ShowState( int stateBits )
|
||||||
if( stateBits & IS_DELETED )
|
if( stateBits & IS_DELETED )
|
||||||
ret << wxT( " | IS_DELETED" );
|
ret << wxT( " | IS_DELETED" );
|
||||||
|
|
||||||
if( stateBits & BUSY )
|
|
||||||
ret << wxT( " | BUSY" );
|
|
||||||
|
|
||||||
if( stateBits & END_ONPAD )
|
if( stateBits & END_ONPAD )
|
||||||
ret << wxT( " | END_ONPAD" );
|
ret << wxT( " | END_ONPAD" );
|
||||||
|
|
||||||
if( stateBits & BEGIN_ONPAD )
|
if( stateBits & BEGIN_ONPAD )
|
||||||
ret << wxT( " | BEGIN_ONPAD" );
|
ret << wxT( " | BEGIN_ONPAD" );
|
||||||
|
|
||||||
if( stateBits & FLAG0 )
|
|
||||||
ret << wxT( " | FLAG0" );
|
|
||||||
|
|
||||||
if( stateBits & FLAG1 )
|
|
||||||
ret << wxT( " | FLAG1" );
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Function ShowState
|
* Function ShowState
|
||||||
* converts a set of state bits to a wxString
|
* converts a set of state bits to a wxString
|
||||||
* @param stateBits Is an OR-ed together set of bits like BUSY, EDIT, etc.
|
* @param stateBits Is an OR-ed together set of bits like IN_EDIT, etc.
|
||||||
*/
|
*/
|
||||||
static wxString ShowState( int stateBits );
|
static wxString ShowState( int stateBits );
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pcb->SetHighLightNet( netinfo->GetNet(), true );
|
pcb->SetHighLightNet( netinfo->GetNet(), true );
|
||||||
renderSettings->SetHighlight( true, netinfo->GetNet(), false, true );
|
renderSettings->SetHighlight( true, netinfo->GetNet(), true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aP
|
||||||
if( aPad )
|
if( aPad )
|
||||||
{
|
{
|
||||||
*m_dummyPad = *aPad;
|
*m_dummyPad = *aPad;
|
||||||
m_dummyPad->ClearFlags( SELECTED|HIGHLIGHTED|BRIGHTENED );
|
m_dummyPad->ClearFlags( SELECTED|BRIGHTENED );
|
||||||
}
|
}
|
||||||
else // We are editing a "master" pad, i.e. a template to create new pads
|
else // We are editing a "master" pad, i.e. a template to create new pads
|
||||||
*m_dummyPad = *m_padMaster;
|
*m_dummyPad = *m_padMaster;
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <class_marker_pcb.h>
|
#include <class_marker_pcb.h>
|
||||||
#include <class_dimension.h>
|
#include <class_dimension.h>
|
||||||
#include <class_pcb_target.h>
|
#include <class_pcb_target.h>
|
||||||
#include <class_marker_pcb.h>
|
|
||||||
|
|
||||||
#include <layers_id_colors_and_visibility.h>
|
#include <layers_id_colors_and_visibility.h>
|
||||||
#include <pcb_painter.h>
|
#include <pcb_painter.h>
|
||||||
|
@ -46,7 +45,6 @@
|
||||||
#include <geometry/shape_line_chain.h>
|
#include <geometry/shape_line_chain.h>
|
||||||
#include <geometry/shape_segment.h>
|
#include <geometry/shape_segment.h>
|
||||||
#include <geometry/shape_circle.h>
|
#include <geometry/shape_circle.h>
|
||||||
#include <geometry/shape_simple.h>
|
|
||||||
|
|
||||||
using namespace KIGFX;
|
using namespace KIGFX;
|
||||||
|
|
||||||
|
@ -240,14 +238,6 @@ const COLOR4D& PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer
|
||||||
return m_layerColorsSel[aLayer];
|
return m_layerColorsSel[aLayer];
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_highlightEnabled && m_highlightItems )
|
|
||||||
{
|
|
||||||
if( item->IsHighlighted() )
|
|
||||||
return m_layerColorsHi[aLayer];
|
|
||||||
else
|
|
||||||
return m_layerColorsDark[aLayer];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to obtain the netcode for the item
|
// Try to obtain the netcode for the item
|
||||||
if( const BOARD_CONNECTED_ITEM* conItem = dyn_cast<const BOARD_CONNECTED_ITEM*> ( item ) )
|
if( const BOARD_CONNECTED_ITEM* conItem = dyn_cast<const BOARD_CONNECTED_ITEM*> ( item ) )
|
||||||
netCode = conItem->GetNetCode();
|
netCode = conItem->GetNetCode();
|
||||||
|
@ -762,15 +752,9 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
||||||
// Hole color is the background color for plated holes, but only if the pad size is greater than the hole size.
|
// Hole color is the background color for plated holes, but only if the pad size is greater than the hole size.
|
||||||
// ( Don't let pads that *should* be NPTH get lost )
|
// ( Don't let pads that *should* be NPTH get lost )
|
||||||
if( ( aLayer == LAYER_PADS_PLATEDHOLES ) && !aPad->PadShouldBeNPTH() )
|
if( ( aLayer == LAYER_PADS_PLATEDHOLES ) && !aPad->PadShouldBeNPTH() )
|
||||||
{
|
color = m_pcbSettings.GetBackgroundColor();
|
||||||
color = m_pcbSettings.GetBackgroundColor();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
color = m_pcbSettings.GetColor( aPad, aLayer );
|
color = m_pcbSettings.GetColor( aPad, aLayer );
|
||||||
}
|
|
||||||
|
|
||||||
VECTOR2D size;
|
|
||||||
|
|
||||||
if( m_pcbSettings.m_sketchMode[LAYER_PADS_TH] )
|
if( m_pcbSettings.m_sketchMode[LAYER_PADS_TH] )
|
||||||
{
|
{
|
||||||
|
|
|
@ -733,9 +733,9 @@ static void moveNoFlagToVector( std::deque<T>& aList, std::vector<BOARD_ITEM*>&
|
||||||
std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ),
|
std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ),
|
||||||
[aIsNew]( T aItem )
|
[aIsNew]( T aItem )
|
||||||
{
|
{
|
||||||
bool doCopy = ( aItem->GetFlags() & FLAG0 ) == 0;
|
bool doCopy = ( aItem->GetFlags() & SKIP_STRUCT ) == 0;
|
||||||
|
|
||||||
aItem->ClearFlags( FLAG0 );
|
aItem->ClearFlags( SKIP_STRUCT );
|
||||||
aItem->SetFlags( aIsNew ? IS_NEW : 0 );
|
aItem->SetFlags( aIsNew ? IS_NEW : 0 );
|
||||||
|
|
||||||
return doCopy;
|
return doCopy;
|
||||||
|
@ -746,7 +746,8 @@ static void moveNoFlagToVector( std::deque<T>& aList, std::vector<BOARD_ITEM*>&
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void moveNoFlagToVector( ZONE_CONTAINERS& aList, std::vector<BOARD_ITEM*>& aTarget, bool aIsNew )
|
static void moveNoFlagToVector( ZONE_CONTAINERS& aList, std::vector<BOARD_ITEM*>& aTarget,
|
||||||
|
bool aIsNew )
|
||||||
{
|
{
|
||||||
if( aList.size() == 0 )
|
if( aList.size() == 0 )
|
||||||
return;
|
return;
|
||||||
|
@ -762,8 +763,8 @@ static void moveNoFlagToVector( ZONE_CONTAINERS& aList, std::vector<BOARD_ITEM*
|
||||||
|
|
||||||
for( ; obj ; )
|
for( ; obj ; )
|
||||||
{
|
{
|
||||||
if( obj->HasFlag( FLAG0 ) )
|
if( obj->HasFlag( SKIP_STRUCT ) )
|
||||||
obj->ClearFlags( FLAG0 );
|
obj->ClearFlags( SKIP_STRUCT );
|
||||||
else
|
else
|
||||||
aTarget.push_back( obj );
|
aTarget.push_back( obj );
|
||||||
|
|
||||||
|
@ -858,16 +859,16 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
|
||||||
// Mark existing items, in order to know what are the new items so we can select only
|
// Mark existing items, in order to know what are the new items so we can select only
|
||||||
// the new items after loading
|
// the new items after loading
|
||||||
for( auto track : brd->Tracks() )
|
for( auto track : brd->Tracks() )
|
||||||
track->SetFlags( FLAG0 );
|
track->SetFlags( SKIP_STRUCT );
|
||||||
|
|
||||||
for( auto module : brd->Modules() )
|
for( auto module : brd->Modules() )
|
||||||
module->SetFlags( FLAG0 );
|
module->SetFlags( SKIP_STRUCT );
|
||||||
|
|
||||||
for( auto drawing : brd->Drawings() )
|
for( auto drawing : brd->Drawings() )
|
||||||
drawing->SetFlags( FLAG0 );
|
drawing->SetFlags( SKIP_STRUCT );
|
||||||
|
|
||||||
for( auto zone : brd->Zones() )
|
for( auto zone : brd->Zones() )
|
||||||
zone->SetFlags( FLAG0 );
|
zone->SetFlags( SKIP_STRUCT );
|
||||||
|
|
||||||
// Keep also the count of copper layers, to adjust if necessary
|
// Keep also the count of copper layers, to adjust if necessary
|
||||||
int initialCopperLayerCount = brd->GetCopperLayerCount();
|
int initialCopperLayerCount = brd->GetCopperLayerCount();
|
||||||
|
|
|
@ -819,16 +819,15 @@ int SELECTION_TOOL::expandConnection( const TOOL_EVENT& aEvent )
|
||||||
// copy the selection, since we're going to iterate and modify
|
// copy the selection, since we're going to iterate and modify
|
||||||
std::deque<EDA_ITEM*> selectedItems = m_selection.GetItems();
|
std::deque<EDA_ITEM*> selectedItems = m_selection.GetItems();
|
||||||
|
|
||||||
// We use the BUSY flag to mark connections
|
|
||||||
for( EDA_ITEM* item : selectedItems )
|
for( EDA_ITEM* item : selectedItems )
|
||||||
item->SetState( BUSY, false );
|
item->ClearTempFlags();
|
||||||
|
|
||||||
for( EDA_ITEM* item : selectedItems )
|
for( EDA_ITEM* item : selectedItems )
|
||||||
{
|
{
|
||||||
TRACK* trackItem = dynamic_cast<TRACK*>( item );
|
TRACK* trackItem = dynamic_cast<TRACK*>( item );
|
||||||
|
|
||||||
// Track items marked BUSY have already been visited
|
// Track items marked SKIP_STRUCT have already been visited
|
||||||
if( trackItem && !trackItem->GetState( BUSY ) )
|
if( trackItem && !( trackItem->GetFlags() & SKIP_STRUCT ) )
|
||||||
selectConnectedTracks( *trackItem, stopCondition );
|
selectConnectedTracks( *trackItem, stopCondition );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -884,7 +883,7 @@ void SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
item->SetState( SKIP_STRUCT, false );
|
item->SetFlags( SKIP_STRUCT );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<wxPoint> activePts;
|
std::vector<wxPoint> activePts;
|
||||||
|
|
|
@ -104,9 +104,7 @@ void TRACKS_CLEANER::removeBadTrackSegments()
|
||||||
|
|
||||||
for( TRACK* segment : m_brd->Tracks() )
|
for( TRACK* segment : m_brd->Tracks() )
|
||||||
{
|
{
|
||||||
segment->SetState( FLAG0, false );
|
for( D_PAD* testedPad : connectivity->GetConnectedPads( segment ) )
|
||||||
|
|
||||||
for( auto testedPad : connectivity->GetConnectedPads( segment ) )
|
|
||||||
{
|
{
|
||||||
if( segment->GetNetCode() != testedPad->GetNetCode() )
|
if( segment->GetNetCode() != testedPad->GetNetCode() )
|
||||||
{
|
{
|
||||||
|
@ -120,7 +118,7 @@ void TRACKS_CLEANER::removeBadTrackSegments()
|
||||||
|
|
||||||
for( TRACK* testedTrack : connectivity->GetConnectedTracks( segment ) )
|
for( TRACK* testedTrack : connectivity->GetConnectedTracks( segment ) )
|
||||||
{
|
{
|
||||||
if( segment->GetNetCode() != testedTrack->GetNetCode() && !testedTrack->GetState( FLAG0 ) )
|
if( segment->GetNetCode() != testedTrack->GetNetCode() )
|
||||||
{
|
{
|
||||||
CLEANUP_ITEM* item = new CLEANUP_ITEM( CLEANUP_SHORT );
|
CLEANUP_ITEM* item = new CLEANUP_ITEM( CLEANUP_SHORT );
|
||||||
item->SetItems( segment );
|
item->SetItems( segment );
|
||||||
|
|
Loading…
Reference in New Issue