Cleanup.
This commit is contained in:
parent
cd2dea7df2
commit
6acd35c981
|
@ -374,11 +374,6 @@ public:
|
|||
*/
|
||||
bool ReplaceInstanceSheetPath( const KIID_PATH& aOldSheetPath, const KIID_PATH& aNewSheetPath );
|
||||
|
||||
/**
|
||||
* Clear the HIGHLIGHTED flag of all items of the component (fields, pins ...)
|
||||
*/
|
||||
bool ClearAllHighlightFlags();
|
||||
|
||||
const EDA_RECT GetBoundingBox() const override;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1458,6 +1458,7 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
|||
m_frame->OnModify();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SCH_MARKER_T: // These items have no properties to edit
|
||||
case SCH_NO_CONNECT_T:
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/**
|
||||
* @file class_board.cpp
|
||||
* @brief BOARD class functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
|
@ -33,14 +28,9 @@
|
|||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <fctsys.h>
|
||||
#include <common.h>
|
||||
#include <kicad_string.h>
|
||||
#include <pcb_base_frame.h>
|
||||
#include <msgpanel.h>
|
||||
#include <reporter.h>
|
||||
#include <ws_proxy_view_item.h>
|
||||
#include <pcbnew.h>
|
||||
#include <collectors.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <class_track.h>
|
||||
|
|
|
@ -25,20 +25,13 @@
|
|||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <macros.h>
|
||||
#include <gr_basic.h>
|
||||
#include <trigo.h>
|
||||
#include <kicad_string.h>
|
||||
#include <richio.h>
|
||||
#include <bitmaps.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
|
||||
#include <base_units.h>
|
||||
#include <class_board.h>
|
||||
#include <class_dimension.h>
|
||||
#include <class_pcb_text.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
||||
|
|
|
@ -28,17 +28,12 @@
|
|||
#include <gr_basic.h>
|
||||
#include <bezier_curves.h>
|
||||
#include <pcb_screen.h>
|
||||
#include <trigo.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <pcbnew.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <class_drawsegment.h>
|
||||
#include <base_units.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
||||
|
|
|
@ -24,22 +24,9 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file class_edge_mod.cpp
|
||||
* @brief EDGE_MODULE class definition.
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <trigo.h>
|
||||
#include <pcb_screen.h>
|
||||
#include <kicad_string.h>
|
||||
#include <macros.h>
|
||||
#include <pcb_base_frame.h>
|
||||
#include <msgpanel.h>
|
||||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
|
@ -202,14 +189,12 @@ void EDGE_MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
|||
break;
|
||||
|
||||
case S_POLYGON:
|
||||
// polygon corners coordinates are always relative to the
|
||||
// footprint position, orientation 0
|
||||
// polygon corners coordinates are relative to the footprint position, orientation 0
|
||||
m_Poly.Mirror( aFlipLeftRight, !aFlipLeftRight );
|
||||
break;
|
||||
}
|
||||
|
||||
// DRAWSEGMENT items are not usually on copper layers, but
|
||||
// it can happen in microwave apps.
|
||||
// DRAWSEGMENT items are not usually on copper layers, but it can happen in microwave apps.
|
||||
// However, currently, only on Front or Back layers.
|
||||
// So the copper layers count is not taken in account
|
||||
SetLayer( FlipLayer( GetLayer() ) );
|
||||
|
@ -272,13 +257,11 @@ void EDGE_MODULE::Mirror( wxPoint aCentre, bool aMirrorAroundXAxis )
|
|||
|
||||
void EDGE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
|
||||
{
|
||||
// We should rotate the relative coordinates, but to avoid duplicate code,
|
||||
// do the base class rotation of draw coordinates, which is acceptable
|
||||
// because in module editor, m_Pos0 = m_Pos
|
||||
// We should rotate the relative coordinates, but to avoid duplicate code do the base class
|
||||
// rotation of draw coordinates, which is acceptable because in module editor, m_Pos0 = m_Pos
|
||||
DRAWSEGMENT::Rotate( aRotCentre, aAngle );
|
||||
|
||||
// and now update the relative coordinates, which are
|
||||
// the reference in most transforms.
|
||||
// and now update the relative coordinates, which are the reference in most transforms.
|
||||
SetLocalCoord();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,13 +25,10 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <gr_basic.h>
|
||||
#include <trigo.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
#include <base_units.h>
|
||||
#include <pcb_base_frame.h>
|
||||
#include <class_board.h>
|
||||
#include <class_board_item.h>
|
||||
#include <class_marker_pcb.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <settings/color_settings.h>
|
||||
|
|
|
@ -26,21 +26,13 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <gr_basic.h>
|
||||
#include <plotter.h>
|
||||
#include <trigo.h>
|
||||
#include <confirm.h>
|
||||
#include <kicad_string.h>
|
||||
#include <pcbnew.h>
|
||||
#include <refdes_utils.h>
|
||||
#include <macros.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
#include <unordered_set>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <class_board.h>
|
||||
#include <class_edge_mod.h>
|
||||
#include <class_module.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
#include <view/view.h>
|
||||
|
||||
MODULE::MODULE( BOARD* parent ) :
|
||||
|
@ -101,13 +93,11 @@ MODULE::MODULE( const MODULE& aModule ) :
|
|||
m_Value->SetParent( this );
|
||||
|
||||
// Copy auxiliary data: Pads
|
||||
for( auto pad : aModule.Pads() )
|
||||
{
|
||||
for( D_PAD* pad : aModule.Pads() )
|
||||
Add( new D_PAD( *pad ) );
|
||||
}
|
||||
|
||||
// Copy auxiliary data: Zones
|
||||
for( auto item : aModule.Zones() )
|
||||
for( MODULE_ZONE_CONTAINER* item : aModule.Zones() )
|
||||
{
|
||||
Add( static_cast<MODULE_ZONE_CONTAINER*>( item->Clone() ) );
|
||||
|
||||
|
@ -119,7 +109,7 @@ MODULE::MODULE( const MODULE& aModule ) :
|
|||
}
|
||||
|
||||
// Copy auxiliary data: Drawings
|
||||
for( auto item : aModule.GraphicalItems() )
|
||||
for( BOARD_ITEM* item : aModule.GraphicalItems() )
|
||||
{
|
||||
switch( item->Type() )
|
||||
{
|
||||
|
@ -157,17 +147,17 @@ MODULE::~MODULE()
|
|||
delete m_Value;
|
||||
delete m_initial_comments;
|
||||
|
||||
for( auto p : m_pads )
|
||||
for( D_PAD* p : m_pads )
|
||||
delete p;
|
||||
|
||||
m_pads.clear();
|
||||
|
||||
for( auto p : m_fp_zones )
|
||||
for( MODULE_ZONE_CONTAINER* p : m_fp_zones )
|
||||
delete p;
|
||||
|
||||
m_fp_zones.clear();
|
||||
|
||||
for( auto d : m_drawings )
|
||||
for( BOARD_ITEM* d : m_drawings )
|
||||
delete d;
|
||||
|
||||
m_drawings.clear();
|
||||
|
@ -207,15 +197,13 @@ MODULE& MODULE::operator=( const MODULE& aOther )
|
|||
// Copy auxiliary data: Pads
|
||||
m_pads.clear();
|
||||
|
||||
for( auto pad : aOther.Pads() )
|
||||
{
|
||||
for( D_PAD* pad : aOther.Pads() )
|
||||
Add( new D_PAD( *pad ) );
|
||||
}
|
||||
|
||||
// Copy auxiliary data: Zones
|
||||
m_fp_zones.clear();
|
||||
|
||||
for( auto item : aOther.Zones() )
|
||||
for( MODULE_ZONE_CONTAINER* item : aOther.Zones() )
|
||||
{
|
||||
Add( static_cast<MODULE_ZONE_CONTAINER*>( item->Clone() ) );
|
||||
|
||||
|
@ -229,7 +217,7 @@ MODULE& MODULE::operator=( const MODULE& aOther )
|
|||
// Copy auxiliary data: Drawings
|
||||
m_drawings.clear();
|
||||
|
||||
for( auto item : aOther.GraphicalItems() )
|
||||
for( BOARD_ITEM* item : aOther.GraphicalItems() )
|
||||
{
|
||||
switch( item->Type() )
|
||||
{
|
||||
|
@ -422,16 +410,16 @@ EDA_RECT MODULE::GetFootprintRect() const
|
|||
area.SetEnd( m_Pos );
|
||||
area.Inflate( Millimeter2iu( 0.25 ) ); // Give a min size to the area
|
||||
|
||||
for( auto item : m_drawings )
|
||||
for( BOARD_ITEM* item : m_drawings )
|
||||
{
|
||||
if( item->Type() == PCB_MODULE_EDGE_T )
|
||||
area.Merge( item->GetBoundingBox() );
|
||||
}
|
||||
|
||||
for( auto pad : m_pads )
|
||||
for( D_PAD* pad : m_pads )
|
||||
area.Merge( pad->GetBoundingBox() );
|
||||
|
||||
for( auto zone : m_fp_zones )
|
||||
for( MODULE_ZONE_CONTAINER* zone : m_fp_zones )
|
||||
area.Merge( zone->GetBoundingBox() );
|
||||
|
||||
return area;
|
||||
|
@ -465,7 +453,7 @@ const EDA_RECT MODULE::GetBoundingBox() const
|
|||
EDA_RECT area = GetFootprintRect();
|
||||
|
||||
// Add in items not collected by GetFootprintRect():
|
||||
for( auto item : m_drawings )
|
||||
for( BOARD_ITEM* item : m_drawings )
|
||||
{
|
||||
if( item->Type() != PCB_MODULE_EDGE_T )
|
||||
area.Merge( item->GetBoundingBox() );
|
||||
|
@ -483,7 +471,7 @@ const EDA_RECT MODULE::GetBoundingBox( bool aIncludeInvisibleText ) const
|
|||
EDA_RECT area = GetFootprintRect();
|
||||
|
||||
// Add in items not collected by GetFootprintRect():
|
||||
for( auto item : m_drawings )
|
||||
for( BOARD_ITEM* item : m_drawings )
|
||||
{
|
||||
if( item->Type() != PCB_MODULE_EDGE_T )
|
||||
area.Merge( item->GetBoundingBox() );
|
||||
|
@ -634,19 +622,19 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co
|
|||
return false;
|
||||
|
||||
// Determine if any elements in the MODULE intersect the rect
|
||||
for( auto pad : m_pads )
|
||||
for( D_PAD* pad : m_pads )
|
||||
{
|
||||
if( pad->HitTest( arect, false, 0 ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
for( auto zone : m_fp_zones )
|
||||
for( MODULE_ZONE_CONTAINER* zone : m_fp_zones )
|
||||
{
|
||||
if( zone->HitTest( arect, false, 0 ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
for( auto item : m_drawings )
|
||||
for( BOARD_ITEM* item : m_drawings )
|
||||
{
|
||||
if( item->HitTest( arect, false, 0 ) )
|
||||
return true;
|
||||
|
@ -660,7 +648,7 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co
|
|||
|
||||
D_PAD* MODULE::FindPadByName( const wxString& aPadName ) const
|
||||
{
|
||||
for( auto pad : m_pads )
|
||||
for( D_PAD* pad : m_pads )
|
||||
{
|
||||
if( pad->GetName() == aPadName )
|
||||
return pad;
|
||||
|
@ -672,7 +660,7 @@ D_PAD* MODULE::FindPadByName( const wxString& aPadName ) const
|
|||
|
||||
D_PAD* MODULE::GetPad( const wxPoint& aPosition, LSET aLayerMask )
|
||||
{
|
||||
for( auto pad : m_pads )
|
||||
for( D_PAD* pad : m_pads )
|
||||
{
|
||||
// ... and on the correct layer.
|
||||
if( !( pad->GetLayerSet() & aLayerMask ).any() )
|
||||
|
@ -690,7 +678,7 @@ D_PAD* MODULE::GetTopLeftPad()
|
|||
{
|
||||
D_PAD* topLeftPad = GetFirstPad();
|
||||
|
||||
for( auto p : m_pads )
|
||||
for( D_PAD* p : m_pads )
|
||||
{
|
||||
wxPoint pnt = p->GetPosition(); // GetPosition() returns the center of the pad
|
||||
|
||||
|
@ -712,7 +700,7 @@ unsigned MODULE::GetPadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
|||
|
||||
unsigned cnt = 0;
|
||||
|
||||
for( auto pad : m_pads )
|
||||
for( D_PAD* pad : m_pads )
|
||||
{
|
||||
if( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED )
|
||||
continue;
|
||||
|
@ -729,7 +717,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
|||
std::set<wxString> usedNames;
|
||||
|
||||
// Create a set of used pad numbers
|
||||
for( auto pad : m_pads )
|
||||
for( D_PAD* pad : m_pads )
|
||||
{
|
||||
// Skip pads not on copper layers (used to build complex
|
||||
// solder paste shapes for instance)
|
||||
|
@ -877,13 +865,13 @@ void MODULE::RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction )
|
|||
{
|
||||
try
|
||||
{
|
||||
for( auto pad : m_pads )
|
||||
for( D_PAD* pad : m_pads )
|
||||
aFunction( static_cast<BOARD_ITEM*>( pad ) );
|
||||
|
||||
for( auto zone : m_fp_zones )
|
||||
for( MODULE_ZONE_CONTAINER* zone : m_fp_zones )
|
||||
aFunction( static_cast<MODULE_ZONE_CONTAINER*>( zone ) );
|
||||
|
||||
for( auto drawing : m_drawings )
|
||||
for( BOARD_ITEM* drawing : m_drawings )
|
||||
aFunction( static_cast<BOARD_ITEM*>( drawing ) );
|
||||
|
||||
aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
|
||||
|
@ -900,14 +888,12 @@ void MODULE::GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads
|
|||
{
|
||||
std::unordered_set<int> layers;
|
||||
|
||||
for( auto item : m_drawings )
|
||||
{
|
||||
for( BOARD_ITEM* item : m_drawings )
|
||||
layers.insert( static_cast<int>( item->GetLayer() ) );
|
||||
}
|
||||
|
||||
if( aIncludePads )
|
||||
{
|
||||
for( auto pad : m_pads )
|
||||
for( D_PAD* pad : m_pads )
|
||||
{
|
||||
int pad_layers[KIGFX::VIEW::VIEW_MAX_LAYERS], pad_layers_count;
|
||||
pad->ViewGetLayers( pad_layers, pad_layers_count );
|
||||
|
@ -920,7 +906,7 @@ void MODULE::GetAllDrawingLayers( int aLayers[], int& aCount, bool aIncludePads
|
|||
aCount = layers.size();
|
||||
int i = 0;
|
||||
|
||||
for( auto layer : layers )
|
||||
for( int layer : layers )
|
||||
aLayers[i++] = layer;
|
||||
}
|
||||
|
||||
|
@ -932,7 +918,6 @@ void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
|
||||
switch( m_Layer )
|
||||
{
|
||||
|
||||
default:
|
||||
wxASSERT_MSG( false, "Illegal layer" ); // do you really have modules placed on other layers?
|
||||
KI_FALLTHROUGH;
|
||||
|
@ -1052,7 +1037,7 @@ void MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
|
|||
m_Reference->KeepUpright( orientation, newOrientation );
|
||||
m_Value->KeepUpright( orientation, newOrientation );
|
||||
|
||||
for( auto item : m_drawings )
|
||||
for( BOARD_ITEM* item : m_drawings )
|
||||
{
|
||||
if( item->Type() == PCB_MODULE_TEXT_T )
|
||||
static_cast<TEXTE_MODULE*>( item )->KeepUpright( orientation, newOrientation );
|
||||
|
|
|
@ -31,17 +31,11 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <gr_basic.h>
|
||||
#include <common.h>
|
||||
#include <kicad_string.h>
|
||||
#include <trigo.h>
|
||||
#include <macros.h>
|
||||
#include <richio.h>
|
||||
#include <bitmaps.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <class_board.h>
|
||||
#include <class_pcb_target.h>
|
||||
#include <base_units.h>
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
||||
|
|
|
@ -32,19 +32,15 @@
|
|||
#include <gr_basic.h>
|
||||
#include <base_struct.h>
|
||||
#include <gr_text.h>
|
||||
#include <kicad_string.h>
|
||||
#include <trigo.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <msgpanel.h>
|
||||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
||||
#include <class_board.h>
|
||||
#include <class_pcb_text.h>
|
||||
#include "pcb_painter.h"
|
||||
#include <pcb_painter.h>
|
||||
|
||||
using KIGFX::PCB_RENDER_SETTINGS;
|
||||
|
||||
|
|
|
@ -24,25 +24,16 @@
|
|||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <gr_basic.h>
|
||||
#include <trigo.h>
|
||||
#include <gr_text.h>
|
||||
#include <kicad_string.h>
|
||||
#include <common.h>
|
||||
#include <richio.h>
|
||||
#include <macros.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <msgpanel.h>
|
||||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <view/view.h>
|
||||
#include <pcbnew.h>
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <kiway.h>
|
||||
|
||||
TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type ) :
|
||||
BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
|
||||
|
|
|
@ -25,18 +25,12 @@
|
|||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
//#include <common.h>
|
||||
#include <pcb_screen.h>
|
||||
#include <pcb_base_frame.h>
|
||||
#include <class_board.h>
|
||||
#include <class_track.h>
|
||||
#include <pcbnew.h>
|
||||
#include <base_units.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
#include <view/view.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
||||
|
|
|
@ -26,22 +26,11 @@
|
|||
#include <bitmaps.h>
|
||||
#include <fctsys.h>
|
||||
#include <geometry/geometry_utils.h>
|
||||
#include <kicad_string.h>
|
||||
#include <macros.h>
|
||||
#include <msgpanel.h>
|
||||
#include <pcb_base_frame.h>
|
||||
#include <pcb_screen.h>
|
||||
#include <richio.h>
|
||||
#include <trigo.h>
|
||||
#include <convert_to_biu.h>
|
||||
#include <class_board.h>
|
||||
#include <class_zone.h>
|
||||
#include <pcbnew.h>
|
||||
#include <zones.h>
|
||||
#include <math_for_graphics.h>
|
||||
#include <geometry/polygon_test_point_inside.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue