KiCad PCB EDA Suite
SCH_LINE Class Reference

Segment description base class to describe items which have 2 end points (track, wire, draw line ...) More...

#include <sch_line.h>

Inheritance diagram for SCH_LINE:
SCH_ITEM EDA_ITEM KIGFX::VIEW_ITEM

Public Member Functions

 SCH_LINE (const wxPoint &pos=wxPoint(0, 0), int layer=LAYER_NOTES)
 
 SCH_LINE (const VECTOR2D &pos, int layer=LAYER_NOTES)
 
 SCH_LINE (const SCH_LINE &aLine)
 
 ~SCH_LINE ()
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
bool IsType (const KICAD_T aScanTypes[]) const override
 Function IsType Checks whether the item is one of the listed types. More...
 
bool IsEndPoint (const wxPoint &aPoint) const
 
bool IsNull () const
 
wxPoint GetStartPoint () const
 
void SetStartPoint (const wxPoint &aPosition)
 
wxPoint GetEndPoint () const
 
void SetEndPoint (const wxPoint &aPosition)
 
PLOT_DASH_TYPE GetDefaultStyle () const
 
void SetLineStyle (const PLOT_DASH_TYPE aStyle)
 
void SetLineStyle (const int aStyleId)
 
PLOT_DASH_TYPE GetLineStyle () const
 
void SetLineColor (const COLOR4D aColor)
 
void SetLineColor (const double r, const double g, const double b, const double a)
 
COLOR4D GetLineColor () const
 Returns COLOR4D::UNSPECIFIED if a custom color hasn't been set for this line. More...
 
void SetLineWidth (const int aSize)
 
bool UsesDefaultStroke () const
 Test if the SCH_LINE object uses the default stroke settings. More...
 
int GetLineSize () const
 
void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers returns the layers the item is drawn on (which may be more than its "home" layer) More...
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes. More...
 
double GetLength () const
 
void Print (RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
 Function Print Print a schematic item. More...
 
int GetPenWidth () const override
 Function GetPenSize virtual pure. More...
 
void Move (const wxPoint &aMoveVector) override
 Function Move moves the item by aMoveVector to a new position. More...
 
void MoveStart (const wxPoint &aMoveVector)
 
void MoveEnd (const wxPoint &aMoveVector)
 
void MirrorX (int aXaxis_position) override
 Function MirrorX mirrors item relative to the X axis about aXaxis_position. More...
 
void MirrorY (int aYaxis_position) override
 Function MirrorY mirrors item relative to the Y axis about aYaxis_position. More...
 
void Rotate (wxPoint aPosition) override
 Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction. More...
 
void RotateStart (wxPoint aPosition)
 
void RotateEnd (wxPoint aPosition)
 
SCH_LINEMergeOverlap (SCH_LINE *aLine)
 Check line against aLine to see if it overlaps and merge if it does. More...
 
bool IsSameQuadrant (SCH_LINE *aLine, const wxPoint &aPosition)
 Check if two lines are in the same quadrant as each other, using a reference point as the origin. More...
 
bool IsParallel (SCH_LINE *aLine)
 
void GetEndPoints (std::vector< DANGLING_END_ITEM > &aItemList) override
 Function GetEndPoints adds the schematic item end points to aItemList if the item has end points. More...
 
bool UpdateDanglingState (std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
 Function IsDanglingStateChanged tests the schematic item to aItemList to check if it's dangling state has changed. More...
 
bool IsStartDangling () const
 
bool IsEndDangling () const
 
bool IsDangling () const override
 
bool IsConnectable () const override
 Function IsConnectable returns true if the schematic item can connect to another schematic item. More...
 
void GetConnectionPoints (std::vector< wxPoint > &aPoints) const override
 Function GetConnectionPoints add all the connection points for this item to aPoints. More...
 
void GetSelectedPoints (std::vector< wxPoint > &aPoints) const
 
bool CanConnect (const SCH_ITEM *aItem) const override
 
wxString GetSelectMenuText (EDA_UNITS aUnits) const override
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
BITMAP_DEF GetMenuImage () const override
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
void GetNetListItem (NETLIST_OBJECT_LIST &aNetListItems, SCH_SHEET_PATH *aSheetPath) override
 Function GetNetListItem creates a new NETLIST_OBJECT for the schematic object and adds it to aNetListItems. More...
 
bool operator< (const SCH_ITEM &aItem) const override
 
const wxPoint GetPosition () const override
 
void SetPosition (const wxPoint &aPosition) override
 Function SetPosition set the schematic item position to aPosition. More...
 
bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const override
 Function HitTest tests if aPosition is contained within or on the bounding box of an item. More...
 
bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const override
 Function HitTest tests if aRect intersects or is contained within the bounding box of an item. More...
 
void Plot (PLOTTER *aPlotter) override
 Function Plot plots the schematic item to aPlotter. More...
 
EDA_ITEMClone () const override
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
void SwapData (SCH_ITEM *aItem) override
 Function SwapData swap the internal data structures aItem with the schematic item. More...
 
void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
bool IsGraphicLine () const
 Returns if the line is a graphic (non electrical line) More...
 
bool IsWire () const
 Returns true if the line is a wire. More...
 
SCH_ITEMDuplicate (bool doClone=false) const
 Routine to create a new copy of given item. More...
 
virtual bool IsMovableFromAnchorPoint ()
 Virtual function IsMovableFromAnchorPoint. More...
 
wxPointGetStoredPos ()
 
void SetStoredPos (wxPoint aPos)
 
SCHEMATICSchematic () const
 Searches the item hierarchy to find a SCHEMATIC. More...
 
virtual bool IsLocked () const
 Function IsLocked. More...
 
virtual void SetLocked (bool aLocked)
 Function SetLocked modifies 'lock' status for of the item. More...
 
SCH_LAYER_ID GetLayer () const
 Function GetLayer returns the layer this item is on. More...
 
void SetLayer (SCH_LAYER_ID aLayer)
 Function SetLayer sets the layer this item is on. More...
 
virtual bool Load (LINE_READER &aLine, wxString &aErrorMsg)
 Function Load reads a schematic item from aLine in a .sch file. More...
 
void ClearConnections ()
 Function ClearConnections clears all of the connection items from the list. More...
 
bool IsConnected (const wxPoint &aPoint) const
 Function IsConnected tests the item to see if it is connected to aPoint. More...
 
SCH_CONNECTIONConnection (const SCH_SHEET_PATH &aPath) const
 Retrieves the connection associated with this object in the given sheet Note: the returned value can be nullptr. More...
 
ITEM_SETConnectedItems (const SCH_SHEET_PATH &aPath)
 Retrieves the set of items connected to this item on the given sheet. More...
 
void AddConnectionTo (const SCH_SHEET_PATH &aPath, SCH_ITEM *aItem)
 Adds a connection link between this item and another. More...
 
SCH_CONNECTIONInitializeConnection (const SCH_SHEET_PATH &aPath)
 Creates a new connection object associated with this object. More...
 
virtual bool ConnectionPropagatesTo (const EDA_ITEM *aItem) const
 Returns true if this item should propagate connection info to aItem. More...
 
bool IsConnectivityDirty ()
 
void SetConnectivityDirty (bool aDirty=true)
 
FIELDS_AUTOPLACED GetFieldsAutoplaced () const
 Return whether the fields have been automatically placed. More...
 
void ClearFieldsAutoplaced ()
 Set fields automatically placed flag false. More...
 
void AutoAutoplaceFields (SCH_SCREEN *aScreen)
 Autoplace fields only if correct to do so automatically. More...
 
virtual void AutoplaceFields (SCH_SCREEN *aScreen, bool aManual)
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
KICAD_T Type () const
 Function Type() More...
 
EDA_ITEMGetParent () const
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag)
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool IsForceVisible () const
 
virtual const wxPoint GetFocusPosition () const
 Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
virtual unsigned int ViewGetLOD (int aLayer, VIEW *aView) const
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
static const char * GetLineStyleName (PLOT_DASH_TYPE aStyle)
 
static PLOT_DASH_TYPE GetLineStyleByName (const wxString &aStyleName)
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
static bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

const KIID m_Uuid
 

Static Public Attributes

static enum wxPenStyle PenStyle []
 

Protected Member Functions

bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. More...
 

Protected Attributes

SCH_LAYER_ID m_Layer
 
EDA_ITEMS m_connections
 
FIELDS_AUTOPLACED m_fieldsAutoplaced
 
wxPoint m_storedPos
 
std::unordered_map< SCH_SHEET_PATH, ITEM_SETm_connected_items
 Stores pointers to other items that are connected to this one, per sheet. More...
 
std::unordered_map< SCH_SHEET_PATH, SCH_CONNECTION * > m_connection_map
 Stores connectivity information, per sheet. More...
 
bool m_connectivity_dirty
 True if connectivity info might be out of date. More...
 
STATUS_FLAGS m_Status
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
STATUS_FLAGS m_Flags
 

Private Member Functions

bool doIsConnected (const wxPoint &aPosition) const override
 Function doIsConnected provides the object specific test to see if it is connected to aPosition. More...
 

Private Attributes

bool m_startIsDangling
 True if start point is not connected. More...
 
bool m_endIsDangling
 True if end point is not connected. More...
 
wxPoint m_start
 Line start point. More...
 
wxPoint m_end
 Line end point. More...
 
int m_size
 Line pensize. More...
 
PLOT_DASH_TYPE m_style
 Line style. More...
 
COLOR4D m_color
 Line color. More...
 

Detailed Description

Segment description base class to describe items which have 2 end points (track, wire, draw line ...)

Definition at line 38 of file sch_line.h.

Constructor & Destructor Documentation

◆ SCH_LINE() [1/3]

SCH_LINE::SCH_LINE ( const wxPoint pos = wxPoint( 0, 0 ),
int  layer = LAYER_NOTES 
)

Definition at line 67 of file sch_line.cpp.

67  :
69 {
70  m_start = pos;
71  m_end = pos;
73  m_size = 0;
75  m_color = COLOR4D::UNSPECIFIED;
76 
77  switch( layer )
78  {
79  default:
81  break;
82 
83  case LAYER_WIRE:
85  break;
86 
87  case LAYER_BUS:
89  break;
90  }
91 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
PLOT_DASH_TYPE m_style
Line style.
Definition: sch_line.h:45
bool m_endIsDangling
True if end point is not connected.
Definition: sch_line.h:41
COLOR4D m_color
Line color.
Definition: sch_line.h:46
#define NULL
bool m_startIsDangling
True if start point is not connected.
Definition: sch_line.h:40
wxPoint m_end
Line end point.
Definition: sch_line.h:43
int m_size
Line pensize.
Definition: sch_line.h:44
wxPoint m_start
Line start point.
Definition: sch_line.h:42
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType)
Definition: sch_item.cpp:47

References DEFAULT, LAYER_BUS, LAYER_NOTES, LAYER_WIRE, m_color, m_end, m_endIsDangling, SCH_ITEM::m_Layer, m_size, m_start, m_startIsDangling, and m_style.

Referenced by Clone(), and MergeOverlap().

◆ SCH_LINE() [2/3]

SCH_LINE::SCH_LINE ( const VECTOR2D pos,
int  layer = LAYER_NOTES 
)
inline

Definition at line 54 of file sch_line.h.

54  :
55  SCH_LINE( wxPoint( pos.x, pos.y ), layer )
56  {}
SCH_LINE(const wxPoint &pos=wxPoint(0, 0), int layer=LAYER_NOTES)
Definition: sch_line.cpp:67

◆ SCH_LINE() [3/3]

SCH_LINE::SCH_LINE ( const SCH_LINE aLine)

Definition at line 94 of file sch_line.cpp.

94  :
95  SCH_ITEM( aLine )
96 {
97  m_start = aLine.m_start;
98  m_end = aLine.m_end;
99  m_size = aLine.m_size;
100  m_style = aLine.m_style;
101  m_color = aLine.m_color;
104 }
PLOT_DASH_TYPE m_style
Line style.
Definition: sch_line.h:45
bool m_endIsDangling
True if end point is not connected.
Definition: sch_line.h:41
COLOR4D m_color
Line color.
Definition: sch_line.h:46
bool m_startIsDangling
True if start point is not connected.
Definition: sch_line.h:40
wxPoint m_end
Line end point.
Definition: sch_line.h:43
int m_size
Line pensize.
Definition: sch_line.h:44
wxPoint m_start
Line start point.
Definition: sch_line.h:42
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType)
Definition: sch_item.cpp:47

References m_color, m_end, m_endIsDangling, m_size, m_start, m_startIsDangling, and m_style.

◆ ~SCH_LINE()

SCH_LINE::~SCH_LINE ( )
inline

Definition at line 60 of file sch_line.h.

60 { }

Member Function Documentation

◆ AddConnectionTo()

void SCH_ITEM::AddConnectionTo ( const SCH_SHEET_PATH aPath,
SCH_ITEM aItem 
)
inherited

Adds a connection link between this item and another.

Definition at line 163 of file sch_item.cpp.

