KiCad PCB EDA Suite
LIB_PIN Class Reference

#include <lib_pin.h>

Inheritance diagram for LIB_PIN:
LIB_ITEM EDA_ITEM KIGFX::VIEW_ITEM

Public Member Functions

 LIB_PIN (LIB_PART *aParent)
 
 ~LIB_PIN ()
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
wxString GetTypeName () override
 Provide a user-consumable name of the object type. More...
 
bool HitTest (const wxPoint &aPosition) const override
 Function HitTest tests if aPosition is contained within or on the bounding area of an item. More...
 
bool HitTest (const wxPoint &aPosRef, int aThreshold, const TRANSFORM &aTransform) const override
 
void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
 Display basic info (type, part and convert) about the current item in message panel. More...
 
void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList, SCH_COMPONENT *aComponent)
 Display pin info (given by GetMsgPanelInfo) and add some info related to aComponent (schematic pin position, and sheet path) More...
 
bool Matches (wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation) override
 Function Matches compares the item against the search criteria in aSearchData. More...
 
const EDA_RECT GetBoundingBox () const override
 
const EDA_RECT GetBoundingBox (bool aIncludeInvisibles) const
 
wxPoint PinEndPoint () const
 
int PinDrawOrient (const TRANSFORM &aTransform) const
 Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation and the matrix transform (rot, mirror) aTransform. More...
 
const wxString & GetName () const
 
void SetName (const wxString &aName, bool aTestOtherPins=true)
 Set the pin name. More...
 
void SetNameTextSize (int aSize, bool aTestOtherPins=true)
 Set the aSize of the pin name text. More...
 
int GetNameTextSize () const
 
const wxString & GetNumber () const
 
void SetNumber (const wxString &aNumber)
 Set the pin number. More...
 
void SetNumberTextSize (int aSize, bool aTestOtherPins=true)
 Set the size of the pin number text. More...
 
int GetNumberTextSize () const
 
int GetOrientation () const
 
void SetOrientation (int aOrientation, bool aTestOtherPins=true)
 Set orientation on the pin. More...
 
void Rotate () override
 Rotate the draw item. More...
 
GRAPHIC_PINSHAPE GetShape () const
 
void SetShape (GRAPHIC_PINSHAPE aShape)
 Set the shape of the pin to aShape. More...
 
ELECTRICAL_PINTYPE GetType () const
 Get the electrical type of the pin. More...
 
wxString const GetCanonicalElectricalTypeName () const
 return a string giving the electrical type of the pin. More...
 
wxString const GetElectricalTypeName () const
 return a translated string for messages giving the electrical type of the pin. More...
 
void SetType (ELECTRICAL_PINTYPE aType, bool aTestOtherPins=true)
 Set the electrical type of the pin. More...
 
void SetLength (int aLength, bool aTestOtherPins=true)
 Set the pin length. More...
 
int GetLength ()
 
void SetPartNumber (int aPart)
 Set the pin part number. More...
 
int GetPartNumber () const
 Get the pin part number. More...
 
void SetConversion (int aConversion)
 Set the body style (conversion) of the pin. More...
 
void SetVisible (bool aVisible)
 Set or clear the visibility flag for the pin. More...
 
void EnableEditMode (bool aEnable, bool aEditPinByPin=false)
 Enable or clear pin editing mode. More...
 
bool IsVisible () const
 Return the visibility status of the draw object. More...
 
bool IsPowerConnection () const
 Return whether this pin forms an implicit power connection: i.e., is hidden and of type POWER_IN. More...
 
int GetPenSize () const override
 
void DrawPinSymbol (EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aPosition, int aOrientation, GR_DRAWMODE aDrawMode, COLOR4D aColor=COLOR4D::UNSPECIFIED, bool aDrawDangling=true, bool aOnlyTarget=false)
 Draw the pin symbol without text. More...
 
void DrawPinTexts (EDA_DRAW_PANEL *aPanel, wxDC *aDC, wxPoint &aPosition, int aOrientation, int TextInside, bool DrawPinNum, bool DrawPinName, COLOR4D aColor, GR_DRAWMODE aDrawMode)
 Put the pin number and pin text info, given the pin line coordinates. More...
 
void DrawPinElectricalTypeName (EDA_DRAW_PANEL *aPanel, wxDC *aDC, wxPoint &aPosition, int aOrientation, COLOR4D aColor, GR_DRAWMODE aDrawMode)
 Draw the electrical type text of the pin (only for the footprint editor) aDrawMode = GR_OR, XOR ... More...
 
void PlotPinTexts (PLOTTER *aPlotter, wxPoint &aPosition, int aOrientation, int aTextInside, bool aDrawPinNum, bool aDrawPinName, int aWidth)
 Plot the pin number and pin text info, given the pin line coordinates. More...
 
void PlotSymbol (PLOTTER *aPlotter, const wxPoint &aPosition, int aOrientation)
 
void SetOffset (const wxPoint &aOffset) override
 Set the drawing object by aOffset from the current position. More...
 
bool Inside (EDA_RECT &aRect) const override
 Test if any part of the draw object is inside rectangle bounds of aRect. More...
 
void Move (const wxPoint &aPosition) override
 Move a draw object to aPosition. More...
 
wxPoint GetPosition () const override
 Return the current draw object position. More...
 
void SetPinPosition (wxPoint aPosition)
 move this and all linked pins to the new position used in pin editing. More...
 
void MirrorHorizontal (const wxPoint &aCenter) override
 Mirror the draw object along the horizontal (X) axis about aCenter point. More...
 
void MirrorVertical (const wxPoint &aCenter) override
 Mirror the draw object along the MirrorVertical (Y) axis about aCenter point. More...
 
void Rotate (const wxPoint &aCenter, bool aRotateCCW=true) override
 Rotate the object about aCenter point. More...
 
void Plot (PLOTTER *aPlotter, const wxPoint &aOffset, bool aFill, const TRANSFORM &aTransform) override
 Plot the draw item using the plot object. More...
 
int GetWidth () const override
 Return the width of the draw item. More...
 
void SetWidth (int aWidth) override
 Set the width of the draw item to aWidth. More...
 
