2013-04-25 16:29:35 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
2016-01-10 21:24:13 +00:00
|
|
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2013-04-25 16:29:35 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
/**
|
|
|
|
* @file class_board.h
|
|
|
|
* @brief Class BOARD to handle a board.
|
|
|
|
*/
|
2007-12-09 12:59:06 +00:00
|
|
|
|
2012-06-01 07:39:32 +00:00
|
|
|
#ifndef CLASS_BOARD_H_
|
|
|
|
#define CLASS_BOARD_H_
|
2007-12-09 12:59:06 +00:00
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dlist.h>
|
|
|
|
|
2013-06-19 10:07:25 +00:00
|
|
|
#include <common.h> // PAGE_INFO
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <layers_id_colors_and_visibility.h>
|
|
|
|
#include <class_netinfo.h>
|
|
|
|
#include <class_pad.h>
|
|
|
|
#include <class_colors_design_settings.h>
|
|
|
|
#include <class_board_design_settings.h>
|
|
|
|
#include <class_title_block.h>
|
2012-02-06 05:44:19 +00:00
|
|
|
#include <class_zone_settings.h>
|
2012-04-05 18:27:56 +00:00
|
|
|
#include <pcb_plot_params.h>
|
2016-05-13 15:31:54 +00:00
|
|
|
#include <board_item_container.h>
|
2008-12-04 04:28:11 +00:00
|
|
|
|
2012-06-09 17:00:13 +00:00
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
class PCB_BASE_FRAME;
|
|
|
|
class PCB_EDIT_FRAME;
|
|
|
|
class PICKED_ITEMS_LIST;
|
2011-09-20 13:57:40 +00:00
|
|
|
class BOARD;
|
2007-12-09 12:59:06 +00:00
|
|
|
class ZONE_CONTAINER;
|
2011-09-20 13:57:40 +00:00
|
|
|
class SEGZONE;
|
|
|
|
class TRACK;
|
2011-09-23 13:57:12 +00:00
|
|
|
class D_PAD;
|
|
|
|
class MARKER_PCB;
|
2013-01-12 17:32:24 +00:00
|
|
|
class MSG_PANEL_ITEM;
|
2013-04-25 16:29:35 +00:00
|
|
|
class NETLIST;
|
|
|
|
class REPORTER;
|
2013-11-25 15:50:03 +00:00
|
|
|
class RN_DATA;
|
2015-07-27 19:45:57 +00:00
|
|
|
class SHAPE_POLY_SET;
|
2008-03-01 13:15:41 +00:00
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2008-03-01 13:15:41 +00:00
|
|
|
/**
|
|
|
|
* Enum LAYER_T
|
|
|
|
* gives the allowed types of layers, same as Specctra DSN spec.
|
|
|
|
*/
|
2011-12-10 05:33:24 +00:00
|
|
|
enum LAYER_T
|
|
|
|
{
|
2012-06-09 17:00:13 +00:00
|
|
|
LT_UNDEFINED = -1,
|
2008-03-01 13:15:41 +00:00
|
|
|
LT_SIGNAL,
|
|
|
|
LT_POWER,
|
|
|
|
LT_MIXED,
|
2009-07-18 11:44:19 +00:00
|
|
|
LT_JUMPER
|
2008-03-01 13:15:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
/**
|
2012-06-09 17:00:13 +00:00
|
|
|
* Class LAYER
|
2008-03-04 04:22:27 +00:00
|
|
|
* holds information pertinent to a layer of a BOARD.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
struct LAYER
|
2008-03-04 04:22:27 +00:00
|
|
|
{
|
2014-06-30 18:45:43 +00:00
|
|
|
LAYER()
|
|
|
|
{
|
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void clear()
|
|
|
|
{
|
|
|
|
m_type = LT_SIGNAL;
|
|
|
|
m_visible = true;
|
|
|
|
m_number = 0;
|
|
|
|
m_name.clear();
|
|
|
|
}
|
2014-06-24 16:17:18 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
LAYER( const wxString& aName = wxEmptyString,
|
|
|
|
LAYER_T aType = LT_SIGNAL, bool aVisible = true, int aNumber = -1 ) :
|
|
|
|
m_name( aName ),
|
|
|
|
m_type( aType ),
|
2012-06-09 17:00:13 +00:00
|
|
|
m_visible( aVisible ),
|
2014-06-24 16:17:18 +00:00
|
|
|
m_number( aNumber )
|
2012-06-09 17:00:13 +00:00
|
|
|
{
|
|
|
|
}
|
2014-06-24 16:17:18 +00:00
|
|
|
*/
|
2012-06-09 17:00:13 +00:00
|
|
|
|
2014-06-25 04:36:02 +00:00
|
|
|
wxString m_name; ///< The name of the layer, there should be no spaces in this name.
|
2012-06-09 17:00:13 +00:00
|
|
|
|
2014-06-25 04:36:02 +00:00
|
|
|
LAYER_T m_type; ///< The type of the layer
|
2012-06-09 17:00:13 +00:00
|
|
|
|
2014-06-25 04:36:02 +00:00
|
|
|
bool m_visible;
|
2008-03-04 04:22:27 +00:00
|
|
|
|
2014-06-25 04:36:02 +00:00
|
|
|
int m_number;
|
2008-03-04 04:22:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ShowType
|
|
|
|
* converts a LAYER_T enum to a const char*
|
|
|
|
* @param aType The LAYER_T to convert
|
|
|
|
* @return const char* - The string representation of the layer type.
|
|
|
|
*/
|
|
|
|
static const char* ShowType( LAYER_T aType );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ParseType
|
|
|
|
* converts a string to a LAYER_T
|
|
|
|
* @param aType The const char* to convert
|
|
|
|
* @return LAYER_T - The binary representation of the layer type, or
|
|
|
|
* LAYER_T(-1) if the string is invalid
|
|
|
|
*/
|
2009-06-11 14:26:17 +00:00
|
|
|
static LAYER_T ParseType( const char* aType );
|
2008-03-04 04:22:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
// Helper class to handle high light nets
|
|
|
|
class HIGH_LIGHT_INFO
|
2011-04-05 17:49:14 +00:00
|
|
|
{
|
|
|
|
friend class BOARD;
|
2014-05-13 09:22:51 +00:00
|
|
|
|
2011-04-05 17:49:14 +00:00
|
|
|
protected:
|
2011-09-14 20:04:58 +00:00
|
|
|
int m_netCode; // net selected for highlight (-1 when no net selected )
|
2012-04-01 20:51:56 +00:00
|
|
|
bool m_highLightOn; // highlight active
|
2011-04-05 17:49:14 +00:00
|
|
|
|
|
|
|
void Clear()
|
|
|
|
{
|
|
|
|
m_netCode = -1;
|
2011-09-14 20:04:58 +00:00
|
|
|
m_highLightOn = false;
|
2011-04-05 17:49:14 +00:00
|
|
|
}
|
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
HIGH_LIGHT_INFO()
|
2011-04-05 17:49:14 +00:00
|
|
|
{
|
|
|
|
Clear();
|
|
|
|
}
|
|
|
|
};
|
2010-01-21 07:41:30 +00:00
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
DECL_VEC_FOR_SWIG(MARKERS, MARKER_PCB*)
|
|
|
|
DECL_VEC_FOR_SWIG(ZONE_CONTAINERS, ZONE_CONTAINER*)
|
|
|
|
DECL_VEC_FOR_SWIG(TRACKS, TRACK*)
|
|
|
|
|
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
/**
|
|
|
|
* Class BOARD
|
2011-09-30 18:15:37 +00:00
|
|
|
* holds information pertinent to a Pcbnew printed circuit board.
|
2008-03-04 04:22:27 +00:00
|
|
|
*/
|
2016-05-13 15:31:54 +00:00
|
|
|
class BOARD : public BOARD_ITEM_CONTAINER
|
2007-12-09 12:59:06 +00:00
|
|
|
{
|
2011-03-01 19:26:17 +00:00
|
|
|
friend class PCB_EDIT_FRAME;
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2007-12-09 12:59:06 +00:00
|
|
|
private:
|
2012-08-29 16:59:50 +00:00
|
|
|
/// the board filename
|
2013-01-09 18:52:44 +00:00
|
|
|
wxString m_fileName;
|
2012-08-29 16:59:50 +00:00
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
/// MARKER_PCBs for clearance problems, owned by pointer.
|
2013-01-09 18:52:44 +00:00
|
|
|
MARKERS m_markers;
|
2011-09-14 20:04:58 +00:00
|
|
|
|
|
|
|
/// edge zone descriptors, owned by pointer.
|
2013-01-09 18:52:44 +00:00
|
|
|
ZONE_CONTAINERS m_ZoneDescriptorList;
|
2008-01-06 12:43:57 +00:00
|
|
|
|
2014-06-24 16:17:18 +00:00
|
|
|
LAYER m_Layer[LAYER_ID_COUNT];
|
2013-08-03 05:15:23 +00:00
|
|
|
|
2012-04-01 20:51:56 +00:00
|
|
|
// if true m_highLight_NetCode is used
|
2013-01-09 18:52:44 +00:00
|
|
|
HIGH_LIGHT_INFO m_highLight; // current high light data
|
|
|
|
HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
|
2008-03-04 04:22:27 +00:00
|
|
|
|
2013-01-09 18:52:44 +00:00
|
|
|
int m_fileFormatVersionAtLoad; ///< the version loaded from the file
|
2011-11-28 04:32:29 +00:00
|
|
|
|
2013-01-09 18:52:44 +00:00
|
|
|
EDA_RECT m_BoundingBox;
|
|
|
|
NETINFO_LIST m_NetInfo; ///< net info list (name, design constraints ..
|
2013-11-25 15:50:03 +00:00
|
|
|
RN_DATA* m_ratsnest;
|
2011-12-10 05:33:24 +00:00
|
|
|
|
|
|
|
BOARD_DESIGN_SETTINGS m_designSettings;
|
2012-02-06 05:44:19 +00:00
|
|
|
ZONE_SETTINGS m_zoneSettings;
|
2012-01-09 08:35:06 +00:00
|
|
|
COLORS_DESIGN_SETTINGS* m_colorsSettings;
|
2011-12-22 21:57:50 +00:00
|
|
|
PAGE_INFO m_paper;
|
2012-04-01 20:51:56 +00:00
|
|
|
TITLE_BLOCK m_titles; ///< text in lower right of screen and plots
|
2012-04-05 18:27:56 +00:00
|
|
|
PCB_PLOT_PARAMS m_plotOptions;
|
2011-12-10 05:33:24 +00:00
|
|
|
|
2013-01-09 18:52:44 +00:00
|
|
|
/// Number of pads connected to the current net.
|
|
|
|
int m_nodeCount;
|
|
|
|
|
|
|
|
/// Number of unconnected nets in the current rats nest.
|
|
|
|
int m_unconnectedNetCount;
|
|
|
|
|
2011-12-10 05:33:24 +00:00
|
|
|
/**
|
|
|
|
* Function chainMarkedSegments
|
|
|
|
* is used by MarkTrace() to set the BUSY flag of connected segments of the trace
|
|
|
|
* segment located at \a aPosition on aLayerMask.
|
|
|
|
* Vias are put in list but their flags BUSY is not set
|
|
|
|
* @param aPosition A wxPoint object containing the position of the starting search.
|
2015-07-10 16:43:25 +00:00
|
|
|
* @param aLayerSet The allowed layers for segments to search.
|
2011-12-10 05:33:24 +00:00
|
|
|
* @param aList The track list to fill with points of flagged segments.
|
|
|
|
*/
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
void chainMarkedSegments( wxPoint aPosition, const LSET& aLayerSet, TRACKS* aList );
|
2011-12-10 05:33:24 +00:00
|
|
|
|
2016-05-30 08:44:48 +00:00
|
|
|
// The default copy constructor & operator= are inadequate,
|
|
|
|
// either write one or do not use it at all
|
|
|
|
BOARD( const BOARD& aOther ) :
|
2016-05-13 15:31:54 +00:00
|
|
|
BOARD_ITEM_CONTAINER( aOther ), m_NetInfo( this )
|
2016-05-30 08:44:48 +00:00
|
|
|
{
|
|
|
|
assert( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
BOARD& operator=( const BOARD& aOther )
|
|
|
|
{
|
|
|
|
assert( false );
|
2016-08-16 08:03:52 +00:00
|
|
|
return *this; // just to mute warning
|
2016-05-30 08:44:48 +00:00
|
|
|
}
|
|
|
|
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
public:
|
2014-06-06 09:44:21 +00:00
|
|
|
static inline bool ClassOf( const EDA_ITEM* aItem )
|
|
|
|
{
|
2014-06-12 20:03:57 +00:00
|
|
|
return aItem && PCB_T == aItem->Type();
|
2014-06-06 09:44:21 +00:00
|
|
|
}
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2012-08-29 16:59:50 +00:00
|
|
|
void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
|
|
|
|
|
|
|
|
const wxString &GetFileName() const { return m_fileName; }
|
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
/// Flags used in ratsnest calculation and update.
|
|
|
|
int m_Status_Pcb;
|
|
|
|
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
DLIST<BOARD_ITEM> m_Drawings; // linked list of lines & texts
|
|
|
|
DLIST<MODULE> m_Modules; // linked list of MODULEs
|
2014-04-25 06:00:04 +00:00
|
|
|
DLIST<TRACK> m_Track; // linked list of TRACKs and VIAs
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
DLIST<SEGZONE> m_Zone; // linked list of SEGZONEs
|
2008-12-04 04:28:11 +00:00
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
/// Ratsnest list for the BOARD
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
std::vector<RATSNEST_ITEM> m_FullRatsnest;
|
2009-10-03 17:18:08 +00:00
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
/// Ratsnest list relative to a given footprint (used while moving a footprint).
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
std::vector<RATSNEST_ITEM> m_LocalRatsnest;
|
2009-08-10 02:22:56 +00:00
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
/// zone contour currently in progress
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
ZONE_CONTAINER* m_CurrentZoneContour;
|
2011-09-14 20:04:58 +00:00
|
|
|
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
BOARD();
|
2007-12-09 12:59:06 +00:00
|
|
|
~BOARD();
|
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual const wxPoint& GetPosition() const override;
|
2013-08-29 10:06:06 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void SetPosition( const wxPoint& aPos ) override;
|
2013-08-29 10:06:06 +00:00
|
|
|
|
2013-04-25 16:29:35 +00:00
|
|
|
bool IsEmpty() const
|
|
|
|
{
|
|
|
|
return m_Drawings.GetCount() == 0 && m_Modules.GetCount() == 0 &&
|
|
|
|
m_Track.GetCount() == 0 && m_Zone.GetCount() == 0;
|
|
|
|
}
|
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void Move( const wxPoint& aMoveVector ) override;
|
2012-06-01 07:39:32 +00:00
|
|
|
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
|
|
|
|
int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; }
|
|
|
|
|
2016-05-13 15:31:54 +00:00
|
|
|
///> @copydoc BOARD_ITEM_CONTAINER::Add()
|
|
|
|
void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_INSERT ) override;
|
2008-12-06 21:20:50 +00:00
|
|
|
|
2016-05-13 15:31:54 +00:00
|
|
|
///> @copydoc BOARD_ITEM_CONTAINER::Remove()
|
|
|
|
void Remove( BOARD_ITEM* aBoardItem ) override;
|
2008-12-06 21:20:50 +00:00
|
|
|
|
2016-05-11 08:17:34 +00:00
|
|
|
BOARD_ITEM* Duplicate( const BOARD_ITEM* aItem, bool aAddToBoard = false );
|
2015-02-12 03:22:24 +00:00
|
|
|
|
2013-11-25 15:50:03 +00:00
|
|
|
/**
|
|
|
|
* Function GetRatsnest()
|
|
|
|
* returns list of missing connections between components/tracks.
|
|
|
|
* @return RATSNEST* is an object that contains informations about missing connections.
|
|
|
|
*/
|
|
|
|
RN_DATA* GetRatsnest() const
|
|
|
|
{
|
|
|
|
return m_ratsnest;
|
|
|
|
}
|
|
|
|
|
2007-12-09 12:59:06 +00:00
|
|
|
/**
|
|
|
|
* Function DeleteMARKERs
|
|
|
|
* deletes ALL MARKERS from the board.
|
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void DeleteMARKERs();
|
2007-12-09 12:59:06 +00:00
|
|
|
|
2007-12-29 19:15:58 +00:00
|
|
|
/**
|
|
|
|
* Function DeleteZONEOutlines
|
|
|
|
* deletes ALL zone outlines from the board.
|
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void DeleteZONEOutlines();
|
2011-09-14 15:08:44 +00:00
|
|
|
|
2007-12-09 12:59:06 +00:00
|
|
|
/**
|
|
|
|
* Function GetMARKER
|
|
|
|
* returns the MARKER at a given index.
|
2009-08-01 19:26:05 +00:00
|
|
|
* @param index The array type index into a collection of MARKER_PCBS.
|
|
|
|
* @return MARKER_PCB* - a pointer to the MARKER_PCB or NULL if index out of range.
|
2007-12-09 12:59:06 +00:00
|
|
|
*/
|
2009-08-01 19:26:05 +00:00
|
|
|
MARKER_PCB* GetMARKER( int index ) const
|
2007-12-09 12:59:06 +00:00
|
|
|
{
|
|
|
|
if( (unsigned) index < m_markers.size() )
|
|
|
|
return m_markers[index];
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2007-12-09 12:59:06 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetMARKERCount
|
2009-08-01 19:26:05 +00:00
|
|
|
* @return int - The number of MARKER_PCBS.
|
2007-12-09 12:59:06 +00:00
|
|
|
*/
|
|
|
|
int GetMARKERCount() const
|
|
|
|
{
|
|
|
|
return (int) m_markers.size();
|
|
|
|
}
|
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
/**
|
|
|
|
* Function SetAuxOrigin
|
|
|
|
* sets the origin point used for plotting.
|
|
|
|
*/
|
|
|
|
void SetAuxOrigin( const wxPoint& aPoint ) { m_designSettings.m_AuxOrigin = aPoint; }
|
|
|
|
const wxPoint& GetAuxOrigin() const { return m_designSettings.m_AuxOrigin; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetGridOrigin
|
|
|
|
* sets the origin point of the grid.
|
|
|
|
*/
|
|
|
|
void SetGridOrigin( const wxPoint& aPoint ) { m_designSettings.m_GridOrigin = aPoint; }
|
|
|
|
const wxPoint& GetGridOrigin() const { return m_designSettings.m_GridOrigin; }
|
|
|
|
|
2011-04-05 17:49:14 +00:00
|
|
|
/**
|
2011-09-14 20:04:58 +00:00
|
|
|
* Function ResetHighLight
|
|
|
|
* Reset all high light data to the init state
|
2011-04-05 17:49:14 +00:00
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void ResetHighLight()
|
2011-04-05 17:49:14 +00:00
|
|
|
{
|
2012-04-01 20:51:56 +00:00
|
|
|
m_highLight.Clear();
|
|
|
|
m_highLightPrevious.Clear();
|
2011-04-05 17:49:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-09-14 20:04:58 +00:00
|
|
|
* Function GetHighLightNetCode
|
|
|
|
* @return netcode of net to highlight (-1 when no net selected)
|
2011-04-05 17:49:14 +00:00
|
|
|
*/
|
2012-04-01 20:51:56 +00:00
|
|
|
int GetHighLightNetCode() { return m_highLight.m_netCode; }
|
2011-04-05 17:49:14 +00:00
|
|
|
|
|
|
|
/**
|
2011-09-14 20:04:58 +00:00
|
|
|
* Function SetHighLightNet
|
|
|
|
* @param aNetCode = netcode of net to highlight
|
2011-04-05 17:49:14 +00:00
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void SetHighLightNet( int aNetCode)
|
2011-04-05 17:49:14 +00:00
|
|
|
{
|
2012-04-01 20:51:56 +00:00
|
|
|
m_highLight.m_netCode = aNetCode;
|
2011-04-05 17:49:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-09-14 20:04:58 +00:00
|
|
|
* Function IsHighLightNetON
|
|
|
|
* @return true if a net is currently highlighted
|
2011-04-05 17:49:14 +00:00
|
|
|
*/
|
2012-04-01 20:51:56 +00:00
|
|
|
bool IsHighLightNetON() { return m_highLight.m_highLightOn; }
|
2011-04-05 17:49:14 +00:00
|
|
|
|
|
|
|
/**
|
2011-09-14 20:04:58 +00:00
|
|
|
* Function HighLightOFF
|
|
|
|
* Disable highlight.
|
2011-04-05 17:49:14 +00:00
|
|
|
*/
|
2012-04-01 20:51:56 +00:00
|
|
|
void HighLightOFF() { m_highLight.m_highLightOn = false; }
|
2011-04-05 17:49:14 +00:00
|
|
|
|
|
|
|
/**
|
2011-09-14 20:04:58 +00:00
|
|
|
* Function HighLightON
|
|
|
|
* Enable highlight.
|
2012-04-01 20:51:56 +00:00
|
|
|
* if m_highLight_NetCode >= 0, this net will be highlighted
|
2011-04-05 17:49:14 +00:00
|
|
|
*/
|
2012-04-01 20:51:56 +00:00
|
|
|
void HighLightON() { m_highLight.m_highLightOn = true; }
|
2011-04-05 17:49:14 +00:00
|
|
|
|
|
|
|
/**
|
2011-09-14 20:04:58 +00:00
|
|
|
* Function PushHighLight
|
|
|
|
* save current high light info for later use
|
2011-04-05 17:49:14 +00:00
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void PushHighLight();
|
2011-04-05 17:49:14 +00:00
|
|
|
|
|
|
|
/**
|
2011-09-14 20:04:58 +00:00
|
|
|
* Function PopHighLight
|
|
|
|
* retrieve a previously saved high light info
|
2011-04-05 17:49:14 +00:00
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void PopHighLight();
|
2011-04-05 17:49:14 +00:00
|
|
|
|
2008-01-23 01:50:16 +00:00
|
|
|
/**
|
|
|
|
* Function GetCopperLayerCount
|
|
|
|
* @return int - The number of copper layers in the BOARD.
|
|
|
|
*/
|
2011-09-14 15:08:44 +00:00
|
|
|
int GetCopperLayerCount() const;
|
2010-01-21 07:41:30 +00:00
|
|
|
|
|
|
|
void SetCopperLayerCount( int aCount );
|
|
|
|
|
2009-10-18 23:22:26 +00:00
|
|
|
/**
|
|
|
|
* Function GetEnabledLayers
|
2014-06-24 16:17:18 +00:00
|
|
|
* is a proxy function that calls the corresponding function in m_BoardSettings
|
2009-10-18 23:22:26 +00:00
|
|
|
* Returns a bit-mask of all the layers that are enabled
|
|
|
|
* @return int - the enabled layers in bit-mapped form.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
LSET GetEnabledLayers() const;
|
2009-10-18 23:22:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetEnabledLayers
|
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
|
|
|
* Changes the bit-mask of enabled layers
|
2010-12-29 17:47:32 +00:00
|
|
|
* @param aLayerMask = The new bit-mask of enabled layers
|
2009-10-18 23:22:26 +00:00
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
void SetEnabledLayers( LSET aLayerMask );
|
2009-10-18 23:22:26 +00:00
|
|
|
|
2010-01-31 20:01:46 +00:00
|
|
|
/**
|
|
|
|
* Function IsLayerEnabled
|
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
|
|
|
* tests whether a given layer is enabled
|
2010-12-29 17:47:32 +00:00
|
|
|
* @param aLayer = The layer to be tested
|
2010-01-31 20:01:46 +00:00
|
|
|
* @return bool - true if the layer is visible.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
bool IsLayerEnabled( LAYER_ID aLayer ) const
|
2010-01-31 20:01:46 +00:00
|
|
|
{
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
return m_designSettings.IsLayerEnabled( aLayer );
|
2010-01-31 20:01:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsLayerVisible
|
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
|
|
|
* tests whether a given layer is visible
|
2013-04-09 16:00:46 +00:00
|
|
|
* @param aLayer = The layer to be tested
|
2010-01-31 20:01:46 +00:00
|
|
|
* @return bool - true if the layer is visible.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
bool IsLayerVisible( LAYER_ID aLayer ) const
|
2010-01-31 20:01:46 +00:00
|
|
|
{
|
2013-04-09 16:00:46 +00:00
|
|
|
return m_designSettings.IsLayerVisible( aLayer );
|
2010-01-31 20:01:46 +00:00
|
|
|
}
|
|
|
|
|
2009-10-18 23:22:26 +00:00
|
|
|
/**
|
2010-01-21 07:41:30 +00:00
|
|
|
* Function GetVisibleLayers
|
2009-10-18 23:22:26 +00:00
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
2010-01-21 07:41:30 +00:00
|
|
|
* Returns a bit-mask of all the layers that are visible
|
|
|
|
* @return int - the visible layers in bit-mapped form.
|
2009-10-18 23:22:26 +00:00
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
LSET GetVisibleLayers() const;
|
2009-10-18 23:22:26 +00:00
|
|
|
|
|
|
|
/**
|
2010-01-21 07:41:30 +00:00
|
|
|
* Function SetVisibleLayers
|
2009-10-18 23:22:26 +00:00
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
2010-01-21 07:41:30 +00:00
|
|
|
* changes the bit-mask of visible layers
|
2010-12-29 17:47:32 +00:00
|
|
|
* @param aLayerMask = The new bit-mask of visible layers
|
2009-10-18 23:22:26 +00:00
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
void SetVisibleLayers( LSET aLayerMask );
|
2009-10-18 23:22:26 +00:00
|
|
|
|
2010-01-25 06:45:34 +00:00
|
|
|
// these 2 functions are not tidy at this time, since there are PCB_VISIBLEs that
|
|
|
|
// are not stored in the bitmap.
|
|
|
|
|
2009-10-18 23:22:26 +00:00
|
|
|
/**
|
|
|
|
* Function GetVisibleElements
|
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
|
|
|
* returns a bit-mask of all the element categories that are visible
|
2010-01-21 20:53:01 +00:00
|
|
|
* @return int - the visible element bitmap or-ed from enum PCB_VISIBLE
|
|
|
|
* @see enum PCB_VISIBLE
|
2009-10-18 23:22:26 +00:00
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
int GetVisibleElements() const;
|
2009-10-18 23:22:26 +00:00
|
|
|
|
2010-01-21 07:41:30 +00:00
|
|
|
/**
|
|
|
|
* Function SetVisibleElements
|
|
|
|
* is a proxy function that calls the correspondent function in m_BoardSettings
|
|
|
|
* changes the bit-mask of visible element categories
|
2010-01-21 20:53:01 +00:00
|
|
|
* @param aMask = The new bit-mask of visible element bitmap or-ed from enum PCB_VISIBLE
|
|
|
|
* @see enum PCB_VISIBLE
|
2010-01-21 07:41:30 +00:00
|
|
|
*/
|
|
|
|
void SetVisibleElements( int aMask );
|
2009-10-18 23:22:26 +00:00
|
|
|
|
2010-01-30 14:46:26 +00:00
|
|
|
/**
|
|
|
|
* Function SetVisibleAlls
|
|
|
|
* changes the bit-mask of visible element categories and layers
|
|
|
|
* @see enum PCB_VISIBLE
|
|
|
|
*/
|
2010-01-31 20:01:46 +00:00
|
|
|
void SetVisibleAlls();
|
2010-01-30 14:46:26 +00:00
|
|
|
|
2010-01-25 06:45:34 +00:00
|
|
|
/**
|
|
|
|
* Function IsElementVisible
|
|
|
|
* tests whether a given element category is visible. Keep this as an
|
|
|
|
* inline function.
|
|
|
|
* @param aPCB_VISIBLE is from the enum by the same name
|
|
|
|
* @return bool - true if the element is visible.
|
|
|
|
* @see enum PCB_VISIBLE
|
|
|
|
*/
|
|
|
|
bool IsElementVisible( int aPCB_VISIBLE ) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetElementVisibility
|
|
|
|
* changes the visibility of an element category
|
|
|
|
* @param aPCB_VISIBLE is from the enum by the same name
|
|
|
|
* @param aNewState = The new visibility state of the element category
|
|
|
|
* @see enum PCB_VISIBLE
|
|
|
|
*/
|
|
|
|
void SetElementVisibility( int aPCB_VISIBLE, bool aNewState );
|
|
|
|
|
2010-01-31 20:01:46 +00:00
|
|
|
/**
|
|
|
|
* Function IsModuleLayerVisible
|
|
|
|
* expects either of the two layers on which a module can reside, and returns
|
|
|
|
* whether that layer is visible.
|
2014-06-24 16:17:18 +00:00
|
|
|
* @param layer One of the two allowed layers for modules: F_Cu or B_Cu
|
2010-01-31 20:01:46 +00:00
|
|
|
* @return bool - true if the layer is visible, else false.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
bool IsModuleLayerVisible( LAYER_ID layer );
|
2010-01-31 20:01:46 +00:00
|
|
|
|
2010-01-21 20:53:01 +00:00
|
|
|
/**
|
|
|
|
* Function GetVisibleElementColor
|
|
|
|
* returns the color of a pcb visible element.
|
|
|
|
* @see enum PCB_VISIBLE
|
|
|
|
*/
|
2012-09-02 12:06:47 +00:00
|
|
|
EDA_COLOR_T GetVisibleElementColor( int aPCB_VISIBLE );
|
2010-01-21 20:53:01 +00:00
|
|
|
|
2012-09-02 12:06:47 +00:00
|
|
|
void SetVisibleElementColor( int aPCB_VISIBLE, EDA_COLOR_T aColor );
|
2011-09-14 15:08:44 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
* Function GetDesignSettings
|
|
|
|
* @return the BOARD_DESIGN_SETTINGS for this BOARD
|
2010-01-31 20:01:46 +00:00
|
|
|
*/
|
2012-02-02 17:45:37 +00:00
|
|
|
BOARD_DESIGN_SETTINGS& GetDesignSettings() const
|
2010-01-31 20:01:46 +00:00
|
|
|
{
|
2012-02-02 17:45:37 +00:00
|
|
|
// remove const-ness with cast.
|
|
|
|
return (BOARD_DESIGN_SETTINGS&) m_designSettings;
|
2010-01-31 20:01:46 +00:00
|
|
|
}
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
* Function SetDesignSettings
|
|
|
|
* @param aDesignSettings the new BOARD_DESIGN_SETTINGS to use
|
2010-01-31 20:01:46 +00:00
|
|
|
*/
|
2014-05-13 09:22:51 +00:00
|
|
|
void SetDesignSettings( const BOARD_DESIGN_SETTINGS& aDesignSettings )
|
|
|
|
{
|
|
|
|
m_designSettings = aDesignSettings;
|
|
|
|
}
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2011-12-22 21:57:50 +00:00
|
|
|
const PAGE_INFO& GetPageSettings() const { return m_paper; }
|
|
|
|
void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
|
|
|
|
|
2012-04-05 18:27:56 +00:00
|
|
|
const PCB_PLOT_PARAMS& GetPlotOptions() const { return m_plotOptions; }
|
|
|
|
void SetPlotOptions( const PCB_PLOT_PARAMS& aOptions ) { m_plotOptions = aOptions; }
|
|
|
|
|
2012-01-09 08:35:06 +00:00
|
|
|
TITLE_BLOCK& GetTitleBlock() { return m_titles; }
|
|
|
|
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
const ZONE_SETTINGS& GetZoneSettings() const { return m_zoneSettings; }
|
|
|
|
void SetZoneSettings( const ZONE_SETTINGS& aSettings ) { m_zoneSettings = aSettings; }
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2013-08-15 15:20:25 +00:00
|
|
|
* Function GetColorSettings
|
2010-01-31 20:01:46 +00:00
|
|
|
* @return the current COLORS_DESIGN_SETTINGS in use
|
|
|
|
*/
|
2011-12-22 21:57:50 +00:00
|
|
|
COLORS_DESIGN_SETTINGS* GetColorsSettings() const { return m_colorsSettings; }
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SetColorsSettings
|
2010-01-31 20:01:46 +00:00
|
|
|
* @param aColorsSettings = the new COLORS_DESIGN_SETTINGS to use
|
|
|
|
*/
|
2013-03-20 04:46:32 +00:00
|
|
|
void SetColorsSettings( COLORS_DESIGN_SETTINGS* aColorsSettings )
|
2010-01-31 20:01:46 +00:00
|
|
|
{
|
|
|
|
m_colorsSettings = aColorsSettings;
|
|
|
|
}
|
|
|
|
|
2013-10-04 08:42:09 +00:00
|
|
|
/**
|
|
|
|
* Function GetBoardPolygonOutlines
|
|
|
|
* Extracts the board outlines and build a closed polygon
|
|
|
|
* from lines, arcs and circle items on edge cut layer
|
|
|
|
* Any closed outline inside the main outline is a hole
|
|
|
|
* All contours should be closed, i.e. have valid vertices to build a closed polygon
|
2015-07-27 19:45:57 +00:00
|
|
|
* @param aPoly The SHAPE_POLY_SET to fill in with outlines/holes.
|
2013-10-04 08:42:09 +00:00
|
|
|
* @param aErrorText = a wxString reference to display an error message
|
|
|
|
* with the coordinate of the point which creates the error
|
|
|
|
* (default = NULL , no message returned on error)
|
|
|
|
* @return true if success, false if a contour is not valid
|
|
|
|
*/
|
2015-07-27 19:45:57 +00:00
|
|
|
bool GetBoardPolygonOutlines( SHAPE_POLY_SET& aOutlines,
|
|
|
|
SHAPE_POLY_SET& aHoles,
|
2013-10-04 08:42:09 +00:00
|
|
|
wxString* aErrorText = NULL );
|
|
|
|
|
2014-05-18 15:16:59 +00:00
|
|
|
/**
|
|
|
|
* Function ConvertBrdLayerToPolygonalContours
|
|
|
|
* Build a set of polygons which are the outlines of copper items
|
|
|
|
* (pads, tracks, vias, texts, zones)
|
|
|
|
* Holes in vias or pads are ignored
|
|
|
|
* Usefull to export the shape of copper layers to dxf polygons
|
|
|
|
* or 3D viewer
|
|
|
|
* the polygons are not merged.
|
2014-06-24 16:17:18 +00:00
|
|
|
* @param aLayer = A copper layer, like B_Cu, etc.
|
2015-07-27 19:45:57 +00:00
|
|
|
* @param aOutlines The SHAPE_POLY_SET to fill in with items outline.
|
2014-05-18 15:16:59 +00:00
|
|
|
*/
|
2015-07-27 19:45:57 +00:00
|
|
|
void ConvertBrdLayerToPolygonalContours( LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines );
|
2014-05-18 15:16:59 +00:00
|
|
|
|
2015-02-15 13:31:47 +00:00
|
|
|
/**
|
|
|
|
* Function GetLayerID
|
|
|
|
* returns the ID of a layer given by aLayerName. Copper layers may
|
|
|
|
* have custom names.
|
|
|
|
*
|
|
|
|
* @param aLayerName = A layer name, like wxT("B.Cu"), etc.
|
|
|
|
*
|
|
|
|
* @return LAYER_ID - the layer id, which for copper layers may
|
|
|
|
* be custom, else standard.
|
|
|
|
*/
|
2015-06-04 12:54:07 +00:00
|
|
|
const LAYER_ID GetLayerID( const wxString& aLayerName ) const;
|
2015-02-15 13:31:47 +00:00
|
|
|
|
2008-01-23 01:50:16 +00:00
|
|
|
/**
|
|
|
|
* Function GetLayerName
|
2013-04-09 16:00:46 +00:00
|
|
|
* returns the name of a layer given by aLayer. Copper layers may
|
2013-03-20 04:46:32 +00:00
|
|
|
* have custom names.
|
2008-01-23 01:50:16 +00:00
|
|
|
*
|
2014-06-24 16:17:18 +00:00
|
|
|
* @param aLayer = A layer, like B_Cu, etc.
|
2013-03-20 04:46:32 +00:00
|
|
|
*
|
|
|
|
* @return wxString - the layer name, which for copper layers may
|
|
|
|
* be custom, else standard.
|
2008-01-23 01:50:16 +00:00
|
|
|
*/
|
2014-06-30 15:03:20 +00:00
|
|
|
const wxString GetLayerName( LAYER_ID aLayer ) const;
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2008-03-01 13:15:41 +00:00
|
|
|
/**
|
|
|
|
* Function SetLayerName
|
2013-04-09 16:00:46 +00:00
|
|
|
* changes the name of the layer given by aLayer.
|
2008-03-01 13:15:41 +00:00
|
|
|
*
|
2014-06-24 16:17:18 +00:00
|
|
|
* @param aLayer A layer, like B_Cu, etc.
|
2008-03-01 13:15:41 +00:00
|
|
|
* @param aLayerName The new layer name
|
2011-09-14 20:04:58 +00:00
|
|
|
* @return bool - true if aLayerName was legal and unique among other
|
2013-04-09 16:00:46 +00:00
|
|
|
* layer names at other layer indices and aLayer was within range, else false.
|
2008-03-01 13:15:41 +00:00
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
bool SetLayerName( LAYER_ID aLayer, const wxString& aLayerName );
|
2008-03-01 13:15:41 +00:00
|
|
|
|
2013-03-20 04:46:32 +00:00
|
|
|
/**
|
|
|
|
* Function GetStandardLayerName
|
|
|
|
* returns an "English Standard" name of a PCB layer when given \a aLayerNumber.
|
|
|
|
* This function is static so it can be called without a BOARD instance. Use
|
|
|
|
* GetLayerName() if want the layer names of a specific BOARD, which could
|
|
|
|
* be different than the default if the user has renamed any copper layers.
|
|
|
|
*
|
2014-11-02 16:25:04 +00:00
|
|
|
* @param aLayerId is the layer identifier (index) to fetch
|
|
|
|
* @return const wxString - containing the layer name or "BAD INDEX" if aLayerId
|
2013-03-20 04:46:32 +00:00
|
|
|
* is not legal
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
static const wxString GetStandardLayerName( LAYER_ID aLayerId )
|
|
|
|
{
|
|
|
|
// a BOARD's standard layer name is the LAYER_ID fixed name
|
|
|
|
return LSET::Name( aLayerId );
|
|
|
|
}
|
2013-03-20 04:46:32 +00:00
|
|
|
|
2015-01-29 16:01:48 +00:00
|
|
|
/**
|
|
|
|
* Function SetLayerDescr
|
|
|
|
* returns the type of the copper layer given by aLayer.
|
|
|
|
*
|
|
|
|
* @param aIndex A layer index in m_Layer
|
|
|
|
* @param aLayer A reference to a LAYER description.
|
|
|
|
* @return false if the index was out of range.
|
|
|
|
*/
|
|
|
|
bool SetLayerDescr( LAYER_ID aIndex, const LAYER& aLayer );
|
2012-06-09 17:00:13 +00:00
|
|
|
|
2008-03-01 13:15:41 +00:00
|
|
|
/**
|
|
|
|
* Function GetLayerType
|
2013-04-09 16:00:46 +00:00
|
|
|
* returns the type of the copper layer given by aLayer.
|
2008-03-01 13:15:41 +00:00
|
|
|
*
|
2014-06-24 16:17:18 +00:00
|
|
|
* @param aLayer A layer index, like B_Cu, etc.
|
2008-03-01 13:15:41 +00:00
|
|
|
* @return LAYER_T - the layer type, or LAYER_T(-1) if the
|
|
|
|
* index was out of range.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
LAYER_T GetLayerType( LAYER_ID aLayer ) const;
|
2008-03-01 13:15:41 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-12 00:25:46 +00:00
|
|
|
* Function SetLayerType
|
2013-04-09 16:00:46 +00:00
|
|
|
* changes the type of the layer given by aLayer.
|
2008-03-01 13:15:41 +00:00
|
|
|
*
|
2014-06-24 16:17:18 +00:00
|
|
|
* @param aLayer A layer index, like B_Cu, etc.
|
2008-03-01 13:15:41 +00:00
|
|
|
* @param aLayerType The new layer type.
|
2013-04-09 16:00:46 +00:00
|
|
|
* @return bool - true if aLayerType was legal and aLayer was within range, else false.
|
2008-03-01 13:15:41 +00:00
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
bool SetLayerType( LAYER_ID aLayer, LAYER_T aLayerType );
|
2008-03-01 13:15:41 +00:00
|
|
|
|
2010-01-21 07:41:30 +00:00
|
|
|
/**
|
|
|
|
* Function SetLayerColor
|
|
|
|
* changes a layer color for any valid layer, including non-copper ones.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
void SetLayerColor( LAYER_ID aLayer, EDA_COLOR_T aColor );
|
2010-01-21 07:41:30 +00:00
|
|
|
|
2010-01-21 20:53:01 +00:00
|
|
|
/**
|
|
|
|
* Function GetLayerColor
|
|
|
|
* gets a layer color for any valid layer, including non-copper ones.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
EDA_COLOR_T GetLayerColor( LAYER_ID aLayer ) const;
|
2008-03-01 13:15:41 +00:00
|
|
|
|
2011-12-10 05:33:24 +00:00
|
|
|
/** Functions to get some items count */
|
|
|
|
int GetNumSegmTrack() const;
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2011-12-10 05:33:24 +00:00
|
|
|
/** Calculate the zone segment count */
|
|
|
|
int GetNumSegmZone() const;
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2007-12-09 12:59:06 +00:00
|
|
|
/**
|
|
|
|
* Function GetNumRatsnests
|
|
|
|
* @return int - The number of rats
|
|
|
|
*/
|
2011-12-10 05:33:24 +00:00
|
|
|
unsigned GetRatsnestsCount() const
|
2007-12-09 12:59:06 +00:00
|
|
|
{
|
2009-05-28 08:42:24 +00:00
|
|
|
return m_FullRatsnest.size();
|
2007-12-09 12:59:06 +00:00
|
|
|
}
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function GetNodesCount
|
2009-06-06 18:08:49 +00:00
|
|
|
* @return the number of pads members of nets (i.e. with netcode > 0)
|
2009-06-11 14:26:17 +00:00
|
|
|
*/
|
2011-12-10 05:33:24 +00:00
|
|
|
unsigned GetNodesCount() const;
|
2009-06-06 18:08:49 +00:00
|
|
|
|
2013-01-09 18:52:44 +00:00
|
|
|
/**
|
|
|
|
* Function SetNodeCount
|
|
|
|
* set the number of nodes of the current net to \a aCount.
|
|
|
|
*
|
|
|
|
* @param aCount is the number of nodes attached to the current net.
|
|
|
|
*/
|
|
|
|
void SetNodeCount( unsigned aCount ) { m_nodeCount = aCount; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetUnconnectedNetCount
|
|
|
|
* @return the number of unconnected nets in the current rats nest.
|
|
|
|
*/
|
|
|
|
unsigned GetUnconnectedNetCount() const { return m_unconnectedNetCount; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetUnconnectedNetCount
|
|
|
|
* sets the number of unconnected nets in the current rats nest to \a aCount.
|
|
|
|
*
|
|
|
|
* @param aCount is the number of unconneceted nets in the current rats nest.
|
|
|
|
*/
|
|
|
|
void SetUnconnectedNetCount( unsigned aCount ) { m_unconnectedNetCount = aCount; }
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2011-12-10 05:33:24 +00:00
|
|
|
* Function GetPadCount
|
2009-06-06 18:08:49 +00:00
|
|
|
* @return the number of pads in board
|
2009-06-11 14:26:17 +00:00
|
|
|
*/
|
2011-12-10 05:33:24 +00:00
|
|
|
unsigned GetPadCount() const
|
|
|
|
{
|
|
|
|
return m_NetInfo.GetPadCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPad
|
|
|
|
* @return D_PAD* - at the \a aIndex from m_NetInfo
|
|
|
|
*/
|
|
|
|
D_PAD* GetPad( unsigned aIndex ) const
|
|
|
|
{
|
|
|
|
return m_NetInfo.GetPad( aIndex );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPads
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
* returns a reference to a list of all the pads. The returned list is not
|
2011-12-10 05:33:24 +00:00
|
|
|
* sorted and contains pointers to PADS, but those pointers do not convey
|
|
|
|
* ownership of the respective PADs.
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
* @return D_PADS - a full list of pads
|
2011-12-10 05:33:24 +00:00
|
|
|
*/
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
const D_PADS& GetPads() { return m_NetInfo.m_PadsFullList; }
|
2011-12-10 05:33:24 +00:00
|
|
|
|
|
|
|
void BuildListOfNets()
|
|
|
|
{
|
|
|
|
m_NetInfo.buildListOfNets();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function FindNet
|
|
|
|
* searches for a net with the given netcode.
|
|
|
|
* @param aNetcode A netcode to search for.
|
|
|
|
* @return NETINFO_ITEM_ITEM* - the net or NULL if not found.
|
|
|
|
*/
|
|
|
|
NETINFO_ITEM* FindNet( int aNetcode ) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function FindNet overloaded
|
|
|
|
* searches for a net with the given name.
|
|
|
|
* @param aNetname A Netname to search for.
|
|
|
|
* @return NETINFO_ITEM* - the net or NULL if not found.
|
|
|
|
*/
|
|
|
|
NETINFO_ITEM* FindNet( const wxString& aNetname ) const;
|
|
|
|
|
2016-01-29 10:21:13 +00:00
|
|
|
NETINFO_LIST& GetNetInfo()
|
|
|
|
{
|
|
|
|
return m_NetInfo;
|
|
|
|
}
|
|
|
|
|
2014-03-11 13:50:53 +00:00
|
|
|
#ifndef SWIG
|
2014-01-16 15:47:31 +00:00
|
|
|
/**
|
|
|
|
* Function BeginNets
|
|
|
|
* @return iterator to the first element of the NETINFO_ITEMs list
|
|
|
|
*/
|
|
|
|
NETINFO_LIST::iterator BeginNets() const
|
|
|
|
{
|
|
|
|
return m_NetInfo.begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function EndNets
|
|
|
|
* @return iterator to the last element of the NETINFO_ITEMs list
|
|
|
|
*/
|
|
|
|
NETINFO_LIST::iterator EndNets() const
|
|
|
|
{
|
|
|
|
return m_NetInfo.end();
|
|
|
|
}
|
2014-03-11 13:50:53 +00:00
|
|
|
#endif
|
2014-01-16 15:47:31 +00:00
|
|
|
|
2011-12-10 05:33:24 +00:00
|
|
|
/**
|
|
|
|
* Function GetNetCount
|
|
|
|
* @return the number of nets (NETINFO_ITEM)
|
|
|
|
*/
|
|
|
|
unsigned GetNetCount() const
|
2009-06-06 18:08:49 +00:00
|
|
|
{
|
2011-12-10 05:33:24 +00:00
|
|
|
return m_NetInfo.GetNetCount();
|
2009-06-06 18:08:49 +00:00
|
|
|
}
|
2007-12-09 12:59:06 +00:00
|
|
|
|
2011-02-25 16:23:24 +00:00
|
|
|
/**
|
|
|
|
* Function ComputeBoundingBox
|
|
|
|
* calculates the bounding box containing all board items (or board edge segments).
|
|
|
|
* @param aBoardEdgesOnly is true if we are interested in board edge segments only.
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
* @return EDA_RECT - the board's bounding box
|
|
|
|
* @see PCB_BASE_FRAME::GetBoardBoundingBox() which calls this and doctors the result
|
2011-02-25 16:23:24 +00:00
|
|
|
*/
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
EDA_RECT ComputeBoundingBox( bool aBoardEdgesOnly = false );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetBoundingBox
|
|
|
|
* may be called soon after ComputeBoundingBox() to return the same EDA_RECT,
|
|
|
|
* as long as the BOARD has not changed. Remember, ComputeBoundingBox()'s
|
|
|
|
* aBoardEdgesOnly argument is considered in this return value also.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
const EDA_RECT GetBoundingBox() const override { return m_BoundingBox; }
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
|
|
|
|
void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2010-12-21 12:41:17 +00:00
|
|
|
/**
|
|
|
|
* Function Draw.
|
|
|
|
* Redraw the BOARD items but not cursors, axis or grid.
|
|
|
|
* @param aPanel = the panel relative to the board
|
2011-09-14 20:04:58 +00:00
|
|
|
* @param aDC = the current device context
|
2010-12-21 12:41:17 +00:00
|
|
|
* @param aDrawMode = GR_COPY, GR_OR ... (not always used)
|
|
|
|
* @param aOffset = an draw offset value (default = 0,0)
|
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
2016-09-24 18:53:15 +00:00
|
|
|
GR_DRAWMODE aDrawMode, const wxPoint& aOffset = ZeroOffset ) override;
|
2008-04-01 06:07:00 +00:00
|
|
|
|
2009-02-25 16:35:47 +00:00
|
|
|
/**
|
|
|
|
* Function DrawHighLight
|
|
|
|
* redraws the objects in the board that are associated with the given aNetCode
|
|
|
|
* and turns on or off the brilliance associated with that net according to the
|
2010-01-24 13:46:01 +00:00
|
|
|
* current value of global g_HighLight_Status
|
2009-02-25 16:35:47 +00:00
|
|
|
* @param aDrawPanel is needed for the clipping support.
|
2011-09-14 20:04:58 +00:00
|
|
|
* @param aDC = the current device context
|
2009-02-25 16:35:47 +00:00
|
|
|
* @param aNetCode is the net number to highlight or to dim.
|
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void DrawHighLight( EDA_DRAW_PANEL* aDrawPanel, wxDC* aDC, int aNetCode );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2007-12-09 12:59:06 +00:00
|
|
|
/**
|
|
|
|
* Function Visit
|
|
|
|
* may be re-implemented for each derived class in order to handle
|
|
|
|
* all the types given by its member data. Implementations should call
|
|
|
|
* inspector->Inspect() on types in scanTypes[], and may use IterateForward()
|
|
|
|
* to do so on lists of such data.
|
|
|
|
* @param inspector An INSPECTOR instance to use in the inspection.
|
|
|
|
* @param testData Arbitrary data used by the inspector.
|
2008-02-12 01:02:53 +00:00
|
|
|
* @param scanTypes Which KICAD_T types are of interest and the order
|
2007-12-09 12:59:06 +00:00
|
|
|
* is significant too, terminated by EOT.
|
|
|
|
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
|
|
|
|
* else SCAN_CONTINUE, and determined by the inspector.
|
|
|
|
*/
|
2016-07-12 19:05:54 +00:00
|
|
|
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
|
2007-12-09 12:59:06 +00:00
|
|
|
|
2008-02-07 17:10:12 +00:00
|
|
|
/**
|
|
|
|
* Function FindModuleByReference
|
|
|
|
* searches for a MODULE within this board with the given
|
|
|
|
* reference designator. Finds only the first one, if there
|
|
|
|
* is more than one such MODULE.
|
|
|
|
* @param aReference The reference designator of the MODULE to find.
|
|
|
|
* @return MODULE* - If found, the MODULE having the given reference
|
|
|
|
* designator, else NULL.
|
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
MODULE* FindModuleByReference( const wxString& aReference ) const;
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2013-04-25 16:29:35 +00:00
|
|
|
/**
|
|
|
|
* Function FindModule
|
|
|
|
* searches for a module matching \a aRefOrTimeStamp depending on the state of
|
|
|
|
* \a aSearchByTimeStamp.
|
|
|
|
* @param aRefOrTimeStamp is the search string.
|
|
|
|
* @param aSearchByTimeStamp searches by the module time stamp value if true. Otherwise
|
|
|
|
* search by reference designator.
|
2013-11-02 00:24:38 +00:00
|
|
|
* @return MODULE* - If found, the module meeting the search criteria, else NULL.
|
2013-04-25 16:29:35 +00:00
|
|
|
*/
|
2013-11-02 00:24:38 +00:00
|
|
|
MODULE* FindModule( const wxString& aRefOrTimeStamp, bool aSearchByTimeStamp = false ) const;
|
2013-04-25 16:29:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ReplaceNetlist
|
|
|
|
* updates the #BOARD according to \a aNetlist.
|
|
|
|
*
|
|
|
|
* The changes are made to the board are as follows they are not disabled in the status
|
|
|
|
* settings in the #NETLIST:
|
|
|
|
* - If a new component is found in the #NETLIST and not in the #BOARD, it is added
|
|
|
|
* to the #BOARD.
|
|
|
|
* - If a the component in the #NETLIST is already on the #BOARD, then one or more of the
|
|
|
|
* following actions can occur:
|
|
|
|
* + If the footprint name in the #NETLIST does not match the footprint name on the
|
|
|
|
* #BOARD, the footprint on the #BOARD is replaced with the footprint specified in
|
|
|
|
* the #NETLIST and the proper parameters are copied from the existing footprint.
|
|
|
|
* + If the reference designator in the #NETLIST does not match the reference designator
|
|
|
|
* on the #BOARD, the reference designator is updated from the #NETLIST.
|
|
|
|
* + If the value field in the #NETLIST does not match the value field on the #BOARD,
|
|
|
|
* the value field is updated from the #NETLIST.
|
|
|
|
* + If the time stamp in the #NETLIST does not match the time stamp on the #BOARD,
|
|
|
|
* the time stamp is updated from the #NETLIST.
|
|
|
|
* - After each footprint is added or update as described above, each footprint pad net
|
|
|
|
* name is compared and updated to the value defined in the #NETLIST.
|
|
|
|
* - After all of the footprints have been added, updated, and net names properly set,
|
|
|
|
* any extra unlock footprints are removed from the #BOARD.
|
|
|
|
*
|
|
|
|
* @param aNetlist is the new netlist to revise the contents of the #BOARD with.
|
2013-08-24 08:08:55 +00:00
|
|
|
* @param aDeleteSinglePadNets if true, remove nets counting only one pad
|
|
|
|
* and set net code to 0 for these pads
|
2013-04-25 16:29:35 +00:00
|
|
|
* @param aReporter is a #REPORTER object to report the changes \a aNetlist makes to
|
|
|
|
* the #BOARD. If NULL, no change reporting occurs.
|
|
|
|
*/
|
2013-08-24 08:08:55 +00:00
|
|
|
void ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
2016-01-10 21:24:13 +00:00
|
|
|
std::vector<MODULE*>* aNewFootprints, REPORTER* aReporter = NULL );
|
2013-04-25 16:29:35 +00:00
|
|
|
|
2007-12-17 20:18:04 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function SortedNetnamesList
|
2007-12-17 20:18:04 +00:00
|
|
|
* @param aNames An array string to fill with net names.
|
2011-09-14 20:04:58 +00:00
|
|
|
* @param aSortbyPadsCount true = sort by active pads count, false = no sort (i.e.
|
|
|
|
* leave the sort by net names)
|
2007-12-17 20:18:04 +00:00
|
|
|
* @return int - net names count.
|
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
int SortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount );
|
2007-12-09 12:59:06 +00:00
|
|
|
|
2009-07-18 11:44:19 +00:00
|
|
|
/**
|
2009-08-17 02:59:38 +00:00
|
|
|
* Function SynchronizeNetsAndNetClasses
|
|
|
|
* copies NETCLASS info to each NET, based on NET membership in a NETCLASS.
|
2011-09-14 20:04:58 +00:00
|
|
|
* Must be called after a Design Rules edition, or after reading a netlist (or editing
|
|
|
|
* the list of nets) Also this function removes the non existing nets in netclasses
|
|
|
|
* and add net nets in default netclass (this happens after reading a netlist)
|
2009-07-18 11:44:19 +00:00
|
|
|
*/
|
2010-01-31 20:01:46 +00:00
|
|
|
void SynchronizeNetsAndNetClasses();
|
2009-07-18 11:44:19 +00:00
|
|
|
|
2009-10-21 19:16:25 +00:00
|
|
|
/***************************************************************************/
|
2010-01-31 20:01:46 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
wxString GetClass() const override
|
2007-12-09 12:59:06 +00:00
|
|
|
{
|
|
|
|
return wxT( "BOARD" );
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(DEBUG)
|
2016-09-24 18:53:15 +00:00
|
|
|
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
2007-12-09 12:59:06 +00:00
|
|
|
#endif
|
2008-01-04 12:27:16 +00:00
|
|
|
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/*************************/
|
|
|
|
/* Copper Areas handling */
|
|
|
|
/*************************/
|
2009-06-11 14:26:17 +00:00
|
|
|
|
2008-11-27 10:12:46 +00:00
|
|
|
/**
|
|
|
|
* Function HitTestForAnyFilledArea
|
|
|
|
* 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
|
|
|
|
* Note: if a zone has its flag BUSY (in .m_State) is set, it is ignored.
|
2010-12-29 17:47:32 +00:00
|
|
|
* @param aRefPos A wxPoint to test
|
2008-11-27 10:12:46 +00:00
|
|
|
* @param aStartLayer the first layer to test
|
2013-09-18 19:21:11 +00:00
|
|
|
* @param aEndLayer the last layer to test
|
|
|
|
* @param aNetCode = the netcode used to filter zones (-1 to to test all zones)
|
2008-11-27 10:12:46 +00:00
|
|
|
* @return ZONE_CONTAINER* return a pointer to the ZONE_CONTAINER found, else NULL
|
|
|
|
*/
|
2009-06-11 14:26:17 +00:00
|
|
|
ZONE_CONTAINER* HitTestForAnyFilledArea( const wxPoint& aRefPos,
|
2014-06-24 16:17:18 +00:00
|
|
|
LAYER_ID aStartLayer,
|
|
|
|
LAYER_ID aEndLayer,
|
2013-09-18 19:21:11 +00:00
|
|
|
int aNetCode );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function RedrawAreasOutlines
|
|
|
|
* Redraw all areas outlines on layer aLayer ( redraw all if aLayer < 0 )
|
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
void RedrawAreasOutlines( EDA_DRAW_PANEL* aPanel,
|
|
|
|
wxDC* aDC,
|
2012-09-01 13:38:27 +00:00
|
|
|
GR_DRAWMODE aDrawMode,
|
2014-06-24 16:17:18 +00:00
|
|
|
LAYER_ID aLayer );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2008-09-26 19:51:36 +00:00
|
|
|
/**
|
|
|
|
* Function RedrawFilledAreas
|
|
|
|
* Redraw all filled areas on layer aLayer ( redraw all if aLayer < 0 )
|
|
|
|
*/
|
2012-09-01 13:38:27 +00:00
|
|
|
void RedrawFilledAreas( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
|
2014-06-24 16:17:18 +00:00
|
|
|
LAYER_ID aLayer );
|
2008-09-26 19:51:36 +00:00
|
|
|
|
2008-02-12 01:02:53 +00:00
|
|
|
/**
|
|
|
|
* Function SetAreasNetCodesFromNetNames
|
|
|
|
* Set the .m_NetCode member of all copper areas, according to the area Net Name
|
2009-11-12 15:43:38 +00:00
|
|
|
* The SetNetCodesFromNetNames is an equivalent to net name, for fast comparisons.
|
|
|
|
* However the Netcode is an arbitrary equivalence, it must be set after each netlist read
|
2008-02-12 01:02:53 +00:00
|
|
|
* or net change
|
|
|
|
* Must be called after pad netcodes are calculated
|
|
|
|
* @return : error count
|
2008-09-27 19:26:29 +00:00
|
|
|
* For non copper areas, netcode is set to 0
|
2008-02-12 01:02:53 +00:00
|
|
|
*/
|
2009-06-11 14:26:17 +00:00
|
|
|
int SetAreasNetCodesFromNetNames( void );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
2008-01-06 17:19:36 +00:00
|
|
|
* Function GetArea
|
|
|
|
* returns the Area (Zone Container) at a given index.
|
|
|
|
* @param index The array type index into a collection of ZONE_CONTAINER *.
|
|
|
|
* @return ZONE_CONTAINER* - a pointer to the Area or NULL if index out of range.
|
|
|
|
*/
|
|
|
|
ZONE_CONTAINER* GetArea( int index ) const
|
|
|
|
{
|
|
|
|
if( (unsigned) index < m_ZoneDescriptorList.size() )
|
|
|
|
return m_ZoneDescriptorList[index];
|
2011-09-07 19:41:04 +00:00
|
|
|
|
2008-01-06 17:19:36 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-02-12 01:02:53 +00:00
|
|
|
/**
|
2008-01-10 20:53:41 +00:00
|
|
|
* Function GetAreaIndex
|
|
|
|
* returns the Area Index for the given Zone Container.
|
|
|
|
* @param aArea :The ZONE_CONTAINER to find.
|
|
|
|
* @return an Area Index in m_ZoneDescriptorList or -1 if non found.
|
|
|
|
*/
|
2009-06-11 14:26:17 +00:00
|
|
|
int GetAreaIndex( const ZONE_CONTAINER* aArea ) const
|
2008-01-10 20:53:41 +00:00
|
|
|
{
|
2009-06-11 14:26:17 +00:00
|
|
|
for( int ii = 0; ii < GetAreaCount(); ii++ ) // Search for aArea in list
|
2008-02-12 01:02:53 +00:00
|
|
|
{
|
2009-06-11 14:26:17 +00:00
|
|
|
if( aArea == GetArea( ii ) ) // Found !
|
2008-02-12 01:02:53 +00:00
|
|
|
return ii;
|
|
|
|
}
|
2009-06-11 14:26:17 +00:00
|
|
|
|
2008-01-10 20:53:41 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2008-02-12 01:02:53 +00:00
|
|
|
|
2008-01-06 17:19:36 +00:00
|
|
|
/**
|
|
|
|
* Function GetAreaCount
|
|
|
|
* @return int - The number of Areas or ZONE_CONTAINER.
|
|
|
|
*/
|
|
|
|
int GetAreaCount() const
|
|
|
|
{
|
|
|
|
return (int) m_ZoneDescriptorList.size();
|
|
|
|
}
|
|
|
|
|
2008-02-12 01:02:53 +00:00
|
|
|
/* Functions used in test, merge and cut outlines */
|
2009-06-11 14:26:17 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function AddArea
|
2009-08-23 15:22:44 +00:00
|
|
|
* Add an empty copper area to board areas list
|
2011-09-07 19:41:04 +00:00
|
|
|
* @param aNewZonesList = a PICKED_ITEMS_LIST * where to store new areas pickers (useful
|
|
|
|
* in undo commands) can be NULL
|
2011-09-14 20:04:58 +00:00
|
|
|
* @param aNetcode = the netcode of the copper area (0 = no net)
|
2009-08-23 15:22:44 +00:00
|
|
|
* @param aLayer = the layer of area
|
|
|
|
* @param aStartPointPosition = position of the first point of the polygon outline of this area
|
2011-09-14 20:04:58 +00:00
|
|
|
* @param aHatch = hatch option
|
2012-07-31 13:12:51 +00:00
|
|
|
* @return a reference to the new area
|
2008-02-12 01:02:53 +00:00
|
|
|
*/
|
2009-08-23 15:22:44 +00:00
|
|
|
ZONE_CONTAINER* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode,
|
2014-06-24 16:17:18 +00:00
|
|
|
LAYER_ID aLayer, wxPoint aStartPointPosition, int aHatch );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function InsertArea
|
2009-06-11 14:26:17 +00:00
|
|
|
* add empty copper area to net, inserting after m_ZoneDescriptorList[iarea]
|
2008-02-12 01:02:53 +00:00
|
|
|
* @return pointer to the new area
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
ZONE_CONTAINER* InsertArea( int netcode, int iarea, LAYER_ID layer, int x, int y, int hatch );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-31 13:12:51 +00:00
|
|
|
* Function NormalizeAreaPolygon
|
|
|
|
* Process an area that has been modified, by normalizing its polygon against itself.
|
|
|
|
* i.e. convert a self-intersecting polygon to one (or more) non self-intersecting polygon(s)
|
2008-02-12 01:02:53 +00:00
|
|
|
* This may change the number and order of copper areas in the net.
|
2012-07-31 13:12:51 +00:00
|
|
|
* @param aNewZonesList = a PICKED_ITEMS_LIST * where to store new created areas pickers
|
2009-08-23 15:22:44 +00:00
|
|
|
* @param aCurrArea = the zone to process
|
2012-07-31 13:12:51 +00:00
|
|
|
* @return true if changes are made
|
2009-06-11 14:26:17 +00:00
|
|
|
*/
|
2013-03-20 14:50:12 +00:00
|
|
|
bool NormalizeAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList, ZONE_CONTAINER* aCurrArea );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-31 13:12:51 +00:00
|
|
|
* Function OnAreaPolygonModified
|
|
|
|
* Process an area that has been modified, by normalizing its polygon
|
|
|
|
* and merging the intersecting polygons for any other areas on the same net.
|
2008-02-12 01:02:53 +00:00
|
|
|
* This may change the number and order of copper areas in the net.
|
2009-08-23 15:22:44 +00:00
|
|
|
* @param aModifiedZonesList = a PICKED_ITEMS_LIST * where to store deleted or added areas
|
2012-07-31 13:12:51 +00:00
|
|
|
* (useful in undo commands can be NULL
|
2008-02-12 01:02:53 +00:00
|
|
|
* @param modified_area = area to test
|
2012-07-31 13:12:51 +00:00
|
|
|
* @return true if some areas modified
|
|
|
|
*/
|
|
|
|
bool OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList,
|
|
|
|
ZONE_CONTAINER* modified_area );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function CombineAllAreasInNet
|
2009-06-11 14:26:17 +00:00
|
|
|
* Checks all copper areas in net for intersections, combining them if found
|
2011-09-14 20:04:58 +00:00
|
|
|
* @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas (useful
|
|
|
|
* in undo commands can be NULL
|
2009-06-11 14:26:17 +00:00
|
|
|
* @param aNetCode = net to consider
|
2013-03-26 09:58:40 +00:00
|
|
|
* @param aUseLocalFlags : if true, don't check areas if both local flags are 0
|
|
|
|
* Sets local flag = 1 for any areas modified
|
2012-07-31 13:12:51 +00:00
|
|
|
* @return true if some areas modified
|
2008-02-12 01:02:53 +00:00
|
|
|
*/
|
2012-07-31 13:12:51 +00:00
|
|
|
bool CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList,
|
2013-03-20 14:50:12 +00:00
|
|
|
int aNetCode,
|
2013-03-26 09:58:40 +00:00
|
|
|
bool aUseLocalFlags );
|
2009-08-23 15:22:44 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function RemoveArea
|
2009-08-23 15:22:44 +00:00
|
|
|
* remove copper area from net, and put it in a deleted list (if exists)
|
2011-09-14 20:04:58 +00:00
|
|
|
* @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas (useful
|
|
|
|
* in undo commands can be NULL
|
2009-08-23 15:22:44 +00:00
|
|
|
* @param area_to_remove = area to delete or put in deleted list
|
|
|
|
*/
|
|
|
|
void RemoveArea( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_to_remove );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
2009-06-11 14:26:17 +00:00
|
|
|
* Function TestAreaIntersections
|
|
|
|
* Check for intersection of a given copper area with other areas in same net
|
|
|
|
* @param area_to_test = area to compare to all other areas in the same net
|
2008-02-12 01:02:53 +00:00
|
|
|
*/
|
|
|
|
bool TestAreaIntersections( ZONE_CONTAINER* area_to_test );
|
|
|
|
|
|
|
|
/**
|
2009-06-11 14:26:17 +00:00
|
|
|
* Function TestAreaIntersection
|
|
|
|
* Test for intersection of 2 copper areas
|
|
|
|
* area_to_test must be after area_ref in m_ZoneDescriptorList
|
|
|
|
* @param area_ref = area reference
|
|
|
|
* @param area_to_test = area to compare for intersection calculations
|
2012-08-02 13:23:53 +00:00
|
|
|
* @return : false if no intersection, true if intersection
|
2008-02-12 01:02:53 +00:00
|
|
|
*/
|
2012-08-02 13:23:53 +00:00
|
|
|
bool TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_test );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
2009-06-11 14:26:17 +00:00
|
|
|
* Function CombineAreas
|
|
|
|
* If possible, combine 2 copper areas
|
2012-07-31 13:12:51 +00:00
|
|
|
* @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas
|
|
|
|
* (useful for undo).
|
2009-11-12 15:43:38 +00:00
|
|
|
* @param area_ref = the main area (zone)
|
2009-08-23 15:22:44 +00:00
|
|
|
* @param area_to_combine = the zone that can be merged with area_ref
|
2009-06-11 14:26:17 +00:00
|
|
|
* area_ref must be BEFORE area_to_combine
|
|
|
|
* area_to_combine will be deleted, if areas are combined
|
2012-07-31 13:12:51 +00:00
|
|
|
* @return : true if area_to_combine is combined with area_ref (and therefore be deleted)
|
2008-02-12 01:02:53 +00:00
|
|
|
*/
|
2012-07-31 13:12:51 +00:00
|
|
|
bool CombineAreas( PICKED_ITEMS_LIST* aDeletedList,
|
|
|
|
ZONE_CONTAINER* area_ref,
|
|
|
|
ZONE_CONTAINER* area_to_combine );
|
2008-02-12 01:02:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Test_Drc_Areas_Outlines_To_Areas_Outlines
|
2011-08-09 03:41:20 +00:00
|
|
|
* tests area outlines for DRC:
|
|
|
|
* Tests areas inside other areas.
|
|
|
|
* Tests areas too close.
|
|
|
|
*
|
|
|
|
* @param aArea_To_Examine: area to compare with other areas, or if NULL then
|
|
|
|
* all areas are compared to all others.
|
2008-02-12 01:02:53 +00:00
|
|
|
* @param aCreate_Markers: if true create DRC markers. False: do not creates anything
|
|
|
|
* @return errors count
|
2009-06-11 14:26:17 +00:00
|
|
|
*/
|
2011-09-14 20:04:58 +00:00
|
|
|
int Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_Examine,
|
|
|
|
bool aCreate_Markers );
|
2008-11-18 18:13:55 +00:00
|
|
|
|
|
|
|
/****** function relative to ratsnest calculations: */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Test_Connection_To_Copper_Areas
|
|
|
|
* init .m_ZoneSubnet parameter in tracks and pads according to the connections to areas found
|
2009-11-12 15:43:38 +00:00
|
|
|
* @param aNetcode = netcode to analyze. if -1, analyze all nets
|
2008-11-18 18:13:55 +00:00
|
|
|
*/
|
|
|
|
void Test_Connections_To_Copper_Areas( int aNetcode = -1 );
|
2011-09-14 20:04:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetViaByPosition
|
|
|
|
* finds the first via at \a aPosition on \a aLayer.
|
|
|
|
* <p>
|
|
|
|
* This function does not use the normal hit test to locate a via which which tests
|
|
|
|
* if a position is within the via's bounding box. It tests for the actual locate
|
|
|
|
* of the via.
|
|
|
|
* </p>
|
|
|
|
* @param aPosition The wxPoint to HitTest() against.
|
2016-01-11 09:13:13 +00:00
|
|
|
* @param aLayer The layer to search. Use -1 (LAYER_ID::UNDEFINED_LAYER) for a don't care.
|
2014-04-25 06:00:04 +00:00
|
|
|
* @return VIA* A point a to the VIA object if found, else NULL.
|
2011-09-14 20:04:58 +00:00
|
|
|
*/
|
2016-01-11 09:13:13 +00:00
|
|
|
VIA* GetViaByPosition( const wxPoint& aPosition, LAYER_ID aLayer = LAYER_ID( -1 ) ) const;
|
2011-09-15 17:58:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPad
|
|
|
|
* finds a pad \a aPosition on \a aLayer.
|
|
|
|
*
|
|
|
|
* @param aPosition A wxPoint object containing the position to hit test.
|
|
|
|
* @param aLayerMask A layer or layers to mask the hit test.
|
|
|
|
* @return A pointer to a D_PAD object if found or NULL if not found.
|
|
|
|
*/
|
2014-06-30 10:00:21 +00:00
|
|
|
D_PAD* GetPad( const wxPoint& aPosition, LSET aLayerMask );
|
|
|
|
D_PAD* GetPad( const wxPoint& aPosition )
|
|
|
|
{
|
|
|
|
return GetPad( aPosition, LSET().set() );
|
|
|
|
}
|
2011-09-15 17:58:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPad
|
|
|
|
* finds a pad connected to \a aEndPoint of \a aTrace.
|
|
|
|
*
|
|
|
|
* @param aTrace A pointer to a TRACK object to hit test against.
|
|
|
|
* @param aEndPoint The end point of \a aTrace the hit test against.
|
|
|
|
* @return A pointer to a D_PAD object if found or NULL if not found.
|
|
|
|
*/
|
2014-04-25 17:13:33 +00:00
|
|
|
D_PAD* GetPad( TRACK* aTrace, ENDPOINT_T aEndPoint );
|
2011-09-15 17:58:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPadFast
|
2013-04-25 16:29:35 +00:00
|
|
|
* return pad found at \a aPosition on \a aLayerMask using the fast search method.
|
2011-09-15 17:58:35 +00:00
|
|
|
* <p>
|
|
|
|
* The fast search method only works if the pad list has already been built.
|
|
|
|
* </p>
|
|
|
|
* @param aPosition A wxPoint object containing the position to hit test.
|
2013-04-25 16:29:35 +00:00
|
|
|
* @param aLayerMask A layer or layers to mask the hit test.
|
2011-09-15 17:58:35 +00:00
|
|
|
* @return A pointer to a D_PAD object if found or NULL if not found.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
D_PAD* GetPadFast( const wxPoint& aPosition, LSET aLayerMask );
|
2011-09-15 17:58:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPad
|
2012-04-01 20:51:56 +00:00
|
|
|
* locates the pad connected at \a aPosition on \a aLayer starting at list position
|
2011-09-15 17:58:35 +00:00
|
|
|
* \a aPad
|
|
|
|
* <p>
|
|
|
|
* This function uses a fast search in this sorted pad list and it is faster than
|
|
|
|
* GetPadFast(). This list is a sorted pad list must be built before calling this
|
|
|
|
* function.
|
|
|
|
* </p>
|
2011-09-16 14:13:02 +00:00
|
|
|
* @note The normal pad list is sorted by increasing netcodes.
|
2011-10-31 13:44:13 +00:00
|
|
|
* @param aPadList = the list of pads candidates (a std::vector<D_PAD*>)
|
2011-09-15 17:58:35 +00:00
|
|
|
* @param aPosition A wxPoint object containing the position to test.
|
2011-09-16 14:13:02 +00:00
|
|
|
* @param aLayerMask A layer or layers to mask the hit test.
|
2011-10-31 13:44:13 +00:00
|
|
|
* @return a D_PAD object pointer to the connected pad.
|
2011-09-15 17:58:35 +00:00
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
D_PAD* GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, LSET aLayerMask );
|
2011-09-16 14:13:02 +00:00
|
|
|
|
2015-09-23 23:02:40 +00:00
|
|
|
/**
|
|
|
|
* Function PadDelete
|
|
|
|
* deletes a given bad from the BOARD by removing it from its module and
|
|
|
|
* from the m_NetInfo. Makes no UI calls.
|
|
|
|
* @param aPad is the pad to delete.
|
|
|
|
*/
|
|
|
|
void PadDelete( D_PAD* aPad );
|
|
|
|
|
2011-09-17 01:22:26 +00:00
|
|
|
/**
|
2011-10-31 13:44:13 +00:00
|
|
|
* Function GetSortedPadListByXthenYCoord
|
2011-09-17 01:22:26 +00:00
|
|
|
* first empties then fills the vector with all pads and sorts them by
|
2011-10-31 13:44:13 +00:00
|
|
|
* increasing x coordinate, and for increasing y coordinate for same values of x coordinates.
|
|
|
|
* The vector only holds pointers to the pads and
|
2011-09-17 01:22:26 +00:00
|
|
|
* those pointers are only references to pads which are owned by the BOARD
|
|
|
|
* through other links.
|
|
|
|
* @param aVector Where to put the pad pointers.
|
2011-12-17 21:21:03 +00:00
|
|
|
* @param aNetCode = the netcode filter:
|
|
|
|
* = -1 to build the full pad list.
|
|
|
|
* = a given netcode to build the pad list relative to the given net
|
2011-09-17 01:22:26 +00:00
|
|
|
*/
|
2011-12-17 21:21:03 +00:00
|
|
|
void GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNetCode = -1 );
|
2011-09-17 01:22:26 +00:00
|
|
|
|
2011-09-16 14:13:02 +00:00
|
|
|
/**
|
2016-07-12 19:05:54 +00:00
|
|
|
* Function GetVisibleTrack
|
|
|
|
* finds the neighboring visible segment of \a aTrace at \a aPosition that is
|
|
|
|
* on a layer in \a aLayerSet.
|
2011-09-16 14:13:02 +00:00
|
|
|
* Traces that are flagged as deleted or busy are ignored.
|
|
|
|
*
|
2016-07-12 19:05:54 +00:00
|
|
|
* @param aStartingTrace is the first TRACK to test, testing continues to end of m_Track list from
|
|
|
|
* this starting point.
|
2011-09-16 14:13:02 +00:00
|
|
|
* @param aPosition A wxPoint object containing the position to test.
|
2016-07-12 19:05:54 +00:00
|
|
|
* @param aLayerSet A set of layers; returned TRACK must be on one of these.
|
|
|
|
* May pass a full set to request any layer.
|
2011-09-16 14:13:02 +00:00
|
|
|
* @return A TRACK object pointer if found otherwise NULL.
|
|
|
|
*/
|
2016-07-12 19:05:54 +00:00
|
|
|
TRACK* GetVisibleTrack( TRACK* aStartingTrace, const wxPoint& aPosition, LSET aLayerSet ) const;
|
2011-09-16 15:54:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function MarkTrace
|
2011-09-20 13:57:40 +00:00
|
|
|
* marks a chain of trace segments, connected to \a aTrace.
|
2011-09-16 15:54:50 +00:00
|
|
|
* <p>
|
|
|
|
* Each segment is marked by setting the BUSY bit into m_Flags. Electrical
|
|
|
|
* continuity is detected by walking each segment, and finally the segments
|
|
|
|
* are rearranged into a contiguous chain within the given list.
|
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* @param aTrace The segment within a list of trace segments to test.
|
|
|
|
* @param aCount A pointer to an integer where to return the number of
|
|
|
|
* marked segments.
|
2012-12-12 11:57:17 +00:00
|
|
|
* @param aTraceLength A pointer to an double where to return the length of the
|
2011-09-16 15:54:50 +00:00
|
|
|
* trace.
|
2012-12-12 11:57:17 +00:00
|
|
|
* @param aInPackageLength A pointer to an double where to return the extra lengths inside
|
2011-09-16 15:54:50 +00:00
|
|
|
* integrated circuits from the pads connected to this track to the
|
|
|
|
* die (if any).
|
|
|
|
* @param aReorder true for reorder the interesting segments (useful for
|
|
|
|
* track edition/deletion) in this case the flag BUSY is
|
|
|
|
* set (the user is responsible of flag clearing). False
|
|
|
|
* for no reorder : useful when we want just calculate the
|
|
|
|
* track length in this case, flags are reset
|
2016-07-19 20:34:09 +00:00
|
|
|
* @return TRACK* - The first in the chain of interesting segments.
|
2011-09-16 15:54:50 +00:00
|
|
|
*/
|
2012-12-12 11:57:17 +00:00
|
|
|
TRACK* MarkTrace( TRACK* aTrace, int* aCount, double* aTraceLength,
|
|
|
|
double* aInPackageLength, bool aReorder );
|
2011-09-16 18:54:04 +00:00
|
|
|
|
2016-07-19 20:34:09 +00:00
|
|
|
/**
|
|
|
|
* Function TrackInNet
|
|
|
|
* collects all the TRACKs and VIAs that are members of a net given by aNetCode.
|
|
|
|
* Used from python.
|
|
|
|
* @param aNetCode gives the id of the net.
|
|
|
|
* @return TRACKS - which are in the net identified by @a aNetCode.
|
|
|
|
*/
|
|
|
|
TRACKS TracksInNet( int aNetCode );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function TrackInNetBetweenPoints
|
|
|
|
* collects all the TRACKs and VIAs that are members of a net given by aNetCode and that
|
|
|
|
* make up a path between two end points. The end points must be carefully chosen,
|
|
|
|
* and are typically the locations of two neighboring pads. The function fails if there
|
2016-09-20 15:59:43 +00:00
|
|
|
* is an intervening pad or a 3 way intersection at a track or via. The seeking starts
|
|
|
|
* at @a aStartPos and strives to travel to @a aGoalPos.
|
2016-07-19 20:34:09 +00:00
|
|
|
* Used from python.
|
|
|
|
* @param aStartPos must correspond to a point on the BOARD which has a TRACK end or start,
|
|
|
|
* typically the location of either a via or pad.
|
2016-09-20 15:59:43 +00:00
|
|
|
* @param aGoalPos must correspond to a point on the BOARD which has a TRACK end or start,
|
2016-07-19 20:34:09 +00:00
|
|
|
* typically the location of either a via or pad.
|
|
|
|
* @param aNetCode gives the id of the net.
|
|
|
|
* @return TRACKS - non empty if success, empty if your aStartPos or aEndPos are bad or
|
|
|
|
* the net is interrupted along the way by an intervening D_PAD or a 3 way path.
|
2016-09-20 15:59:43 +00:00
|
|
|
* @throw IO_ERROR in order to convey detailed error reason upon failure.
|
2016-07-19 20:34:09 +00:00
|
|
|
*/
|
2016-09-20 15:59:43 +00:00
|
|
|
TRACKS TracksInNetBetweenPoints( const wxPoint& aStartPos, const wxPoint& aGoalPos, int aNetCode );
|
2016-07-19 20:34:09 +00:00
|
|
|
|
2011-09-16 18:54:04 +00:00
|
|
|
/**
|
|
|
|
* Function GetFootprint
|
|
|
|
* get a footprint by its bounding rectangle at \a aPosition on \a aLayer.
|
|
|
|
* <p>
|
|
|
|
* If more than one footprint is at \a aPosition, then the closest footprint on the
|
|
|
|
* active layer is returned. The distance is calculated via manhattan distance from
|
|
|
|
* the center of the bounding rectangle to \a aPosition.
|
|
|
|
*
|
2011-09-17 01:22:26 +00:00
|
|
|
* @param aPosition A wxPoint object containing the position to test.
|
2011-09-16 18:54:04 +00:00
|
|
|
* @param aActiveLayer Layer to test.
|
|
|
|
* @param aVisibleOnly Search only the visible layers if true.
|
|
|
|
* @param aIgnoreLocked Ignore locked modules when true.
|
|
|
|
* @return MODULE* The best module or NULL if none.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
MODULE* GetFootprint( const wxPoint& aPosition, LAYER_ID aActiveLayer,
|
2011-09-16 18:54:04 +00:00
|
|
|
bool aVisibleOnly, bool aIgnoreLocked = false );
|
2011-09-17 01:22:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetLockPoint
|
|
|
|
* returns the item at the "attachment" point at the end of a trace at \a aPosition
|
|
|
|
* on \a aLayerMask.
|
|
|
|
* <p>
|
|
|
|
* This may be a PAD or another trace segment.
|
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* @param aPosition A wxPoint object containing the position to test.
|
|
|
|
* @param aLayerMask A layer or layers to mask the hit test. Use -1 to ignore
|
|
|
|
* layer mask.
|
|
|
|
* @return A pointer to a BOARD_ITEM object if found otherwise NULL.
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
BOARD_CONNECTED_ITEM* GetLockPoint( const wxPoint& aPosition, LSET aLayerMask );
|
2011-09-17 01:22:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function CreateLockPoint
|
|
|
|
* creates an intermediate point on \a aSegment and break it into two segments
|
2012-02-04 20:30:00 +00:00
|
|
|
* at \a aPosition.
|
2011-09-17 01:22:26 +00:00
|
|
|
* <p>
|
|
|
|
* The new segment starts from \a aPosition and ends at the end point of \a
|
2012-02-04 20:30:00 +00:00
|
|
|
* aSegment. The original segment now ends at \a aPosition.
|
2011-09-17 01:22:26 +00:00
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* @param aPosition A wxPoint object containing the position to test and the new
|
|
|
|
* segment start position if the return value is not NULL.
|
|
|
|
* @param aSegment The trace segment to create the lock point on.
|
|
|
|
* @param aList The pick list to add the created items to.
|
|
|
|
* @return NULL if no new point was created or a pointer to a TRACK ojbect of the
|
|
|
|
* created segment. If \a aSegment points to a via the exact value of \a
|
|
|
|
* aPosition and a pointer to the via are returned.
|
|
|
|
*/
|
|
|
|
TRACK* CreateLockPoint( wxPoint& aPosition, TRACK* aSegment, PICKED_ITEMS_LIST* aList );
|
2007-12-09 12:59:06 +00:00
|
|
|
};
|
|
|
|
|
2012-06-01 07:39:32 +00:00
|
|
|
#endif // CLASS_BOARD_H_
|