164 {
165  m_connected_items[ aSheet ].insert( aItem );
166 }
std::unordered_map< SCH_SHEET_PATH, ITEM_SET > m_connected_items
Stores pointers to other items that are connected to this one, per sheet.
Definition: sch_item.h:163

References SCH_ITEM::m_connected_items.

Referenced by SCH_TEXT::UpdateDanglingState().

◆ AutoAutoplaceFields()

void SCH_ITEM::AutoAutoplaceFields ( SCH_SCREEN aScreen)
inlineinherited

Autoplace fields only if correct to do so automatically.

Fields that have been moved by hand are not automatically placed.

Parameters
aScreenis the SCH_SCREEN associated with the current instance of the component.

Definition at line 432 of file sch_item.h.

433  {
434  if( GetFieldsAutoplaced() )
436  }
FIELDS_AUTOPLACED GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
Definition: sch_item.h:417
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
Definition: sch_item.h:438

References SCH_ITEM::AutoplaceFields(), FIELDS_AUTOPLACED_MANUAL, and SCH_ITEM::GetFieldsAutoplaced().

Referenced by SCH_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Rotate(), and SCH_EDIT_FRAME::SelectUnit().

◆ AutoplaceFields()

virtual void SCH_ITEM::AutoplaceFields ( SCH_SCREEN aScreen,
bool  aManual 
)
inlinevirtualinherited

Reimplemented in SCH_SHEET, and SCH_COMPONENT.

Definition at line 438 of file sch_item.h.

438 { }

Referenced by SCH_ITEM::AutoAutoplaceFields().

◆ CanConnect()

bool SCH_LINE::CanConnect ( const SCH_ITEM aItem) const
overridevirtual

Reimplemented from SCH_ITEM.

Definition at line 568 of file sch_line.cpp.

569 {
570  switch( aItem->Type() )
571  {
572  case SCH_JUNCTION_T:
573  case SCH_NO_CONNECT_T:
574  case SCH_LABEL_T:
575  case SCH_GLOBAL_LABEL_T:
576  case SCH_HIER_LABEL_T:
578  case SCH_COMPONENT_T:
579  case SCH_SHEET_T:
580  case SCH_SHEET_PIN_T:
581  return true;
582 
583  default:
584  return aItem->GetLayer() == m_Layer;
585  }
586 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

References SCH_ITEM::GetLayer(), SCH_ITEM::m_Layer, SCH_BUS_WIRE_ENTRY_T, SCH_COMPONENT_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_T, SCH_NO_CONNECT_T, SCH_SHEET_PIN_T, SCH_SHEET_T, and EDA_ITEM::Type().

◆ ClassOf()

static bool SCH_LINE::ClassOf ( const EDA_ITEM aItem)
inlinestatic

Definition at line 62 of file sch_line.h.

63  {
64  return aItem && SCH_LINE_T == aItem->Type();
65  }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

References SCH_LINE_T, and EDA_ITEM::Type().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearConnections()

void SCH_ITEM::ClearConnections ( )
inlineinherited

Function ClearConnections clears all of the connection items from the list.

The vector release method is used to prevent the item pointers from being deleted. Do not use the vector erase method on the connection list.

Definition at line 371 of file sch_item.h.

371 { m_connections.clear(); }
EDA_ITEMS m_connections
Definition: sch_item.h:157

References SCH_ITEM::m_connections.

◆ ClearEditFlags()

◆ ClearFieldsAutoplaced()

void SCH_ITEM::ClearFieldsAutoplaced ( )
inlineinherited

Set fields automatically placed flag false.

Definition at line 422 of file sch_item.h.

FIELDS_AUTOPLACED m_fieldsAutoplaced
Definition: sch_item.h:158

References FIELDS_AUTOPLACED_NO, and SCH_ITEM::m_fieldsAutoplaced.

Referenced by SCH_MOVE_TOOL::moveItem(), DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow(), and DIALOG_SCH_EDIT_ONE_FIELD::UpdateField().

◆ ClearFlags()

void EDA_ITEM::ClearFlags ( STATUS_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 240 of file base_struct.h.

240 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References EDA_ITEM::m_Flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_COMPONENT::ClearAllHighlightFlags(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearHighlighted(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), KIGFX::SCH_VIEW::HighlightItem(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceModule(), LIB_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::RollbackPartFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearHighlighted()

void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 218 of file base_struct.h.

218 { ClearFlags( HIGHLIGHTED ); }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:139
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:240

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 252 of file base_struct.h.

253  {
255  DO_NOT_DRAW | FLAG0 | FLAG1 | BUSY );
256  }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
#define FLAG1
Pcbnew: flag used in local computations.
Definition: base_struct.h:133
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: base_struct.h:125
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:128
#define BUSY
Pcbnew: flag indicating that the structure has.
Definition: base_struct.h:137
#define CANDIDATE
flag indicating that the structure is connected
Definition: base_struct.h:127
#define FLAG0
Pcbnew: flag used in local computations.
Definition: base_struct.h:134
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:123
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:240
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:129
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:122

References BUSY, CANDIDATE, EDA_ITEM::ClearFlags(), DO_NOT_DRAW, ENDPOINT, FLAG0, FLAG1, IS_LINKED, SKIP_STRUCT, STARTPOINT, and TEMP_SELECTED.

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 153 of file view_item.h.

154  {
156  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:161
#define NULL

References KIGFX::VIEW_ITEM::m_viewPrivData, and NULL.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Clone()

EDA_ITEM * SCH_LINE::Clone ( ) const
overridevirtual

Function Clone creates a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

Reimplemented from EDA_ITEM.

Definition at line 107 of file sch_line.cpp.

108 {
109  return new SCH_LINE( *this );
110 }
SCH_LINE(const wxPoint &pos=wxPoint(0, 0), int layer=LAYER_NOTES)
Definition: sch_line.cpp:67

References SCH_LINE().

◆ ConnectedItems()

ITEM_SET & SCH_ITEM::ConnectedItems ( const SCH_SHEET_PATH aPath)
inherited

Retrieves the set of items connected to this item on the given sheet.

Definition at line 157 of file sch_item.cpp.

158 {
159  return m_connected_items[ aSheet ];
160 }
std::unordered_map< SCH_SHEET_PATH, ITEM_SET > m_connected_items
Stores pointers to other items that are connected to this one, per sheet.
Definition: sch_item.h:163

References SCH_ITEM::m_connected_items.

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), CONNECTION_GRAPH::buildConnectionGraph(), and CONNECTION_GRAPH::updateItemConnectivity().

◆ Connection()

◆ ConnectionPropagatesTo()

virtual bool SCH_ITEM::ConnectionPropagatesTo ( const EDA_ITEM aItem) const
inlinevirtualinherited

Returns true if this item should propagate connection info to aItem.

Reimplemented in SCH_BUS_WIRE_ENTRY.

Definition at line 408 of file sch_item.h.

408 { return true; }

Referenced by CONNECTION_GRAPH::updateItemConnectivity().

◆ doIsConnected()

bool SCH_LINE::doIsConnected ( const wxPoint aPosition) const
overrideprivatevirtual

Function doIsConnected provides the object specific test to see if it is connected to aPosition.

Note
Override this function if the derived object can be connect to another object such as a wire, bus, or junction. Do not override this function for objects that cannot have connections. The default will always return false. This functions is call through the public function IsConnected() which performs tests common to all schematic items before calling the item specific connection testing.
Parameters
aPositionA reference to a wxPoint object containing the test position.
Returns
True if connection to aPosition exists.

Reimplemented from SCH_ITEM.

Definition at line 740 of file sch_line.cpp.

741 {
742  if( m_Layer != LAYER_WIRE && m_Layer != LAYER_BUS )
743  return false;
744 
745  return IsEndPoint( aPosition );
746 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
bool IsEndPoint(const wxPoint &aPoint) const
Definition: sch_line.h:90

References IsEndPoint(), LAYER_BUS, LAYER_WIRE, and SCH_ITEM::m_Layer.

◆ Duplicate()

SCH_ITEM * SCH_ITEM::Duplicate ( bool  doClone = false) const
inherited

Routine to create a new copy of given item.

The new object is not put in draw list (not linked).

Parameters
doClone(default = false) indicates unique values (such as timestamp and sheet name) should be duplicated. Use only for undo/redo operations.

Definition at line 78 of file sch_item.cpp.

79 {
80  SCH_ITEM* newItem = (SCH_ITEM*) Clone();
81 
82  if( !doClone )
83  const_cast<KIID&>( newItem->m_Uuid ) = KIID();
84 
85  newItem->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
86 
87  if( newItem->Type() == SCH_COMPONENT_T )
88  {
89  SCH_COMPONENT* component = (SCH_COMPONENT*) newItem;
90 
91  for( SCH_PIN* pin : component->GetSchPins() )
93 
94  for( SCH_FIELD& field : component->GetFields() )
95  field.ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
96  }
97 
98  if( newItem->Type() == SCH_SHEET_T )
99  {
100  SCH_SHEET* sheet = (SCH_SHEET*) newItem;
101 
102  for( SCH_FIELD& field : sheet->GetFields() )
104 
105  for( SCH_SHEET_PIN* pin : sheet->GetPins() )
106  pin->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
107  }
108 
109  return newItem;
110 }
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populates a std::vector with SCH_FIELDs.
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:268
#define SELECTED
Definition: base_struct.h:124
Definition: common.h:68
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:140
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:84
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:216
const KIID m_Uuid
Definition: base_struct.h:166
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:362
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:139
Schematic symbol object.
Definition: sch_component.h:88
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:240
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:151
SCH_PIN_PTRS GetSchPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieves a list of the SCH_PINs for the given sheet path.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

References BRIGHTENED, EDA_ITEM::ClearFlags(), EDA_ITEM::Clone(), SCH_SHEET::GetFields(), SCH_COMPONENT::GetFields(), SCH_SHEET::GetPins(), SCH_COMPONENT::GetSchPins(), HIGHLIGHTED, EDA_ITEM::m_Uuid, SCH_COMPONENT_T, SCH_SHEET_T, SELECTED, and EDA_ITEM::Type().

Referenced by SCH_EDIT_TOOL::Duplicate(), SCH_EAGLE_PLUGIN::loadSchematic(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_EDIT_TOOL::RepeatDrawItem(), and SCH_EDIT_FRAME::SaveCopyInUndoList().

◆ GetBoundingBox()

const EDA_RECT SCH_LINE::GetBoundingBox ( ) const
overridevirtual

Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.

This box should be an enclosing perimeter for visible components of this object, and the units should be in the pcb or schematic coordinate system. It is OK to overestimate the size by a few counts.

Reimplemented from EDA_ITEM.

Definition at line 205 of file sch_line.cpp.

206 {
207  int width = m_size / 2;
208  int extra = m_size & 0x1;
209 
210  int xmin = std::min( m_start.x, m_end.x ) - width;
211  int ymin = std::min( m_start.y, m_end.y ) - width;
212 
213  int xmax = std::max( m_start.x, m_end.x ) + width + extra;
214  int ymax = std::max( m_start.y, m_end.y ) + width + extra;
215 
216  EDA_RECT ret( wxPoint( xmin, ymin ), wxSize( xmax - xmin, ymax - ymin ) );
217 
218  return ret;
219 }
wxPoint m_end
Line end point.
Definition: sch_line.h:43
int m_size
Line pensize.
Definition: sch_line.h:44
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, m_size, m_start, wxPoint::x, and wxPoint::y.

◆ GetClass()

wxString SCH_LINE::GetClass ( ) const
inlineoverridevirtual

Function GetClass returns the class name.

Returns
wxString

Reimplemented from SCH_ITEM.

Definition at line 67 of file sch_line.h.

68  {
69  return wxT( "SCH_LINE" );
70  }

◆ GetConnectionPoints()

void SCH_LINE::GetConnectionPoints ( std::vector< wxPoint > &  aPoints) const
overridevirtual

Function GetConnectionPoints add all the connection points for this item to aPoints.

Not all schematic items have connection points so the default method does nothing.

Parameters
aPointsList of connection points to add to.

Reimplemented from SCH_ITEM.

Definition at line 589 of file sch_line.cpp.

590 {
591  aPoints.push_back( m_start );
592  aPoints.push_back( m_end );
593 }
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, and m_start.

◆ GetDefaultStyle()

PLOT_DASH_TYPE SCH_LINE::GetDefaultStyle ( ) const

Definition at line 255 of file sch_line.cpp.

256 {
257  if( IsGraphicLine() )
258  return PLOT_DASH_TYPE::DASH;
259 
260  return PLOT_DASH_TYPE::SOLID;
261 }
bool IsGraphicLine() const
Returns if the line is a graphic (non electrical line)
Definition: sch_line.cpp:817

References DASH, IsGraphicLine(), and SOLID.

Referenced by GetLineStyle(), SCH_LEGACY_PLUGIN::saveLine(), SetLineStyle(), and UsesDefaultStroke().

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 244 of file base_struct.h.

245  {
246  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
248 
249  return m_Flags & mask;
250  }
#define IS_NEW
New item, just created.
Definition: base_struct.h:117
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:119
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Definition: base_struct.h:180
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:118
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: base_struct.h:130
#define IS_MOVED
Item being moved.
Definition: base_struct.h:116

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, IS_WIRE_IMAGE, EDA_ITEM::m_Flags, and STRUCT_DELETED.

Referenced by SCH_EDIT_TOOL::ChangeShape(), SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_COMPONENT::GetMsgPanelInfo(), LIB_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_EDIT_PIN::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), and SCH_EDIT_FRAME::TrimWire().

◆ GetEndPoint()

◆ GetEndPoints()

void SCH_LINE::GetEndPoints ( std::vector< DANGLING_END_ITEM > &  aItemList)
overridevirtual

Function GetEndPoints adds the schematic item end points to aItemList if the item has end points.

The default version doesn't do anything since many of the schematic object cannot be tested for dangling ends. If you add a new schematic item that can have a dangling end ( no connect ), override this method to provide the correct end points.

Parameters
aItemList- List of DANGLING_END_ITEMS to add to.

Reimplemented from SCH_ITEM.

Definition at line 501 of file sch_line.cpp.

502 {
503  if( IsGraphicLine() )
504  return;
505 
506  if( ( GetLayer() == LAYER_BUS ) || ( GetLayer() == LAYER_WIRE ) )
507  {
509  m_start );
510  aItemList.push_back( item );
511 
513  m_end );
514  aItemList.push_back( item1 );
515  }
516 }
bool IsGraphicLine() const
Returns if the line is a graphic (non electrical line)
Definition: sch_line.cpp:817
wxPoint m_end
Line end point.
Definition: sch_line.h:43
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241
DANGLING_END_ITEM is a helper class used to store the state of schematic items that can be connected ...
Definition: sch_item.h:80
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References BUS_END_END, BUS_START_END, SCH_ITEM::GetLayer(), IsGraphicLine(), LAYER_BUS, LAYER_WIRE, m_end, m_start, WIRE_END_END, and WIRE_START_END.

◆ GetFieldsAutoplaced()

FIELDS_AUTOPLACED SCH_ITEM::GetFieldsAutoplaced ( ) const
inlineinherited

Return whether the fields have been automatically placed.

Definition at line 417 of file sch_item.h.

417 { return m_fieldsAutoplaced; }
FIELDS_AUTOPLACED m_fieldsAutoplaced
Definition: sch_item.h:158

References SCH_ITEM::m_fieldsAutoplaced.

Referenced by SCH_ITEM::AutoAutoplaceFields(), and EE_POINT_EDITOR::updateItem().

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in TRACK.

Definition at line 351 of file base_struct.h.

351 { return GetPosition(); }
virtual const wxPoint GetPosition() const
Definition: base_struct.h:344

References EDA_ITEM::GetPosition().

Referenced by PCB_BASE_FRAME::FocusOnItem(), and SCH_EDIT_FRAME::FocusOnItem().

◆ GetLayer()

◆ GetLength()

double SCH_LINE::GetLength ( ) const
Returns
The length of the line segment.

Definition at line 222 of file sch_line.cpp.

223 {
224  return GetLineLength( m_start, m_end );
225 }
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:206
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References GetLineLength(), m_end, and m_start.

◆ GetLineColor()

COLOR4D SCH_LINE::GetLineColor ( ) const

Returns COLOR4D::UNSPECIFIED if a custom color hasn't been set for this line.

Definition at line 249 of file sch_line.cpp.

250 {
251  return m_color;
252 }
COLOR4D m_color
Line color.
Definition: sch_line.h:46

References m_color.

Referenced by SCH_SEXPR_PLUGIN::saveLine(), SCH_LEGACY_PLUGIN::saveLine(), and SCH_EDIT_FRAME::SchematicCleanUp().

◆ GetLineSize()

int SCH_LINE::GetLineSize ( ) const
inline

Definition at line 135 of file sch_line.h.

135 { return m_size; }
int m_size
Line pensize.
Definition: sch_line.h:44

References m_size.

Referenced by KIGFX::SCH_PAINTER::getLineWidth(), SCH_SEXPR_PLUGIN::saveLine(), SCH_LEGACY_PLUGIN::saveLine(), and SCH_EDIT_FRAME::SchematicCleanUp().

◆ GetLineStyle()

PLOT_DASH_TYPE SCH_LINE::GetLineStyle ( ) const

Definition at line 279 of file sch_line.cpp.

280 {
282  return m_style;
283 
284  return GetDefaultStyle();
285 }
PLOT_DASH_TYPE m_style
Line style.
Definition: sch_line.h:45
PLOT_DASH_TYPE GetDefaultStyle() const
Definition: sch_line.cpp:255

References DEFAULT, GetDefaultStyle(), and m_style.

Referenced by KIGFX::SCH_PAINTER::draw(), Plot(), Print(), SCH_SEXPR_PLUGIN::saveLine(), SCH_LEGACY_PLUGIN::saveLine(), and SCH_EDIT_FRAME::SchematicCleanUp().

◆ GetLineStyleByName()

PLOT_DASH_TYPE SCH_LINE::GetLineStyleByName ( const wxString &  aStyleName)
static
Returns
the style id from the style name (mainly to read style from .sch file

Definition at line 134 of file sch_line.cpp.

135 {
136  PLOT_DASH_TYPE id = PLOT_DASH_TYPE::DEFAULT; // Default style id
137 
138  //find the name by value
139  auto resultIt = std::find_if( lineStyleNames.begin(), lineStyleNames.end(),
140  [aStyleName]( const auto& it ) { return it.second == aStyleName; } );
141 
142  if( resultIt != lineStyleNames.end() )
143  id = resultIt->first;
144 
145  return id;
146 }
const std::map< PLOT_DASH_TYPE, const char * > lineStyleNames
Definition: sch_line.cpp:116
PLOT_DASH_TYPE
Enum for choosing dashed line type.
Definition: plotter.h:87

References DEFAULT, and lineStyleNames.

Referenced by SCH_LEGACY_PLUGIN::loadWire().

◆ GetLineStyleName()

const char * SCH_LINE::GetLineStyleName ( PLOT_DASH_TYPE  aStyle)
static
Returns
the style name from the style id (mainly to write it in .sch file

Definition at line 124 of file sch_line.cpp.

125 {
126  auto resultIt = lineStyleNames.find( aStyle );
127 
128  //legacy behavior is to default to dash if there is no name
129  return resultIt == lineStyleNames.end() ? lineStyleNames.find( PLOT_DASH_TYPE::DASH )->second :
130  resultIt->second;
131 }
const std::map< PLOT_DASH_TYPE, const char * > lineStyleNames
Definition: sch_line.cpp:116

References DASH, and lineStyleNames.

Referenced by SCH_LEGACY_PLUGIN::saveLine().

◆ GetMenuImage()

BITMAP_DEF SCH_LINE::GetMenuImage ( ) const
overridevirtual

Function GetMenuImage returns a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented from EDA_ITEM.

Definition at line 632 of file sch_line.cpp.

633 {
634  if( m_Layer == LAYER_NOTES )
635  return add_dashed_line_xpm;
636  else if( m_Layer == LAYER_WIRE )
637  return add_line_xpm;
638 
639  return add_bus_xpm;
640 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
const BITMAP_OPAQUE add_dashed_line_xpm[1]
const BITMAP_OPAQUE add_line_xpm[1]
Definition: add_line.cpp:30
const BITMAP_OPAQUE add_bus_xpm[1]
Definition: add_bus.cpp:30

References add_bus_xpm, add_dashed_line_xpm, add_line_xpm, LAYER_NOTES, LAYER_WIRE, and SCH_ITEM::m_Layer.

◆ GetMsgPanelInfo()

void SCH_LINE::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Parameters
aListis the list to populate.

Reimplemented from EDA_ITEM.

Definition at line 785 of file sch_line.cpp.

786 {
787  wxString msg;
788 
789  switch( GetLayer() )
790  {
791  case LAYER_WIRE: msg = _( "Net Wire" ); break;
792  case LAYER_BUS: msg = _( "Bus Wire" ); break;
793  default: msg = _( "Graphical" ); return;
794  }
795 
796  aList.push_back( MSG_PANEL_ITEM( _( "Line Type" ), msg, DARKCYAN ) );
797 
798  SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( aFrame );
799 
800  if( !frame )
801  return;
802 
803  if( auto conn = Connection( frame->GetCurrentSheet() ) )
804  {
805 #if defined(DEBUG)
806  conn->AppendDebugInfoToMsgPanel( aList );
807 
808  msg.Printf( "%zu", m_connected_items.size() );
809  aList.push_back( MSG_PANEL_ITEM( _( "Connections" ), msg, BROWN ) );
810 #else
811  conn->AppendInfoToMsgPanel( aList );
812 #endif
813  }
814 }
std::unordered_map< SCH_SHEET_PATH, ITEM_SET > m_connected_items
Stores pointers to other items that are connected to this one, per sheet.
Definition: sch_item.h:163
Schematic editor (Eeschema) main window.
SCH_CONNECTION * Connection(const SCH_SHEET_PATH &aPath) const
Retrieves the connection associated with this object in the given sheet Note: the returned value can ...
Definition: sch_item.cpp:147
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241
#define _(s)
Definition: 3d_actions.cpp:33
SCH_SHEET_PATH & GetCurrentSheet() const
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
Definition: colors.h:62

References _, BROWN, SCH_ITEM::Connection(), DARKCYAN, SCH_EDIT_FRAME::GetCurrentSheet(), SCH_ITEM::GetLayer(), LAYER_BUS, LAYER_WIRE, and SCH_ITEM::m_connected_items.

◆ GetNetListItem()

void SCH_LINE::GetNetListItem ( NETLIST_OBJECT_LIST aNetListItems,
SCH_SHEET_PATH aSheetPath 
)
overridevirtual

Function GetNetListItem creates a new NETLIST_OBJECT for the schematic object and adds it to aNetListItems.

Not all schematic objects have net list items associated with them. This method only needs to be overridden for those schematic objects that have net list objects associated with them.

Reimplemented from SCH_ITEM.

Definition at line 643 of file sch_line.cpp.

645 {
646  // Net list item not required for graphic lines.
647  if( IsGraphicLine() )
648  return;
649 
650  NETLIST_OBJECT* item = new NETLIST_OBJECT();
651  item->m_SheetPath = *aSheetPath;
652  item->m_SheetPathInclude = *aSheetPath;
653  item->m_Comp = (SCH_ITEM*) this;
654  item->m_Start = m_start;
655  item->m_End = m_end;
656 
657  if( GetLayer() == LAYER_BUS )
658  {
659  item->m_Type = NETLIST_ITEM::BUS;
660  }
661  else /* WIRE */
662  {
664  }
665 
666  aNetListItems.push_back( item );
667 }
bool IsGraphicLine() const
Returns if the line is a graphic (non electrical line)
Definition: sch_line.cpp:817
SCH_SHEET_PATH m_SheetPathInclude
SCH_SHEET_PATH m_SheetPath
EDA_ITEM * m_Comp
wxPoint m_end
Line end point.
Definition: sch_line.h:43
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241
NETLIST_ITEM m_Type
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:151
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References BUS, SCH_ITEM::GetLayer(), IsGraphicLine(), LAYER_BUS, NETLIST_OBJECT::m_Comp, m_end, NETLIST_OBJECT::m_End, NETLIST_OBJECT::m_SheetPath, NETLIST_OBJECT::m_SheetPathInclude, m_start, NETLIST_OBJECT::m_Start, NETLIST_OBJECT::m_Type, and SEGMENT.

◆ GetParent()

◆ GetPenWidth()

int SCH_LINE::GetPenWidth ( ) const
overridevirtual

Function GetPenSize virtual pure.

Returns
the size of the "pen" that be used to draw or plot this item

Reimplemented from SCH_ITEM.

Definition at line 294 of file sch_line.cpp.

295 {
296  if( m_size == 0 && Schematic() )
297  return std::max( Schematic()->Settings().m_DefaultLineWidth, 1 );
298 
299  return std::max( m_size, 1 );
300 }
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:113
int m_size
Line pensize.
Definition: sch_line.h:44

References m_size, and SCH_ITEM::Schematic().

Referenced by HitTest(), Plot(), and Print().

◆ GetPosition()

const wxPoint SCH_LINE::GetPosition ( ) const
inlineoverridevirtual

Reimplemented from EDA_ITEM.

Definition at line 209 of file sch_line.h.

209 { return m_start; }
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_start.

Referenced by EE_POINT_EDITOR::updateItem().

◆ GetSelectedPoints()

void SCH_LINE::GetSelectedPoints ( std::vector< wxPoint > &  aPoints) const

Definition at line 596 of file sch_line.cpp.

597 {
598  if( m_Flags & STARTPOINT )
599  aPoints.push_back( m_start );
600 
601  if( m_Flags & ENDPOINT )
602  aPoints.push_back( m_end );
603 }
wxPoint m_end
Line end point.
Definition: sch_line.h:43
STATUS_FLAGS m_Flags
Definition: base_struct.h:180
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:123
wxPoint m_start
Line start point.
Definition: sch_line.h:42
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:122

References ENDPOINT, m_end, EDA_ITEM::m_Flags, m_start, and STARTPOINT.

◆ GetSelectMenuText()

wxString SCH_LINE::GetSelectMenuText ( EDA_UNITS  aUnits) const
overridevirtual

Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position.

The default version of this function raises an assertion in the debug mode and returns a string to indicate that it was not overridden to provide the object specific text.

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 606 of file sch_line.cpp.

607 {
608  wxString txtfmt, orient;
609 
610  if( m_start.x == m_end.x )
611  orient = _( "Vertical" );
612  else if( m_start.y == m_end.y )
613  orient = _( "Horizontal" );
614 
615  switch( m_Layer )
616  {
617  case LAYER_NOTES: txtfmt = _( "%s Graphic Line from (%s, %s) to (%s, %s)" ); break;
618  case LAYER_WIRE: txtfmt = _( "%s Wire from (%s, %s) to (%s, %s)" ); break;
619  case LAYER_BUS: txtfmt = _( "%s Bus from (%s, %s) to (%s, %s)" ); break;
620  default: txtfmt = _( "%s Line on Unknown Layer from (%s, %s) to (%s, %s)" ); break;
621  }
622 
623  return wxString::Format( txtfmt,
624  orient,
625  MessageTextFromValue( aUnits, m_start.x ),
626  MessageTextFromValue( aUnits, m_start.y ),
627  MessageTextFromValue( aUnits, m_end.x ),
628  MessageTextFromValue( aUnits, m_end.y ) );
629 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:124
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define _(s)
Definition: 3d_actions.cpp:33
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References _, Format(), LAYER_BUS, LAYER_NOTES, LAYER_WIRE, m_end, SCH_ITEM::m_Layer, m_start, MessageTextFromValue(), wxPoint::x, and wxPoint::y.

◆ GetStartPoint()

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 223 of file base_struct.h.

224  {
225  return m_Status & type;
226  }
STATUS_FLAGS m_Status
Definition: base_struct.h:177

References EDA_ITEM::m_Status.

Referenced by SELECTION_TOOL::expandConnection(), TRACK::GetMsgPanelInfoBase_Common(), and TRACK::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 236 of file base_struct.h.

236 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:177

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

◆ GetStoredPos()

wxPoint& SCH_ITEM::GetStoredPos ( )
inlineinherited

Definition at line 209 of file sch_item.h.

209 { return m_storedPos; }
wxPoint m_storedPos
Definition: sch_item.h:159

References SCH_ITEM::m_storedPos.

Referenced by SCH_MOVE_TOOL::moveItem().

◆ HasFlag()

◆ HitTest() [1/2]

bool SCH_LINE::HitTest ( const wxPoint aPosition,
int  aAccuracy = 0 
) const
overridevirtual

Function HitTest tests if aPosition is contained within or on the bounding box of an item.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
aAccuracyIncrease the item bounding box by this amount.
Returns
True if aPosition is within the item bounding box.

Reimplemented from EDA_ITEM.

Definition at line 693 of file sch_line.cpp.

694 {
695  // Performance enhancement for connection-building
696  if( aPosition == m_start || aPosition == m_end )
697  return true;
698 
699  // Insure minimum accuracy
700  if( aAccuracy == 0 )
701  aAccuracy = ( GetPenWidth() / 2 ) + 4;
702 
703  return TestSegmentHit( aPosition, m_start, m_end, aAccuracy );
704 }
bool TestSegmentHit(const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
Definition: trigo.cpp:129
int GetPenWidth() const override
Function GetPenSize virtual pure.
Definition: sch_line.cpp:294
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References GetPenWidth(), m_end, m_start, and TestSegmentHit().

Referenced by SCH_MOVE_TOOL::getConnectedDragItems().

◆ HitTest() [2/2]

bool SCH_LINE::HitTest ( const EDA_RECT aRect,
bool  aContained,
int  aAccuracy = 0 
) const
overridevirtual

Function HitTest tests if aRect intersects or is contained within the bounding box of an item.

Parameters
aRectA reference to a EDA_RECT object containing the rectangle to test.
aContainedSet to true to test for containment instead of an intersection.
aAccuracyIncrease aRect by this amount.
Returns
True if aRect contains or intersects the item bounding box.

Reimplemented from EDA_ITEM.

Definition at line 707 of file sch_line.cpp.

708 {
709  if( m_Flags & ( STRUCT_DELETED | SKIP_STRUCT ) )
710  return false;
711 
712  EDA_RECT rect = aRect;
713 
714  if ( aAccuracy )
715  rect.Inflate( aAccuracy );
716 
717  if( aContained )
718  return rect.Contains( m_start ) && rect.Contains( m_end );
719 
720  return rect.Intersects( m_start, m_end );
721 }
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:128
bool Contains(const wxPoint &aPoint) const
Function Contains.
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
wxPoint m_end
Line end point.
Definition: sch_line.h:43
STATUS_FLAGS m_Flags
Definition: base_struct.h:180
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
wxPoint m_start
Line start point.
Definition: sch_line.h:42
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References EDA_RECT::Contains(), EDA_RECT::Inflate(), EDA_RECT::Intersects(), m_end, EDA_ITEM::m_Flags, m_start, SKIP_STRUCT, and STRUCT_DELETED.

◆ InitializeConnection()

SCH_CONNECTION * SCH_ITEM::InitializeConnection ( const SCH_SHEET_PATH aPath)
inherited

Creates a new connection object associated with this object.

Parameters
aPathis the sheet path to initialize

Definition at line 169 of file sch_item.cpp.

170 {
171  if( Connection( aSheet ) )
172  {
173  Connection( aSheet )->Reset();
174  Connection( aSheet )->SetSheet( aSheet );
175  return Connection( aSheet );
176  }
177 
178  auto connection = new SCH_CONNECTION( this );
179  connection->SetSheet( aSheet );
180  m_connection_map.insert( std::make_pair( aSheet, connection ) );
181  return connection;
182 }
void SetSheet(SCH_SHEET_PATH aSheet)
void Reset()
Clears connectivity information.
std::unordered_map< SCH_SHEET_PATH, SCH_CONNECTION * > m_connection_map
Stores connectivity information, per sheet.
Definition: sch_item.h:166
SCH_CONNECTION * Connection(const SCH_SHEET_PATH &aPath) const
Retrieves the connection associated with this object in the given sheet Note: the returned value can ...
Definition: sch_item.cpp:147
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).

References SCH_ITEM::Connection(), SCH_ITEM::m_connection_map, SCH_CONNECTION::Reset(), and SCH_CONNECTION::SetSheet().

Referenced by CONNECTION_GRAPH::buildConnectionGraph().

◆ IsBrightened()

bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

◆ IsConnectable()

bool SCH_LINE::IsConnectable ( ) const
overridevirtual

Function IsConnectable returns true if the schematic item can connect to another schematic item.

Reimplemented from SCH_ITEM.

Definition at line 559 of file sch_line.cpp.

560 {
561  if( m_Layer == LAYER_WIRE || m_Layer == LAYER_BUS )
562  return true;
563 
564  return false;
565 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156

References LAYER_BUS, LAYER_WIRE, and SCH_ITEM::m_Layer.

◆ IsConnected()

bool SCH_ITEM::IsConnected ( const wxPoint aPoint) const
inherited

Function IsConnected tests the item to see if it is connected to aPoint.

Parameters
aPointA reference to a wxPoint object containing the coordinates to test.
Returns
True if connection to aPoint exists.

Definition at line 138 of file sch_item.cpp.

139 {
140  if( ( m_Flags & STRUCT_DELETED ) || ( m_Flags & SKIP_STRUCT ) )
141  return false;
142 
143  return doIsConnected( aPosition );
144 }
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:128
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
STATUS_FLAGS m_Flags
Definition: base_struct.h:180
virtual bool doIsConnected(const wxPoint &aPosition) const
Function doIsConnected provides the object specific test to see if it is connected to aPosition.
Definition: sch_item.h:486

References SCH_ITEM::doIsConnected(), EDA_ITEM::m_Flags, SKIP_STRUCT, and STRUCT_DELETED.

Referenced by SCH_SCREEN::IsTerminalPoint().

◆ IsConnectivityDirty()

bool SCH_ITEM::IsConnectivityDirty ( )
inlineinherited

Definition at line 410 of file sch_item.h.

410 { return m_connectivity_dirty; }
bool m_connectivity_dirty
True if connectivity info might be out of date.
Definition: sch_item.h:169

References SCH_ITEM::m_connectivity_dirty.

◆ IsDangling()

bool SCH_LINE::IsDangling ( ) const
inlineoverridevirtual

Reimplemented from SCH_ITEM.

Definition at line 191 of file sch_line.h.

191 { return m_startIsDangling || m_endIsDangling; }
bool m_endIsDangling
True if end point is not connected.
Definition: sch_line.h:41
bool m_startIsDangling
True if start point is not connected.
Definition: sch_line.h:40

References m_endIsDangling, and m_startIsDangling.

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 205 of file base_struct.h.

205 { return m_Flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:119
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References IS_DRAGGED, and EDA_ITEM::m_Flags.

Referenced by DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), and KIGFX::SCH_PAINTER::setDeviceColors().

◆ IsEndDangling()

bool SCH_LINE::IsEndDangling ( ) const
inline

Definition at line 190 of file sch_line.h.

190 { return m_endIsDangling; }
bool m_endIsDangling
True if end point is not connected.
Definition: sch_line.h:41

References m_endIsDangling.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ IsEndPoint()

bool SCH_LINE::IsEndPoint ( const wxPoint aPoint) const
inline

Definition at line 90 of file sch_line.h.

91  {
92  return aPoint == m_start || aPoint == m_end;
93  }
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, and m_start.

Referenced by SCH_EDIT_FRAME::BreakSegment(), SCH_EDIT_FRAME::DeleteJunction(), doIsConnected(), and SCH_EDIT_FRAME::SchematicCleanUp().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 293 of file base_struct.h.

293 { return m_forceVisible; }
bool m_forceVisible
Definition: base_struct.h:179

References EDA_ITEM::m_forceVisible.

Referenced by KIGFX::SCH_PAINTER::draw(), and SCH_FIELD::Print().

◆ IsGraphicLine()

bool SCH_LINE::IsGraphicLine ( ) const

Returns if the line is a graphic (non electrical line)

Currently, anything on the internal NOTES layer is a graphic line

Definition at line 817 of file sch_line.cpp.

818 {
819  return ( GetLayer() == LAYER_NOTES );
820 }
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241

References SCH_ITEM::GetLayer(), and LAYER_NOTES.

Referenced by GetDefaultStyle(), GetEndPoints(), GetNetListItem(), SCH_EDIT_TOOL::Init(), SCH_LEGACY_PLUGIN::saveLine(), and UpdateDanglingState().

◆ IsHighlighted()

bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 209 of file base_struct.h.

209 { return m_Flags & HIGHLIGHTED; }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:139
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References HIGHLIGHTED, and EDA_ITEM::m_Flags.

Referenced by SCH_COMPONENT::ClearAllHighlightFlags(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and KIGFX::SCH_VIEW::HighlightItem().

◆ IsLocked()

virtual bool SCH_ITEM::IsLocked ( ) const
inlinevirtualinherited

Function IsLocked.

Returns
bool - true if the object is locked, else false

Definition at line 229 of file sch_item.h.

229 { return false; }

Referenced by SCH_EDIT_TOOL::DeleteItemCursor().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 202 of file base_struct.h.

202 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:113
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMovableFromAnchorPoint()

virtual bool SCH_ITEM::IsMovableFromAnchorPoint ( )
inlinevirtualinherited

Virtual function IsMovableFromAnchorPoint.

Returns
true for items which are moved with the anchor point at mouse cursor and false for items moved with no reference to anchor Usually return true for small items (labels, junctions) and false for items which can be large (hierarchical sheets, compoments)

Reimplemented in SCH_SHEET, SCH_COMPONENT, SCH_BITMAP, SCH_SHEET_PIN, and SCH_BUS_ENTRY_BASE.

Definition at line 207 of file sch_item.h.

207 { return true; }

Referenced by SCH_MOVE_TOOL::Main().

◆ IsMoving()

◆ IsNew()

◆ IsNull()

bool SCH_LINE::IsNull ( ) const
inline

Definition at line 95 of file sch_line.h.

95 { return m_start == m_end; }
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, and m_start.

Referenced by SCH_EDIT_FRAME::SchematicCleanUp(), and SCH_LINE_WIRE_BUS_TOOL::simplifyWireList().

◆ IsParallel()

bool SCH_LINE::IsParallel ( SCH_LINE aLine)

Definition at line 375 of file sch_line.cpp.

376 {
377  wxCHECK_MSG( aLine != NULL && aLine->Type() == SCH_LINE_T, false,
378  wxT( "Cannot test line segment for overlap." ) );
379 
380  wxPoint firstSeg = m_end - m_start;
381  wxPoint secondSeg = aLine->m_end - aLine->m_start;
382 
383  // Use long long here to avoid overflow in calculations
384  return !( (long long) firstSeg.x * secondSeg.y - (long long) firstSeg.y * secondSeg.x );
385 }
#define NULL
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

References m_end, m_start, NULL, SCH_LINE_T, EDA_ITEM::Type(), wxPoint::x, and wxPoint::y.

Referenced by SCH_EDIT_FRAME::SchematicCleanUp(), and SCH_LINE_WIRE_BUS_TOOL::simplifyWireList().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

Override this method in any derived object that supports test find and replace.

Returns
True if the item has replaceable text that can be modified using the find and replace dialog.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 508 of file base_struct.h.

508 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 208 of file base_struct.h.

208 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:180
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:118

References IS_RESIZED, and EDA_ITEM::m_Flags.

Referenced by KIGFX::SCH_PAINTER::setDeviceColors().

◆ IsSameQuadrant()

bool SCH_LINE::IsSameQuadrant ( SCH_LINE aLine,
const wxPoint aPosition 
)

Check if two lines are in the same quadrant as each other, using a reference point as the origin.

Parameters
aLine- Line to compare
aPosition- Point to reference against lines
Returns
true if lines are mostly in different quadrants of aPosition, false otherwise

Definition at line 352 of file sch_line.cpp.

353 {
354  wxPoint first;
355  wxPoint second;
356 
357  if( m_start == aPosition )
358  first = m_end - aPosition;
359  else if( m_end == aPosition )
360  first = m_start - aPosition;
361  else
362  return false;
363 
364  if( aLine->m_start == aPosition )
365  second = aLine->m_end - aPosition;
366  else if( aLine->m_end == aPosition )
367  second = aLine->m_start - aPosition;
368  else
369  return false;
370 
371  return ( sign( first.x ) == sign( second.x ) && sign( first.y ) == sign( second.y ) );
372 }
int sign(T val)
Definition: util.h:90
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, m_start, sign(), wxPoint::x, and wxPoint::y.

◆ IsSelected()

◆ IsStartDangling()

bool SCH_LINE::IsStartDangling ( ) const
inline

Definition at line 189 of file sch_line.h.

189 { return m_startIsDangling; }
bool m_startIsDangling
True if start point is not connected.
Definition: sch_line.h:40

References m_startIsDangling.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ IsType()

bool SCH_LINE::IsType ( const KICAD_T  aScanTypes[]) const
inlineoverridevirtual

Function IsType Checks whether the item is one of the listed types.

Parameters
aScanTypesList of item types
Returns
true if the item type is contained in the list aScanTypes

Reimplemented from EDA_ITEM.

Definition at line 72 of file sch_line.h.

73  {
74  if( SCH_ITEM::IsType( aScanTypes ) )
75  return true;
76 
77  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
78  {
79  if( *p == SCH_LINE_LOCATE_WIRE_T && m_Layer == LAYER_WIRE )
80  return true;
81  else if ( *p == SCH_LINE_LOCATE_BUS_T && m_Layer == LAYER_BUS )
82  return true;
83  else if ( *p == SCH_LINE_LOCATE_GRAPHIC_LINE_T && m_Layer == LAYER_NOTES )
84  return true;
85  }
86 
87  return false;
88  }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
virtual bool IsType(const KICAD_T aScanTypes[]) const
Function IsType Checks whether the item is one of the listed types.
Definition: base_struct.h:269

References EOT, EDA_ITEM::IsType(), LAYER_BUS, LAYER_NOTES, LAYER_WIRE, SCH_ITEM::m_Layer, SCH_LINE_LOCATE_BUS_T, SCH_LINE_LOCATE_GRAPHIC_LINE_T, and SCH_LINE_LOCATE_WIRE_T.

Referenced by SCH_EDIT_FRAME::DeleteJunction().

◆ IsWire()

bool SCH_LINE::IsWire ( ) const

Returns true if the line is a wire.

Returns
true if this line is on the wire layer.

Definition at line 823 of file sch_line.cpp.

824 {
825  return ( GetLayer() == LAYER_WIRE );
826 }
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241

References SCH_ITEM::GetLayer(), and LAYER_WIRE.

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 206 of file base_struct.h.

206 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

◆ IterateForward() [1/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::deque< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use the main queue instead

Definition at line 390 of file base_struct.h.

394  {
395  for( auto it : aList )
396  {
397  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
399  return SEARCH_RESULT::QUIT;
400  }
401 
403  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...

References CONTINUE, QUIT, and EDA_ITEM::Visit().

Referenced by GERBER_FILE_IMAGE::Visit(), and BOARD::Visit().

◆ IterateForward() [2/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use std::vector instead

Definition at line 411 of file base_struct.h.

413  {
414  for( auto it : aList )
415  {
416  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
418  return SEARCH_RESULT::QUIT;
419  }
420 
422  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...

References CONTINUE, QUIT, and EDA_ITEM::Visit().

◆ Load()

virtual bool SCH_ITEM::Load ( LINE_READER aLine,
wxString &  aErrorMsg 
)
inlinevirtualinherited

Function Load reads a schematic item from aLine in a .sch file.

Parameters
aLine- Essentially this is file to read the object from.
aErrorMsg- Description of the error if an error occurs while loading the object.
Returns
True if the object loaded successfully.

Definition at line 306 of file sch_item.h.

306 { return false; }

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData 
)
inlinevirtualinherited

Function Matches compares the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, LIB_PIN, SCH_PIN, TEXTE_MODULE, SCH_MARKER, MARKER_PCB, and TEXTE_PCB.

Definition at line 464 of file base_struct.h.

465  {
466  return false;
467  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), TEXTE_PCB::Matches(), MARKER_PCB::Matches(), SCH_MARKER::Matches(), TEXTE_MODULE::Matches(), LIB_PIN::Matches(), SCH_FIELD::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
wxFindReplaceData &  aSearchData 
)
protectedinherited

Function Matches compares aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 143 of file base_struct.cpp.

144 {
145  wxString text = aText;
146  wxString searchText = aSearchData.GetFindString();
147 
148  // Don't match if searching for replaceable item and the item doesn't support text replace.
149  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
150  return false;
151 
152  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
153  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
154 
155  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
156  {
157  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
158  return text.Matches( searchText );
159 
160  return text.MakeUpper().Matches( searchText.MakeUpper() );
161  }
162 
163  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
164  return aText.Find( searchText ) != wxNOT_FOUND;
165 
166  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
167 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:508

References FR_MATCH_WILDCARD, FR_SEARCH_REPLACE, and EDA_ITEM::IsReplaceable().

◆ MergeOverlap()

SCH_LINE * SCH_LINE::MergeOverlap ( SCH_LINE aLine)

Check line against aLine to see if it overlaps and merge if it does.

This method will return an equivalent of the union of line and aLine if the two lines overlap. This method is used to merge multiple line segments into a single line.

Parameters
aLine- Line to compare.
Returns
New line that combines the two or NULL on non-overlapping segments.

Definition at line 388 of file sch_line.cpp.

389 {
390  auto less = []( const wxPoint& lhs, const wxPoint& rhs ) -> bool
391  {
392  if( lhs.x == rhs.x )
393  return lhs.y < rhs.y;
394  return lhs.x < rhs.x;
395  };
396 
397  wxCHECK_MSG( aLine != NULL && aLine->Type() == SCH_LINE_T, NULL,
398  wxT( "Cannot test line segment for overlap." ) );
399 
400  if( this == aLine || GetLayer() != aLine->GetLayer() )
401  return nullptr;
402 
403  auto leftmost_start = aLine->m_start;
404  auto leftmost_end = aLine->m_end;
405 
406  auto rightmost_start = m_start;
407  auto rightmost_end = m_end;
408 
409  // We place the start to the left and below the end of both lines
410  if( leftmost_start != std::min( { leftmost_start, leftmost_end }, less ) )
411  std::swap( leftmost_start, leftmost_end );
412  if( rightmost_start != std::min( { rightmost_start, rightmost_end }, less ) )
413  std::swap( rightmost_start, rightmost_end );
414 
415  // -leftmost is the line that starts farthest to the left
416  // -other is the line that is _not_ leftmost
417  // -rightmost is the line that ends farthest to the right. This may or
418  // may not be 'other' as the second line may be completely covered by
419  // the first.
420  if( less( rightmost_start, leftmost_start ) )
421  {
422  std::swap( leftmost_start, rightmost_start );
423  std::swap( leftmost_end, rightmost_end );
424  }
425 
426  auto other_start = rightmost_start;
427  auto other_end = rightmost_end;
428 
429  if( less( rightmost_end, leftmost_end ) )
430  {
431  rightmost_start = leftmost_start;
432  rightmost_end = leftmost_end;
433  }
434 
435  // If we end one before the beginning of the other, no overlap is possible
436  if( less( leftmost_end, other_start ) )
437  {
438  return nullptr;
439  }
440 
441  // Search for a common end:
442  if( ( leftmost_start == other_start ) && ( leftmost_end == other_end ) ) // Trivial case
443  {
444  auto ret = new SCH_LINE( *aLine );
445  ret->SetStartPoint( leftmost_start );
446  ret->SetEndPoint( leftmost_end );
447 
448  if( IsSelected() || aLine->IsSelected() )
449  ret->SetSelected();
450 
451  return ret;
452  }
453 
454  bool colinear = false;
455 
456  /* Test alignment: */
457  if( ( leftmost_start.y == leftmost_end.y ) &&
458  ( other_start.y == other_end.y ) ) // Horizontal segment
459  {
460  colinear = ( leftmost_start.y == other_start.y );
461  }
462  else if( ( leftmost_start.x == leftmost_end.x ) &&
463  ( other_start.x == other_end.x ) ) // Vertical segment
464  {
465  colinear = ( leftmost_start.x == other_start.x );
466  }
467  else
468  {
469  // We use long long here to avoid overflow -- it enforces promotion
470  // Don't use double as we need to make a direct comparison
471  // The slope of the left-most line is dy/dx. Then we check that the slope
472  // from the left most start to the right most start is the same as well as
473  // the slope from the left most start to right most end.
474  long long dx = leftmost_end.x - leftmost_start.x;
475  long long dy = leftmost_end.y - leftmost_start.y;
476  colinear = ( ( ( other_start.y - leftmost_start.y ) * dx ==
477  ( other_start.x - leftmost_start.x ) * dy ) &&
478  ( ( other_end.y - leftmost_start.y ) * dx ==
479  ( other_end.x - leftmost_start.x ) * dy ) );
480  }
481 
482  // Make a new segment that merges the 2 segments
483  if( colinear )
484  {
485  leftmost_end = rightmost_end;
486 
487  auto ret = new SCH_LINE( *aLine );
488  ret->SetStartPoint( leftmost_start );
489  ret->SetEndPoint( leftmost_end );
490 
491  if( IsSelected() || aLine->IsSelected() )
492  ret->SetSelected();
493 
494  return ret;
495  }
496 
497  return nullptr;
498 }
bool IsSelected() const
Definition: base_struct.h:207
#define NULL
wxPoint m_end
Line end point.
Definition: sch_line.h:43
YYCODETYPE lhs
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241
wxPoint m_start
Line start point.
Definition: sch_line.h:42
SCH_LINE(const wxPoint &pos=wxPoint(0, 0), int layer=LAYER_NOTES)
Definition: sch_line.cpp:67
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

References SCH_ITEM::GetLayer(), EDA_ITEM::IsSelected(), numEval::lhs, m_end, m_start, NULL, SCH_LINE(), SCH_LINE_T, and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_FRAME::SchematicCleanUp(), and SCH_LINE_WIRE_BUS_TOOL::simplifyWireList().

◆ MirrorX()

void SCH_LINE::MirrorX ( int  aXaxis_position)
overridevirtual

Function MirrorX mirrors item relative to the X axis about aXaxis_position.

Parameters
aXaxis_positionThe X axis position to mirror around.

Implements SCH_ITEM.

Definition at line 319 of file sch_line.cpp.

320 {
321  MIRROR( m_start.y, aXaxis_position );
322  MIRROR( m_end.y, aXaxis_position );
323 }
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:175
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, m_start, MIRROR(), and wxPoint::y.

◆ MirrorY()

void SCH_LINE::MirrorY ( int  aYaxis_position)
overridevirtual

Function MirrorY mirrors item relative to the Y axis about aYaxis_position.

Parameters
aYaxis_positionThe Y axis position to mirror around.

Implements SCH_ITEM.

Definition at line 326 of file sch_line.cpp.

327 {
328  MIRROR( m_start.x, aYaxis_position );
329  MIRROR( m_end.x, aYaxis_position );
330 }
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:175
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, m_start, MIRROR(), and wxPoint::x.

◆ Move()

void SCH_LINE::Move ( const wxPoint aMoveVector)
overridevirtual

Function Move moves the item by aMoveVector to a new position.

Parameters
aMoveVector= the displacement vector

Implements SCH_ITEM.

Definition at line 149 of file sch_line.cpp.

150 {
151  if( aOffset != wxPoint( 0, 0 ) )
152  {
153  m_start += aOffset;
154  m_end += aOffset;
155  SetModified();
156  }
157 }
void SetModified()
Definition: base_struct.cpp:85
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, m_start, and EDA_ITEM::SetModified().

◆ MoveEnd()

void SCH_LINE::MoveEnd ( const wxPoint aMoveVector)

Definition at line 170 of file sch_line.cpp.

171 {
172  if( aOffset != wxPoint( 0, 0 ) )
173  {
174  m_end += aOffset;
175  SetModified();
176  }
177 }
void SetModified()
Definition: base_struct.cpp:85
wxPoint m_end
Line end point.
Definition: sch_line.h:43

References m_end, and EDA_ITEM::SetModified().

Referenced by SCH_MOVE_TOOL::moveItem().

◆ MoveStart()

void SCH_LINE::MoveStart ( const wxPoint aMoveVector)

Definition at line 160 of file sch_line.cpp.

161 {
162  if( aOffset != wxPoint( 0, 0 ) )
163  {
164  m_start += aOffset;
165  SetModified();
166  }
167 }
void SetModified()
Definition: base_struct.cpp:85
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_start, and EDA_ITEM::SetModified().

Referenced by SCH_MOVE_TOOL::moveItem().

◆ operator<() [1/2]

bool SCH_LINE::operator< ( const SCH_ITEM aItem) const
overridevirtual

Reimplemented from SCH_ITEM.

Definition at line 670 of file sch_line.cpp.

671 {
672  if( Type() != aItem.Type() )
673  return Type() < aItem.Type();
674 
675  auto line = static_cast<const SCH_LINE*>( &aItem );
676 
677  if( GetLayer() != line->GetLayer() )
678  return GetLayer() < line->GetLayer();
679 
680  if( GetStartPoint().x != line->GetStartPoint().x )
681  return GetStartPoint().x < line->GetStartPoint().x;
682 
683  if( GetStartPoint().y != line->GetStartPoint().y )
684  return GetStartPoint().y < line->GetStartPoint().y;
685 
686  if( GetEndPoint().x != line->GetEndPoint().x )
687  return GetEndPoint().x < line->GetEndPoint().x;
688 
689  return GetEndPoint().y < line->GetEndPoint().y;
690 }
wxPoint GetStartPoint() const
Definition: sch_line.h:97
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197
wxPoint GetEndPoint() const
Definition: sch_line.h:100

References GetEndPoint(), SCH_ITEM::GetLayer(), GetStartPoint(), EDA_ITEM::Type(), wxPoint::x, and wxPoint::y.

◆ operator<() [2/2]

bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 197 of file base_struct.cpp.

198 {
199  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
200  GetChars( GetClass() ) ) );
201 
202  return false;
203 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
virtual wxString GetClass() const =0
Function GetClass returns the class name.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

References Format(), GetChars(), and EDA_ITEM::GetClass().

◆ Plot()

void SCH_LINE::Plot ( PLOTTER aPlotter)
overridevirtual

Function Plot plots the schematic item to aPlotter.

Parameters
aPlotterA pointer to a PLOTTER object.

Reimplemented from SCH_ITEM.

Definition at line 749 of file sch_line.cpp.

750 {
751  auto* settings = static_cast<KIGFX::SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
752  int penWidth;
753 
754  if( m_color != COLOR4D::UNSPECIFIED )
755  aPlotter->SetColor( m_color );
756  else
757  aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( GetLayer() ) );
758 
759  switch( m_Layer )
760  {
761  case LAYER_WIRE: penWidth = settings->m_DefaultWireThickness; break;
762  case LAYER_BUS: penWidth = settings->m_DefaultBusThickness; break;
763  default: penWidth = GetPenWidth(); break;
764  }
765 
766  penWidth = std::max( penWidth, aPlotter->RenderSettings()->GetDefaultPenWidth() );
767 
768  aPlotter->SetCurrentLineWidth( penWidth );
769  aPlotter->SetDash( GetLineStyle() );
770 
771  aPlotter->MoveTo( m_start );
772  aPlotter->FinishTo( m_end );
773 
774  aPlotter->SetDash( PLOT_DASH_TYPE::SOLID );
775 }
void FinishTo(const wxPoint &pos)
Definition: plotter.h:257
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
virtual void SetColor(COLOR4D color)=0
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
COLOR4D m_color
Line color.
Definition: sch_line.h:46
PLOT_DASH_TYPE GetLineStyle() const
Definition: sch_line.cpp:279
int GetPenWidth() const override
Function GetPenSize virtual pure.
Definition: sch_line.cpp:294
wxPoint m_end
Line end point.
Definition: sch_line.h:43
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241
void MoveTo(const wxPoint &pos)
Definition: plotter.h:247
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:137
int GetDefaultPenWidth() const
wxPoint m_start
Line start point.
Definition: sch_line.h:42
virtual void SetDash(PLOT_DASH_TYPE dashed)=0
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

References PLOTTER::FinishTo(), KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), SCH_ITEM::GetLayer(), KIGFX::RENDER_SETTINGS::GetLayerColor(), GetLineStyle(), GetPenWidth(), LAYER_BUS, LAYER_WIRE, m_color, m_end, SCH_ITEM::m_Layer, m_start, PLOTTER::MoveTo(), PLOTTER::RenderSettings(), PLOTTER::SetColor(), PLOTTER::SetCurrentLineWidth(), PLOTTER::SetDash(), and SOLID.

◆ Print()

void SCH_LINE::Print ( RENDER_SETTINGS aSettings,
const wxPoint aOffset 
)
overridevirtual

Function Print Print a schematic item.

Each schematic item should have its own method

Parameters
aOffsetdrawing offset (usually {0,0} but can be different when moving an object)

Implements SCH_ITEM.

Definition at line 303 of file sch_line.cpp.

304 {
305  wxDC* DC = aSettings->GetPrintDC();
307  wxPoint start = m_start;
308  wxPoint end = m_end;
309  int penWidth = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() );
310 
311  if( color == COLOR4D::UNSPECIFIED )
312  color = aSettings->GetLayerColor( m_Layer );
313 
314  GRLine( nullptr, DC, start.x, start.y, end.x, end.y, penWidth, color,
316 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
int color
Definition: DXF_plotter.cpp:61
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
COLOR4D m_color
Line color.
Definition: sch_line.h:46
PLOT_DASH_TYPE GetLineStyle() const
Definition: sch_line.cpp:279
int GetPenWidth() const override
Function GetPenSize virtual pure.
Definition: sch_line.cpp:294
static wxPenStyle getwxPenStyle(PLOT_DASH_TYPE aType)
Definition: sch_line.cpp:47
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:230
wxPoint m_end
Line end point.
Definition: sch_line.h:43
PLOT_DASH_TYPE
Enum for choosing dashed line type.
Definition: plotter.h:87
int GetDefaultPenWidth() const
wxPoint m_start
Line start point.
Definition: sch_line.h:42
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:40

References color, KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), KIGFX::RENDER_SETTINGS::GetLayerColor(), GetLineStyle(), GetPenWidth(), KIGFX::RENDER_SETTINGS::GetPrintDC(), getwxPenStyle(), GRLine(), m_color, m_end, SCH_ITEM::m_Layer, m_start, wxPoint::x, and wxPoint::y.

◆ Replace() [1/2]

bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
wxString &  aText 
)
staticinherited

Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aTextA reference to a wxString object containing the text to be replaced.
Returns
True if aText was modified, otherwise false.

Definition at line 170 of file base_struct.cpp.

171 {
172  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
173 
174  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
175  aSearchData.GetFindString() :
176  aSearchData.GetFindString().Upper() );
177 
178  if( result == wxNOT_FOUND )
179  return false;
180 
181  wxString prefix = aText.Left( result );
182  wxString suffix;
183 
184  if( aSearchData.GetFindString().length() + result < aText.length() )
185  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
186 
187  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
188  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
189  GetChars( suffix ) );
190 
191  aText = prefix + aSearchData.GetReplaceString() + suffix;
192 
193  return true;
194 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153

References GetChars(), and traceFindReplace.

Referenced by SCH_FIELD::Replace(), EDA_TEXT::Replace(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ Replace() [2/2]

virtual bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
void *  aAuxData = NULL 
)
inlinevirtualinherited

Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

This function must be overridden for items that support text replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item text was modified, otherwise false.

Reimplemented in SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 496 of file base_struct.h.

496 { return false; }

◆ Rotate()

void SCH_LINE::Rotate ( wxPoint  aPosition)
overridevirtual

Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to rotate around.

Implements SCH_ITEM.

Definition at line 333 of file sch_line.cpp.

334 {
335  RotatePoint( &m_start, aPosition, 900 );
336  RotatePoint( &m_end, aPosition, 900 );
337 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, m_start, and RotatePoint().

◆ RotateEnd()

void SCH_LINE::RotateEnd ( wxPoint  aPosition)

Definition at line 346 of file sch_line.cpp.

347 {
348  RotatePoint( &m_end, aPosition, 900 );
349 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
wxPoint m_end
Line end point.
Definition: sch_line.h:43

References m_end, and RotatePoint().

Referenced by SCH_EDIT_TOOL::Rotate().

◆ RotateStart()

void SCH_LINE::RotateStart ( wxPoint  aPosition)

Definition at line 340 of file sch_line.cpp.

341 {
342  RotatePoint( &m_start, aPosition, 900 );
343 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_start, and RotatePoint().

Referenced by SCH_EDIT_TOOL::Rotate().

◆ Schematic()

SCHEMATIC * SCH_ITEM::Schematic ( ) const
inherited

Searches the item hierarchy to find a SCHEMATIC.

Every SCH_ITEM that lives on a SCH_SCREEN should be parented to either that screen or another SCH_ITEM on the same screen (for example, pins to their components).

Every SCH_SCREEN should be parented to the SCHEMATIC. Note that this hierarchy is not the same as the sheet hierarchy!

Returns
the parent schematic this item lives on, or nullptr

Definition at line 113 of file sch_item.cpp.

114 {
115  EDA_ITEM* parent = GetParent();
116 
117  while( parent )
118  {
119  if( parent->Type() == SCHEMATIC_T )
120  return static_cast<SCHEMATIC*>( parent );
121  else
122  parent = parent->GetParent();
123  }
124 
125  return nullptr;
126 }
EDA_ITEM * GetParent() const
Definition: base_struct.h:199
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:163
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

References EDA_ITEM::GetParent(), SCHEMATIC_T, and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::CreateSheetPin(), SCH_JUNCTION::GetBoundingBox(), SCH_MARKER::GetColorLayer(), GetPenWidth(), SCH_COMPONENT::GetSchPins(), SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), SCH_SHEET::IsRootSheet(), SCH_LABEL::IsType(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnAddField(), SCH_JUNCTION::Plot(), SCH_JUNCTION::Print(), SCH_HIERLABEL::Print(), SCH_SHEET::ResolveTextVar(), and SCH_MARKER::ViewGetLayers().

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

◆ SetConnectivityDirty()

void SCH_ITEM::SetConnectivityDirty ( bool  aDirty = true)
inlineinherited

Definition at line 412 of file sch_item.h.

412 { m_connectivity_dirty = aDirty; }
bool m_connectivity_dirty
True if connectivity info might be out of date.
Definition: sch_item.h:169

References SCH_ITEM::m_connectivity_dirty.

Referenced by SCH_EDIT_FRAME::SaveCopyInUndoList().

◆ SetEndPoint()

void SCH_LINE::SetEndPoint ( const wxPoint aPosition)
inline

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 239 of file base_struct.h.

239 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddModuleToBoard(), PCBNEW_CONTROL::AppendBoard(), SCH_EDIT_TOOL::ChangeTextType(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), LIB_PIN_TOOL::CreatePin(), SCH_EDIT_FRAME::CreateSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::Duplicate(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_VIEW::HighlightItem(), EDIT_POINTS_FACTORY::Make(), TRACKS_CLEANER::mergeCollinearSegments(), LIB_MOVE_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), WS_DATA_ITEM::SyncDrawItems(), WS_DATA_ITEM_TEXT::SyncDrawItems(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible.

Parameters
aEnableTrue forces the item to be drawn. False uses the item's visibility setting to determine if the item is to be drawn.

Definition at line 291 of file base_struct.h.

291 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: base_struct.h:179

References EDA_ITEM::m_forceVisible.

◆ SetHighlighted()

void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 214 of file base_struct.h.

214 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:239
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:139

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

◆ SetLayer()

void SCH_ITEM::SetLayer ( SCH_LAYER_ID  aLayer)
inlineinherited

Function SetLayer sets the layer this item is on.

Parameters
aLayerThe layer number.

Definition at line 248 of file sch_item.h.

248 { m_Layer = aLayer; }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156

References SCH_ITEM::m_Layer.

Referenced by PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), SCH_NO_CONNECT::SCH_NO_CONNECT(), SCH_FIELD::SetId(), and CONNECTION_GRAPH::updateItemConnectivity().

◆ SetLineColor() [1/2]

void SCH_LINE::SetLineColor ( const COLOR4D  aColor)

Definition at line 228 of file sch_line.cpp.

229 {
230  m_color = aColor;
231 }
COLOR4D m_color
Line color.
Definition: sch_line.h:46

References m_color.

◆ SetLineColor() [2/2]

void SCH_LINE::SetLineColor ( const double  r,
const double  g,
const double  b,
const double  a 
)

Definition at line 234 of file sch_line.cpp.

235 {
236  COLOR4D newColor(r, g, b, a);
237 
238  if( newColor == COLOR4D::UNSPECIFIED )
239  m_color = COLOR4D::UNSPECIFIED;
240  else
241  {
242  // Eeschema does not allow alpha channel in colors
243  newColor.a = 1.0;
244  m_color = newColor;
245  }
246 }
double a
Alpha component.
Definition: color4d.h:305
COLOR4D m_color
Line color.
Definition: sch_line.h:46
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:40

References KIGFX::COLOR4D::a, and m_color.

◆ SetLineStyle() [1/2]

void SCH_LINE::SetLineStyle ( const PLOT_DASH_TYPE  aStyle)

Definition at line 270 of file sch_line.cpp.

271 {
272  if( aStyle == GetDefaultStyle() )
274  else
275  m_style = aStyle;
276 }
PLOT_DASH_TYPE m_style
Line style.
Definition: sch_line.h:45
PLOT_DASH_TYPE GetDefaultStyle() const
Definition: sch_line.cpp:255

References DEFAULT, GetDefaultStyle(), and m_style.

Referenced by SetLineStyle().

◆ SetLineStyle() [2/2]

void SCH_LINE::SetLineStyle ( const int  aStyleId)

Definition at line 264 of file sch_line.cpp.

265 {
266  SetLineStyle( static_cast<PLOT_DASH_TYPE>( aStyleId ) );
267 }
void SetLineStyle(const PLOT_DASH_TYPE aStyle)
Definition: sch_line.cpp:270

References SetLineStyle().

◆ SetLineWidth()

void SCH_LINE::SetLineWidth ( const int  aSize)

Definition at line 288 of file sch_line.cpp.

289 {
290  m_size = aSize;
291 }
int m_size
Line pensize.
Definition: sch_line.h:44

References m_size.

◆ SetLocked()

virtual void SCH_ITEM::SetLocked ( bool  aLocked)
inlinevirtualinherited

Function SetLocked modifies 'lock' status for of the item.

Definition at line 235 of file sch_item.h.

235 {}

◆ SetModified()

◆ SetParent()

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Definition at line 200 of file base_struct.h.

200 { m_Parent = aParent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:178

References EDA_ITEM::m_Parent.

Referenced by MODULE::Add(), BOARD::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewComponent(), SCH_SHEET::AddPin(), LIB_CONTROL::AddSymbolToSchematic(), SCH_SCREEN::Append(), LIB_FIELD::Copy(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SCH_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_PART::LIB_PART(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), LIB_EDIT_FRAME::LoadOneSymbol(), MODULE::MODULE(), DIALOG_LIB_EDIT_PIN::OnPaintShowPanel(), MODULE::operator=(), LIB_PART::operator=(), PCB_PARSER::parseMODULE_unchecked(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_SEXPR_PARSER::ParseSymbol(), LIB_EDIT_TOOL::Paste(), PCBNEW_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), pasteModuleItemsToModEdit(), SCH_DRAWING_TOOLS::PlaceComponent(), PCB_EDITOR_CONTROL::PlaceModule(), BOARD_COMMIT::Push(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET_PIN::SCH_SHEET_PIN(), LIB_PART::SetFields(), LIB_PART::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), SwapItemData(), and DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary().

◆ SetPosition()

void SCH_LINE::SetPosition ( const wxPoint aPosition)
overridevirtual

Function SetPosition set the schematic item position to aPosition.

Parameters
aPositionA reference to a wxPoint object containing the new position.

Implements SCH_ITEM.

Definition at line 778 of file sch_line.cpp.

779 {
780  m_end = m_end - ( m_start - aPosition );
781  m_start = aPosition;
782 }
wxPoint m_end
Line end point.
Definition: sch_line.h:43
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_end, and m_start.

◆ SetSelected()

◆ SetStartPoint()

void SCH_LINE::SetStartPoint ( const wxPoint aPosition)
inline

◆ SetState()

void EDA_ITEM::SetState ( int  type,
int  state 
)
inlineinherited

Definition at line 228 of file base_struct.h.

229  {
230  if( state )
231  m_Status |= type; // state = ON or OFF
232  else
233  m_Status &= ~type;
234  }
STATUS_FLAGS m_Status
Definition: base_struct.h:177

References EDA_ITEM::m_Status.

Referenced by LEGACY_PLUGIN::loadTrackList(), TRACKS_CLEANER::mergeCollinearSegments(), SELECTION_TOOL::selectConnectedTracks(), and TRACK::SetLocked().

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 237 of file base_struct.h.

237 { m_Status = aStatus; }
STATUS_FLAGS m_Status
Definition: base_struct.h:177

References EDA_ITEM::m_Status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetStoredPos()

void SCH_ITEM::SetStoredPos ( wxPoint  aPos)
inlineinherited

Definition at line 210 of file sch_item.h.

210 { m_storedPos = aPos; }
wxPoint m_storedPos
Definition: sch_item.h:159

References SCH_ITEM::m_storedPos.

Referenced by SCH_MOVE_TOOL::Main(), and SCH_MOVE_TOOL::moveItem().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 212 of file base_struct.h.

212 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:239
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ Sort()

static bool EDA_ITEM::Sort ( const EDA_ITEM aLeft,
const EDA_ITEM aRight 
)
inlinestaticinherited

Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers.

Parameters
aLeftThe left hand item to compare.
aRightThe right hand item to compare.
Returns
True if aLeft is less than aRight.

Definition at line 527 of file base_struct.h.

527 { return *aLeft < *aRight; }

◆ SwapData()

void SCH_LINE::SwapData ( SCH_ITEM aItem)
overridevirtual

Function SwapData swap the internal data structures aItem with the schematic item.

Obviously, aItem must have the same type than me

Parameters
aItemThe item to swap the data structures with.

Reimplemented from SCH_ITEM.

Definition at line 724 of file sch_line.cpp.

725 {
726  SCH_LINE* item = (SCH_LINE*) aItem;
727 
728  std::swap( m_Layer, item->m_Layer );
729 
730  std::swap( m_start, item->m_start );
731  std::swap( m_end, item->m_end );
732  std::swap( m_startIsDangling, item->m_startIsDangling );
733  std::swap( m_endIsDangling, item->m_endIsDangling );
734  std::swap( m_style, item->m_style );
735  std::swap( m_size, item->m_size );
736  std::swap( m_color, item->m_color );
737 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156
PLOT_DASH_TYPE m_style
Line style.
Definition: sch_line.h:45
bool m_endIsDangling
True if end point is not connected.
Definition: sch_line.h:41
COLOR4D m_color
Line color.
Definition: sch_line.h:46
bool m_startIsDangling
True if start point is not connected.
Definition: sch_line.h:40
wxPoint m_end
Line end point.
Definition: sch_line.h:43
int m_size
Line pensize.
Definition: sch_line.h:44
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:38
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References m_color, m_end, m_endIsDangling, SCH_ITEM::m_Layer, m_size, m_start, m_startIsDangling, and m_style.

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Function Type()

returns the type of object. This attribute should never be changed after a constructor sets it, so there is no public "setter" method.

Returns
KICAD_T - the type of object.

Definition at line 197 of file base_struct.h.

197 { return m_StructType; }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:174

References EDA_ITEM::m_StructType.

Referenced by MODULE::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), POINT_EDITOR::addCorner(), CONNECTION_SUBGRAPH::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), ZONE_FILLER::addKnockout(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), SCH_SCREEN::Append(), CONNECTION_GRAPH::buildConnectionGraph(), SCH_SCREENS::buildScreenList(), calcArea(), calcMaxArea(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), SCH_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), TEXTE_PCB::ClassOf(), MARKER_PCB::ClassOf(), SCH_NO_CONNECT::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), SCH_PIN::ClassOf(), EDGE_MODULE::ClassOf(), PCB_TARGET::ClassOf(), ClassOf(), SCH_FIELD::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), ZONE_CONTAINER::ClassOf(), SCH_BITMAP::ClassOf(), DIMENSION::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), SCH_SHEET_PIN::ClassOf(), MODULE::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), D_PAD::ClassOf(), SCH_COMPONENT::ClassOf(), SCH_SCREEN::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), SCH_TEXT::ClassOf(), BOARD::ClassOf(), SCH_SHEET::ClassOf(), ARC::ClassOf(), VIA::ClassOf(), SCH_LABEL::ClassOf(), SCH_GLOBALLABEL::ClassOf(), SCH_HIERLABEL::ClassOf(), TRACKS_CLEANER::cleanupSegments(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_TEXT::compare(), LIB_POLYLINE::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_ITEM::compare(), LIB_PIN::compare(), GRID_HELPER::computeAnchors(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), EE_RTREE::contains(), DIALOG_TEXT_PROPERTIES::convertKIIDsToReferences(), DIALOG_LABEL_EDITOR::convertKIIDsToReferences(), MODULE::CoverageRatio(), BOARD_ADAPTER::createLayers(), PCB_BASE_FRAME::CreateNewModule(), SCH_DRAWING_TOOLS::createNewText(), BOARD_ADAPTER::createNewTrack(), D_PAD::D_PAD(), SCH_SCREEN::DeleteItem(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDIT_TOOL::DoDelete(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), DRC::doTrackDrc(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), CN_ITEM::Dump(), EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), MODULE::DuplicateItem(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), LIB_EDIT_TOOL::editTextProperties(), EditToolSelectionFilter(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckLabels(), NETLIST_EXPORTER::findNextComponent(), PCB_BASE_FRAME::FocusOnItem(), EDIT_TOOL::FootprintFilter(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), SCH_FIELD::GetBoundingBox(), TRACK::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), NETLIST_OBJECT::GetComponentParent(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetContextualTextVars(), CONNECTION_GRAPH::getDefaultConnection(), CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_TEXT::GetEndPoints(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_FIELD::GetMenuImage(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTION_SUBGRAPH::GetNameForDriver(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), getRect(), KIGFX::SCH_PAINTER::getRenderColor(), TEXTE_PCB::GetShownText(), SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), SELECTION_TOOL::GuessSelectionCandidates(), EE_SELECTION_TOOL::GuessSelectionCandidates(), hash_eda(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), KIGFX::SCH_VIEW::HighlightItem(), highlightNet(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_RTREE::insert(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), TRACK::IsNull(), IsParallel(), SCH_FIELD::IsReplaceable(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), SCH_FIELD::Matches(), MergeOverlap(), SCH_EDIT_TOOL::Mirror(), SCH_MOVE_TOOL::moveItem(), SCH_EDITOR_CONTROL::nextMatch(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), POINT_EDITOR::OnSelectionChange(), SCH_JUNCTION::operator<(), SCH_BUS_ENTRY_BASE::operator<(), SCH_FIELD::operator<(), operator<(), LIB_ITEM::operator<(), SCH_TEXT::operator<(), SCH_ITEM::operator<(), SCH_SHEET::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), SCH_SCREEN::Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), SCH_FIELD::Print(), SCH_SCREEN::Print(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SELECTION_TOOL::RebuildSelection(), SCH_CONNECTION::recacheName(), SCH_BASE_FRAME::RefreshItem(), SCH_BASE_FRAME::RefreshSelection(), EE_RTREE::remove(), MODULE::Remove(), CN_CONNECTIVITY_ALGO::Remove(), BOARD::Remove(), SCH_SCREEN::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), LIB_PART::RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_FIELD::Replace(), WS_PROXY_UNDO_ITEM::Restore(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), SCH_TEXT::Rotate(), DRC_TEXTVAR_TESTER::RunDRC(), SCH_SEXPR_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_SEXPR_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_SEXPR_PLUGIN_CACHE::saveCircle(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_SEXPR_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SCREEN::Schematic(), SCH_ITEM::Schematic(), SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), SELECTION_TOOL::selectConnectedTracks(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), BOARD_COMMIT::Stage(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_FIELD::SwapData(), TEXTE_PCB::SwapData(), TRACK::SwapData(), DIMENSION::SwapData(), ARC::SwapData(), SCH_SHEET::SwapData(), VIA::SwapData(), SCH_COMPONENT::SwapData(), MODULE::SwapData(), ZONE_CONTAINER::SwapData(), D_PAD::SwapData(), SwapItemData(), TEXTE_MODULE::TEXTE_MODULE(), AR_MATRIX::TraceSegmentPcb(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), LIB_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), SCH_TEXT::UpdateDanglingState(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), EE_POINT_EDITOR::updateItem(), PL_POINT_EDITOR::updateItem(), POINT_EDITOR::updateItem(), CONNECTION_GRAPH::updateItemConnectivity(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), SCH_SHEET::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ UpdateDanglingState()

bool SCH_LINE::UpdateDanglingState ( std::vector< DANGLING_END_ITEM > &  aItemList,
const SCH_SHEET_PATH aPath = nullptr 
)
overridevirtual

Function IsDanglingStateChanged tests the schematic item to aItemList to check if it's dangling state has changed.

Note that the return value only true when the state of the test has changed. Use the IsDangling() method to get the current dangling state of the item. Some of the schematic objects cannot be tested for a dangling state, the default method always returns false. Only override the method if the item can be tested for a dangling state.

If aSheet is passed a non-null pointer to a SCH_SHEET_PATH, the overrided method can optionally use it to update sheet-local connectivity information

Parameters
aItemList- List of items to test item against.
aSheet- Sheet path to update connections for
Returns
True if the dangling state has changed from it's current setting.

Reimplemented from SCH_ITEM.

Definition at line 519 of file sch_line.cpp.

521 {
522  bool previousStartState = m_startIsDangling;
523  bool previousEndState = m_endIsDangling;
524 
526 
527  if( GetLayer() == LAYER_WIRE )
528  {
529  for( DANGLING_END_ITEM item : aItemList )
530  {
531  if( item.GetItem() == this )
532  continue;
533 
534  if( item.GetType() == BUS_START_END ||
535  item.GetType() == BUS_END_END ||
536  item.GetType() == BUS_ENTRY_END )
537  continue;
538 
539  if( m_start == item.GetPosition() )
540  m_startIsDangling = false;
541 
542  if( m_end == item.GetPosition() )
543  m_endIsDangling = false;
544 
546  break;
547  }
548  }
549  else if( GetLayer() == LAYER_BUS || IsGraphicLine() )
550  {
551  // Lines on the notes layer and the bus layer cannot be tested for dangling ends.
552  previousStartState = previousEndState = m_startIsDangling = m_endIsDangling = false;
553  }
554 
555  return ( previousStartState != m_startIsDangling ) || ( previousEndState != m_endIsDangling );
556 }
bool IsGraphicLine() const
Returns if the line is a graphic (non electrical line)
Definition: sch_line.cpp:817
bool m_endIsDangling
True if end point is not connected.
Definition: sch_line.h:41
bool m_startIsDangling
True if start point is not connected.
Definition: sch_line.h:40
wxPoint m_end
Line end point.
Definition: sch_line.h:43
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
Definition: sch_item.h:241
DANGLING_END_ITEM is a helper class used to store the state of schematic items that can be connected ...
Definition: sch_item.h:80
wxPoint m_start
Line start point.
Definition: sch_line.h:42

References BUS_END_END, BUS_ENTRY_END, BUS_START_END, SCH_ITEM::GetLayer(), IsGraphicLine(), LAYER_BUS, LAYER_WIRE, m_end, m_endIsDangling, m_start, and m_startIsDangling.

◆ UsesDefaultStroke()

bool SCH_LINE::UsesDefaultStroke ( ) const

Test if the SCH_LINE object uses the default stroke settings.

The stroke settings include the line width, style, and color.

Returns
True if the SCH_LINE object uses the default stroke settings.

Definition at line 829 of file sch_line.cpp.

830 {
831  return m_size == 0 && m_color == COLOR4D::UNSPECIFIED
833 }
PLOT_DASH_TYPE m_style
Line style.
Definition: sch_line.h:45
PLOT_DASH_TYPE GetDefaultStyle() const
Definition: sch_line.cpp:255
COLOR4D m_color
Line color.
Definition: sch_line.h:46
int m_size
Line pensize.
Definition: sch_line.h:44

References DEFAULT, GetDefaultStyle(), m_color, m_size, and m_style.

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

Function ViewBBox() returns the bounding box of the item covering all its layers.

Returns
BOX2I - the current bounding box

Implements KIGFX::VIEW_ITEM.

Reimplemented in D_PAD, MODULE, EDIT_POINTS, GERBER_DRAW_ITEM, DRAWSEGMENT, DIMENSION, TEXTE_MODULE, TRACK, ROUTER_PREVIEW_ITEM, MARKER_PCB, KIGFX::WS_PROXY_VIEW_ITEM, MY_DRAWING, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::PREVIEW::POLYGON_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, BRIGHT_BOX, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 218 of file base_struct.cpp.

219 {
220  // Basic fallback
221  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
222  VECTOR2I( GetBoundingBox().GetSize() ) );
223 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:521
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: base_struct.cpp:95

References EDA_ITEM::GetBoundingBox().

Referenced by GERBVIEW_FRAME::GetDocumentExtents(), BRIGHT_BOX::ViewBBox(), DIMENSION::ViewBBox(), DRAWSEGMENT::ViewBBox(), and BRIGHT_BOX::ViewDraw().

◆ ViewDraw()

virtual void KIGFX::VIEW_ITEM::ViewDraw ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Function ViewDraw() Draws the parts of the object belonging to layer aLayer.

viewDraw() is an alternative way for drawing objects if if there is no PAINTER assigned for the view or if the PAINTER doesn't know how to paint this particular implementation of VIEW_ITEM. The preferred way of drawing is to design an appropriate PAINTER object, the method below is intended only for quick hacks and debugging purposes.

Parameters
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on

Reimplemented in EDIT_POINTS, ROUTER_PREVIEW_ITEM, KIGFX::VIEW_GROUP, KIGFX::WS_PROXY_VIEW_ITEM, KIGFX::PREVIEW::SELECTION_AREA, MY_DRAWING, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::VIEW_OVERLAY, KIGFX::ORIGIN_VIEWITEM, BRIGHT_BOX, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, and PCB_BRIGHT_BOX.

Definition at line 116 of file view_item.h.

117  {}

Referenced by KIGFX::VIEW::draw(), and KIGFX::VIEW::updateItemGeometry().

◆ ViewGetLayers()

void SCH_LINE::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtual

Function ViewGetLayers returns the layers the item is drawn on (which may be more than its "home" layer)

Reimplemented from SCH_ITEM.

Definition at line 197 of file sch_line.cpp.

198 {
199  aCount = 2;
200  aLayers[0] = m_Layer;
201  aLayers[1] = LAYER_SELECTION_SHADOWS;
202 }
SCH_LAYER_ID m_Layer
Definition: sch_item.h:156

References LAYER_SELECTION_SHADOWS, and SCH_ITEM::m_Layer.

◆ ViewGetLOD()

virtual unsigned int KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Function ViewGetLOD() Returns the level of detail (LOD) of the item.

A level of detail is the minimal VIEW scale that is sufficient for an item to be shown on a given layer.

Parameters
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on
Returns
the level of detail. 0 always show the item, because the actual zoom level (or VIEW scale) is always > 0

Reimplemented in MODULE_ZONE_CONTAINER, D_PAD, MODULE, VIA, GERBER_DRAW_ITEM, TEXTE_MODULE, TRACK, and EDGE_MODULE.

Definition at line 140 of file view_item.h.

141  {
142  // By default always show the item
143  return 0;
144  }

Referenced by KIGFX::VIEW::drawItem::operator()(), GRID_HELPER::queryVisible(), and SELECTION_TOOL::Selectable().

◆ viewPrivData()

◆ Visit()

SEARCH_RESULT EDA_ITEM::Visit ( INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
virtualinherited

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.

Parameters
inspectorAn INSPECTOR instance to use in the inspection.
testDataArbitrary data used by the inspector.
scanTypesWhich KICAD_T types are of interest and the order is significant too, terminated by EOT.
Returns
SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE, and determined by the inspector.

Reimplemented in BOARD, SCH_COMPONENT, MODULE, SCH_SHEET, LIB_PART, GERBER_FILE_IMAGE, GERBER_DRAW_ITEM, TRACK, and GBR_LAYOUT.

Definition at line 118 of file base_struct.cpp.

119 {
120 #if 0 && defined(DEBUG)
121  std::cout << GetClass().mb_str() << ' ';
122 #endif
123 
124  if( IsType( scanTypes ) )
125  {
126  if( SEARCH_RESULT::QUIT == inspector( this, testData ) )
127  return SEARCH_RESULT::QUIT;
128  }
129 
131 }
virtual bool IsType(const KICAD_T aScanTypes[]) const
Function IsType Checks whether the item is one of the listed types.
Definition: base_struct.h:269
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References CONTINUE, EDA_ITEM::GetClass(), EDA_ITEM::IsType(), and QUIT.

Referenced by GERBER_COLLECTOR::Collect(), GENERAL_COLLECTOR::Collect(), PCB_TYPE_COLLECTOR::Collect(), PCB_LAYER_COLLECTOR::Collect(), and EDA_ITEM::IterateForward().

Member Data Documentation

◆ m_color

COLOR4D SCH_LINE::m_color
private

Line color.

Definition at line 46 of file sch_line.h.

Referenced by GetLineColor(), Plot(), Print(), SCH_LINE(), SetLineColor(), SwapData(), and UsesDefaultStroke().

◆ m_connected_items

std::unordered_map<SCH_SHEET_PATH, ITEM_SET> SCH_ITEM::m_connected_items
protectedinherited

Stores pointers to other items that are connected to this one, per sheet.

Definition at line 163 of file sch_item.h.

Referenced by SCH_ITEM::AddConnectionTo(), SCH_ITEM::ConnectedItems(), GetMsgPanelInfo(), SCH_LABEL::IsType(), and SCH_TEXT::UpdateDanglingState().

◆ m_connection_map

std::unordered_map<SCH_SHEET_PATH, SCH_CONNECTION*> SCH_ITEM::m_connection_map
protectedinherited

Stores connectivity information, per sheet.

Definition at line 166 of file sch_item.h.

Referenced by SCH_ITEM::Connection(), SCH_ITEM::InitializeConnection(), and SCH_ITEM::~SCH_ITEM().

◆ m_connections

EDA_ITEMS SCH_ITEM::m_connections
protectedinherited

Definition at line 157 of file sch_item.h.

Referenced by SCH_ITEM::ClearConnections(), and SCH_ITEM::~SCH_ITEM().

◆ m_connectivity_dirty

bool SCH_ITEM::m_connectivity_dirty
protectedinherited

True if connectivity info might be out of date.

Definition at line 169 of file sch_item.h.

Referenced by SCH_ITEM::IsConnectivityDirty(), SCH_ITEM::SCH_ITEM(), and SCH_ITEM::SetConnectivityDirty().

◆ m_end

◆ m_endIsDangling

bool SCH_LINE::m_endIsDangling
private

True if end point is not connected.

Definition at line 41 of file sch_line.h.

Referenced by IsDangling(), IsEndDangling(), SCH_LINE(), SwapData(), and UpdateDanglingState().

◆ m_fieldsAutoplaced

◆ m_Flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_Layer

◆ m_Parent

◆ m_size

int SCH_LINE::m_size
private

Line pensize.

Definition at line 44 of file sch_line.h.

Referenced by GetBoundingBox(), GetLineSize(), GetPenWidth(), SCH_LINE(), SetLineWidth(), SwapData(), and UsesDefaultStroke().

◆ m_start

◆ m_startIsDangling

bool SCH_LINE::m_startIsDangling
private

True if start point is not connected.

Definition at line 40 of file sch_line.h.

Referenced by IsDangling(), IsStartDangling(), SCH_LINE(), SwapData(), and UpdateDanglingState().

◆ m_Status

STATUS_FLAGS EDA_ITEM::m_Status
protectedinherited

◆ m_storedPos

wxPoint SCH_ITEM::m_storedPos
protectedinherited

Definition at line 159 of file sch_item.h.

Referenced by SCH_ITEM::GetStoredPos(), and SCH_ITEM::SetStoredPos().

◆ m_style

PLOT_DASH_TYPE SCH_LINE::m_style
private

Line style.

Definition at line 45 of file sch_line.h.

Referenced by GetLineStyle(), SCH_LINE(), SetLineStyle(), SwapData(), and UsesDefaultStroke().

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 166 of file base_struct.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddHierarchicalReference(), SCH_EDIT_FRAME::AnnotateComponents(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), SCH_SHEET_PATH::Cmp(), DIALOG_LABEL_EDITOR::convertReferencesToKIIDs(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), PCB_BASE_FRAME::FocusOnItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_IO::format(), FormatProbeItem(), SCH_PIN::GetDefaultNetName(), BOARD::GetItem(), SCH_SHEET::GetMsgPanelInfo(), SCH_REFERENCE::GetPath(), SCH_COMPONENT::GetRef(), SCH_MARKER::GetUUID(), MARKER_PCB::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), SCH_LEGACY_PLUGIN::loadComponent(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), LEGACY_PLUGIN::loadTrackList(), NETLIST_EXPORTER_GENERIC::makeComponents(), SCH_EDIT_FRAME::mapExistingAnnotation(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), PCB_PARSER::parseDIMENSION(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_COMPONENT::ReplaceInstanceSheetPath(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_EDIT_FRAME::SaveProject(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_COMPONENT::SCH_COMPONENT(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), RC_ITEM::SetItems(), SwapItemData(), DIALOG_SCH_SHEET_PROPS::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ PenStyle

enum wxPenStyle SCH_LINE::PenStyle[]
static

Definition at line 50 of file sch_line.h.


The documentation for this class was generated from the following files: