KiCad PCB EDA Suite
base_struct.h File Reference

Basic classes for most KiCad items. More...

#include <core/typeinfo.h>
#include <bitmap_types.h>
#include <view/view_item.h>

Go to the source code of this file.

Classes

class  EDA_ITEM
 Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards. More...
 

Macros

#define IS_CHANGED   (1 << 0)
 std::function passed to nested users by ref, avoids copying std::function More...
 
#define IS_LINKED   (1 << 1)
 Used in calculation to mark linked items (temporary use) More...
 
#define IN_EDIT   (1 << 2)
 Item currently edited. More...
 
#define IS_MOVED   (1 << 3)
 Item being moved. More...
 
#define IS_NEW   (1 << 4)
 New item, just created. More...
 
#define IS_RESIZED   (1 << 5)
 Item being resized. More...
 
#define IS_DRAGGED   (1 << 6)
 Item being dragged. More...
 
#define IS_DELETED   (1 << 7)
 
#define IS_WIRE_IMAGE   (1 << 8)
 Item to be drawn as wireframe while editing. More...
 
#define STARTPOINT   (1 << 9)
 
#define ENDPOINT   (1 << 10)
 
#define SELECTED   (1 << 11)
 
#define SELECTEDNODE   (1 << 12)
 flag indicating that the structure has already selected More...
 
#define STRUCT_DELETED   (1 << 13)
 flag indication structures to be erased More...
 
#define CANDIDATE   (1 << 14)
 flag indicating that the structure is connected More...
 
#define SKIP_STRUCT   (1 << 15)
 flag indicating that the structure should be ignored More...
 
#define DO_NOT_DRAW   (1 << 16)
 Used to disable draw function. More...
 
#define IS_CANCELLED   (1 << 17)
 flag set when edit dialogs are canceled when editing a More...
 
#define TRACK_LOCKED   (1 << 18)
 Pcbnew: track locked: protected from global deletion. More...
 
#define TRACK_AR   (1 << 19)
 Pcbnew: autorouted track. More...
 
#define FLAG1   (1 << 20)
 Pcbnew: flag used in local computations. More...
 
#define FLAG0   (1 << 21)
 Pcbnew: flag used in local computations. More...
 
#define BEGIN_ONPAD   (1 << 22)
 Pcbnew: flag set for track segment starting on a pad. More...
 
#define END_ONPAD   (1 << 23)
 Pcbnew: flag set for track segment ending on a pad. More...
 
#define BUSY   (1 << 24)
 Pcbnew: flag indicating that the structure has. More...
 
#define HIGHLIGHTED   (1 << 25)
 item is drawn in normal colors, when the rest is darkened More...
 
#define BRIGHTENED   (1 << 26)
 item is drawn with a bright contour More...
 
#define DP_COUPLED   (1 << 27)
 item is coupled with another item making a differential pair More...
 
#define EDA_ITEM_ALL_FLAGS   -1
 

Typedefs

typedef std::function< SEARCH_RESULT(EDA_ITEM *aItem, void *aTestData) > INSPECTOR_FUNC
 Typedef INSPECTOR is used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T objects. More...
 
typedef const INSPECTOR_FUNCINSPECTOR
 
typedef unsigned STATUS_FLAGS
 
typedef std::vector< EDA_ITEM * > EDA_ITEMS
 Define list of drawing items for screens. More...
 

Enumerations

enum  FILL_T { NO_FILL, FILLED_SHAPE, FILLED_WITH_BG_BODYCOLOR }
 Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas. More...
 
enum  SEARCH_RESULT { SEARCH_QUIT, SEARCH_CONTINUE }
 

Functions

EDA_ITEMnew_clone (const EDA_ITEM &aItem)
 Function new_clone provides cloning capabilities for all Boost pointer containers of EDA_ITEM pointers. More...
 

Variables

const wxString traceFindReplace
 Flag to enable find and replace debug tracing. More...
 

Detailed Description

Basic classes for most KiCad items.

Definition in file base_struct.h.

Macro Definition Documentation

#define BEGIN_ONPAD   (1 << 22)
#define CANDIDATE   (1 << 14)

flag indicating that the structure is connected

Definition at line 137 of file base_struct.h.

Referenced by SCH_SCREEN::GetConnection(), and SCH_SCREEN::MarkConnections().

#define DP_COUPLED   (1 << 27)

item is coupled with another item making a differential pair

(applies to segments only)

Definition at line 153 of file base_struct.h.

#define EDA_ITEM_ALL_FLAGS   -1

Definition at line 156 of file base_struct.h.

Referenced by PCB_BASE_EDIT_FRAME::PutDataInPreviousState().

#define END_ONPAD   (1 << 23)
#define FLAG0   (1 << 21)
#define FLAG1   (1 << 20)

Pcbnew: flag used in local computations.

Definition at line 144 of file base_struct.h.

#define HIGHLIGHTED   (1 << 25)

item is drawn in normal colors, when the rest is darkened

Definition at line 150 of file base_struct.h.

Referenced by EDA_ITEM::ClearHighlighted(), EDA_ITEM::IsHighlighted(), and EDA_ITEM::SetHighlighted().

#define IS_CANCELLED   (1 << 17)

flag set when edit dialogs are canceled when editing a

new object

Definition at line 140 of file base_struct.h.

Referenced by LIB_EDIT_FRAME::CreatePin(), and LIB_EDIT_FRAME::OnEditPin().

#define IS_CHANGED   (1 << 0)

std::function passed to nested users by ref, avoids copying std::function

Item was edited, and modified

Definition at line 123 of file base_struct.h.

Referenced by LIB_EDIT_FRAME::GlobalSetPins(), EDA_ITEM::IsModified(), LIB_PIN::Save(), LIB_PIN::SetConversion(), and EDA_ITEM::SetModified().

#define IS_MOVED   (1 << 3)

Item being moved.

Definition at line 126 of file base_struct.h.

Referenced by Abort_MoveOrCopyModule(), AbortMoveAndEditTarget(), PCB_EDIT_FRAME::AppendBoardFile(), LIB_CIRCLE::BeginEdit(), LIB_RECTANGLE::BeginEdit(), LIB_POLYLINE::BeginEdit(), LIB_TEXT::BeginEdit(), LIB_ARC::BeginEdit(), LIB_FIELD::BeginEdit(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), PCB_EDIT_FRAME::Block_Move(), LIB_POLYLINE::calcEdit(), LIB_RECTANGLE::calcEdit(), LIB_TEXT::calcEdit(), LIB_ARC::calcEdit(), LIB_FIELD::calcEdit(), LIB_CIRCLE::ContinueEdit(), LIB_RECTANGLE::ContinueEdit(), LIB_POLYLINE::ContinueEdit(), LIB_TEXT::ContinueEdit(), LIB_ARC::ContinueEdit(), LIB_FIELD::ContinueEdit(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_PART::Draw(), BOARD::Draw(), LIB_CIRCLE::drawGraphic(), LIB_POLYLINE::drawGraphic(), LIB_RECTANGLE::drawGraphic(), LIB_BEZIER::drawGraphic(), LIB_ARC::drawGraphic(), LIB_CIRCLE::EndEdit(), LIB_RECTANGLE::EndEdit(), LIB_POLYLINE::EndEdit(), LIB_TEXT::EndEdit(), LIB_ARC::EndEdit(), LIB_FIELD::EndEdit(), LIB_ITEM::InEditMode(), EDA_ITEM::IsMoving(), SCH_EDIT_FRAME::MoveImage(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::PlaceTarget(), SCH_EDIT_FRAME::PrepareMoveItem(), SCH_COMPONENT::SCH_COMPONENT(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), PCB_EDIT_FRAME::StartMoveModule(), PCB_BASE_FRAME::StartMovePad(), LIB_EDIT_FRAME::StartMovePin(), PCB_BASE_FRAME::StartMoveTexteModule(), and PCB_EDIT_FRAME::StartMoveTextePcb().

#define IS_NEW   (1 << 4)

New item, just created.

Definition at line 127 of file base_struct.h.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), LIB_CIRCLE::BeginEdit(), LIB_RECTANGLE::BeginEdit(), LIB_POLYLINE::BeginEdit(), LIB_TEXT::BeginEdit(), LIB_ARC::BeginEdit(), LIB_FIELD::BeginEdit(), SCH_EDIT_FRAME::BeginSegment(), LIB_CIRCLE::calcEdit(), LIB_POLYLINE::calcEdit(), LIB_RECTANGLE::calcEdit(), LIB_TEXT::calcEdit(), LIB_ARC::calcEdit(), LIB_FIELD::calcEdit(), LIB_CIRCLE::ContinueEdit(), LIB_RECTANGLE::ContinueEdit(), LIB_POLYLINE::ContinueEdit(), LIB_TEXT::ContinueEdit(), LIB_ARC::ContinueEdit(), LIB_FIELD::ContinueEdit(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), LIB_EDIT_FRAME::CreateGraphicItem(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), PCB_EDIT_FRAME::createPopupMenuForTracks(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::EditDimension(), LIB_CIRCLE::EndEdit(), LIB_RECTANGLE::EndEdit(), LIB_POLYLINE::EndEdit(), LIB_TEXT::EndEdit(), LIB_ARC::EndEdit(), LIB_FIELD::EndEdit(), SCH_EDIT_FRAME::ImportSheetPin(), LIB_ITEM::InEditMode(), EDA_ITEM::IsNew(), SCH_EDIT_FRAME::Load_Component(), PCB_BASE_FRAME::LoadModuleFromLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), and SCH_COMPONENT::SCH_COMPONENT().

#define IS_WIRE_IMAGE   (1 << 8)

Item to be drawn as wireframe while editing.

Definition at line 131 of file base_struct.h.

Referenced by EDA_ITEM::IsWireImage(), and EDA_ITEM::SetWireImage().

#define SELECTEDNODE   (1 << 12)

flag indicating that the structure has already selected

Definition at line 135 of file base_struct.h.

Referenced by SCH_SCREEN::GetConnection().

#define SKIP_STRUCT   (1 << 15)
#define STRUCT_DELETED   (1 << 13)
#define TRACK_AR   (1 << 19)

Pcbnew: autorouted track.

Definition at line 143 of file base_struct.h.

Referenced by DIALOG_GLOBAL_DELETION::AcceptPcbDelete(), TRACK::GetMsgPanelInfoBase_Common(), and OrCell_Trace().

Typedef Documentation

typedef std::vector< EDA_ITEM* > EDA_ITEMS

Define list of drawing items for screens.

The standard C++ container was chosen so the pointer can be removed from a list without it being destroyed.

Definition at line 544 of file base_struct.h.

typedef const INSPECTOR_FUNC& INSPECTOR

Definition at line 118 of file base_struct.h.

typedef std::function< SEARCH_RESULT ( EDA_ITEM* aItem, void* aTestData ) > INSPECTOR_FUNC

Typedef INSPECTOR is used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T objects.

Provide an implementation as needed to inspect EDA_ITEMs visited via EDA_ITEM::Visit() and EDA_ITEM::IterateForward().

FYI the std::function may hold a lambda, std::bind, pointer to func, or ptr to member function, per modern C++. It is used primarily for searching, but not limited to that. It can also collect or modify the scanned objects. 'Capturing' lambdas are particularly convenient because they can use context and this often means aTestData is not used.

Parameters
aItemAn EDA_ITEM to examine.
aTestDatais arbitrary data needed by the inspector to determine if the EDA_ITEM under test meets its match criteria, and is often NULL with the advent of capturing lambdas.
Returns
A SEARCH_RESULT type SEARCH_QUIT if the iterator function is to stop the scan, else SEARCH_CONTINUE;

Definition at line 93 of file base_struct.h.

typedef unsigned STATUS_FLAGS

Definition at line 158 of file base_struct.h.

Enumeration Type Documentation

enum FILL_T

Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas.

Enumerator
NO_FILL 
FILLED_SHAPE 
FILLED_WITH_BG_BODYCOLOR 

Definition at line 70 of file base_struct.h.

70  {
71  NO_FILL, // Poly, Square, Circle, Arc = option No Fill
72  FILLED_SHAPE, /* Poly, Square, Circle, Arc = option Fill
73  * with current color ("Solid shape") */
74  FILLED_WITH_BG_BODYCOLOR /* Poly, Square, Circle, Arc = option Fill
75  * with background body color, translucent
76  * (texts inside this shape can be seen)
77  * not filled in B&W mode when plotting or
78  * printing */
79 };
Enumerator
SEARCH_QUIT 
SEARCH_CONTINUE 

Definition at line 82 of file base_struct.h.

Function Documentation

EDA_ITEM* new_clone ( const EDA_ITEM aItem)
inline

Function new_clone provides cloning capabilities for all Boost pointer containers of EDA_ITEM pointers.

Parameters
aItemEDA_ITEM to clone.
Returns
Clone of aItem.

Definition at line 535 of file base_struct.h.

References EDA_ITEM::Clone().

535 { return aItem.Clone(); }
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.