pcbnew: Minor changes in CONNECTIVITY_DATA interface:
- renamed connectivity.[h|cpp] to connectivity_data [.h|.cpp] so that the file name matches the main class name. - GetNetItems() now returns a vector instead of a list
This commit is contained in:
parent
41a9007b6d
commit
00ad8f24a0
|
@ -390,7 +390,7 @@ set( PCB_COMMON_SRCS
|
|||
../pcbnew/class_zone.cpp
|
||||
../pcbnew/class_zone_settings.cpp
|
||||
../pcbnew/classpcb.cpp
|
||||
../pcbnew/connectivity.cpp
|
||||
../pcbnew/connectivity_data.cpp
|
||||
../pcbnew/connectivity_algo.cpp
|
||||
../pcbnew/convert_drawsegment_list_to_polygon.cpp
|
||||
../pcbnew/ratsnest_data.cpp
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include <pcbnew.h>
|
||||
#include <protos.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#define BLOCK_OUTLINE_COLOR YELLOW
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <view/view.h>
|
||||
#include <board_commit.h>
|
||||
#include <tools/pcb_tool.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#include <functional>
|
||||
using namespace std::placeholders;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <class_zone.h>
|
||||
|
||||
#include <pcb_netlist.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <reporter.h>
|
||||
|
||||
#include <board_netlist_updater.h>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#include <class_pcb_text.h>
|
||||
#include <class_pcb_target.h>
|
||||
#include <class_dimension.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
|
||||
/* This is an odd place for this, but CvPcb won't link if it is
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <class_board.h>
|
||||
#include <class_board_item.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
|
||||
BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED_ITEM )
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <class_track.h>
|
||||
#include <dialog_cleaning_options.h>
|
||||
#include <board_commit.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <connectivity_algo.h>
|
||||
|
||||
// Helper class used to clean tracks and vias
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <deque>
|
||||
#include <intrusive_list.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
class CN_ITEM;
|
||||
class CN_CONNECTIVITY_ALGO_IMPL;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <profile.h>
|
||||
#endif
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <connectivity_algo.h>
|
||||
#include <ratsnest_data.h>
|
||||
|
||||
|
@ -324,11 +324,11 @@ void CONNECTIVITY_DATA::Clear()
|
|||
}
|
||||
|
||||
|
||||
const std::list<BOARD_CONNECTED_ITEM*> CONNECTIVITY_DATA::GetConnectedItems(
|
||||
const std::vector<BOARD_CONNECTED_ITEM*> CONNECTIVITY_DATA::GetConnectedItems(
|
||||
const BOARD_CONNECTED_ITEM* aItem,
|
||||
const KICAD_T aTypes[] ) const
|
||||
{
|
||||
std::list<BOARD_CONNECTED_ITEM*> rv;
|
||||
std::vector<BOARD_CONNECTED_ITEM*> rv;
|
||||
const auto clusters = m_connAlgo->SearchClusters( CN_CONNECTIVITY_ALGO::CSM_CONNECTIVITY_CHECK,
|
||||
aTypes, aItem->GetNetCode() );
|
||||
|
||||
|
@ -348,11 +348,11 @@ const std::list<BOARD_CONNECTED_ITEM*> CONNECTIVITY_DATA::GetConnectedItems(
|
|||
}
|
||||
|
||||
|
||||
const std::list<BOARD_CONNECTED_ITEM*> CONNECTIVITY_DATA::GetNetItems( int aNetCode,
|
||||
const std::vector<BOARD_CONNECTED_ITEM*> CONNECTIVITY_DATA::GetNetItems( int aNetCode,
|
||||
const KICAD_T aTypes[] ) const
|
||||
{
|
||||
std::set<BOARD_CONNECTED_ITEM*> items;
|
||||
std::list<BOARD_CONNECTED_ITEM*> rv;
|
||||
std::vector<BOARD_CONNECTED_ITEM*> rv;
|
||||
|
||||
m_connAlgo->ForEachItem( [&items, aNetCode, &aTypes] ( CN_ITEM* aItem )
|
||||
{
|
||||
|
@ -373,7 +373,7 @@ const std::list<BOARD_CONNECTED_ITEM*> CONNECTIVITY_DATA::GetNetItems( int aNetC
|
|||
}
|
||||
} );
|
||||
|
||||
std::copy( items.begin(), items.end(), std::front_inserter( rv ) );
|
||||
std::copy( items.begin(), items.end(), std::back_inserter( rv ) );
|
||||
|
||||
return rv;
|
||||
}
|
|
@ -23,14 +23,13 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __CONNECTIVITY_H
|
||||
#define __CONNECTIVITY_H
|
||||
#ifndef __CONNECTIVITY_DATA_H
|
||||
#define __CONNECTIVITY_DATA_H
|
||||
|
||||
#include <core/typeinfo.h>
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
#include <math/vector2d.h>
|
||||
|
@ -192,7 +191,7 @@ public:
|
|||
* @param aItem is the reference item to find other connected items.
|
||||
* @param aTypes allows to filter by item types.
|
||||
*/
|
||||
const std::list<BOARD_CONNECTED_ITEM*> GetConnectedItems( const BOARD_CONNECTED_ITEM* aItem,
|
||||
const std::vector<BOARD_CONNECTED_ITEM*> GetConnectedItems( const BOARD_CONNECTED_ITEM* aItem,
|
||||
const KICAD_T aTypes[] ) const;
|
||||
|
||||
/**
|
||||
|
@ -201,7 +200,7 @@ public:
|
|||
* @param aNetCode is the net code.
|
||||
* @param aTypes allows to filter by item types.
|
||||
*/
|
||||
const std::list<BOARD_CONNECTED_ITEM*> GetNetItems( int aNetCode,
|
||||
const std::vector<BOARD_CONNECTED_ITEM*> GetNetItems( int aNetCode,
|
||||
const KICAD_T aTypes[] ) const;
|
||||
|
||||
const std::vector<VECTOR2I> NearestUnconnectedTargets( const BOARD_CONNECTED_ITEM* aRef,
|
|
@ -33,7 +33,7 @@
|
|||
#include <confirm.h>
|
||||
#include <wxPcbStruct.h>
|
||||
#include <macros.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#include <class_board.h>
|
||||
#include <class_track.h>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <class_board_design_settings.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
||||
#include <dialog_netlist.h>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <view/view.h>
|
||||
#include <view/view_controls.h>
|
||||
#include <pcb_painter.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#define COL_NETNAME 0
|
||||
#define COL_NETINFO 1
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
#include <class_module.h>
|
||||
#include <class_board.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
/* a list of DRAG_SEGM_PICKER items used to move or drag tracks */
|
||||
std::vector<DRAG_SEGM_PICKER> g_DragSegmentList;
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <view/view.h>
|
||||
#include <geometry/seg.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <connectivity_algo.h>
|
||||
|
||||
#include <tool/tool_manager.h>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
#include <dialog_global_edit_tracks_and_vias.h>
|
||||
#include <invoke_pcb_dialog.h>
|
||||
#include <array_creator.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#include <dialog_move_exact.h>
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include <class_board.h>
|
||||
#include <class_track.h>
|
||||
#include <class_zone.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
|
||||
static void Abort_Create_Track( EDA_DRAW_PANEL* panel, wxDC* DC );
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include <wx/wfstream.h>
|
||||
#include <boost/ptr_container/ptr_map.hpp>
|
||||
#include <memory.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
using namespace PCB_KEYS_T;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <drag.h>
|
||||
#include <dialog_get_footprint_by_name.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
static void MoveFootprint( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||
const wxPoint& aPosition, bool aErase );
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <worksheet_viewitem.h>
|
||||
#include <ratsnest_viewitem.h>
|
||||
#include <ratsnest_data.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#include <class_colors_design_settings.h>
|
||||
#include <class_board.h>
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <worksheet_viewitem.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <ratsnest_viewitem.h>
|
||||
|
||||
#include <tool/tool_manager.h>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include <pcbnew.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <ratsnest_data.h>
|
||||
|
||||
#include <wxPcbStruct.h>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include <ratsnest_viewitem.h>
|
||||
#include <ratsnest_data.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <pcb_painter.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <class_track.h>
|
||||
#include <class_zone.h>
|
||||
#include <class_drawsegment.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <view/view.h>
|
||||
|
||||
#include <specctra.h>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <view/view_controls.h>
|
||||
#include <view/view.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <confirm.h>
|
||||
#include <bitmaps.h>
|
||||
#include <hotkeys.h>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <pcb_draw_panel_gal.h>
|
||||
#include <class_module.h>
|
||||
#include <class_pcb_target.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <collectors.h>
|
||||
#include <zones_functions_for_undo_redo.h>
|
||||
#include <board_commit.h>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <pcbnew_id.h>
|
||||
#include <wxPcbStruct.h>
|
||||
#include <pcb_draw_panel_gal.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <view/view_controls.h>
|
||||
|
|
|
@ -43,7 +43,7 @@ using namespace std::placeholders;
|
|||
#include <class_zone.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
// Point editor
|
||||
TOOL_ACTION PCB_ACTIONS::pointEditorAddCorner( "pcbnew.PointEditor.addCorner",
|
||||
|
|
|
@ -49,7 +49,7 @@ using namespace std::placeholders;
|
|||
|
||||
#include <tool/tool_event.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#include "selection_tool.h"
|
||||
#include "pcb_bright_box.h"
|
||||
|
|
|
@ -52,7 +52,7 @@ using namespace std::placeholders;
|
|||
|
||||
#include <tool/tool_event.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#include "selection_tool.h"
|
||||
#include "pcb_bright_box.h"
|
||||
|
@ -870,7 +870,7 @@ void SELECTION_TOOL::selectAllItemsConnectedToItem( BOARD_CONNECTED_ITEM& aSourc
|
|||
constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_VIA_T, EOT };
|
||||
auto connectivity = board()->GetConnectivity();
|
||||
|
||||
std::list<BOARD_CONNECTED_ITEM*> items;
|
||||
std::vector<BOARD_CONNECTED_ITEM*> items;
|
||||
items = connectivity->GetConnectedItems( &aSourceItem, types );
|
||||
|
||||
for( auto item : connectivity->GetConnectedItems( &aSourceItem, types ) )
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include <pcbnew.h>
|
||||
#include <protos.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
static void ListSetState( EDA_ITEM* Start, int NbItem, STATUS_FLAGS State,
|
||||
bool onoff );
|
||||
|
|
|
@ -45,7 +45,7 @@ using namespace std::placeholders;
|
|||
#include <class_zone.h>
|
||||
#include <class_edge_mod.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#include <tools/selection_tool.h>
|
||||
#include <tool/tool_manager.h>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <protos.h>
|
||||
#include <zones_functions_for_undo_redo.h>
|
||||
#include <drc_stuff.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
// Outline creation:
|
||||
static void Abort_Zone_Create_Outline( EDA_DRAW_PANEL* Panel, wxDC* DC );
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <pcbnew.h>
|
||||
#include <zones.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
#include <board_commit.h>
|
||||
|
||||
#define FORMAT_STRING _( "Filling zone %d out of %d (net %s)..." )
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <class_board.h>
|
||||
#include <class_zone.h>
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
void ZONE_CONTAINER::TestForCopperIslandAndRemoveInsulatedIslands( BOARD* aPcb )
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include <pcb_painter.h>
|
||||
#include <wxPcbStruct.h>
|
||||
|
||||
#include <connectivity.h>
|
||||
#include <connectivity_data.h>
|
||||
|
||||
#include <io_mgr.h>
|
||||
#include <set>
|
||||
|
|
Loading…
Reference in New Issue