BITMAP_DEF GetMenuImage () const override
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
wxString GetSelectMenuText (EDA_UNITS_T 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...
 
EDA_ITEMClone () const override
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
void CalcEdit (const wxPoint &aPosition) override
 Calculates the attributes of an item at aPosition when it is being edited. More...
 
virtual void BeginEdit (STATUS_FLAGS aEditMode, const wxPoint aPosition=wxPoint(0, 0))
 Begin an editing a component library draw item in aEditMode at aPosition. More...
 
virtual bool ContinueEdit (const wxPoint aPosition)
 Continue an edit in progress at aPosition. More...
 
virtual void EndEdit (const wxPoint &aPosition, bool aAbort=false)
 End an object editing action. More...
 
virtual void Draw (EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void *aData, const TRANSFORM &aTransform)
 Draw an item. More...
 
LIB_PARTGetParent () const
 
void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. More...
 
bool operator== (const LIB_ITEM &aOther) const
 Test LIB_ITEM objects for equivalence. More...
 
bool operator== (const LIB_ITEM *aOther) const
 
bool operator< (const LIB_ITEM &aOther) const
 Test if another draw item is less than this draw object. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
void SetPosition (const wxPoint &aPosition)
 
bool IsFillable () const
 Check if draw object can be filled. More...
 
bool InEditMode () const
 Return the draw item editing mode status. More...
 
virtual COLOR4D GetDefaultColor ()
 
void SetUnit (int aUnit)
 
int GetUnit () const
 
void SetConvert (int aConvert)
 
int GetConvert () const
 
void SetFillMode (FILL_T aFillMode)
 
FILL_T GetFillMode () const
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (timestamp_t aNewTimeStamp)
 
timestamp_t GetTimeStamp () const
 
EDA_ITEMNext () const
 
EDA_ITEMBack () const
 
DHEADGetList () const
 
void SetNext (EDA_ITEM *aNext)
 
void SetBack (EDA_ITEM *aBack)
 
void SetParent (EDA_ITEM *aParent)
 
void SetList (DHEAD *aList)
 
bool IsNew () const
 
bool IsModified () 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 IsType (const KICAD_T aScanTypes[])
 Function IsType Checks whether the item is one of the listed types. More...
 
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...
 
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...
 
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...
 
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 const wxString GetCanonicalElectricalTypeName (ELECTRICAL_PINTYPE aType)
 return a string giving the electrical type of a pin. More...
 
static wxArrayString GetOrientationNames ()
 Get a list of pin orientation names. More...
 
static const BITMAP_DEF * GetOrientationSymbols ()
 Get a list of pin orientation bitmaps for menus and dialogs. More...
 
static int GetOrientationCode (int aIndex)
 Get the orientation code by index used to set the pin orientation. More...
 
static int GetOrientationIndex (int aCode)
 Get the index of the orientation code. More...
 
static SEARCH_RESULT IterateForward (EDA_ITEM *listStart, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes. 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...
 

Protected Member Functions

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

Protected Attributes

int m_Unit
 Unit identification for multiple parts per package. More...
 
int m_Convert
 Shape identification for alternate body styles. More...
 
FILL_T m_Fill
 The body fill type. More...
 
wxPoint m_initialPos
 Temporary position when moving an existing item. More...
 
wxPoint m_initialCursorPos
 Initial cursor position at the beginning of a move. More...
 
bool m_isFillable
 Flag to indicate if draw item is fillable. More...
 
EDA_ITEMPnext
 next in linked list More...
 
EDA_ITEMPback
 previous in linked list More...
 
DHEADm_List
 which DLIST I am on. More...
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
timestamp_t m_TimeStamp
 Time stamp used for logical links. More...
 
bool m_forceVisible
 Set to true to override the visibility setting of the item. More...
 
STATUS_FLAGS m_Flags
 Flag bits for editing and other uses. More...
 

Private Member Functions

void drawGraphic (EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void *aData, const TRANSFORM &aTransform) override
 Draw a pin, with or without the pin texts. More...
 
void getMsgPanelInfoBase (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList)
 Build the pin basic info to display in message panel. More...
 
int compare (const LIB_ITEM &aOther) const override
 Provide the draw object specific comparison called by the == and < operators. More...
 

Private Attributes

wxPoint m_position
 Position of the pin. More...
 
int m_length
 Length of the pin. More...
 
int m_orientation
 Pin orientation (Up, Down, Left, Right) More...
 
GRAPHIC_PINSHAPE m_shape
 Shape drawn around pin. More...
 
int m_width
 Line width of the pin. More...
 
ELECTRICAL_PINTYPE m_type
 Electrical type of the pin. See enum ELECTRICAL_PINTYPE. More...
 
int m_attributes
 Set bit 0 to indicate pin is invisible. More...
 
wxString m_name
 
wxString m_number
 
int m_numTextSize
 
int m_nameTextSize
 Pin num and Pin name sizes. More...
 

Friends

class SCH_LEGACY_PLUGIN_CACHE
 

Detailed Description

Definition at line 68 of file lib_pin.h.

Constructor & Destructor Documentation

◆ LIB_PIN()

LIB_PIN::LIB_PIN ( LIB_PART aParent)

Definition at line 147 of file lib_pin.cpp.

147  :
148  LIB_ITEM( LIB_PIN_T, aParent ),
150 {
152  m_orientation = PIN_RIGHT; // Pin orient: Up, Down, Left, Right
153  m_type = PIN_UNSPECIFIED; // electrical type of pin
154  m_attributes = 0; // bit 0 != 0: pin invisible
157  m_width = 0;
158 }
int m_nameTextSize
Pin num and Pin name sizes.
Definition: lib_pin.h:85
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78
int m_numTextSize
Definition: lib_pin.h:84
static int GetDefaultPinLength()
int m_length
Length of the pin.
Definition: lib_pin.h:76
static int GetPinNumDefaultSize()
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
int m_attributes
Set bit 0 to indicate pin is invisible.
Definition: lib_pin.h:81
static int GetPinNameDefaultSize()
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80
LIB_ITEM(KICAD_T aType, LIB_PART *aComponent=NULL, int aUnit=0, int aConvert=0, FILL_T aFillType=NO_FILL)
int m_width
Line width of the pin.
Definition: lib_pin.h:79

References LIB_EDIT_FRAME::GetDefaultPinLength(), LIB_EDIT_FRAME::GetPinNameDefaultSize(), LIB_EDIT_FRAME::GetPinNumDefaultSize(), m_attributes, m_length, m_nameTextSize, m_numTextSize, m_orientation, m_type, m_width, PIN_RIGHT, and PIN_UNSPECIFIED.

Referenced by Clone().

◆ ~LIB_PIN()

LIB_PIN::~LIB_PIN ( )
inline

Definition at line 111 of file lib_pin.h.

111 { }

Member Function Documentation

◆ Back()

EDA_ITEM* EDA_ITEM::Back ( ) const
inlineinherited

Definition at line 210 of file base_struct.h.

210 { return Pback; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:168

References EDA_ITEM::Pback.

Referenced by DHEAD::insert(), and DHEAD::remove().

◆ BeginEdit()

virtual void LIB_ITEM::BeginEdit ( STATUS_FLAGS  aEditMode,
const wxPoint  aPosition = wxPoint( 0, 0 ) 
)
inlinevirtualinherited

Begin an editing a component library draw item in aEditMode at aPosition.

This is used to start an editing action such as resize or move a draw object. It typically would be called on a left click when a draw tool is selected in the component library editor and one of the graphics tools is selected. It allows the draw item to maintain it's own internal state while it is being edited. Call AbortEdit() to quit the editing mode.

Parameters
aEditModeThe editing mode being performed. See base_struct.h for a list of mode flags.
aPositionThe position in drawing coordinates where the editing mode was started. This may or may not be required depending on the item being edited and the edit mode.

Reimplemented in LIB_FIELD, LIB_ARC, LIB_TEXT, LIB_POLYLINE, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 158 of file lib_draw_item.h.

158 {}

Referenced by LIB_EDIT_FRAME::CreateGraphicItem(), LIB_EDIT_FRAME::StartModifyDrawSymbol(), and LIB_EDIT_FRAME::StartMoveDrawSymbol().

◆ CalcEdit()

void LIB_PIN::CalcEdit ( const wxPoint &  aPosition)
overridevirtual

Calculates the attributes of an item at aPosition when it is being edited.

This method gets called by the Draw() method when the item is being edited. This probably should be a pure virtual method but bezier curves are not yet editable in the component library editor. Therefore, the default method does nothing.

Parameters
aPositionThe current mouse position in drawing coordinates.

Reimplemented from LIB_ITEM.

Definition at line 2008 of file lib_pin.cpp.

2009 {
2010  DBG(printf("m_Flags %x\n", m_Flags );)
2011  if( m_Flags == IS_NEW )
2012  {
2013  SetPosition( aPosition );
2014  }
2015  else if( m_Flags == IS_MOVED )
2016  {
2017  DBG(printf("MOVEPIN\n");)
2018  Move( aPosition );
2019  }
2020 }
void SetPosition(const wxPoint &aPosition)
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
void Move(const wxPoint &aPosition) override
Move a draw object to aPosition.
Definition: lib_pin.cpp:1595
#define DBG(x)
Definition: fctsys.h:33
#define IS_MOVED
Item being moved.
Definition: base_struct.h:113

References DBG, IS_MOVED, IS_NEW, EDA_ITEM::m_Flags, Move(), and LIB_ITEM::SetPosition().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 236 of file base_struct.h.

236 { ClearFlags( BRIGHTENED ); }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:138
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), and SELECTION_TOOL::unhighlight().

◆ ClearFlags()

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

Definition at line 257 of file base_struct.h.

257 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References EDA_ITEM::m_Flags.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_Move_Pad(), Abort_MoveOrCopyModule(), Abort_MoveTrack(), Abort_Zone_Create_Outline(), Abort_Zone_Move_Corner_Or_Outlines(), AbortMoveAndEditTarget(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), AbortPinMove(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_EDIT_FRAME::addCurrentItemToScreen(), PNS_KICAD_IFACE::AddItem(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), LIB_EDIT_FRAME::BlockCopySelectedItems(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_COMPONENT::ClearAllHighlightFlags(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearHighlighted(), ClearMarkItems(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), MWAVE::CreateMicrowaveInductor(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment_Edge(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::Exchange_Module(), ExitSheet(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), MarkItemsInBloc(), MirrorX(), MirrorY(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnOrient(), LIB_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_FIELD::Place(), PCB_EDIT_FRAME::Place_DrawItem(), FOOTPRINT_EDIT_FRAME::Place_EdgeMod(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_EDIT_FRAME::PlaceDimensionText(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlacePad(), PCB_EDIT_FRAME::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_BASE_FRAME::PlaceTexteModule(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), BOARD_COMMIT::Revert(), PCB_BASE_FRAME::Rotate_Module(), RotateListOfItems(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SetRepeatItem(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ ClearHighlighted()

void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 235 of file base_struct.h.

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

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

◆ ClearSelected()

void EDA_ITEM::ClearSelected ( )
inlineinherited

Definition at line 234 of file base_struct.h.

234 { ClearFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257

References EDA_ITEM::ClearFlags(), and SELECTED.

Referenced by POINT_EDITOR::addCorner(), EDIT_TOOL::Duplicate(), GAL_ARRAY_CREATOR::prePushAction(), SELECTION_TOOL::unhighlight(), and GERBVIEW_SELECTION_TOOL::unselectVisually().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 153 of file view_item.h.

154  {
155  m_viewPrivData = NULL;
156  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:161

References KIGFX::VIEW_ITEM::m_viewPrivData.

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

◆ Clone()

EDA_ITEM * LIB_PIN::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 1551 of file lib_pin.cpp.

1552 {
1553  return new LIB_PIN( *this );
1554 }
LIB_PIN(LIB_PART *aParent)
Definition: lib_pin.cpp:147

References LIB_PIN().

Referenced by LIB_EDIT_FRAME::CreateImagePins(), DrawMovePin(), and LIB_EDIT_FRAME::RepeatPinItem().

◆ compare()

int LIB_PIN::compare ( const LIB_ITEM aOther) const
overrideprivatevirtual

Provide the draw object specific comparison called by the == and < operators.

The base object sort order which always proceeds the derived object sort order is as follows:

  • Component alternate part (DeMorgan) number.
  • Component part number.
  • KICAD_T enum value.
  • Result of derived classes comparison.
Parameters
aOtherA reference to the other LIB_ITEM to compare the arc against.
Returns
An integer value less than 0 if the object is less than aOther ojbect, zero if the object is equal to aOther object, or greater than 0 if the object is greater than aOther object.

The pin specific sort order is as follows:

  • Pin number.
  • Pin name, case insensitive compare.
  • Pin horizontal (X) position.
  • Pin vertical (Y) position.

Implements LIB_ITEM.

Definition at line 1557 of file lib_pin.cpp.

1558 {
1559  wxASSERT( other.Type() == LIB_PIN_T );
1560 
1561  const LIB_PIN* tmp = (LIB_PIN*) &other;
1562 
1563  if( m_number != tmp->m_number )
1564  return m_number.Cmp( tmp->m_number );
1565 
1566  int result = m_name.CmpNoCase( tmp->m_name );
1567 
1568  if( result != 0 )
1569  return result;
1570 
1571  if( m_position.x != tmp->m_position.x )
1572  return m_position.x - tmp->m_position.x;
1573 
1574  if( m_position.y != tmp->m_position.y )
1575  return m_position.y - tmp->m_position.y;
1576 
1577  return 0;
1578 }
wxString m_name
Definition: lib_pin.h:82
wxString m_number
Definition: lib_pin.h:83
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References LIB_PIN_T, m_name, m_number, m_position, and EDA_ITEM::Type().

◆ ContinueEdit()

virtual bool LIB_ITEM::ContinueEdit ( const wxPoint  aPosition)
inlinevirtualinherited

Continue an edit in progress at aPosition.

This is used to perform the next action while editing a draw item. This would be called for each additional left click when the mouse is captured while the item is being edited.

Parameters
aPositionThe position of the mouse left click in drawing coordinates.
Returns
True if additional mouse clicks are required to complete the edit in progress.

Reimplemented in LIB_FIELD, LIB_ARC, LIB_TEXT, LIB_POLYLINE, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 170 of file lib_draw_item.h.

170 { return false; }

◆ Draw()

void LIB_ITEM::Draw ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
const wxPoint &  aOffset,
COLOR4D  aColor,
GR_DRAWMODE  aDrawMode,
void *  aData,
const TRANSFORM aTransform 
)
virtualinherited

Draw an item.

Parameters
aPanelDrawPanel to use (can be null) mainly used for clipping purposes.
aDCDevice Context (can be null)
aOffsetOffset to draw
aColorDraw color, or COLOR4D::UNSPECIFIED to use the normal body item color
aDrawModeGR_OR, GR_XOR, ...
aDataValue or pointer used to pass others parameters, depending on body items. Used for some items to force to force no fill mode ( has meaning only for items what can be filled ). used in printing or moving objects mode or to pass reference to the lib component for pins.
aTransformTransform Matrix (rotation, mirror ..)

Definition at line 114 of file lib_draw_item.cpp.

118 {
119  #if 0
120  if( InEditMode() )
121  {
122  // Temporarily disable filling while the item is being edited.
123  FILL_T fillMode = m_Fill;
125 
126  m_Fill = NO_FILL;
127 
128 #ifndef USE_WX_OVERLAY
129  // Erase the old items using the previous attributes.
130  if( m_eraseLastDrawItem )
131  {
132  GRSetDrawMode( aDC, g_XorMode );
133  drawEditGraphics( aPanel->GetClipBox(), aDC, color );
134  drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData,
135  aTransform );
136  }
137 #endif
138  // Calculate the new attributes at the current cursor position.
139  CalcEdit( aOffset );
140 
141  // Draw the items using the new attributes.
142  drawEditGraphics( aPanel->GetClipBox(), aDC, color );
143  drawGraphic( aPanel, aDC, wxPoint( 0, 0 ), color, g_XorMode, aData,
144  aTransform );
145 
146  m_Fill = fillMode;
147  }
148  else
149  #endif
150  {
151  drawGraphic( aPanel, aDC, aOffset, aColor, aDrawMode, aData, aTransform );
152  }
153 }
GR_DRAWMODE g_XorMode
Definition: gr_basic.cpp:74
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
virtual COLOR4D GetDefaultColor()
int color
Definition: DXF_plotter.cpp:62
virtual EDA_RECT * GetClipBox()
virtual void CalcEdit(const wxPoint &aPosition)
Calculates the attributes of an item at aPosition when it is being edited.
bool InEditMode() const
Return the draw item editing mode status.
virtual void drawEditGraphics(EDA_RECT *aClipBox, wxDC *aDC, COLOR4D aColor)
Draw any editing specific graphics when the item is being edited.
Definition: lib_draw_item.h:94
virtual void drawGraphic(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void *aData, const TRANSFORM &aTransform)=0
Draw the item on aPanel.
FILL_T m_Fill
The body fill type.
FILL_T
Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas.
Definition: base_struct.h:54
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References LIB_ITEM::CalcEdit(), color, LIB_ITEM::drawEditGraphics(), LIB_ITEM::drawGraphic(), g_XorMode, EDA_DRAW_PANEL::GetClipBox(), LIB_ITEM::GetDefaultColor(), GRSetDrawMode(), LIB_ITEM::InEditMode(), LIB_ITEM::m_Fill, and NO_FILL.

Referenced by LIB_EDIT_FRAME::EditSymbolText(), DIALOG_LIB_EDIT_PIN::OnPaintShowPanel(), and LIB_PART::RemoveDrawItem().

◆ drawGraphic()

void LIB_PIN::drawGraphic ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
const wxPoint &  aOffset,
COLOR4D  aColor,
GR_DRAWMODE  aDrawMode,
void *  aData,
const TRANSFORM aTransform 
)
overrideprivatevirtual

Draw a pin, with or without the pin texts.

Parameters
aPanelDrawPanel to use (can be null) mainly used for clipping purposes.
aDCDevice Context (can be null)
aOffsetOffset to draw
aColorCOLOR4D::UNSPECIFIED to use the normal body item color, or else use this color
aDrawModeGR_OR, GR_XOR, ...
aData= used here as uintptr_t containing bitwise OR'd flags: PIN_DRAW_TEXTS, – false to draw only pin shape, useful for fast mode PIN_DRAW_DANGLING, – true to draw the pin with its target PIN_DANGLING_HIDDEN – draw the target even if the pin is hidden PIN_DRAW_ELECTRICAL_TYPE_NAME – Draw the pin electrical type name
aTransformTransform Matrix (rotation, mirror ..)

Implements LIB_ITEM.

Definition at line 576 of file lib_pin.cpp.

583 {
584  // aData is used here as a bitfield of flags.
585  uintptr_t flags = (uintptr_t) aData;
586  bool drawPinText = flags & PIN_DRAW_TEXTS;
587  bool drawPinDangling = flags & PIN_DRAW_DANGLING;
588  bool drawDanglingHidden = flags & PIN_DANGLING_HIDDEN;
589  bool drawElectricalTypeName = flags & PIN_DRAW_ELECTRICAL_TYPE_NAME;
590 
591  LIB_PART* Entry = GetParent();
592 
593  /* Calculate pin orient taking in account the component orientation. */
594  int orient = PinDrawOrient( aTransform );
595 
596  /* Calculate the pin position */
597  wxPoint pos1 = aTransform.TransformCoordinate( m_position ) + aOffset;
598 
599  // Invisible pins are only drawn on request.
600  // They are drawn in GetInvisibleItemColor().
601  if( ! IsVisible() )
602  {
603  bool drawHidden = true;
604 
605  if( aPanel && aPanel->GetParent() )
606  {
607  EDA_DRAW_FRAME* frame = aPanel->GetParent();
608 
609  if( frame->IsType( FRAME_SCH ) )
610  drawHidden = static_cast<SCH_EDIT_FRAME*>( frame )->GetShowAllPins();
611  }
612 
613  if( !drawHidden )
614  {
615  if( drawPinDangling && drawDanglingHidden )
616  {
617  // Draw the target
618  DrawPinSymbol( aPanel, aDC, pos1, orient, aDrawMode, aColor, drawPinDangling,
619  /* aOnlyTarget */ true );
620  }
621  return;
622  }
623 
624  aColor = GetInvisibleItemColor();
625  }
626 
627  /* Drawing from the pin and the special symbol combination */
628  DrawPinSymbol( aPanel, aDC, pos1, orient, aDrawMode, aColor, drawPinDangling );
629 
630  if( drawPinText )
631  {
632  DrawPinTexts( aPanel, aDC, pos1, orient, Entry->GetPinNameOffset(),
633  Entry->ShowPinNumbers(), Entry->ShowPinNames(),
634  aColor, aDrawMode );
635  }
636 
637  if( drawElectricalTypeName )
638  DrawPinElectricalTypeName( aPanel, aDC, pos1, orient, aColor, aDrawMode );
639 
640 
641  /* Set to one (1) to draw bounding box around pin to validate bounding
642  * box calculation. */
643 #if 0
644  EDA_RECT bBox = GetBoundingBox();
645  bBox.RevertYAxis();
646  bBox = aTransform.TransformCoordinate( bBox );
647  bBox.Move( aOffset );
648  GRRect( aPanel ? aPanel->GetClipBox() : NULL, aDC, bBox, 0, LIGHTMAGENTA );
649 #endif
650 }
void Move(const wxPoint &aMoveVector)
Function Move moves the rectangle by the aMoveVector.
void DrawPinElectricalTypeName(EDA_DRAW_PANEL *aPanel, wxDC *aDC, wxPoint &aPosition, int aOrientation, COLOR4D aColor, GR_DRAWMODE aDrawMode)
Draw the electrical type text of the pin (only for the footprint editor) aDrawMode = GR_OR,...
Definition: lib_pin.cpp:1066
int GetPinNameOffset()
LIB_PART * GetParent() const
virtual EDA_RECT * GetClipBox()
const EDA_RECT GetBoundingBox() const override
Definition: lib_pin.h:145
The base class for create windows for drawing purpose.
Definition: draw_frame.h:81
int PinDrawOrient(const TRANSFORM &aTransform) const
Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation...
Definition: lib_pin.cpp:1506
void RevertYAxis()
Function RevertYAxis Mirror the rectangle from the X axis (negate Y pos and size)
Definition: eda_rect.h:144
COLOR4D GetInvisibleItemColor()
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:41
virtual EDA_DRAW_FRAME * GetParent() const =0
bool ShowPinNames()
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:1003
bool ShowPinNumbers()
Define a library symbol object.
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:362
void DrawPinTexts(EDA_DRAW_PANEL *aPanel, wxDC *aDC, wxPoint &aPosition, int aOrientation, int TextInside, bool DrawPinNum, bool DrawPinName, COLOR4D aColor, GR_DRAWMODE aDrawMode)
Put the pin number and pin text info, given the pin line coordinates.
Definition: lib_pin.cpp:852
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
bool IsType(FRAME_T aType) const
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void DrawPinSymbol(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aPosition, int aOrientation, GR_DRAWMODE aDrawMode, COLOR4D aColor=COLOR4D::UNSPECIFIED, bool aDrawDangling=true, bool aOnlyTarget=false)
Draw the pin symbol without text.
Definition: lib_pin.cpp:653

References DrawPinElectricalTypeName(), DrawPinSymbol(), DrawPinTexts(), FRAME_SCH, GetBoundingBox(), EDA_DRAW_PANEL::GetClipBox(), GetInvisibleItemColor(), EDA_DRAW_PANEL::GetParent(), LIB_ITEM::GetParent(), LIB_PART::GetPinNameOffset(), GRRect(), EDA_BASE_FRAME::IsType(), IsVisible(), LIGHTMAGENTA, m_position, EDA_RECT::Move(), PIN_DANGLING_HIDDEN, PIN_DRAW_DANGLING, PIN_DRAW_ELECTRICAL_TYPE_NAME, PIN_DRAW_TEXTS, PinDrawOrient(), EDA_RECT::RevertYAxis(), LIB_PART::ShowPinNames(), LIB_PART::ShowPinNumbers(), and TRANSFORM::TransformCoordinate().

◆ DrawPinElectricalTypeName()

void LIB_PIN::DrawPinElectricalTypeName ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
wxPoint &  aPosition,
int  aOrientation,
COLOR4D  aColor,
GR_DRAWMODE  aDrawMode 
)

Draw the electrical type text of the pin (only for the footprint editor) aDrawMode = GR_OR, XOR ...

Definition at line 1066 of file lib_pin.cpp.

1069 {
1070  wxString etypeName = GetElectricalTypeName();
1071 
1072  // Use a reasonable (small) size to draw the text
1073  int etextSize = (m_nameTextSize*3)/4;
1074 
1075  #define ETXT_MAX_SIZE Millimeter2iu(0.7 )
1076  if( etextSize > ETXT_MAX_SIZE )
1077  etextSize = ETXT_MAX_SIZE;
1078 
1079  // Use a reasonable pen size to draw the text
1080  int pensize = etextSize/6;
1081 
1082  // Get a suitable color
1083  if( ( aColor == COLOR4D::UNSPECIFIED ) && IsSelected() )
1084  aColor = GetItemSelectedColor();
1085  else if( !IsVisible() )
1086  aColor = GetInvisibleItemColor();
1087  else
1088  aColor = GetLayerColor( LAYER_NOTES );
1089 
1090  wxPoint txtpos = aPosition;
1091  int offset = Millimeter2iu( 0.4 );
1093  int orient = TEXT_ANGLE_HORIZ;
1094 
1095  switch( aOrientation )
1096  {
1097  case PIN_UP:
1098  txtpos.y += offset;
1099  orient = TEXT_ANGLE_VERT;
1100  hjustify = GR_TEXT_HJUSTIFY_RIGHT;
1101  break;
1102 
1103  case PIN_DOWN:
1104  txtpos.y -= offset;
1105  orient = TEXT_ANGLE_VERT;
1106  break;
1107 
1108  case PIN_LEFT:
1109  txtpos.x += offset;
1110  break;
1111 
1112  case PIN_RIGHT:
1113  txtpos.x -= offset;
1114  hjustify = GR_TEXT_HJUSTIFY_RIGHT;
1115  break;
1116  }
1117 
1118  GRSetDrawMode( aDC, aDrawMode );
1119  EDA_RECT* clipbox = aPanel? aPanel->GetClipBox() : NULL;
1120 
1121  DrawGraphicText( clipbox, aDC, txtpos, aColor, etypeName,
1122  orient, wxSize( etextSize, etextSize ),
1123  hjustify, GR_TEXT_VJUSTIFY_CENTER, pensize,
1124  false, false );
1125 }
#define TEXT_ANGLE_HORIZ
int m_nameTextSize
Pin num and Pin name sizes.
Definition: lib_pin.h:85
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:62
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
#define ETXT_MAX_SIZE
bool IsSelected() const
Definition: base_struct.h:224
#define TEXT_ANGLE_VERT
virtual EDA_RECT * GetClipBox()
Definition: lib_pin.h:55
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
COLOR4D GetInvisibleItemColor()
void DrawGraphicText(EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
wxString const GetElectricalTypeName() const
return a translated string for messages giving the electrical type of the pin.
Definition: lib_pin.h:275
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:362
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
COLOR4D GetItemSelectedColor()

References DrawGraphicText(), ETXT_MAX_SIZE, EDA_DRAW_PANEL::GetClipBox(), GetElectricalTypeName(), GetInvisibleItemColor(), GetItemSelectedColor(), GetLayerColor(), GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, GRSetDrawMode(), EDA_ITEM::IsSelected(), IsVisible(), LAYER_NOTES, m_nameTextSize, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, TEXT_ANGLE_HORIZ, and TEXT_ANGLE_VERT.

Referenced by drawGraphic().

◆ DrawPinSymbol()

void LIB_PIN::DrawPinSymbol ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
const wxPoint &  aPosition,
int  aOrientation,
GR_DRAWMODE  aDrawMode,
COLOR4D  aColor = COLOR4D::UNSPECIFIED,
bool  aDrawDangling = true,
bool  aOnlyTarget = false 
)

Draw the pin symbol without text.

If aColor != 0, draw with aColor, else with the normal pin color.

Definition at line 653 of file lib_pin.cpp.

661 {
662  int MapX1, MapY1, x1, y1;
663  int width = GetPenSize();
664  int posX = aPinPos.x, posY = aPinPos.y, len = m_length;
665  EDA_RECT* clipbox = aPanel ? aPanel->GetClipBox() : NULL;
666 
668 
669  if( aColor == COLOR4D::UNSPECIFIED ) // Used normal color or selected color
670  {
671  if( IsSelected() )
673  }
674  else
675  color = aColor;
676 
677  GRSetDrawMode( aDC, aDrawMode );
678 
679  MapX1 = MapY1 = 0;
680  x1 = posX;
681  y1 = posY;
682 
683  switch( aOrient )
684  {
685  case PIN_UP:
686  y1 = posY - len;
687  MapY1 = 1;
688  break;
689 
690  case PIN_DOWN:
691  y1 = posY + len;
692  MapY1 = -1;
693  break;
694 
695  case PIN_LEFT:
696  x1 = posX - len;
697  MapX1 = 1;
698  break;
699 
700  case PIN_RIGHT:
701  x1 = posX + len;
702  MapX1 = -1;
703  break;
704  }
705 
706  // Draw the pin end target (active end of the pin)
707  BASE_SCREEN* screen = aPanel ? aPanel->GetScreen() : NULL;
708  #define NCSYMB_PIN_DIM TARGET_PIN_RADIUS
709 
710  // Draw but do not print the pin end target 1 pixel width
711  if( m_type != PIN_NC && ( screen == NULL || !screen->m_IsPrinting ) )
712  {
713  if( aDrawDangling )
714  GRCircle( clipbox, aDC, posX, posY, TARGET_PIN_RADIUS, 0, color );
715  }
716 
717  if( aOnlyTarget )
718  return;
719 
720 
722  {
723  const int radius = ExternalPinDecoSize( *this );
724  GRCircle( clipbox, aDC, MapX1 * radius + x1,
725  MapY1 * radius + y1,
726  radius, width, color );
727 
728  GRMoveTo( MapX1 * radius * 2 + x1,
729  MapY1 * radius * 2 + y1 );
730  GRLineTo( clipbox, aDC, posX, posY, width, color );
731  }
732  else if( m_shape == PINSHAPE_FALLING_EDGE_CLOCK ) /* an alternative for Inverted Clock */
733  {
734  const int clock_size = InternalPinDecoSize( *this );
735  if( MapY1 == 0 ) /* MapX1 = +- 1 */
736  {
737  GRMoveTo( x1, y1 + clock_size );
738  GRLineTo( clipbox, aDC, x1 + MapX1 * clock_size * 2, y1,
739  width, color );
740  GRLineTo( clipbox, aDC, x1, y1 - clock_size, width, color );
741  }
742  else /* MapX1 = 0 */
743  {
744  GRMoveTo( x1 + clock_size, y1 );
745  GRLineTo( clipbox, aDC, x1, y1 + MapY1 * clock_size * 2,
746  width, color );
747  GRLineTo( clipbox, aDC, x1 - clock_size, y1,
748  width, color );
749  }
750  GRMoveTo( MapX1 * clock_size * 2 + x1, MapY1 * clock_size * 2 + y1 );
751  GRLineTo( clipbox, aDC, posX, posY, width, color );
752  }
753  else
754  {
755  GRMoveTo( x1, y1 );
756  GRLineTo( clipbox, aDC, posX, posY, width, color );
757  }
758 
760  {
761  const int clock_size = InternalPinDecoSize( *this );
762  if( MapY1 == 0 ) /* MapX1 = +- 1 */
763  {
764  GRMoveTo( x1, y1 + clock_size );
765  GRLineTo( clipbox, aDC, x1 - MapX1 * clock_size * 2, y1,
766  width, color );
767  GRLineTo( clipbox, aDC, x1, y1 - clock_size,
768  width, color );
769  }
770  else /* MapX1 = 0 */
771  {
772  GRMoveTo( x1 + clock_size, y1 );
773  GRLineTo( clipbox, aDC, x1, y1 - MapY1 * clock_size * 2,
774  width, color );
775  GRLineTo( clipbox, aDC, x1 - clock_size, y1,
776  width, color );
777  }
778  }
779 
781  {
782  const int symbol_size = ExternalPinDecoSize( *this );
783  if( MapY1 == 0 ) /* MapX1 = +- 1 */
784  {
785  GRMoveTo( x1 + MapX1 * symbol_size * 2, y1 );
786  GRLineTo( clipbox, aDC,
787  x1 + MapX1 * symbol_size * 2, y1 - symbol_size * 2,
788  width, color );
789  GRLineTo( clipbox, aDC, x1, y1, width, color );
790  }
791  else /* MapX1 = 0 */
792  {
793  GRMoveTo( x1, y1 + MapY1 * symbol_size * 2 );
794  GRLineTo( clipbox, aDC, x1 - symbol_size * 2,
795  y1 + MapY1 * symbol_size * 2, width, color );
796  GRLineTo( clipbox, aDC, x1, y1, width, color );
797  }
798  }
799 
800 
801  if( m_shape == PINSHAPE_OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */
802  {
803  const int symbol_size = ExternalPinDecoSize( *this );
804  if( MapY1 == 0 ) /* MapX1 = +- 1 */
805  {
806  GRMoveTo( x1, y1 - symbol_size * 2 );
807  GRLineTo( clipbox,
808  aDC,
809  x1 + MapX1 * symbol_size * 2,
810  y1,
811  width,
812  color );
813  }
814  else /* MapX1 = 0 */
815  {
816  GRMoveTo( x1 - symbol_size * 2, y1 );
817  GRLineTo( clipbox, aDC, x1, y1 + MapY1 * symbol_size * 2,
818  width, color );
819  }
820  }
821  else if( m_shape == PINSHAPE_NONLOGIC ) /* NonLogic pin symbol */
822  {
823  const int symbol_size = ExternalPinDecoSize( *this );
824  GRMoveTo( x1 - (MapX1 + MapY1) * symbol_size,
825  y1 - (MapY1 - MapX1) * symbol_size );
826  GRLineTo( clipbox, aDC,
827  x1 + (MapX1 + MapY1) * symbol_size,
828  y1 + (MapY1 - MapX1) * symbol_size,
829  width, color );
830  GRMoveTo( x1 - (MapX1 - MapY1) * symbol_size,
831  y1 - (MapY1 + MapX1) * symbol_size );
832  GRLineTo( clipbox, aDC,
833  x1 + (MapX1 - MapY1) * symbol_size,
834  y1 + (MapY1 + MapX1) * symbol_size,
835  width, color );
836  }
837 
838  if( m_type == PIN_NC ) // Draw a N.C. symbol
839  {
840  GRLine( clipbox, aDC,
841  posX - NCSYMB_PIN_DIM, posY - NCSYMB_PIN_DIM,
842  posX + NCSYMB_PIN_DIM, posY + NCSYMB_PIN_DIM,
843  width, color );
844  GRLine( clipbox, aDC,
845  posX + NCSYMB_PIN_DIM, posY - NCSYMB_PIN_DIM,
846  posX - NCSYMB_PIN_DIM, posY + NCSYMB_PIN_DIM,
847  width, color );
848  }
849 }
virtual BASE_SCREEN * GetScreen()=0
static int ExternalPinDecoSize(const LIB_PIN &aPin)
Utility for getting the size of the 'external' pin decorators (as a radius)
Definition: lib_pin.cpp:142
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
bool IsSelected() const
Definition: base_struct.h:224
int color
Definition: DXF_plotter.cpp:62
virtual EDA_RECT * GetClipBox()
Definition: lib_pin.h:55
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
int m_length
Length of the pin.
Definition: lib_pin.h:76
void GRLineTo(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, COLOR4D Color)
Definition: gr_basic.cpp:337
int GetPenSize() const override
Definition: lib_pin.cpp:564
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
static int InternalPinDecoSize(const LIB_PIN &aPin)
Utility for getting the size of the 'internal' pin decorators (as a radius)
Definition: lib_pin.cpp:133
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:285
bool m_IsPrinting
Definition: base_screen.h:220
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:327
#define NCSYMB_PIN_DIM
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:755
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
#define TARGET_PIN_RADIUS
Definition: lib_pin.h:43
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80
COLOR4D GetItemSelectedColor()
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References color, ExternalPinDecoSize(), EDA_DRAW_PANEL::GetClipBox(), GetItemSelectedColor(), GetLayerColor(), GetPenSize(), EDA_DRAW_PANEL::GetScreen(), GRCircle(), GRLine(), GRLineTo(), GRMoveTo(), GRSetDrawMode(), InternalPinDecoSize(), EDA_ITEM::IsSelected(), LAYER_PIN, BASE_SCREEN::m_IsPrinting, m_length, m_shape, m_type, NCSYMB_PIN_DIM, PIN_DOWN, PIN_LEFT, PIN_NC, PIN_RIGHT, PIN_UP, PINSHAPE_CLOCK, PINSHAPE_CLOCK_LOW, PINSHAPE_FALLING_EDGE_CLOCK, PINSHAPE_INPUT_LOW, PINSHAPE_INVERTED, PINSHAPE_INVERTED_CLOCK, PINSHAPE_NONLOGIC, PINSHAPE_OUTPUT_LOW, and TARGET_PIN_RADIUS.

Referenced by drawGraphic().

◆ DrawPinTexts()

void LIB_PIN::DrawPinTexts ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
wxPoint &  aPosition,
int  aOrientation,
int  TextInside,
bool  DrawPinNum,
bool  DrawPinName,
COLOR4D  aColor,
GR_DRAWMODE  aDrawMode 
)

Put the pin number and pin text info, given the pin line coordinates.

The line must be vertical or horizontal. If DrawPinName == false the pin name is not printed. If DrawPinNum = false the pin number is not printed. If TextInside then the text is been put inside,otherwise all is drawn outside. Pin Name: substring between '~' is negated DrawMode = GR_OR, XOR ...

Definition at line 852 of file lib_pin.cpp.

861 {
862  if( !DrawPinName && !DrawPinNum )
863  return;
864 
865  int x, y;
866 
867  wxSize PinNameSize( m_nameTextSize, m_nameTextSize );
868  wxSize PinNumSize( m_numTextSize, m_numTextSize );
869 
870  int nameLineWidth = GetPenSize();
871 
872  nameLineWidth = Clamp_Text_PenSize( nameLineWidth, m_nameTextSize, false );
873  int numLineWidth = GetPenSize();
874  numLineWidth = Clamp_Text_PenSize( numLineWidth, m_numTextSize, false );
875 
876  int name_offset = PIN_TEXT_MARGIN +
877  ( nameLineWidth + GetDefaultLineThickness() ) / 2;
878  int num_offset = PIN_TEXT_MARGIN +
879  ( numLineWidth + GetDefaultLineThickness() ) / 2;
880 
881  GRSetDrawMode( DC, DrawMode );
882  EDA_RECT* clipbox = panel? panel->GetClipBox() : NULL;
883 
884  /* Get the num and name colors */
885  if( ( Color == COLOR4D::UNSPECIFIED ) && IsSelected() )
886  Color = GetItemSelectedColor();
887 
888  COLOR4D NameColor = Color == COLOR4D::UNSPECIFIED ?
889  GetLayerColor( LAYER_PINNAM ) : Color;
890  COLOR4D NumColor = Color == COLOR4D::UNSPECIFIED ?
891  GetLayerColor( LAYER_PINNUM ) : Color;
892 
893  int x1 = pin_pos.x;
894  int y1 = pin_pos.y;
895 
896  switch( orient )
897  {
898  case PIN_UP:
899  y1 -= m_length;
900  break;
901 
902  case PIN_DOWN:
903  y1 += m_length;
904  break;
905 
906  case PIN_LEFT:
907  x1 -= m_length;
908  break;
909 
910  case PIN_RIGHT:
911  x1 += m_length;
912  break;
913  }
914 
915  if( m_name.IsEmpty() )
916  DrawPinName = false;
917 
918  if( TextInside ) // Draw the text inside, but the pin numbers outside.
919  {
920  if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) )
921  {
922  // It is an horizontal line
923  if( DrawPinName )
924  {
925  if( orient == PIN_RIGHT )
926  {
927  x = x1 + TextInside;
928  DrawGraphicText( clipbox, DC, wxPoint( x, y1 ), NameColor,
929  m_name,
931  PinNameSize,
933  GR_TEXT_VJUSTIFY_CENTER, nameLineWidth,
934  false, false );
935  }
936  else // Orient == PIN_LEFT
937  {
938  x = x1 - TextInside;
939  DrawGraphicText( clipbox, DC, wxPoint( x, y1 ), NameColor,
940  m_name,
942  PinNameSize,
944  GR_TEXT_VJUSTIFY_CENTER, nameLineWidth,
945  false, false );
946  }
947  }
948 
949  if( DrawPinNum )
950  {
951  DrawGraphicText( clipbox, DC,
952  wxPoint( (x1 + pin_pos.x) / 2,
953  y1 - num_offset ), NumColor,
954  m_number,
955  TEXT_ANGLE_HORIZ, PinNumSize,
957  GR_TEXT_VJUSTIFY_BOTTOM, numLineWidth,
958  false, false );
959  }
960  }
961  else /* Its a vertical line. */
962  {
963  // Text is drawn from bottom to top (i.e. to negative value for Y axis)
964  if( orient == PIN_DOWN )
965  {
966  y = y1 + TextInside;
967 
968  if( DrawPinName )
969  DrawGraphicText( clipbox, DC, wxPoint( x1, y ), NameColor,
970  m_name,
971  TEXT_ANGLE_VERT, PinNameSize,
973  GR_TEXT_VJUSTIFY_CENTER, nameLineWidth,
974  false, false );
975 
976  if( DrawPinNum )
977  DrawGraphicText( clipbox, DC,
978  wxPoint( x1 - num_offset,
979  (y1 + pin_pos.y) / 2 ), NumColor,
980  m_number,
981  TEXT_ANGLE_VERT, PinNumSize,
983  GR_TEXT_VJUSTIFY_BOTTOM, numLineWidth,
984  false, false );
985  }
986  else /* PIN_UP */
987  {
988  y = y1 - TextInside;
989 
990  if( DrawPinName )
991  DrawGraphicText( clipbox, DC, wxPoint( x1, y ), NameColor,
992  m_name,
993  TEXT_ANGLE_VERT, PinNameSize,
995  GR_TEXT_VJUSTIFY_CENTER, nameLineWidth,
996  false, false );
997 
998  if( DrawPinNum )
999  DrawGraphicText( clipbox, DC,
1000  wxPoint( x1 - num_offset,
1001  (y1 + pin_pos.y) / 2 ), NumColor,
1002  m_number,
1003  TEXT_ANGLE_VERT, PinNumSize,
1005  GR_TEXT_VJUSTIFY_BOTTOM, numLineWidth,
1006  false, false );
1007  }
1008  }
1009  }
1010  else /**** Draw num & text pin outside ****/
1011  {
1012  if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) )
1013  {
1014  /* Its an horizontal line. */
1015  if( DrawPinName )
1016  {
1017  x = (x1 + pin_pos.x) / 2;
1018  DrawGraphicText( clipbox, DC, wxPoint( x, y1 - name_offset ),
1019  NameColor, m_name,
1020  TEXT_ANGLE_HORIZ, PinNameSize,
1022  GR_TEXT_VJUSTIFY_BOTTOM, nameLineWidth,
1023  false, false );
1024  }
1025  if( DrawPinNum )
1026  {
1027  x = (x1 + pin_pos.x) / 2;
1028  DrawGraphicText( clipbox, DC, wxPoint( x, y1 + num_offset ),
1029  NumColor, m_number,
1030  TEXT_ANGLE_HORIZ, PinNumSize,
1032  GR_TEXT_VJUSTIFY_TOP, numLineWidth,
1033  false, false );
1034  }
1035  }
1036  else /* Its a vertical line. */
1037  {
1038  if( DrawPinName )
1039  {
1040  y = (y1 + pin_pos.y) / 2;
1041  DrawGraphicText( clipbox, DC, wxPoint( x1 - name_offset, y ),
1042  NameColor, m_name,
1043  TEXT_ANGLE_VERT, PinNameSize,
1045  GR_TEXT_VJUSTIFY_BOTTOM, nameLineWidth,
1046  false, false );
1047  }
1048 
1049  if( DrawPinNum )
1050  {
1051  DrawGraphicText( clipbox, DC,
1052  wxPoint( x1 + num_offset, (y1 + pin_pos.y)
1053  / 2 ),
1054  NumColor, m_number,
1055  TEXT_ANGLE_VERT, PinNumSize,
1057  GR_TEXT_VJUSTIFY_TOP, numLineWidth,
1058  false, false );
1059  }
1060  }
1061  }
1062 }
#define TEXT_ANGLE_HORIZ
int m_nameTextSize
Pin num and Pin name sizes.
Definition: lib_pin.h:85
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize As a rule, pen width should not be >1/4em, otherwise the character will b...
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
bool IsSelected() const
Definition: base_struct.h:224
#define TEXT_ANGLE_VERT
int m_numTextSize
Definition: lib_pin.h:84
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i....
wxString m_name
Definition: lib_pin.h:82
Definition: lib_pin.h:55
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
int m_length
Length of the pin.
Definition: lib_pin.h:76
void DrawGraphicText(EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
int GetPenSize() const override
Definition: lib_pin.cpp:564
wxString m_number
Definition: lib_pin.h:83
#define PIN_TEXT_MARGIN
Definition: lib_pin.cpp:63
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
COLOR4D GetItemSelectedColor()
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References Clamp_Text_PenSize(), DrawGraphicText(), EDA_DRAW_PANEL::GetClipBox(), GetDefaultLineThickness(), GetItemSelectedColor(), GetLayerColor(), GetPenSize(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, GRSetDrawMode(), EDA_ITEM::IsSelected(), LAYER_PINNAM, LAYER_PINNUM, m_length, m_name, m_nameTextSize, m_number, m_numTextSize, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_TEXT_MARGIN, PIN_UP, TEXT_ANGLE_HORIZ, and TEXT_ANGLE_VERT.

Referenced by drawGraphic().

◆ EnableEditMode()

void LIB_PIN::EnableEditMode ( bool  aEnable,
bool  aEditPinByPin = false 
)

Enable or clear pin editing mode.

The pin editing mode marks or unmarks all pins common to this pin object for further editing. If any of the pin modification methods are called after enabling the editing mode, all pins marked for editing will have the same attribute changed. The only case were this is not true making this pin common to all parts or body styles in the component. See SetCommonToAllParts() and SetCommonToAllBodyStyles() for more information.

Parameters
aEnable= true marks all common pins for editing mode. False clears the editing mode.
aEditPinByPin== true enables the edit pin by pin mode. aEditPinByPin == false enables the pin edit coupling between pins at the same location if aEnable == false, aEditPinByPin is not used

Definition at line 514 of file lib_pin.cpp.

515 {
516  LIB_PINS pinList;
517 
518  if( GetParent() == NULL )
519  return;
520 
521  GetParent()->GetPins( pinList );
522 
523  for( size_t i = 0; i < pinList.size(); i++ )
524  {
525  if( pinList[i] == this )
526  continue;
527 
528  if( ( pinList[i]->m_position == m_position )
529  && ( pinList[i]->m_orientation == m_orientation )
530  && !IsNew() && !aEditPinByPin && aEnable )
531  {
532  pinList[i]->SetFlags( IS_LINKED | IN_EDIT );
533  }
534  else
535  pinList[i]->ClearFlags( IS_LINKED | IN_EDIT );
536  }
537 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
#define IN_EDIT
Item currently edited.
Definition: base_struct.h:112
LIB_PART * GetParent() const
bool IsNew() const
Definition: base_struct.h:219
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
size_t i
Definition: json11.cpp:597

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IN_EDIT, IS_LINKED, EDA_ITEM::IsNew(), m_orientation, and m_position.

Referenced by LIB_EDIT_FRAME::OnEditPin().

◆ EndEdit()

virtual void LIB_ITEM::EndEdit ( const wxPoint &  aPosition,
bool  aAbort = false 
)
inlinevirtualinherited

End an object editing action.

This is used to end or abort an edit action in progress initiated by BeginEdit().

Parameters
aPositionThe position of the last edit event in drawing coordinates.
aAbortSet to true to abort the current edit in progress.

Reimplemented in LIB_FIELD, LIB_ARC, LIB_TEXT, LIB_POLYLINE, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 180 of file lib_draw_item.h.

180 { m_Flags = 0; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References EDA_ITEM::m_Flags.

Referenced by AbortSymbolTraceOn(), and LIB_EDIT_FRAME::EndDrawGraphicItem().

◆ GetBoundingBox() [1/2]

const EDA_RECT LIB_PIN::GetBoundingBox ( ) const
inlineoverridevirtual
Returns
the boundary box for this, in library coordinates

Reimplemented from LIB_ITEM.

Definition at line 145 of file lib_pin.h.

145 { return GetBoundingBox( false ); }
const EDA_RECT GetBoundingBox() const override
Definition: lib_pin.h:145

References GetBoundingBox().

Referenced by drawGraphic(), GetBoundingBox(), HitTest(), Matches(), and DIALOG_LIB_EDIT_PIN::OnPaintShowPanel().

◆ GetBoundingBox() [2/2]

const EDA_RECT LIB_PIN::GetBoundingBox ( bool  aIncludeInvisibles) const
Parameters
aIncludeInvisibles- if false, do not include labels for invisible pins in the calculation.

Definition at line 1775 of file lib_pin.cpp.

1776 {
1777  LIB_PART* entry = (LIB_PART* ) m_Parent;
1778  EDA_RECT bbox;
1779  wxPoint begin;
1780  wxPoint end;
1781  int nameTextOffset = 0;
1782  bool showName = !m_name.IsEmpty() && (m_name != wxT( "~" ));
1783  bool showNum = !m_number.IsEmpty();
1784  int minsizeV = TARGET_PIN_RADIUS;
1785 
1786  if( !aIncludeInvisibles && !IsVisible() )
1787  showName = false;
1788 
1789  if( entry )
1790  {
1791  if( entry->ShowPinNames() )
1792  nameTextOffset = entry->GetPinNameOffset();
1793  else
1794  showName = false;
1795 
1796  showNum = entry->ShowPinNumbers();
1797  }
1798 
1799  // First, calculate boundary box corners position
1800  int numberTextLength = showNum ? m_numTextSize * m_number.Len() : 0;
1801 
1802  // Actual text height is bigger than text size
1803  int numberTextHeight = showNum ? KiROUND( m_numTextSize * 1.1 ) : 0;
1804 
1806  minsizeV = std::max( TARGET_PIN_RADIUS, ExternalPinDecoSize( *this ) );
1807 
1808  // calculate top left corner position
1809  // for the default pin orientation (PIN_RIGHT)
1810  begin.y = std::max( minsizeV, numberTextHeight + PIN_TEXT_MARGIN );
1811  begin.x = std::min( -TARGET_PIN_RADIUS, m_length - (numberTextLength / 2) );
1812 
1813  // calculate bottom right corner position and adjust top left corner position
1814  int nameTextLength = 0;
1815  int nameTextHeight = 0;
1816 
1817  if( showName )
1818  {
1819  int length = m_name.Len();
1820 
1821  // Don't count the line over text symbol.
1822  if( m_name.Left( 1 ) == wxT( "~" ) )
1823  length -= 1;
1824 
1825  nameTextLength = ( m_nameTextSize * length ) + nameTextOffset;
1826 
1827  // Actual text height are bigger than text size
1828  nameTextHeight = KiROUND( m_nameTextSize * 1.1 ) + PIN_TEXT_MARGIN;
1829  }
1830 
1831  if( nameTextOffset ) // for values > 0, pin name is inside the body
1832  {
1833  end.x = m_length + nameTextLength;
1834  end.y = std::min( -minsizeV, -nameTextHeight / 2 );
1835  }
1836  else // if value == 0:
1837  // pin name is outside the body, and above the pin line
1838  // pin num is below the pin line
1839  {
1840  end.x = std::max(m_length, nameTextLength);
1841  end.y = -begin.y;
1842  begin.y = std::max( minsizeV, nameTextHeight );
1843  }
1844 
1845  // Now, calculate boundary box corners position for the actual pin orientation
1846  int orient = PinDrawOrient( DefaultTransform );
1847 
1848  /* Calculate the pin position */
1849  switch( orient )
1850  {
1851  case PIN_UP:
1852  // Pin is rotated and texts positions are mirrored
1853  RotatePoint( &begin, wxPoint( 0, 0 ), -900 );
1854  RotatePoint( &end, wxPoint( 0, 0 ), -900 );
1855  break;
1856 
1857  case PIN_DOWN:
1858  RotatePoint( &begin, wxPoint( 0, 0 ), 900 );
1859  RotatePoint( &end, wxPoint( 0, 0 ), 900 );
1860  begin.x = -begin.x;
1861  end.x = -end.x;
1862  break;
1863 
1864  case PIN_LEFT:
1865  begin.x = -begin.x;
1866  end.x = -end.x;
1867  break;
1868 
1869  case PIN_RIGHT:
1870  break;
1871  }
1872 
1873  begin += m_position;
1874  end += m_position;
1875 
1876  bbox.SetOrigin( begin );
1877  bbox.SetEnd( end );
1878  bbox.Normalize();
1879  bbox.Inflate( ( GetPenSize() / 2 ) + 1 );
1880 
1881  // Draw Y axis is reversed in schematic:
1882  bbox.RevertYAxis();
1883 
1884  return bbox;
1885 }
int m_nameTextSize
Pin num and Pin name sizes.
Definition: lib_pin.h:85
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:171
static int ExternalPinDecoSize(const LIB_PIN &aPin)
Utility for getting the size of the 'external' pin decorators (as a radius)
Definition: lib_pin.cpp:142
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78
int GetPinNameOffset()
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
int m_numTextSize
Definition: lib_pin.h:84
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:124
wxString m_name
Definition: lib_pin.h:82
Definition: lib_pin.h:55
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
int PinDrawOrient(const TRANSFORM &aTransform) const
Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation...
Definition: lib_pin.cpp:1506
int m_length
Length of the pin.
Definition: lib_pin.h:76
void RevertYAxis()
Function RevertYAxis Mirror the rectangle from the X axis (negate Y pos and size)
Definition: eda_rect.h:144
bool ShowPinNames()
int GetPenSize() const override
Definition: lib_pin.cpp:564
bool ShowPinNumbers()
wxString m_number
Definition: lib_pin.h:83
void SetEnd(int x, int y)
Definition: eda_rect.h:134
Define a library symbol object.
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:362
void Normalize()
Function Normalize ensures that the height ant width are positive.
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
TRANSFORM DefaultTransform
Definition: eeschema.cpp:59
#define max(a, b)
Definition: auxiliary.h:86
#define PIN_TEXT_MARGIN
Definition: lib_pin.cpp:63
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
#define TARGET_PIN_RADIUS
Definition: lib_pin.h:43
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
#define min(a, b)
Definition: auxiliary.h:85

References DefaultTransform, ExternalPinDecoSize(), GetPenSize(), LIB_PART::GetPinNameOffset(), EDA_RECT::Inflate(), IsVisible(), KiROUND(), m_length, m_name, m_nameTextSize, m_number, m_numTextSize, EDA_ITEM::m_Parent, m_position, m_shape, max, min, EDA_RECT::Normalize(), PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_TEXT_MARGIN, PIN_UP, PinDrawOrient(), PINSHAPE_INVERTED, PINSHAPE_INVERTED_CLOCK, EDA_RECT::RevertYAxis(), RotatePoint(), EDA_RECT::SetEnd(), EDA_RECT::SetOrigin(), LIB_PART::ShowPinNames(), LIB_PART::ShowPinNumbers(), and TARGET_PIN_RADIUS.

◆ GetCanonicalElectricalTypeName() [1/2]

const wxString LIB_PIN::GetCanonicalElectricalTypeName ( ELECTRICAL_PINTYPE  aType)
static

return a string giving the electrical type of a pin.

Can be used when a known, not translated name is needed (for instance in net lists)

Parameters
aTypeis the electrical type (see enum ELECTRICAL_PINTYPE )
Returns
The electrical name for a pin type (see enun MsgPinElectricType for names).

Definition at line 76 of file lib_pin.cpp.

77 {
78  if( aType < 0 || aType >= (int) PINTYPE_COUNT )
79  return wxT( "???" );
80 
81  // These strings are the canonical name of the electrictal type
82  // Not translated, no space in name, only ASCII chars.
83  // to use when the string name must be known and well defined
84  // must have same order than enum ELECTRICAL_PINTYPE (see lib_pin.h)
85  static const wxChar* msgPinElectricType[] =
86  {
87  wxT( "input" ),
88  wxT( "output" ),
89  wxT( "BiDi" ),
90  wxT( "3state" ),
91  wxT( "passive" ),
92  wxT( "unspc" ),
93  wxT( "power_in" ),
94  wxT( "power_out" ),
95  wxT( "openCol" ),
96  wxT( "openEm" ),
97  wxT( "NotConnected" )
98  };
99 
100  return msgPinElectricType[ aType ];
101 }

References PINTYPE_COUNT.

◆ GetCanonicalElectricalTypeName() [2/2]

wxString const LIB_PIN::GetCanonicalElectricalTypeName ( ) const
inline

return a string giving the electrical type of the pin.

Can be used when a known, not translated name is needed (for instance in net lists)

Returns
The canonical electrical name of the pin.

Definition at line 266 of file lib_pin.h.

267  {
269  }
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80
wxString const GetCanonicalElectricalTypeName() const
return a string giving the electrical type of the pin.
Definition: lib_pin.h:266

References m_type.

◆ GetClass()

wxString LIB_PIN::GetClass ( ) const
inlineoverridevirtual

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 113 of file lib_pin.h.

114  {
115  return wxT( "LIB_PIN" );
116  }

◆ GetConvert()

◆ GetDefaultColor()

COLOR4D LIB_ITEM::GetDefaultColor ( )
virtualinherited

Reimplemented in LIB_FIELD.

Definition at line 165 of file lib_draw_item.cpp.

166 {
167  return GetLayerColor( LAYER_DEVICE );
168 }
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174

References GetLayerColor(), and LAYER_DEVICE.

Referenced by LIB_ITEM::Draw(), LIB_TEXT::drawGraphic(), and LIB_TEXT::Plot().

◆ GetElectricalTypeName()

wxString const LIB_PIN::GetElectricalTypeName ( ) const
inline

return a translated string for messages giving the electrical type of the pin.

Returns
The electrical name of the pin.

Definition at line 275 of file lib_pin.h.

276  {
277  return GetText( m_type );
278  }
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80

References GetText(), and m_type.

Referenced by KIGFX::SCH_PAINTER::draw(), DrawPinElectricalTypeName(), and GetSelectMenuText().

◆ GetFillMode()

◆ GetFlags()

STATUS_FLAGS EDA_ITEM::GetFlags ( ) const
inlineinherited

Definition at line 258 of file base_struct.h.

258 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References EDA_ITEM::m_Flags.

Referenced by AbortMoveAndEditTarget(), SCH_SCREEN::addConnectedItemsToBlock(), AddMenusForBitmap(), AddMenusForBusEntry(), AddMenusForComponent(), AddMenusForComponentField(), AddMenusForEditComponent(), AddMenusForGLabel(), AddMenusForHierchicalSheet(), AddMenusForHLabel(), AddMenusForLabel(), AddMenusForSheetPin(), AddMenusForText(), SCH_EDIT_FRAME::BeginSegment(), SCH_EDIT_FRAME::ChangeTextOrient(), Collect_TrackSegmentsToDrag(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), LIB_EDIT_FRAME::copySelectedItems(), LIB_EDIT_FRAME::CreatePin(), PCB_EDIT_FRAME::createPopUpMenuForFootprints(), PCB_EDIT_FRAME::createPopUpMenuForFpPads(), PCB_EDIT_FRAME::createPopUpMenuForFpTexts(), PCB_EDIT_FRAME::createPopUpMenuForTexts(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::createPopUpMenuForZones(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteItem(), SCH_EDIT_FRAME::DeleteItemsInList(), SCH_EDIT_FRAME::DeleteJunction(), PCB_BASE_FRAME::DeleteTextModule(), BOARD::Draw(), PCB_EDIT_FRAME::Edit_TrackSegm_Width(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditImage(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_VIEW_FRAME::GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), InitialiseDragParameters(), EDA_DRAW_FRAME::isBusy(), Magnetize(), SCH_EDIT_FRAME::MirrorImage(), SCH_EDIT_FRAME::MirrorSheet(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnMouseEvent(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_EDIT_FRAME::OrientComponent(), PCB_EDIT_FRAME::PlaceTarget(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), LIB_EDIT_FRAME::Process_Special_Functions(), TRACKS_CLEANER::removeDuplicatesOfTrack(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_EDIT_FRAME::RotateField(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), SCH_EDIT_FRAME::RotateImage(), PCB_BASE_FRAME::RotateTextModule(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SCREEN::SelectBlockItems(), SCH_EDIT_FRAME::SetBusEntryShape(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ GetLength()

int LIB_PIN::GetLength ( )
inline

◆ GetList()

DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited

◆ GetMenuImage()

BITMAP_DEF LIB_PIN::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 1956 of file lib_pin.cpp.

1957 {
1958  return GetBitmap( m_type );
1959 }
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80
BITMAP_DEF GetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:70

References GetBitmap(), and m_type.

◆ GetMsgPanelInfo() [1/2]

void LIB_PIN::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

Display basic info (type, part and convert) about the current item in message panel.

This base function is used to display the information common to the all library items. Call the base class from the derived class or the common information will not be updated in the message panel.

Parameters
aListis the list to populate.

Reimplemented from LIB_ITEM.

Referenced by SCH_EDIT_FRAME::LocateAndShowItem(), LIB_EDIT_FRAME::OnEditPin(), LIB_EDIT_FRAME::RepeatPinItem(), and LIB_EDIT_FRAME::StartMovePin().

◆ GetMsgPanelInfo() [2/2]

void LIB_PIN::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList,
SCH_COMPONENT aComponent 
)

Display pin info (given by GetMsgPanelInfo) and add some info related to aComponent (schematic pin position, and sheet path)

Parameters
aListis the message list to fill
aComponentis the component which "owns" the pin

Definition at line 1752 of file lib_pin.cpp.

1754 {
1755  getMsgPanelInfoBase( aUnits, aList );
1756 
1757  if( !aComponent )
1758  return;
1759 
1760  wxString text;
1761  wxPoint pinpos = aComponent->GetTransform().TransformCoordinate( GetPosition() )
1762  + aComponent->GetPosition();
1763 
1764  text = MessageTextFromValue( aUnits, pinpos.x, true );
1765  aList.push_back( MSG_PANEL_ITEM( _( "Pos X" ), text, DARKMAGENTA ) );
1766 
1767  text = MessageTextFromValue( aUnits, pinpos.y, true );
1768  aList.push_back( MSG_PANEL_ITEM( _( "Pos Y" ), text, DARKMAGENTA ) );
1769 
1770  aList.push_back( MSG_PANEL_ITEM( aComponent->GetField( REFERENCE )->GetShownText(),
1771  aComponent->GetField( VALUE )->GetShownText(),
1772  DARKCYAN ) );
1773 }
Field Reference of part, i.e. "IC21".
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:41
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
wxString MessageTextFromValue(EDA_UNITS_T aUnits, int aValue, bool aUseMils)
Definition: base_units.cpp:125
#define VALUE
TRANSFORM & GetTransform() const
wxPoint GetPosition() const override
Return the current draw object position.
Definition: lib_pin.h:463
wxPoint GetPosition() const override
Function GetPosition.
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:148
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
void getMsgPanelInfoBase(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList)
Build the pin basic info to display in message panel.
Definition: lib_pin.cpp:1705

References DARKCYAN, DARKMAGENTA, SCH_COMPONENT::GetField(), getMsgPanelInfoBase(), GetPosition(), SCH_COMPONENT::GetPosition(), EDA_TEXT::GetShownText(), SCH_COMPONENT::GetTransform(), MessageTextFromValue(), REFERENCE, TRANSFORM::TransformCoordinate(), and VALUE.

◆ getMsgPanelInfoBase()

void LIB_PIN::getMsgPanelInfoBase ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
private

Build the pin basic info to display in message panel.

they are pin info without the actual pin position, which is not known in schematic without knowing the parent component

Definition at line 1705 of file lib_pin.cpp.

1706 {
1707  wxString text = m_number.IsEmpty() ? wxT( "?" ) : m_number;
1708 
1709  LIB_ITEM::GetMsgPanelInfo( aUnits, aList );
1710 
1711  aList.push_back( MSG_PANEL_ITEM( _( "Name" ), m_name, DARKCYAN ) );
1712 
1713  aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text, DARKCYAN ) );
1714 
1715  aList.push_back( MSG_PANEL_ITEM( _( "Type" ), GetText( m_type ), RED ) );
1716 
1717  text = GetText( m_shape );
1718 
1719  aList.push_back( MSG_PANEL_ITEM( _( "Style" ), text, BLUE ) );
1720 
1721  if( IsVisible() )
1722  text = _( "Yes" );
1723  else
1724  text = _( "No" );
1725 
1726  aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), text, DARKGREEN ) );
1727 
1728  // Display pin length
1729  text = StringFromValue( aUnits, m_length, true );
1730  aList.push_back( MSG_PANEL_ITEM( _( "Length" ), text, MAGENTA ) );
1731 
1733  aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), text, DARKMAGENTA ) );
1734 }
Definition: colors.h:57
virtual void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78
static const wxString getPinOrientationName(unsigned aPinOrientationCode)
Definition: lib_pin.cpp:108
static int GetOrientationIndex(int aCode)
Get the index of the orientation code.
Definition: lib_pin.cpp:1908
Definition: colors.h:61
wxString m_name
Definition: lib_pin.h:82
int m_length
Length of the pin.
Definition: lib_pin.h:76
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
wxString m_number
Definition: lib_pin.h:83
Definition: colors.h:60
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:362
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80
wxString StringFromValue(EDA_UNITS_T aUnits, int aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:210
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53

References BLUE, DARKCYAN, DARKGREEN, DARKMAGENTA, LIB_ITEM::GetMsgPanelInfo(), GetOrientationIndex(), getPinOrientationName(), GetText(), IsVisible(), m_length, m_name, m_number, m_orientation, m_shape, m_type, MAGENTA, RED, and StringFromValue().

Referenced by GetMsgPanelInfo().

◆ GetName()

const wxString& LIB_PIN::GetName ( void  ) const
inline

◆ GetNameTextSize()

int LIB_PIN::GetNameTextSize ( ) const
inline

◆ GetNumber()

◆ GetNumberTextSize()

◆ GetOrientation()

int LIB_PIN::GetOrientation ( ) const
inline

◆ GetOrientationCode()

int LIB_PIN::GetOrientationCode ( int  aIndex)
static

Get the orientation code by index used to set the pin orientation.

Parameters
aIndex- The index of the orientation code to look up.
Returns
Orientation code if index is valid. Returns right orientation on index error.

Definition at line 1899 of file lib_pin.cpp.

1900 {
1901  if( index >= 0 && index < (int) PIN_ORIENTATION_CNT )
1902  return pin_orientation_codes[ index ];
1903 
1904  return PIN_RIGHT;
1905 }
static const int pin_orientation_codes[]
Definition: lib_pin.cpp:53
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:60

References PIN_ORIENTATION_CNT, pin_orientation_codes, and PIN_RIGHT.

Referenced by DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), PIN_TABLE_DATA_MODEL::SetValue(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ GetOrientationIndex()

int LIB_PIN::GetOrientationIndex ( int  aCode)
static

Get the index of the orientation code.

Parameters
aCode- The orientation code to look up.
Returns
The index of the orientation code if found. Otherwise, return wxNOT_FOUND.

Definition at line 1908 of file lib_pin.cpp.

1909 {
1910  size_t i;
1911 
1912  for( i = 0; i < PIN_ORIENTATION_CNT; i++ )
1913  {
1914  if( pin_orientation_codes[i] == code )
1915  return (int) i;
1916  }
1917 
1918  return wxNOT_FOUND;
1919 }
static const int pin_orientation_codes[]
Definition: lib_pin.cpp:53
size_t i
Definition: json11.cpp:597
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:60

References i, PIN_ORIENTATION_CNT, and pin_orientation_codes.

Referenced by getMsgPanelInfoBase(), PIN_TABLE_DATA_MODEL::GetValue(), and DIALOG_LIB_EDIT_PIN::TransferDataToWindow().

◆ GetOrientationNames()

wxArrayString LIB_PIN::GetOrientationNames ( void  )
static

Get a list of pin orientation names.

Returns
List of valid pin orientation names.

Definition at line 1888 of file lib_pin.cpp.

1889 {
1890  wxArrayString tmp;
1891 
1892  for( unsigned ii = 0; ii < PIN_ORIENTATION_CNT; ii++ )
1893  tmp.Add( getPinOrientationName( ii ) );
1894 
1895  return tmp;
1896 }
static const wxString getPinOrientationName(unsigned aPinOrientationCode)
Definition: lib_pin.cpp:108
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:60

References getPinOrientationName(), and PIN_ORIENTATION_CNT.

Referenced by DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), and DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE().

◆ GetOrientationSymbols()

const BITMAP_DEF * LIB_PIN::GetOrientationSymbols ( )
static

Get a list of pin orientation bitmaps for menus and dialogs.

Returns
List of valid pin orientation bitmaps symbols in .xpm format

Definition at line 1950 of file lib_pin.cpp.

1951 {
1952  return iconsPinsOrientations;
1953 }
static const BITMAP_DEF iconsPinsOrientations[]
Definition: lib_pin.cpp:67

References iconsPinsOrientations.

Referenced by DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), and DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE().

◆ GetParent()

◆ GetPartNumber()

int LIB_PIN::GetPartNumber ( ) const
inline

Get the pin part number.

Definition at line 315 of file lib_pin.h.

315 { return m_Unit; }
int m_Unit
Unit identification for multiple parts per package.

References LIB_ITEM::m_Unit.

◆ GetPenSize()

int LIB_PIN::GetPenSize ( ) const
overridevirtual
Returns
the size of the "pen" that be used to draw or plot this item

Implements LIB_ITEM.

Definition at line 564 of file lib_pin.cpp.

565 {
566  if( m_width > 0 )
567  return m_width;
568 
569  if( m_width == 0 )
570  return GetDefaultLineThickness();
571 
572  return 0;
573 }
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i....
int m_width
Line width of the pin.
Definition: lib_pin.h:79

References GetDefaultLineThickness(), and m_width.

Referenced by KIGFX::SCH_PAINTER::draw(), DrawPinSymbol(), DrawPinTexts(), GetBoundingBox(), Plot(), PlotPinTexts(), and PlotSymbol().

◆ GetPosition()

wxPoint LIB_PIN::GetPosition ( ) const
inlineoverridevirtual

◆ GetSelectMenuText()

wxString LIB_PIN::GetSelectMenuText ( EDA_UNITS_T  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 1962 of file lib_pin.cpp.

1963 {
1964  return wxString::Format( _( "Pin %s, %s, %s" ),
1965  m_number,
1967  GetText( m_shape ));
1968 }
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78
wxString m_number
Definition: lib_pin.h:83
wxString const GetElectricalTypeName() const
return a translated string for messages giving the electrical type of the pin.
Definition: lib_pin.h:275
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
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(), GetElectricalTypeName(), GetText(), m_number, and m_shape.

Referenced by Matches().

◆ GetShape()

GRAPHIC_PINSHAPE LIB_PIN::GetShape ( ) const
inline

Definition at line 235 of file lib_pin.h.

235 { return m_shape; }
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78

References m_shape.

Referenced by KIGFX::SCH_PAINTER::draw(), LIB_EDIT_FRAME::OnEditPin(), LIB_EDIT_FRAME::PlacePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), and DIALOG_LIB_EDIT_PIN::TransferDataToWindow().

◆ GetState()

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 253 of file base_struct.h.

253 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:164

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

◆ GetTimeStamp()

◆ GetType()

ELECTRICAL_PINTYPE LIB_PIN::GetType ( ) const
inline

Get the electrical type of the pin.

Returns
The electrical type of the pin (see enum ELECTRICAL_PINTYPE for values).

Definition at line 251 of file lib_pin.h.

251 { return m_type; }
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80

References m_type.

Referenced by KIGFX::SCH_PAINTER::draw(), IsPowerConnection(), LIB_EDIT_FRAME::OnEditPin(), LIB_EDIT_FRAME::PlacePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), and DIALOG_LIB_EDIT_PIN::TransferDataToWindow().

◆ GetTypeName()

wxString LIB_PIN::GetTypeName ( )
inlineoverridevirtual

Provide a user-consumable name of the object type.

Perform localization when called so that run-time language selection works.

Implements LIB_ITEM.

Definition at line 118 of file lib_pin.h.

119  {
120  return _( "Pin" );
121  }

◆ GetUnit()

◆ GetWidth()

int LIB_PIN::GetWidth ( ) const
inlineoverridevirtual

Return the width of the draw item.

Returns
Width of draw object.

Implements LIB_ITEM.

Definition at line 482 of file lib_pin.h.

482 { return m_width; }
int m_width
Line width of the pin.
Definition: lib_pin.h:79

References m_width.

◆ HitTest() [1/2]

bool LIB_PIN::HitTest ( const wxPoint &  aPosition) const
overridevirtual

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

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
Returns
True if aPosition is within or on the item bounding area.

Reimplemented from LIB_ITEM.

Definition at line 540 of file lib_pin.cpp.

541 {
542  return HitTest( aPosition, 0, DefaultTransform );
543 }
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item.
Definition: lib_pin.cpp:540
TRANSFORM DefaultTransform
Definition: eeschema.cpp:59

References DefaultTransform.

◆ HitTest() [2/2]

bool LIB_PIN::HitTest ( const wxPoint &  aPosition,
int  aThreshold,
const TRANSFORM aTransform 
) const
overridevirtual
Parameters
aPositionA wxPoint to test.
aThresholdMaximum distance to this object (usually the half thickness of a line) if < 0, it will be automatically set to half pen size when locating lines or arcs and set to 0 for other items.
aTransformThe transform matrix.
Returns
True if the point aPosition is near this object

Implements LIB_ITEM.

Definition at line 546 of file lib_pin.cpp.

547 {
548  if( aThreshold < 0 )
549  aThreshold = 0;
550 
551  TRANSFORM transform = DefaultTransform;
552  DefaultTransform = aTransform;
553 
554  EDA_RECT rect = GetBoundingBox();
555  rect.Inflate( aThreshold );
556 
557  //Restore matrix
558  DefaultTransform = transform;
559 
560  return rect.Contains( aPosition );
561 }
const EDA_RECT GetBoundingBox() const override
Definition: lib_pin.h:145
bool Contains(const wxPoint &aPoint) const
Function Contains.
Class for tranforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
TRANSFORM DefaultTransform
Definition: eeschema.cpp:59
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References EDA_RECT::Contains(), DefaultTransform, GetBoundingBox(), and EDA_RECT::Inflate().

◆ InEditMode()

bool LIB_ITEM::InEditMode ( ) const
inlineinherited

Return the draw item editing mode status.

Returns
True if the item is being edited.

Definition at line 372 of file lib_draw_item.h.

372 { return ( m_Flags & ( IS_NEW | IS_DRAGGED | IS_MOVED | IS_RESIZED ) ) != 0; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:116
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:115
#define IS_MOVED
Item being moved.
Definition: base_struct.h:113

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_RESIZED, and EDA_ITEM::m_Flags.

Referenced by LIB_ITEM::Draw(), LIB_EDIT_FRAME::EditField(), LIB_EDIT_FRAME::EditGraphicSymbol(), LIB_EDIT_FRAME::EditSymbolText(), LIB_EDIT_FRAME::IsEditingDrawItem(), LIB_EDIT_FRAME::OnHotKey(), LIB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnOrient(), LIB_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRotate(), LIB_TEXT::Rotate(), LIB_FIELD::Rotate(), LIB_TEXT::SetText(), LIB_FIELD::SetText(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ Inside()

bool LIB_PIN::Inside ( EDA_RECT aRect) const
overridevirtual

Test if any part of the draw object is inside rectangle bounds of aRect.

Parameters
aRectRectangle to check against.
Returns
True if object is inside rectangle.

Implements LIB_ITEM.

Definition at line 1587 of file lib_pin.cpp.

1588 {
1589  wxPoint end = PinEndPoint();
1590 
1591  return rect.Contains( m_position.x, -m_position.y ) || rect.Contains( end.x, -end.y );
1592 }
wxPoint PinEndPoint() const
Definition: lib_pin.cpp:1479
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References EDA_RECT::Contains(), m_position, and PinEndPoint().

◆ IsBrightened()

bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

Definition at line 227 of file base_struct.h.

227 { return m_Flags & BRIGHTENED; }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:138
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References BRIGHTENED, and EDA_ITEM::m_Flags.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), KIGFX::GERBVIEW_PAINTER::draw(), and KIGFX::PCB_RENDER_SETTINGS::GetColor().

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

◆ IsFillable()

bool LIB_ITEM::IsFillable ( ) const
inlineinherited

Check if draw object can be filled.

The default setting is false. If the derived object support filling, set the m_isFillable member to true.

Returns
True if draw object can be filled. Default is false.

Definition at line 365 of file lib_draw_item.h.

365 { return m_isFillable; }
bool m_isFillable
Flag to indicate if draw item is fillable.

References LIB_ITEM::m_isFillable.

Referenced by LIB_EDIT_FRAME::EditGraphicSymbol(), and DIALOG_LIB_EDIT_DRAW_ITEM::TransferDataToWindow().

◆ IsHighlighted()

bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 226 of file base_struct.h.

226 { return m_Flags & HIGHLIGHTED; }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:137
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References HIGHLIGHTED, and EDA_ITEM::m_Flags.

Referenced by KIGFX::SCH_PAINTER::draw(), and KIGFX::getOverlayColor().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 220 of file base_struct.h.

220 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:110
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by LIB_EDIT_FRAME::OnEditPin().

◆ IsMoving()

◆ IsNew()

bool EDA_ITEM::IsNew ( ) const
inlineinherited

Definition at line 219 of file base_struct.h.

219 { return m_Flags & IS_NEW; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References IS_NEW, and EDA_ITEM::m_Flags.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_MoveOrCopyModule(), Abort_Zone_Create_Outline(), AbortBuildDimension(), AbortMoveAndEditTarget(), abortMoveItem(), AbortPinMove(), AbortSymbolTraceOn(), SCH_EDIT_FRAME::addCurrentItemToScreen(), SCH_EDIT_FRAME::addJunctionMenuEntries(), AddMenusForBus(), AddMenusForWire(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteCurrentSegment(), LIB_ARC::drawEditGraphics(), LIB_ARC::drawGraphic(), EnableEditMode(), LIB_EDIT_FRAME::EndDrawGraphicItem(), SCH_EDIT_FRAME::EndSegment(), ExitSheet(), LIB_PART::LIB_PART(), EDIT_TOOL::MoveExact(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_BASE_FRAME::PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PCB_EDIT_FRAME::PlaceTarget(), SCH_EDIT_FRAME::PrepareMoveItem(), SCH_EDIT_FRAME::ReSizeSheet(), ShowClearance(), PCB_EDIT_FRAME::StartMoveTextePcb(), PCB_EDIT_FRAME::SwitchLayer(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataFromWindow(), and DIALOG_LABEL_EDITOR::TransferDataFromWindow().

◆ IsPowerConnection()

bool LIB_PIN::IsPowerConnection ( ) const
inline

Return whether this pin forms an implicit power connection: i.e., is hidden and of type POWER_IN.

Definition at line 368 of file lib_pin.h.

368  {
369 
370  return (
371  ( !IsVisible() && GetType() == PIN_POWER_IN )
372  ||
373  ( (LIB_PART*)GetParent()->IsPower() && GetType() == PIN_POWER_IN )
374  ) ; }
LIB_PART * GetParent() const
Define a library symbol object.
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:362
ELECTRICAL_PINTYPE GetType() const
Get the electrical type of the pin.
Definition: lib_pin.h:251

References LIB_ITEM::GetParent(), GetType(), IsVisible(), and PIN_POWER_IN.

Referenced by KIGFX::SCH_PAINTER::draw(), and LIB_PART::Draw().

◆ 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_FIELD, SCH_SHEET_PIN, and SCH_TEXT.

Definition at line 464 of file base_struct.h.

464 { return false; }

Referenced by EDA_ITEM::Matches(), and EDA_ITEM::Replace().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 225 of file base_struct.h.

225 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:115

References IS_RESIZED, and EDA_ITEM::m_Flags.

Referenced by ExitSheet(), and KIGFX::SCH_PAINTER::setColors().

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

◆ IsType()

bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[])
inlineinherited

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

Definition at line 266 of file base_struct.h.

267  {
268  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
269  {
270  if( m_StructType == *p )
271  return true;
272  }
273 
274  return false;
275  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:163
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

References EOT, and EDA_ITEM::m_StructType.

◆ IsVisible()

bool LIB_PIN::IsVisible ( ) const
inline

Return the visibility status of the draw object.

Returns
True if draw object is visible otherwise false.

Definition at line 362 of file lib_pin.h.

362 { return ( m_attributes & PIN_INVISIBLE ) == 0; }
#define PIN_INVISIBLE
Definition: lib_pin.h:46
int m_attributes
Set bit 0 to indicate pin is invisible.
Definition: lib_pin.h:81

References m_attributes, and PIN_INVISIBLE.

Referenced by KIGFX::SCH_PAINTER::draw(), drawGraphic(), DrawPinElectricalTypeName(), GetBoundingBox(), getMsgPanelInfoBase(), IsPowerConnection(), LIB_EDIT_FRAME::OnEditPin(), Plot(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SetVisible(), and DIALOG_LIB_EDIT_PIN::TransferDataToWindow().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 223 of file base_struct.h.

223 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:118
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

Referenced by SCH_FIELD::Draw().

◆ IterateForward()

SEARCH_RESULT EDA_ITEM::IterateForward ( EDA_ITEM listStart,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
staticinherited

Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes.

Parameters
listStartThe first in a list of EDA_ITEMs to iterate over.
inspectorIs an INSPECTOR to call on each object that is one of the requested scanTypes.
testDataIs an aid to testFunc, and should be sufficient to allow it to fully determine if an item meets the match criteria, but it may also be used to collect output.
scanTypesA KICAD_T array that is EOT terminated, and provides both the order and interest level of of the types of objects to be iterated over.
Returns
SEARCH_RESULT SEARCH_QUIT if the called INSPECTOR returned SEARCH_QUIT, else SCAN_CONTINUE;

Definition at line 130 of file base_struct.cpp.

134 {
135  EDA_ITEM* p = listStart;
136 
137  for( ; p; p = p->Pnext )
138  {
139  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
140  return SEARCH_QUIT;
141  }
142 
143  return SEARCH_CONTINUE;
144 }
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...
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167

References EDA_ITEM::Pnext, SEARCH_CONTINUE, SEARCH_QUIT, and EDA_ITEM::Visit().

Referenced by SCH_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::Collect(), SCH_TYPE_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::GetItem(), GERBER_FILE_IMAGE::Visit(), MODULE::Visit(), and BOARD::Visit().

◆ Matches() [1/2]

bool LIB_PIN::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData,
wxPoint *  aFindLocation 
)
overridevirtual

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.
aFindLocationA pointer to a wxPoint object to store the location of matched item. The pointer can be NULL if it is not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented from EDA_ITEM.

Definition at line 1971 of file lib_pin.cpp.

1972 {
1973  wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText( MILLIMETRES ) );
1974 
1975  // Note: this will have to be modified if we add find and replace capability to the
1976  // compoment library editor. Otherwise, you wont be able to replace pin text.
1977  if( !( aSearchData.GetFlags() & FR_SEARCH_ALL_PINS )
1978  || ( aSearchData.GetFlags() & FR_SEARCH_REPLACE ) )
1979  return false;
1980 
1981  wxLogTrace( traceFindItem, wxT( " child item " ) + GetSelectMenuText( MILLIMETRES ) );
1982 
1983  if( EDA_ITEM::Matches( GetName(), aSearchData ) || EDA_ITEM::Matches( m_number, aSearchData ) )
1984  {
1985  if( aFindLocation )
1986  *aFindLocation = GetBoundingBox().Centre();
1987 
1988  return true;
1989  }
1990 
1991  return false;
1992 }
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:420
Search texts (name and number (a 4 letters text) )in pins.
const EDA_RECT GetBoundingBox() const override
Definition: lib_pin.h:145
wxString m_number
Definition: lib_pin.h:83
const wxString & GetName() const
Definition: lib_pin.h:166
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: lib_pin.cpp:1962
const wxChar *const traceFindItem
Flag to enable find debug tracing.
Perform a search for a item that has replaceable text.
wxPoint Centre() const
Definition: eda_rect.h:60

References EDA_RECT::Centre(), FR_SEARCH_ALL_PINS, FR_SEARCH_REPLACE, GetBoundingBox(), GetName(), GetSelectMenuText(), m_number, EDA_ITEM::Matches(), MILLIMETRES, and traceFindItem.

◆ 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 182 of file base_struct.cpp.

183 {
184  wxString text = aText;
185  wxString searchText = aSearchData.GetFindString();
186 
187  // Don't match if searching for replaceable item and the item doesn't support text replace.
188  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
189  return false;
190 
191  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
192  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
193 
194  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
195  {
196  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
197  return text.Matches( searchText );
198 
199  return text.MakeUpper().Matches( searchText.MakeUpper() );
200  }
201 
202  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
203  return aText.Find( searchText ) != wxNOT_FOUND;
204 
205  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
206 }
Perform search using simple wild card matching (* & ?).
Perform a search for a item that has replaceable text.
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:464

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

◆ MirrorHorizontal()

void LIB_PIN::MirrorHorizontal ( const wxPoint &  aCenter)
overridevirtual

Mirror the draw object along the horizontal (X) axis about aCenter point.

Parameters
aCenterPoint to mirror around.

Implements LIB_ITEM.

Definition at line 1605 of file lib_pin.cpp.

1606 {
1607  m_position.x -= center.x;
1608  m_position.x *= -1;
1609  m_position.x += center.x;
1610 
1611  if( m_orientation == PIN_RIGHT )
1613  else if( m_orientation == PIN_LEFT )
1615 }
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References m_orientation, m_position, PIN_LEFT, and PIN_RIGHT.

◆ MirrorVertical()

void LIB_PIN::MirrorVertical ( const wxPoint &  aCenter)
overridevirtual

Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.

Parameters
aCenterPoint to mirror around.

Implements LIB_ITEM.

Definition at line 1617 of file lib_pin.cpp.

1618 {
1619  m_position.y -= center.y;
1620  m_position.y *= -1;
1621  m_position.y += center.y;
1622 
1623  if( m_orientation == PIN_UP )
1625  else if( m_orientation == PIN_DOWN )
1627 }
Definition: lib_pin.h:55
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References m_orientation, m_position, PIN_DOWN, and PIN_UP.

◆ Move()

void LIB_PIN::Move ( const wxPoint &  aPosition)
overridevirtual

Move a draw object to aPosition.

Parameters
aPositionPosition to move draw item to.

Implements LIB_ITEM.

Definition at line 1595 of file lib_pin.cpp.

1596 {
1597  if( m_position != newPosition )
1598  {
1599  m_position = newPosition;
1600  SetModified();
1601  }
1602 }
void SetModified()
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References m_position, and EDA_ITEM::SetModified().

Referenced by CalcEdit(), LIB_EDIT_FRAME::CreatePin(), DrawMovePin(), LIB_EDIT_FRAME::PlacePin(), and LIB_EDIT_FRAME::RepeatPinItem().

◆ Next()

◆ operator<() [1/2]

bool LIB_ITEM::operator< ( const LIB_ITEM aOther) const
inherited

Test if another draw item is less than this draw object.

Parameters
aOther- Draw item to compare against.
Returns
- True if object is less than this object.

Definition at line 93 of file lib_draw_item.cpp.

94 {
95  int result = m_Convert - aOther.m_Convert;
96 
97  if( result != 0 )
98  return result < 0;
99 
100  result = m_Unit - aOther.m_Unit;
101 
102  if( result != 0 )
103  return result < 0;
104 
105  result = Type() - aOther.Type();
106 
107  if( result != 0 )
108  return result < 0;
109 
110  return ( compare( aOther ) < 0 );
111 }
int m_Unit
Unit identification for multiple parts per package.
virtual int compare(const LIB_ITEM &aOther) const =0
Provide the draw object specific comparison called by the == and < operators.
int m_Convert
Shape identification for alternate body styles.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201

References LIB_ITEM::compare(), LIB_ITEM::m_Convert, LIB_ITEM::m_Unit, and EDA_ITEM::Type().

◆ 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 239 of file base_struct.cpp.

240 {
241  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
242  GetChars( GetClass() ) ) );
243 
244  return false;
245 }
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:92
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().

◆ operator==() [1/2]

bool LIB_ITEM::operator== ( const LIB_ITEM aOther) const
inherited

Test LIB_ITEM objects for equivalence.

Parameters
aOtherObject to test against.
Returns
True if object is identical to this object.

Definition at line 84 of file lib_draw_item.cpp.

85 {
86  return ( ( Type() == aOther.Type() )
87  && ( m_Unit == aOther.m_Unit )
88  && ( m_Convert == aOther.m_Convert )
89  && compare( aOther ) == 0 );
90 }
int m_Unit
Unit identification for multiple parts per package.
virtual int compare(const LIB_ITEM &aOther) const =0
Provide the draw object specific comparison called by the == and < operators.
int m_Convert
Shape identification for alternate body styles.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201

References LIB_ITEM::compare(), LIB_ITEM::m_Convert, LIB_ITEM::m_Unit, and EDA_ITEM::Type().

◆ operator==() [2/2]

bool LIB_ITEM::operator== ( const LIB_ITEM aOther) const
inlineinherited

Definition at line 263 of file lib_draw_item.h.

264  {
265  return *this == *aOther;
266  }

◆ PinDrawOrient()

int LIB_PIN::PinDrawOrient ( const TRANSFORM aTransform) const

Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation and the matrix transform (rot, mirror) aTransform.

Parameters
aTransformTransform matrix

Definition at line 1506 of file lib_pin.cpp.

1507 {
1508  int orient;
1509  wxPoint end; // position of pin end starting at 0,0 according to its orientation, length = 1
1510 
1511  switch( m_orientation )
1512  {
1513  case PIN_UP:
1514  end.y = 1;
1515  break;
1516 
1517  case PIN_DOWN:
1518  end.y = -1;
1519  break;
1520 
1521  case PIN_LEFT:
1522  end.x = -1;
1523  break;
1524 
1525  case PIN_RIGHT:
1526  end.x = 1;
1527  break;
1528  }
1529 
1530  // = pos of end point, according to the component orientation
1531  end = aTransform.TransformCoordinate( end );
1532  orient = PIN_UP;
1533 
1534  if( end.x == 0 )
1535  {
1536  if( end.y > 0 )
1537  orient = PIN_DOWN;
1538  }
1539  else
1540  {
1541  orient = PIN_RIGHT;
1542 
1543  if( end.x < 0 )
1544  orient = PIN_LEFT;
1545  }
1546 
1547  return orient;
1548 }
Definition: lib_pin.h:55
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:41
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77

References m_orientation, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, and TRANSFORM::TransformCoordinate().

Referenced by drawGraphic(), AUTOPLACER::get_pin_side(), GetBoundingBox(), and Plot().

◆ PinEndPoint()

wxPoint LIB_PIN::PinEndPoint ( ) const
Returns
The pin end position for a component in the normal orientation.

Definition at line 1479 of file lib_pin.cpp.

1480 {
1481  wxPoint pos = m_position;
1482 
1483  switch( m_orientation )
1484  {
1485  case PIN_UP:
1486  pos.y += m_length;
1487  break;
1488 
1489  case PIN_DOWN:
1490  pos.y -= m_length;
1491  break;
1492 
1493  case PIN_LEFT:
1494  pos.x -= m_length;
1495  break;
1496 
1497  case PIN_RIGHT:
1498  pos.x += m_length;
1499  break;
1500  }
1501 
1502  return pos;
1503 }
Definition: lib_pin.h:55
int m_length
Length of the pin.
Definition: lib_pin.h:76
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References m_length, m_orientation, m_position, PIN_DOWN, PIN_LEFT, PIN_RIGHT, and PIN_UP.

Referenced by Inside().

◆ Plot()

void LIB_PIN::Plot ( PLOTTER aPlotter,
const wxPoint &  aOffset,
bool  aFill,
const TRANSFORM aTransform 
)
overridevirtual

Plot the draw item using the plot object.

Parameters
aPlotterThe plot object to plot to.
aOffsetPlot offset position.
aFillFlag to indicate whether or not the object is filled.
aTransformThe plot transform.

Implements LIB_ITEM.

Definition at line 1678 of file lib_pin.cpp.

1680 {
1681  if( ! IsVisible() )
1682  return;
1683 
1684  int orient = PinDrawOrient( aTransform );
1685 
1686  wxPoint pos = aTransform.TransformCoordinate( m_position ) + offset;
1687 
1688  PlotSymbol( plotter, pos, orient );
1689  PlotPinTexts( plotter, pos, orient, GetParent()->GetPinNameOffset(),
1690  GetParent()->ShowPinNumbers(), GetParent()->ShowPinNames(),
1691  GetPenSize() );
1692 }
LIB_PART * GetParent() const
void PlotPinTexts(PLOTTER *aPlotter, wxPoint &aPosition, int aOrientation, int aTextInside, bool aDrawPinNum, bool aDrawPinName, int aWidth)
Plot the pin number and pin text info, given the pin line coordinates.
Definition: lib_pin.cpp:1279
int PinDrawOrient(const TRANSFORM &aTransform) const
Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation...
Definition: lib_pin.cpp:1506
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:41
int GetPenSize() const override
Definition: lib_pin.cpp:564
void PlotSymbol(PLOTTER *aPlotter, const wxPoint &aPosition, int aOrientation)
Definition: lib_pin.cpp:1128
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:362
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References LIB_ITEM::GetParent(), GetPenSize(), IsVisible(), m_position, PinDrawOrient(), PlotPinTexts(), PlotSymbol(), and TRANSFORM::TransformCoordinate().

◆ PlotPinTexts()

void LIB_PIN::PlotPinTexts ( PLOTTER aPlotter,
wxPoint &  aPosition,
int  aOrientation,
int  aTextInside,
bool  aDrawPinNum,
bool  aDrawPinName,
int  aWidth 
)

Plot the pin number and pin text info, given the pin line coordinates.

Same as DrawPinTexts((), but output is the plotter The line must be vertical or horizontal. If TextInside then the text is been put inside (moving from x1, y1 in the opposite direction to x2,y2), otherwise all is drawn outside.

Definition at line 1279 of file lib_pin.cpp.

1282 {
1283  if( m_name.IsEmpty() || m_name == wxT( "~" ) )
1284  DrawPinName = false;
1285 
1286  if( m_number.IsEmpty() )
1287  DrawPinNum = false;
1288 
1289  if( !DrawPinNum && !DrawPinName )
1290  return;
1291 
1292  int x, y;
1293  wxSize PinNameSize = wxSize( m_nameTextSize, m_nameTextSize );
1294  wxSize PinNumSize = wxSize( m_numTextSize, m_numTextSize );
1295 
1296  int nameLineWidth = GetPenSize();
1297  nameLineWidth = Clamp_Text_PenSize( nameLineWidth, m_nameTextSize, false );
1298  int numLineWidth = GetPenSize();
1299  numLineWidth = Clamp_Text_PenSize( numLineWidth, m_numTextSize, false );
1300 
1301  int name_offset = PIN_TEXT_MARGIN +
1302  ( nameLineWidth + GetDefaultLineThickness() ) / 2;
1303  int num_offset = PIN_TEXT_MARGIN +
1304  ( numLineWidth + GetDefaultLineThickness() ) / 2;
1305 
1306  /* Get the num and name colors */
1307  COLOR4D NameColor = GetLayerColor( LAYER_PINNAM );
1308  COLOR4D NumColor = GetLayerColor( LAYER_PINNUM );
1309 
1310  int x1 = pin_pos.x;
1311  int y1 = pin_pos.y;
1312 
1313  switch( orient )
1314  {
1315  case PIN_UP:
1316  y1 -= m_length;
1317  break;
1318 
1319  case PIN_DOWN:
1320  y1 += m_length;
1321  break;
1322 
1323  case PIN_LEFT:
1324  x1 -= m_length;
1325  break;
1326 
1327  case PIN_RIGHT:
1328  x1 += m_length;
1329  break;
1330  }
1331 
1332  /* Draw the text inside, but the pin numbers outside. */
1333  if( TextInside )
1334  {
1335  if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) ) /* Its an horizontal line. */
1336  {
1337  if( DrawPinName )
1338  {
1339  if( orient == PIN_RIGHT )
1340  {
1341  x = x1 + TextInside;
1342  plotter->Text( wxPoint( x, y1 ), NameColor,
1343  m_name,
1345  PinNameSize,
1348  aWidth, false, false );
1349  }
1350  else // orient == PIN_LEFT
1351  {
1352  x = x1 - TextInside;
1353 
1354  if( DrawPinName )
1355  plotter->Text( wxPoint( x, y1 ),
1356  NameColor, m_name, TEXT_ANGLE_HORIZ,
1357  PinNameSize,
1360  aWidth, false, false );
1361  }
1362  }
1363  if( DrawPinNum )
1364  {
1365  plotter->Text( wxPoint( (x1 + pin_pos.x) / 2,
1366  y1 - num_offset ),
1367  NumColor, m_number,
1368  TEXT_ANGLE_HORIZ, PinNumSize,
1371  aWidth, false, false );
1372  }
1373  }
1374  else /* Its a vertical line. */
1375  {
1376  if( orient == PIN_DOWN )
1377  {
1378  y = y1 + TextInside;
1379 
1380  if( DrawPinName )
1381  plotter->Text( wxPoint( x1, y ), NameColor,
1382  m_name,
1383  TEXT_ANGLE_VERT, PinNameSize,
1386  aWidth, false, false );
1387 
1388  if( DrawPinNum )
1389  {
1390  plotter->Text( wxPoint( x1 - num_offset,
1391  (y1 + pin_pos.y) / 2 ),
1392  NumColor, m_number,
1393  TEXT_ANGLE_VERT, PinNumSize,
1396  aWidth, false, false );
1397  }
1398  }
1399  else /* PIN_UP */
1400  {
1401  y = y1 - TextInside;
1402 
1403  if( DrawPinName )
1404  plotter->Text( wxPoint( x1, y ), NameColor,
1405  m_name,
1406  TEXT_ANGLE_VERT, PinNameSize,
1409  aWidth, false, false );
1410 
1411  if( DrawPinNum )
1412  {
1413  plotter->Text( wxPoint( x1 - num_offset,
1414  (y1 + pin_pos.y) / 2 ),
1415  NumColor, m_number,
1416  TEXT_ANGLE_VERT, PinNumSize,
1419  aWidth, false, false );
1420  }
1421  }
1422  }
1423  }
1424  else /* Draw num & text pin outside */
1425  {
1426  if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) )
1427  {
1428  /* Its an horizontal line. */
1429  if( DrawPinName )
1430  {
1431  x = (x1 + pin_pos.x) / 2;
1432  plotter->Text( wxPoint( x, y1 - name_offset ),
1433  NameColor, m_name,
1434  TEXT_ANGLE_HORIZ, PinNameSize,
1437  aWidth, false, false );
1438  }
1439 
1440  if( DrawPinNum )
1441  {
1442  x = ( x1 + pin_pos.x ) / 2;
1443  plotter->Text( wxPoint( x, y1 + num_offset ),
1444  NumColor, m_number,
1445  TEXT_ANGLE_HORIZ, PinNumSize,
1448  aWidth, false, false );
1449  }
1450  }
1451  else /* Its a vertical line. */
1452  {
1453  if( DrawPinName )
1454  {
1455  y = ( y1 + pin_pos.y ) / 2;
1456  plotter->Text( wxPoint( x1 - name_offset, y ),
1457  NameColor, m_name,
1458  TEXT_ANGLE_VERT, PinNameSize,
1461  aWidth, false, false );
1462  }
1463 
1464  if( DrawPinNum )
1465  {
1466  plotter->Text( wxPoint( x1 + num_offset,
1467  ( y1 + pin_pos.y ) / 2 ),
1468  NumColor, m_number,
1469  TEXT_ANGLE_VERT, PinNumSize,
1472  aWidth, false, false );
1473  }
1474  }
1475  }
1476 }
#define TEXT_ANGLE_HORIZ
int m_nameTextSize
Pin num and Pin name sizes.
Definition: lib_pin.h:85
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize As a rule, pen width should not be >1/4em, otherwise the character will b...
#define TEXT_ANGLE_VERT
int m_numTextSize
Definition: lib_pin.h:84
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i....
wxString m_name
Definition: lib_pin.h:82
Definition: lib_pin.h:55
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
int m_length
Length of the pin.
Definition: lib_pin.h:76
int GetPenSize() const override
Definition: lib_pin.cpp:564
wxString m_number
Definition: lib_pin.h:83
#define PIN_TEXT_MARGIN
Definition: lib_pin.cpp:63
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References Clamp_Text_PenSize(), GetDefaultLineThickness(), GetLayerColor(), GetPenSize(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, LAYER_PINNAM, LAYER_PINNUM, m_length, m_name, m_nameTextSize, m_number, m_numTextSize, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_TEXT_MARGIN, PIN_UP, PLOTTER::Text(), TEXT_ANGLE_HORIZ, and TEXT_ANGLE_VERT.

Referenced by Plot().

◆ PlotSymbol()

void LIB_PIN::PlotSymbol ( PLOTTER aPlotter,
const wxPoint &  aPosition,
int  aOrientation 
)

Definition at line 1128 of file lib_pin.cpp.

1129 {
1130  int MapX1, MapY1, x1, y1;
1132 
1133  aPlotter->SetColor( color );
1134  aPlotter->SetCurrentLineWidth( GetPenSize() );
1135 
1136  MapX1 = MapY1 = 0;
1137  x1 = aPosition.x; y1 = aPosition.y;
1138 
1139  switch( aOrientation )
1140  {
1141  case PIN_UP:
1142  y1 = aPosition.y - m_length;
1143  MapY1 = 1;
1144  break;
1145 
1146  case PIN_DOWN:
1147  y1 = aPosition.y + m_length;
1148  MapY1 = -1;
1149  break;
1150 
1151  case PIN_LEFT:
1152  x1 = aPosition.x - m_length;
1153  MapX1 = 1;
1154  break;
1155 
1156  case PIN_RIGHT:
1157  x1 = aPosition.x + m_length;
1158  MapX1 = -1;
1159  break;
1160  }
1161 
1163  {
1164  const int radius = ExternalPinDecoSize( *this );
1165  aPlotter->Circle( wxPoint( MapX1 * radius + x1,
1166  MapY1 * radius + y1 ),
1167  radius * 2, // diameter
1168  NO_FILL, // fill option
1169  GetPenSize() ); // width
1170 
1171  aPlotter->MoveTo( wxPoint( MapX1 * radius * 2 + x1,
1172  MapY1 * radius * 2 + y1 ) );
1173  aPlotter->FinishTo( aPosition );
1174  }
1175  else if( m_shape == PINSHAPE_FALLING_EDGE_CLOCK )
1176  {
1177  const int clock_size = InternalPinDecoSize( *this );
1178  if( MapY1 == 0 ) /* MapX1 = +- 1 */
1179  {
1180  aPlotter->MoveTo( wxPoint( x1, y1 + clock_size ) );
1181  aPlotter->LineTo( wxPoint( x1 + MapX1 * clock_size * 2, y1 ) );
1182  aPlotter->FinishTo( wxPoint( x1, y1 - clock_size ) );
1183  }
1184  else /* MapX1 = 0 */
1185  {
1186  aPlotter->MoveTo( wxPoint( x1 + clock_size, y1 ) );
1187  aPlotter->LineTo( wxPoint( x1, y1 + MapY1 * clock_size * 2 ) );
1188  aPlotter->FinishTo( wxPoint( x1 - clock_size, y1 ) );
1189  }
1190 
1191  aPlotter->MoveTo( wxPoint( MapX1 * clock_size * 2 + x1,
1192  MapY1 * clock_size * 2 + y1 ) );
1193  aPlotter->FinishTo( aPosition );
1194  }
1195  else
1196  {
1197  aPlotter->MoveTo( wxPoint( x1, y1 ) );
1198  aPlotter->FinishTo( aPosition );
1199  }
1200 
1203  {
1204  const int clock_size = InternalPinDecoSize( *this );
1205  if( MapY1 == 0 ) /* MapX1 = +- 1 */
1206  {
1207  aPlotter->MoveTo( wxPoint( x1, y1 + clock_size ) );
1208  aPlotter->LineTo( wxPoint( x1 - MapX1 * clock_size * 2, y1 ) );
1209  aPlotter->FinishTo( wxPoint( x1, y1 - clock_size ) );
1210  }
1211  else /* MapX1 = 0 */
1212  {
1213  aPlotter->MoveTo( wxPoint( x1 + clock_size, y1 ) );
1214  aPlotter->LineTo( wxPoint( x1, y1 - MapY1 * clock_size * 2 ) );
1215  aPlotter->FinishTo( wxPoint( x1 - clock_size, y1 ) );
1216  }
1217  }
1218 
1219  if( m_shape == PINSHAPE_INPUT_LOW || m_shape == PINSHAPE_CLOCK_LOW ) /* IEEE symbol "Active Low Input" */
1220  {
1221  const int symbol_size = ExternalPinDecoSize( *this );
1222 
1223  if( MapY1 == 0 ) /* MapX1 = +- 1 */
1224  {
1225  aPlotter->MoveTo( wxPoint( x1 + MapX1 * symbol_size * 2, y1 ) );
1226  aPlotter->LineTo( wxPoint( x1 + MapX1 * symbol_size * 2,
1227  y1 - symbol_size * 2 ) );
1228  aPlotter->FinishTo( wxPoint( x1, y1 ) );
1229  }
1230  else /* MapX1 = 0 */
1231  {
1232  aPlotter->MoveTo( wxPoint( x1, y1 + MapY1 * symbol_size * 2 ) );
1233  aPlotter->LineTo( wxPoint( x1 - symbol_size * 2,
1234  y1 + MapY1 * symbol_size * 2 ) );
1235  aPlotter->FinishTo( wxPoint( x1, y1 ) );
1236  }
1237  }
1238 
1239 
1240  if( m_shape == PINSHAPE_OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */
1241  {
1242  const int symbol_size = ExternalPinDecoSize( *this );
1243 
1244  if( MapY1 == 0 ) /* MapX1 = +- 1 */
1245  {
1246  aPlotter->MoveTo( wxPoint( x1, y1 - symbol_size * 2 ) );
1247  aPlotter->FinishTo( wxPoint( x1 + MapX1 * symbol_size * 2, y1 ) );
1248  }
1249  else /* MapX1 = 0 */
1250  {
1251  aPlotter->MoveTo( wxPoint( x1 - symbol_size * 2, y1 ) );
1252  aPlotter->FinishTo( wxPoint( x1, y1 + MapY1 * symbol_size * 2 ) );
1253  }
1254  }
1255  else if( m_shape == PINSHAPE_NONLOGIC ) /* NonLogic pin symbol */
1256  {
1257  const int symbol_size = ExternalPinDecoSize( *this );
1258  aPlotter->MoveTo( wxPoint( x1 - (MapX1 + MapY1) * symbol_size,
1259  y1 - (MapY1 - MapX1) * symbol_size ) );
1260  aPlotter->FinishTo( wxPoint( x1 + (MapX1 + MapY1) * symbol_size,
1261  y1 + (MapY1 - MapX1) * symbol_size ) );
1262  aPlotter->MoveTo( wxPoint( x1 - (MapX1 - MapY1) * symbol_size,
1263  y1 - (MapY1 + MapX1) * symbol_size ) );
1264  aPlotter->FinishTo( wxPoint( x1 + (MapX1 - MapY1) * symbol_size,
1265  y1 + (MapY1 + MapX1) * symbol_size ) );
1266  }
1267  if( m_type == PIN_NC ) // Draw a N.C. symbol
1268  {
1269  const int ex1 = aPosition.x;
1270  const int ey1 = aPosition.y;
1271  aPlotter->MoveTo( wxPoint( ex1 - NCSYMB_PIN_DIM, ey1 - NCSYMB_PIN_DIM ) );
1272  aPlotter->FinishTo( wxPoint( ex1 + NCSYMB_PIN_DIM, ey1 + NCSYMB_PIN_DIM ) );
1273  aPlotter->MoveTo( wxPoint( ex1 + NCSYMB_PIN_DIM, ey1 - NCSYMB_PIN_DIM ) );
1274  aPlotter->FinishTo( wxPoint( ex1 - NCSYMB_PIN_DIM, ey1 + NCSYMB_PIN_DIM ) );
1275  }
1276 }
void FinishTo(const wxPoint &pos)
Definition: plotter.h:251
static int ExternalPinDecoSize(const LIB_PIN &aPin)
Utility for getting the size of the 'external' pin decorators (as a radius)
Definition: lib_pin.cpp:142
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78
virtual void SetColor(COLOR4D color)=0
int color
Definition: DXF_plotter.cpp:62
Definition: lib_pin.h:55
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
int m_length
Length of the pin.
Definition: lib_pin.h:76
int GetPenSize() const override
Definition: lib_pin.cpp:564
void LineTo(const wxPoint &pos)
Definition: plotter.h:246
static int InternalPinDecoSize(const LIB_PIN &aPin)
Utility for getting the size of the 'internal' pin decorators (as a radius)
Definition: lib_pin.cpp:133
void MoveTo(const wxPoint &pos)
Definition: plotter.h:241
#define NCSYMB_PIN_DIM
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References PLOTTER::Circle(), color, ExternalPinDecoSize(), PLOTTER::FinishTo(), GetLayerColor(), GetPenSize(), InternalPinDecoSize(), LAYER_PIN, PLOTTER::LineTo(), m_length, m_shape, m_type, PLOTTER::MoveTo(), NCSYMB_PIN_DIM, NO_FILL, PIN_DOWN, PIN_LEFT, PIN_NC, PIN_RIGHT, PIN_UP, PINSHAPE_CLOCK, PINSHAPE_CLOCK_LOW, PINSHAPE_FALLING_EDGE_CLOCK, PINSHAPE_INPUT_LOW, PINSHAPE_INVERTED, PINSHAPE_INVERTED_CLOCK, PINSHAPE_NONLOGIC, PINSHAPE_OUTPUT_LOW, PLOTTER::SetColor(), and PLOTTER::SetCurrentLineWidth().

Referenced by Plot().

◆ Replace() [1/2]

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

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 209 of file base_struct.cpp.

210 {
211  wxCHECK_MSG( IsReplaceable(), false,
212  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
213 
214  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
215 
216  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
217  aSearchData.GetFindString() :
218  aSearchData.GetFindString().Upper() );
219 
220  if( result == wxNOT_FOUND )
221  return false;
222 
223  wxString prefix = aText.Left( result );
224  wxString suffix;
225 
226  if( aSearchData.GetFindString().length() + result < aText.length() )
227  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
228 
229  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
230  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
231  GetChars( suffix ) );
232 
233  aText = prefix + aSearchData.GetReplaceString() + suffix;
234 
235  return true;
236 }
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:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:464

References GetChars(), EDA_ITEM::GetClass(), EDA_ITEM::IsReplaceable(), and traceFindReplace.

Referenced by FOOTPRINT_INFO_GENERATOR::GetHtmlFieldRow(), SCH_TEXT::Replace(), SCH_FIELD::Replace(), SCH_SHEET_PIN::Replace(), SCH_SHEET::Replace(), and SCH_FIND_COLLECTOR::ReplaceItem().

◆ 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_SHEET, SCH_SHEET_PIN, SCH_FIELD, and SCH_TEXT.

Definition at line 452 of file base_struct.h.

452 { return false; }

◆ Rotate() [1/2]

void LIB_PIN::Rotate ( )
overridevirtual

Rotate the draw item.

Reimplemented from LIB_ITEM.

Definition at line 1922 of file lib_pin.cpp.

1923 {
1924  int orient = PIN_RIGHT;
1925 
1926  switch( GetOrientation() )
1927  {
1928  case PIN_UP:
1929  orient = PIN_LEFT;
1930  break;
1931 
1932  case PIN_DOWN:
1933  orient = PIN_RIGHT;
1934  break;
1935 
1936  case PIN_LEFT:
1937  orient = PIN_DOWN;
1938  break;
1939 
1940  case PIN_RIGHT:
1941  orient = PIN_UP;
1942  break;
1943  }
1944 
1945  // Set the new orientation
1946  SetOrientation( orient );
1947 }
int GetOrientation() const
Definition: lib_pin.h:221
Definition: lib_pin.h:55
void SetOrientation(int aOrientation, bool aTestOtherPins=true)
Set orientation on the pin.
Definition: lib_pin.cpp:269

References GetOrientation(), PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, and SetOrientation().

◆ Rotate() [2/2]

void LIB_PIN::Rotate ( const wxPoint &  aCenter,
bool  aRotateCCW = true 
)
overridevirtual

Rotate the object about aCenter point.

Parameters
aCenterPoint to rotate around.
aRotateCCWTrue to rotate counter clockwise. False to rotate clockwise.

Implements LIB_ITEM.

Definition at line 1629 of file lib_pin.cpp.

1630 {
1631  int rot_angle = aRotateCCW ? -900 : 900;
1632 
1633  RotatePoint( &m_position, center, rot_angle );
1634 
1635  if( aRotateCCW )
1636  {
1637  switch( m_orientation )
1638  {
1639  case PIN_RIGHT:
1641  break;
1642 
1643  case PIN_UP:
1645  break;
1646  case PIN_LEFT:
1648  break;
1649 
1650  case PIN_DOWN:
1652  break;
1653  }
1654  }
1655  else
1656  {
1657  switch( m_orientation )
1658  {
1659  case PIN_RIGHT:
1661  break;
1662 
1663  case PIN_UP:
1665  break;
1666  case PIN_LEFT:
1668  break;
1669 
1670  case PIN_DOWN:
1672  break;
1673  }
1674  }
1675 }
Definition: lib_pin.h:55
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References m_orientation, m_position, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, and RotatePoint().

◆ SetBack()

void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 215 of file base_struct.h.

215 { Pback = aBack; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:168

References EDA_ITEM::Pback.

Referenced by DHEAD::append(), DHEAD::insert(), SCH_EDIT_FRAME::PutDataInPreviousState(), DHEAD::remove(), and SwapItemData().

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 232 of file base_struct.h.

232 { SetFlags( BRIGHTENED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:138

References BRIGHTENED, and EDA_ITEM::SetFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), and SELECTION_TOOL::highlight().

◆ SetConversion()

void LIB_PIN::SetConversion ( int  aConversion)

Set the body style (conversion) of the pin.

If the pin is changed from not common to common to all body styles, any linked pins will be removed from the parent component.

Parameters
aConversion- Body style of the pin. Set to zero to make pin common to all body styles.

Definition at line 450 of file lib_pin.cpp.

451 {
452  if( m_Convert == style )
453  return;
454 
455  m_Convert = style;
456  SetFlags( IS_CHANGED );
457 
458  if( style == 0 )
459  {
460  LIB_PIN* pin;
461  LIB_PIN* tmp = GetParent()->GetNextPin();
462 
463  while( tmp != NULL )
464  {
465  pin = tmp;
466  tmp = GetParent()->GetNextPin( pin );
467 
468  if( ( pin->m_Flags & IS_LINKED ) == 0
469  || ( pin == this )
470  || ( m_Unit && ( m_Unit != pin->m_Unit ) )
471  || ( m_position != pin->m_position )
472  || ( pin->m_orientation != m_orientation ) )
473  continue;
474 
475  GetParent()->RemoveDrawItem( (LIB_ITEM*) pin );
476  }
477  }
478 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
LIB_PART * GetParent() const
int m_Unit
Unit identification for multiple parts per package.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:110
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
void RemoveDrawItem(LIB_ITEM *aItem, EDA_DRAW_PANEL *aPanel=NULL, wxDC *aDc=NULL)
Remove draw aItem from list.
int m_Convert
Shape identification for alternate body styles.

References LIB_PART::GetNextPin(), LIB_ITEM::GetParent(), IS_CHANGED, IS_LINKED, LIB_ITEM::m_Convert, EDA_ITEM::m_Flags, m_orientation, m_position, LIB_ITEM::m_Unit, LIB_PART::RemoveDrawItem(), and EDA_ITEM::SetFlags().

Referenced by DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetConvert()

◆ SetFillMode()

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 256 of file base_struct.h.

256 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_SCREEN::addConnectedItemsToBlock(), PCB_BASE_FRAME::AddModuleToBoard(), AddSegmentToDragList(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), SCH_EDIT_FRAME::BeginSegment(), LIB_EDIT_FRAME::BlockCopySelectedItems(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), LIB_EDIT_FRAME::copySelectedItems(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), SCH_EDIT_FRAME::DeleteItem(), DrawMovingBlockOutlines(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), SCH_EDIT_FRAME::HandleBlockPlace(), KIGFX::SCH_VIEW::HighlightItem(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_EDIT_FRAME::ImportSheetPin(), InvokeDialogImportGfxBoard(), InvokeDialogImportGfxModule(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), SCH_EDIT_FRAME::Load_Component(), SCH_SCREEN::MarkConnections(), MarkItemsInBloc(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnSelectUnit(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), PCB_EDIT_FRAME::Other_Layer_Route(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PrepareMoveItem(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_EDIT_FRAME::ReSizeSheet(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_SCREEN::SelectBlockItems(), EDA_ITEM::SetBrightened(), SetConversion(), BLOCK_SELECTOR::SetFlags(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), LIB_EDIT_FRAME::StartMovePin(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_EDIT_FRAME::StartMoveTextePcb(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and UndrawAndMarkSegmentsToDrag().

◆ 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 285 of file base_struct.h.

285 { m_forceVisible = aEnable; }
bool m_forceVisible
Set to true to override the visibility setting of the item.
Definition: base_struct.h:175

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDIT_FRAME::OnFindSchematicItem(), and SCH_EDIT_FRAME::updateFindReplaceView().

◆ SetHighlighted()

void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 231 of file base_struct.h.

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

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

◆ SetLength()

void LIB_PIN::SetLength ( int  aLength,
bool  aTestOtherPins = true 
)

Set the pin length.

This will also update the length of the pins marked by EnableEditMode().

Parameters
aLength- The length of the pin in mils.
aTestOtherPinsdetermines if other pins need to be updated

Definition at line 363 of file lib_pin.cpp.

364 {
365  if( m_length != length )
366  {
367  m_length = length;
368  SetModified();
369  }
370 
371  if( !aTestOtherPins )
372  return;
373 
374  if( GetParent() == NULL )
375  return;
376 
377  LIB_PINS pinList;
378  GetParent()->GetPins( pinList );
379 
380  for( size_t i = 0; i < pinList.size(); i++ )
381  {
382  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
383  || pinList[i]->m_Convert != m_Convert
384  || pinList[i]->m_length == length )
385  continue;
386 
387  pinList[i]->m_length = length;
388  SetModified();
389  }
390 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
LIB_PART * GetParent() const
int m_length
Length of the pin.
Definition: lib_pin.h:76
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597
int m_Convert
Shape identification for alternate body styles.

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, LIB_ITEM::m_Convert, EDA_ITEM::m_Flags, m_length, and EDA_ITEM::SetModified().

Referenced by LIB_EDIT_FRAME::CreatePin(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetList()

void EDA_ITEM::SetList ( DHEAD aList)
inlineinherited

Definition at line 217 of file base_struct.h.

217 { m_List = aList; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:169

References EDA_ITEM::m_List.

Referenced by DHEAD::append(), DHEAD::insert(), DHEAD::remove(), and SwapItemData().

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

Definition at line 100 of file base_struct.cpp.

101 {
102  SetFlags( IS_CHANGED );
103 
104  // If this a child object, then the parent modification state also needs to be set.
105  if( m_Parent )
107 }
void SetModified()
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:171
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:110
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256

References IS_CHANGED, EDA_ITEM::m_Parent, EDA_ITEM::SetFlags(), and EDA_ITEM::SetModified().

Referenced by SCH_COMPONENT::ClearAnnotation(), SCH_LINE::Move(), Move(), SCH_COMPONENT::Move(), LIB_PART::RemoveDrawItem(), SCH_COMPONENT::SetConvert(), SetLength(), SCH_COMPONENT::SetLibId(), EDA_ITEM::SetModified(), LIB_FIELD::SetName(), SetName(), SetNameTextSize(), SetNumber(), SetNumberTextSize(), SetOrientation(), SetPartNumber(), SetPinPosition(), SetShape(), SCH_COMPONENT::SetTransform(), SetType(), SCH_COMPONENT::SetUnit(), SetVisible(), and SetWidth().

◆ SetName()

void LIB_PIN::SetName ( const wxString &  aName,
bool  aTestOtherPins = true 
)

Set the pin name.

This will also all of the pin names marked by EnableEditMode().

Parameters
aNameNew pin name.
aTestOtherPinsdetermines if other pins need to be updated

Definition at line 161 of file lib_pin.cpp.

162 {
163  wxString tmp = ( aName.IsEmpty() ) ? wxT( "~" ) : aName;
164 
165  // pin name string does not support spaces
166  tmp.Replace( wxT( " " ), wxT( "_" ) );
167 
168  if( m_name != tmp )
169  {
170  m_name = tmp;
171  SetModified();
172  }
173 
174  if( !aTestOtherPins )
175  return;
176 
177  if( GetParent() == NULL )
178  return;
179 
180  LIB_PINS pinList;
181  GetParent()->GetPins( pinList );
182 
183  for( size_t i = 0; i < pinList.size(); i++ )
184  {
185  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->m_name == m_name )
186  continue;
187 
188  pinList[i]->m_name = m_name;
189  SetModified();
190  }
191 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
LIB_PART * GetParent() const
wxString m_name
Definition: lib_pin.h:82
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, EDA_ITEM::m_Flags, m_name, and EDA_ITEM::SetModified().

Referenced by DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), LIB_EDIT_FRAME::RepeatPinItem(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetNameTextSize()

void LIB_PIN::SetNameTextSize ( int  aSize,
bool  aTestOtherPins = true 
)

Set the aSize of the pin name text.

This will also update the text size of the name of the pins marked by EnableEditMode().

Parameters
aSizeThe text size of the pin name in schematic units ( mils ).
aTestOtherPinsdetermines if other pins need to be updated

Definition at line 194 of file lib_pin.cpp.

195 {
196  if( size != m_nameTextSize )
197  {
198  m_nameTextSize = size;
199  SetModified();
200  }
201 
202  if( !aTestOtherPins )
203  return;
204 
205  if( GetParent() == NULL )
206  return;
207 
208  LIB_PINS pinList;
209  GetParent()->GetPins( pinList );
210 
211  for( size_t i = 0; i < pinList.size(); i++ )
212  {
213  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->m_nameTextSize == size )
214  continue;
215 
216  pinList[i]->m_nameTextSize = size;
217  SetModified();
218  }
219 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
int m_nameTextSize
Pin num and Pin name sizes.
Definition: lib_pin.h:85
LIB_PART * GetParent() const
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, EDA_ITEM::m_Flags, m_nameTextSize, and EDA_ITEM::SetModified().

Referenced by LIB_EDIT_FRAME::CreatePin(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetNext()

void EDA_ITEM::SetNext ( EDA_ITEM aNext)
inlineinherited

Definition at line 214 of file base_struct.h.

214 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167

References EDA_ITEM::Pnext.

Referenced by DHEAD::append(), DHEAD::insert(), SCH_EDIT_FRAME::PutDataInPreviousState(), DHEAD::remove(), and SwapItemData().

◆ SetNumber()

void LIB_PIN::SetNumber ( const wxString &  aNumber)

Set the pin number.

Others pin numbers marked by EnableEditMode() are not modified because each pin has its own number

Parameters
aNumberNew pin number.

Definition at line 222 of file lib_pin.cpp.

223 {
224  // Unlike SetName, others pin numbers marked by EnableEditMode() are
225  // not modified because each pin has its own number, so set number
226  // only for this.
227 
228  wxString tmp = ( aNumber.IsEmpty() ) ? wxT( "~" ) : aNumber;
229 
230  // pin number string does not support spaces
231  tmp.Replace( wxT( " " ), wxT( "_" ) );
232 
233  if( m_number != tmp )
234  {
235  m_number = tmp;
236  SetModified();
237  }
238 }
void SetModified()
wxString m_number
Definition: lib_pin.h:83

References m_number, and EDA_ITEM::SetModified().

Referenced by LIB_EDIT_FRAME::CreateImagePins(), SCH_EAGLE_PLUGIN::loadSymbol(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), LIB_EDIT_FRAME::RepeatPinItem(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetNumberTextSize()

void LIB_PIN::SetNumberTextSize ( int  aSize,
bool  aTestOtherPins = true 
)

Set the size of the pin number text.

This will also update the text size of the number of the pins marked by EnableEditMode().

Parameters
aSizeThe text size of the pin number in schematic units ( mils ).
aTestOtherPinsdetermines if other pins need to be updated

Definition at line 241 of file lib_pin.cpp.

242 {
243  if( size != m_numTextSize )
244  {
245  m_numTextSize = size;
246  SetModified();
247  }
248 
249  if( !aTestOtherPins )
250  return;
251 
252  if( GetParent() == NULL )
253  return;
254 
255  LIB_PINS pinList;
256  GetParent()->GetPins( pinList );
257 
258  for( size_t i = 0; i < pinList.size(); i++ )
259  {
260  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->m_numTextSize == size )
261  continue;
262 
263  pinList[i]->m_numTextSize = size;
264  SetModified();
265  }
266 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
int m_numTextSize
Definition: lib_pin.h:84
LIB_PART * GetParent() const
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, EDA_ITEM::m_Flags, m_numTextSize, and EDA_ITEM::SetModified().

Referenced by LIB_EDIT_FRAME::CreatePin(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetOffset()

void LIB_PIN::SetOffset ( const wxPoint &  aOffset)
overridevirtual

Set the drawing object by aOffset from the current position.

Parameters
aOffsetCoordinates to offset the item position.

Implements LIB_ITEM.

Definition at line 1581 of file lib_pin.cpp.

1582 {
1583  m_position += aOffset;
1584 }
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75

References m_position.

◆ SetOrientation()

void LIB_PIN::SetOrientation ( int  aOrientation,
bool  aTestOtherPins = true 
)

Set orientation on the pin.

This will also update the orientation of the pins marked by EnableEditMode().

Parameters
aOrientation- The orientation of the pin.
aTestOtherPinsdetermines if other pins need to be updated

Definition at line 269 of file lib_pin.cpp.

270 {
271  if( m_orientation != orientation )
272  {
273  m_orientation = orientation;
274  SetModified();
275  }
276 
277  if( !aTestOtherPins )
278  return;
279 
280  if( GetParent() == NULL )
281  return;
282 
283  LIB_PINS pinList;
284  GetParent()->GetPins( pinList );
285 
286  for( size_t i = 0; i < pinList.size(); i++ )
287  {
288  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 ||
289  pinList[i]->m_orientation == orientation )
290  continue;
291 
292  pinList[i]->m_orientation = orientation;
293  SetModified();
294  }
295 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
LIB_PART * GetParent() const
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, EDA_ITEM::m_Flags, m_orientation, and EDA_ITEM::SetModified().

Referenced by LIB_EDIT_FRAME::CreatePin(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), Rotate(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetParent()

void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlineinherited

◆ SetPartNumber()

void LIB_PIN::SetPartNumber ( int  aPart)

Set the pin part number.

If the pin is changed from not common to common to all parts, any linked pins will be removed from the parent component.

Parameters
aPart- Number of the part the pin belongs to. Set to zero to make pin common to all parts in a multi-part component.

Definition at line 420 of file lib_pin.cpp.

421 {
422  if( m_Unit == part )
423  return;
424 
425  m_Unit = part;
426  SetModified();
427 
428  if( m_Unit == 0 )
429  {
430  LIB_PIN* pin;
431  LIB_PIN* tmp = GetParent()->GetNextPin();
432 
433  while( tmp != NULL )
434  {
435  pin = tmp;
436  tmp = GetParent()->GetNextPin( pin );
437 
438  if( pin->m_Flags == 0 || pin == this
439  || ( m_Convert && ( m_Convert != pin->m_Convert ) )
440  || ( m_position != pin->m_position )
441  || ( pin->m_orientation != m_orientation ) )
442  continue;
443 
444  GetParent()->RemoveDrawItem( (LIB_ITEM*) pin );
445  }
446  }
447 }
void SetModified()
LIB_PART * GetParent() const
int m_Unit
Unit identification for multiple parts per package.
The base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:67
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
void RemoveDrawItem(LIB_ITEM *aItem, EDA_DRAW_PANEL *aPanel=NULL, wxDC *aDc=NULL)
Remove draw aItem from list.
int m_Convert
Shape identification for alternate body styles.

References LIB_PART::GetNextPin(), LIB_ITEM::GetParent(), LIB_ITEM::m_Convert, EDA_ITEM::m_Flags, m_orientation, m_position, LIB_ITEM::m_Unit, LIB_PART::RemoveDrawItem(), and EDA_ITEM::SetModified().

Referenced by DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetPinPosition()

void LIB_PIN::SetPinPosition ( wxPoint  aPosition)

move this and all linked pins to the new position used in pin editing.

use SetPinPosition to set the position of this only

Parameters
aPositionis the new position of this and linked pins

Definition at line 393 of file lib_pin.cpp.

394 {
395  if( m_position != aPosition )
396  {
397  m_position = aPosition;
398  SetModified();
399  }
400 
401  if( GetParent() == NULL )
402  return;
403 
404  LIB_PINS pinList;
405  GetParent()->GetPins( pinList );
406 
407  for( size_t i = 0; i < pinList.size(); i++ )
408  {
409  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
410  || pinList[i]->m_Convert != m_Convert
411  || pinList[i]->m_position == aPosition )
412  continue;
413 
414  pinList[i]->m_position = aPosition;
415  SetModified();
416  }
417 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
LIB_PART * GetParent() const
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597
int m_Convert
Shape identification for alternate body styles.

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, LIB_ITEM::m_Convert, EDA_ITEM::m_Flags, m_position, and EDA_ITEM::SetModified().

Referenced by DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetPosition()

void LIB_ITEM::SetPosition ( const wxPoint &  aPosition)
inlineinherited

◆ SetSelected()

void EDA_ITEM::SetSelected ( )
inlineinherited

Definition at line 230 of file base_struct.h.

230 { SetFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256

References SELECTED, and EDA_ITEM::SetFlags().

Referenced by SELECTION_TOOL::highlight(), LIB_EDIT_FRAME::pasteClipboard(), and GERBVIEW_SELECTION_TOOL::selectVisually().

◆ SetShape()

void LIB_PIN::SetShape ( GRAPHIC_PINSHAPE  aShape)

Set the shape of the pin to aShape.

This will also update the draw style of the pins marked by EnableEditMode().

Parameters
aShape- The draw shape of the pin. See enum GRAPHIC_PINSHAPE.

Definition at line 298 of file lib_pin.cpp.

299 {
300  assert( aShape >= 0 && aShape < int( PINSHAPE_COUNT ) );
301 
302  if( m_shape != aShape )
303  {
304  m_shape = aShape;
305  SetModified();
306  }
307 
308  if( GetParent() == NULL )
309  return;
310 
311  LIB_PINS pinList;
312  GetParent()->GetPins( pinList );
313 
314  for( size_t i = 0; i < pinList.size(); i++ )
315  {
316  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
317  || pinList[i]->m_Convert != m_Convert
318  || pinList[i]->m_shape == aShape )
319  continue;
320 
321  pinList[i]->m_shape = aShape;
322  SetModified();
323  }
324 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78
LIB_PART * GetParent() const
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597
int m_Convert
Shape identification for alternate body styles.

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, LIB_ITEM::m_Convert, EDA_ITEM::m_Flags, m_shape, PINSHAPE_COUNT, and EDA_ITEM::SetModified().

Referenced by LIB_EDIT_FRAME::CreatePin(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetState()

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

◆ SetTimeStamp()

void EDA_ITEM::SetTimeStamp ( timestamp_t  aNewTimeStamp)
inlineinherited

Definition at line 206 of file base_struct.h.

206 { m_TimeStamp = aNewTimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172

References EDA_ITEM::m_TimeStamp.

Referenced by PCB_BASE_FRAME::AddModuleToBoard(), BOARD_NETLIST_UPDATER::addNewComponent(), PCAD2KICAD::PCB_TEXT::AddToBoard(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_ARC::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), PCAD2KICAD::PCB_MODULE::AddToBoard(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::CreateSheet(), Diagnose(), SCH_EDIT_FRAME::DuplicateItemsInList(), DuplicateStruct(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::FootprintSave(), EDA_ITEM::initVars(), BOARD::InsertArea(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), EAGLE_PLUGIN::loadSignals(), LEGACY_PLUGIN::loadTrackList(), EDA_ITEM::operator=(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageText(), PCB_PARSER::parseDIMENSION(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDIT_FRAME::Process_Special_Functions(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), BOARD::ReplaceNetlist(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET::SCH_SHEET(), SCH_COMPONENT::SetTimeStamp(), SimilarLabelsDiagnose(), SwapItemData(), TestDuplicateSheetNames(), and DIALOG_ERC::TestErc().

◆ SetType()

void LIB_PIN::SetType ( ELECTRICAL_PINTYPE  aType,
bool  aTestOtherPins = true 
)

Set the electrical type of the pin.

This will also update the electrical type of the pins marked by EnableEditMode().

Parameters
aType- The electrical type of the pin(see enun ELECTRICAL_PINTYPE for values).
aTestOtherPinsdetermines if other pins need to be updated

Definition at line 327 of file lib_pin.cpp.

328 {
329  assert( aType >= 0 && aType < (int)PINTYPE_COUNT );
330 
331  if( aType < PIN_INPUT )
332  aType = PIN_INPUT;
333 
334  if( aType >= (int)PINTYPE_COUNT )
335  aType = PIN_NC;
336 
337  if( m_type != aType )
338  {
339  m_type = aType;
340  SetModified();
341  }
342 
343  if( !aTestOtherPins )
344  return;
345 
346  if( GetParent() == NULL )
347  return;
348 
349  LIB_PINS pinList;
350  GetParent()->GetPins( pinList );
351 
352  for( size_t i = 0; i < pinList.size(); i++ )
353  {
354  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->m_type == aType )
355  continue;
356 
357  pinList[i]->m_type = aType;
358  SetModified();
359  }
360 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
LIB_PART * GetParent() const
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, EDA_ITEM::m_Flags, m_type, PIN_INPUT, PIN_NC, PINTYPE_COUNT, and EDA_ITEM::SetModified().

Referenced by LIB_EDIT_FRAME::CreatePin(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetUnit()

◆ SetVisible()

void LIB_PIN::SetVisible ( bool  aVisible)

Set or clear the visibility flag for the pin.

This will also update the visibility of the pins marked by EnableEditMode().

Parameters
aVisible- True to make the pin visible or false to hide the pin.

Definition at line 481 of file lib_pin.cpp.

482 {
483  if( visible == IsVisible() )
484  return;
485 
486  if( visible )
488  else
490 
491  SetModified();
492 
493  if( GetParent() == NULL )
494  return;
495 
496  LIB_PINS pinList;
497  GetParent()->GetPins( pinList );
498 
499  for( size_t i = 0; i < pinList.size(); i++ )
500  {
501  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->IsVisible() == visible )
502  continue;
503 
504  if( visible )
505  pinList[i]->m_attributes &= ~PIN_INVISIBLE;
506  else
507  pinList[i]->m_attributes |= PIN_INVISIBLE;
508 
509  SetModified();
510  }
511 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
void SetModified()
LIB_PART * GetParent() const
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define PIN_INVISIBLE
Definition: lib_pin.h:46
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:362
int m_attributes
Set bit 0 to indicate pin is invisible.
Definition: lib_pin.h:81
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
size_t i
Definition: json11.cpp:597

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), i, IS_LINKED, IsVisible(), m_attributes, EDA_ITEM::m_Flags, PIN_INVISIBLE, and EDA_ITEM::SetModified().

Referenced by LIB_EDIT_FRAME::CreatePin(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), DIALOG_LIB_EDIT_PIN::TransferDataFromWindow(), and DIALOG_LIB_EDIT_PIN::TransferDataToWindow().

◆ SetWidth()

void LIB_PIN::SetWidth ( int  aWidth)
overridevirtual

Set the width of the draw item to aWidth.

Implements LIB_ITEM.

Definition at line 1695 of file lib_pin.cpp.

1696 {
1697  if( m_width != aWidth )
1698  {
1699  m_width = aWidth;
1700  SetModified();
1701  }
1702 }
void SetModified()
int m_width
Line width of the pin.
Definition: lib_pin.h:79

References m_width, and EDA_ITEM::SetModified().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 229 of file base_struct.h.

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

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 483 of file base_struct.h.

483 { return *aLeft < *aRight; }

Referenced by PART_LIB::GetEntryTypePowerNames().

◆ 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 201 of file base_struct.h.

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

References EDA_ITEM::m_StructType.

Referenced by Abort_Move_ModuleOutline(), abortMoveItem(), AbortPinMove(), MODULE::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), PCB_EDIT_FRAME::Add45DegreeSegment(), SCH_SCREEN::addConnectedItemsToBlock(), POINT_EDITOR::addCorner(), SCH_EDIT_FRAME::addCurrentItemToScreen(), AddMenusForComponent(), AddMenusForEditComponent(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::Begin_Route(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), LIB_EDIT_FRAME::BlockCopySelectedItems(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), calcArea(), calcMaxArea(), POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_EDIT_FRAME::CheckListConnections(), CN_VISITOR::checkZoneItemConnection(), TEXTE_PCB::ClassOf(), EDGE_MODULE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), PCB_TARGET::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), ZONE_CONTAINER::ClassOf(), MARKER_PCB::ClassOf(), DIMENSION::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), MODULE::ClassOf(), SCH_COMPONENT::ClassOf(), D_PAD::ClassOf(), BOARD::ClassOf(), VIA::ClassOf(), SCH_SHEET::CleanupSheet(), Collect_TrackSegmentsToDrag(), LIB_CIRCLE::compare(), LIB_BEZIER::compare(), LIB_RECTANGLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), compare(), SCH_SHEET::ComponentCount(), GRID_HELPER::computeAnchors(), SCH_SCREEN::CountConnectedItems(), SCH_SHEET::CountSheets(), MODULE::CoverageRatio(), LIB_EDIT_FRAME::CreateGraphicItem(), CINFO3D_VISU::createLayers(), BOARD::CreateLockPoint(), SCH_EDIT_FRAME::CreateNewText(), CINFO3D_VISU::createNewTrack(), PCB_EDIT_FRAME::createPopupMenuForTracks(), CreateRoutesSection(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), D_PAD::D_PAD(), FOOTPRINT_EDIT_FRAME::Delete_Edge_Module(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), LIB_EDIT_FRAME::deleteItem(), SCH_EDIT_FRAME::DeleteItem(), DeleteNullTrackSegments(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_ERC::DisplayERC_MarkersList(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), DRC::doTrackDrc(), DRC::doTrackKeepoutDrc(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), DrawMovePin(), DrawMovingBlockOutlines(), drawPickedItems(), CN_ITEM::Dump(), BOARD::Duplicate(), MODULE::Duplicate(), PCB_EDIT_FRAME::duplicateItems(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditSymbolText(), EditToolSelectionFilter(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::EraseRedundantTrack(), ExitSheet(), find_vias_and_tracks_at(), SCH_EDIT_FRAME::FindComponentAndItem(), NETLIST_EXPORTER::findNextComponent(), NETLIST_EXPORTER::findNextComponentAndCreatePinList(), SCH_SHEET_PATH::FindNextItem(), SCH_SHEET_LIST::FindNextItem(), SCH_SHEET_PATH::FindPreviousItem(), SCH_SHEET_LIST::FindPreviousItem(), EDIT_TOOL::FootprintFilter(), FootprintWriteShape(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), TRACK::GetBestInsertPoint(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetClearance(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), NETLIST_OBJECT::GetComponentParent(), SCH_SCREEN::GetConnection(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetEndPoints(), SCH_SHEET::GetEndPoints(), GetFirstTrack(), GetFirstVia(), SCH_SCREEN::GetHierarchicalItems(), SCH_SCREENS::GetLibNicknames(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), BOARD_CONNECTED_ITEM::GetNetClass(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), SCH_SCREEN::GetPin(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), getRect(), SELECTION::GetTopLeftItem(), LIB_EDIT_FRAME::GlobalSetPins(), SELECTION_TOOL::guessSelectionCandidates(), hash_eda(), SCH_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), SELECTION_TOOL::highlight(), KIGFX::SCH_VIEW::HighlightItem(), SCH_EDIT_FRAME::ImportSheetPin(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), SCH_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), SCH_FIND_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), SCH_COLLECTOR::IsNode(), TRACK::IsNull(), SCH_LINE::IsParallel(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), SCH_EDIT_FRAME::LocateAndShowItem(), SCH_EDIT_FRAME::LocateItem(), SCH_SHEET::LocatePathOfScreen(), Magnetize(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), MarkItemsInBloc(), BOARD::MarkTrace(), TRACKS_CLEANER::mergeCollinearSegmentIfPossible(), TRACKS_CLEANER::MergeCollinearTracks(), SCH_LINE::MergeOverlap(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), moveItemWithMouseCursor(), MoveMarkedItems(), MoveMarkedItemsExactly(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), LIB_EDIT_FRAME::OnEditComponentProperties(), SCH_EDIT_FRAME::OnEditItem(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), SCH_EDIT_FRAME::OnHotKey(), LIB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), POINT_EDITOR::OnSelectionChange(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), LIB_ITEM::operator==(), OrCell_Trace(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::PasteItemsFromClipboard(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), DRAWING_TOOL::PlaceImportedGraphics(), LIB_EDIT_FRAME::PlacePin(), SCH_FIELD::Plot(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), SCH_EDIT_FRAME::PrepareMoveItem(), GAL_ARRAY_CREATOR::prePushAction(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), DIALOG_EXCHANGE_FOOTPRINTS::processMatchingModules(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_BASE_FRAME::RefreshItem(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), CN_CONNECTIVITY_ALGO::Remove(), BOARD::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), LIB_PART::RemoveDrawItem(), TRACKS_CLEANER::removeDuplicatesOfTrack(), SCH_SHEET::RemovePin(), FOOTPRINT_EDIT_FRAME::RemoveStruct(), PCB_EDIT_FRAME::RemoveStruct(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SCREEN::ReplaceWires(), PCB_BASE_FRAME::ResetTextSize(), SCH_EDIT_FRAME::ReSizeSheet(), BOARD_COMMIT::Revert(), SCH_TEXT::Rotate(), SCH_EDIT_FRAME::RotateField(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_EDIT_FRAME::SaveUndoItemInUndoList(), SCH_EDIT_FRAME::SaveWireImage(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SELECTION_TOOL::select(), SELECTION_TOOL::selectable(), SCH_SCREEN::SelectBlockItems(), PCB_EDIT_FRAME::SelectHighLight(), ITEM_PICKER::SetItem(), SetSchItemParent(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), PCB_EDIT_FRAME::Show_1_Ratsnest(), Show_MoveNode(), ShowClearance(), ShowNewTrackWhenMovingCursor(), SortByTimeStamp(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), PCB_TARGET::SwapData(), SCH_BITMAP::SwapData(), SCH_FIELD::SwapData(), SCH_SHEET_PIN::SwapData(), TEXTE_PCB::SwapData(), DIMENSION::SwapData(), DRAWSEGMENT::SwapData(), TRACK::SwapData(), SCH_SHEET::SwapData(), VIA::SwapData(), SCH_COMPONENT::SwapData(), MODULE::SwapData(), ZONE_CONTAINER::SwapData(), D_PAD::SwapData(), SwapItemData(), PCB_EDIT_FRAME::SwitchLayer(), TestDuplicateSheetNames(), TRACKS_CLEANER::testTrackEndpointDangling(), TEXTE_MODULE::TEXTE_MODULE(), AR_MATRIX::TraceSegmentPcb(), TraceSegmentPcb(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), SELECTION_TOOL::unhighlight(), SCH_SHEET_PATH::UpdateAllScreenReferences(), SCH_TEXT::UpdateDanglingState(), POINT_EDITOR::updateItem(), POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), EDA_ITEM::Visit(), SCH_SHEET::Visit(), and SCH_COMPONENT::Visit().

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited