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 Types

enum  LIB_CONVERT : int { BASE = 1, DEMORGAN = 2 }
 
enum  COMPARE_FLAGS : int { NORMAL = 0x00, UNIT = 0x01 }
 The list of flags used by the compare function. More...
 

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, int aAccuracy=0) const override
 Function HitTest tests if aPosition is contained within or on the bounding box of an item. More...
 
void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, 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_DRAW_FRAME *aFrame, 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) 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...
 
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 GetPenWidth () const override
 
void PrintPinSymbol (RENDER_SETTINGS *aSettings, const wxPoint &aPos, int aOrientation)
 Print the pin symbol without text. More...
 
void PrintPinTexts (RENDER_SETTINGS *aSettings, wxPoint &aPosition, int aOrientation, int TextInside, bool DrawPinNum, bool DrawPinName)
 Put the pin number and pin text info, given the pin line coordinates. More...
 
void PrintPinElectricalTypeName (RENDER_SETTINGS *aSettings, wxPoint &aPosition, int aOrientation)
 Draw the electrical type text of the pin (only for the footprint editor) More...
 
void PlotPinTexts (PLOTTER *aPlotter, wxPoint &aPosition, int aOrientation, int aTextInside, bool aDrawPinNum, bool aDrawPinName)
 Plot the pin number and pin text info, given the pin line coordinates. More...
 
void PlotSymbol (PLOTTER *aPlotter, const wxPoint &aPosition, int aOrientation)
 
void Offset (const wxPoint &aOffset) override
 Set the drawing object by aOffset from the current position. More...
 
void MoveTo (const wxPoint &aPosition) override
 Move a draw object to aPosition. More...
 
const wxPoint GetPosition () const override
 
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
 
void SetWidth (int aWidth) override
 
BITMAP_DEF GetMenuImage () const override
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
wxString GetSelectMenuText (EDA_UNITS aUnits) const override
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
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 (const wxPoint aPosition)
 Begin drawing a component library draw item at aPosition. More...
 
virtual bool ContinueEdit (const wxPoint aPosition)
 Continue an edit in progress at aPosition. More...
 
virtual void EndEdit ()
 End an object editing action. More...
 
virtual void Print (RENDER_SETTINGS *aSettings, const wxPoint &aOffset, 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 HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const override
 Function HitTest tests if aRect intersects or is contained within the bounding box of an item. More...
 
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...
 
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...
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag)
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool IsType (const KICAD_T aScanTypes[]) const
 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...
 
bool IsForceVisible () const
 
virtual const wxPoint GetFocusPosition () const
 Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
virtual bool 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_DEFGetOrientationSymbols ()
 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...
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
static bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

const KIID m_Uuid
 

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...
 
bool m_isFillable
 
STATUS_FLAGS m_Status
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
STATUS_FLAGS m_Flags
 

Private Member Functions

void print (RENDER_SETTINGS *aSettings, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform) override
 Print a pin, with or without the pin texts. More...
 
void getMsgPanelInfoBase (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
 Build the pin basic info to display in message panel. More...
 
int compare (const LIB_ITEM &aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags=LIB_ITEM::COMPARE_FLAGS::NORMAL) const override
 Provide the draw object specific comparison called by the == and < operators. More...
 

Private Attributes

wxPoint m_position
 
int m_length
 
int m_orientation
 
GRAPHIC_PINSHAPE m_shape
 
int m_width
 
ELECTRICAL_PINTYPE m_type
 
int m_attributes
 
wxString m_name
 
wxString m_number
 
int m_numTextSize
 
int m_nameTextSize
 

Friends

class SCH_LEGACY_PLUGIN_CACHE
 

Detailed Description

Definition at line 63 of file lib_pin.h.

Member Enumeration Documentation

◆ COMPARE_FLAGS

enum LIB_ITEM::COMPARE_FLAGS : int
inherited

The list of flags used by the compare function.

  • NORMAL This compares everthing between two LIB_ITEM objects.
  • UNIT This compare flag ignores unit and convert and pin number information when comparing LIB_ITEM objects for unit comparison.
Enumerator
NORMAL 
UNIT 

Definition at line 116 of file lib_item.h.

116 : int { NORMAL = 0x00, UNIT = 0x01 };

◆ LIB_CONVERT

enum LIB_ITEM::LIB_CONVERT : int
inherited
Enumerator
BASE 
DEMORGAN 

Definition at line 107 of file lib_item.h.

107 : int { BASE = 1, DEMORGAN = 2 };

Constructor & Destructor Documentation

◆ LIB_PIN()

LIB_PIN::LIB_PIN ( LIB_PART aParent)

Definition at line 160 of file lib_pin.cpp.

162 {
163  m_orientation = PIN_RIGHT; // Pin orient: Up, Down, Left, Right
164  m_type = ELECTRICAL_PINTYPE::PT_UNSPECIFIED; // electrical type of pin
165  m_attributes = 0; // bit 0 != 0: pin invisible
166  m_width = 0;
167 
168  // Use the application settings for pin sizes if exists.
169  // pgm can be nullptr when running a shared lib from a script, not from a kicad appl
170  PGM_BASE* pgm = PgmOrNull();
171 
172  if( pgm )
173  {
175  m_length = Mils2iu( settings->m_Defaults.pin_length );
176  m_numTextSize = Mils2iu( settings->m_Defaults.pin_num_size );
177  m_nameTextSize = Mils2iu( settings->m_Defaults.pin_name_size );
178  }
179  else // Use hardcoded eeschema defaults: libedit settings are not existing.
180  {
181  m_length = Mils2iu( DEFAULT_PIN_LENGTH );
182  m_numTextSize = Mils2iu( DEFAULT_PINNUM_SIZE );
184  }
185 }
int m_nameTextSize
Definition: lib_pin.h:80
GRAPHIC_PINSHAPE m_shape
Definition: lib_pin.h:73
VTBL_ENTRY SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:175
int m_numTextSize
Definition: lib_pin.h:79
PGM_BASE keeps program (whole process) data for KiCad programs.
Definition: pgm_base.h:137
unknown electrical properties: creates always a warning when connected
#define DEFAULT_PIN_LENGTH
The default pin number size when creating pins(can be changed in preference menu)
int m_length
Definition: lib_pin.h:71
int m_orientation
Definition: lib_pin.h:72
AppSettings * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
#define DEFAULT_PINNUM_SIZE
The default pin name size when creating pins(can be changed in preference menu)
#define DEFAULT_PINNAME_SIZE
The default selection highlight thickness (can be changed in preference menu)
int m_attributes
Definition: lib_pin.h:76
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75
PGM_BASE * PgmOrNull()
similat to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
LIB_ITEM(KICAD_T aType, LIB_PART *aComponent=NULL, int aUnit=0, int aConvert=0, FILL_T aFillType=NO_FILL)
Definition: lib_item.cpp:37
int m_width
Definition: lib_pin.h:74

References DEFAULT_PIN_LENGTH, DEFAULT_PINNAME_SIZE, DEFAULT_PINNUM_SIZE, SETTINGS_MANAGER::GetAppSettings(), PGM_BASE::GetSettingsManager(), LINE, m_attributes, LIBEDIT_SETTINGS::m_Defaults, m_length, m_nameTextSize, m_numTextSize, m_orientation, m_type, m_width, PgmOrNull(), LIBEDIT_SETTINGS::DEFAULTS::pin_length, LIBEDIT_SETTINGS::DEFAULTS::pin_name_size, LIBEDIT_SETTINGS::DEFAULTS::pin_num_size, PIN_RIGHT, and PT_UNSPECIFIED.

Referenced by Clone().

◆ ~LIB_PIN()

LIB_PIN::~LIB_PIN ( )
inline

Definition at line 98 of file lib_pin.h.

98 { }

Member Function Documentation

◆ BeginEdit()

virtual void LIB_ITEM::BeginEdit ( const wxPoint  aPosition)
inlinevirtualinherited

Begin drawing a component library draw item at aPosition.

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.

Parameters
aPositionThe position in drawing coordinates where the drawing was started. May or may not be required depending on the item being drawn.

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

Definition at line 133 of file lib_item.h.

133 {}

Referenced by LIB_DRAWING_TOOLS::DrawShape().

◆ 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 1698 of file lib_pin.cpp.

1699 {
1700  if( IsMoving() )
1701  {
1702  DBG(printf("MOVEPIN\n");)
1703  MoveTo( aPosition );
1704  }
1705 }
bool IsMoving() const
Definition: base_struct.h:200
void MoveTo(const wxPoint &aPosition) override
Move a draw object to aPosition.
Definition: lib_pin.cpp:1333
#define DBG(x)
Definition: fctsys.h:33

References DBG, EDA_ITEM::IsMoving(), and MoveTo().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearEditFlags()

◆ ClearFlags()

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

Definition at line 233 of file base_struct.h.

233 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References EDA_ITEM::m_Flags.

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

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 245 of file base_struct.h.

246  {
248  DO_NOT_DRAW );
249  }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: base_struct.h:125
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:128
#define CANDIDATE
flag indicating that the structure is connected
Definition: base_struct.h:127
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:123
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:233
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:129
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:122

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

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 153 of file view_item.h.

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

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

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

◆ Clone()

EDA_ITEM * 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 1266 of file lib_pin.cpp.

1267 {
1268  return new LIB_PIN( *this );
1269 }
LIB_PIN(LIB_PART *aParent)
Definition: lib_pin.cpp:160

References LIB_PIN().

Referenced by LIB_PIN_TOOL::CreateImagePins(), and LIB_PIN_TOOL::RepeatPin().

◆ compare()

int LIB_PIN::compare ( const LIB_ITEM aOther,
LIB_ITEM::COMPARE_FLAGS  aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL 
) 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.
Note
Make sure you call down to LIB_ITEM::compare before doing any derived object comparisons or you will break the sorting using the symbol library file format.
Parameters
aOtherA reference to the other LIB_ITEM to compare the arc against.
aCompareFlagsThe flags used to perform the comparison.
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.

Reimplemented from LIB_ITEM.

Definition at line 1272 of file lib_pin.cpp.

1273 {
1274  wxASSERT( aOther.Type() == LIB_PIN_T );
1275 
1276  int retv = LIB_ITEM::compare( aOther, aCompareFlags );
1277 
1278  if( retv )
1279  return retv;
1280 
1281  const LIB_PIN* tmp = (LIB_PIN*) &aOther;
1282 
1283  // When comparing units, we do not compare the part numbers. If everything else is
1284  // identical, then we can just renumber the parts for the inherited symbol.
1285  if( !( aCompareFlags & COMPARE_FLAGS::UNIT ) && m_number != tmp->m_number )
1286  return m_number.Cmp( tmp->m_number );
1287 
1288  int result = m_name.CmpNoCase( tmp->m_name );
1289 
1290  if( result )
1291  return result;
1292 
1293  if( m_position.x != tmp->m_position.x )
1294  return m_position.x - tmp->m_position.x;
1295 
1296  if( m_position.y != tmp->m_position.y )
1297  return m_position.y - tmp->m_position.y;
1298 
1299  if( m_length != tmp->m_length )
1300  return m_length - tmp->m_length;
1301 
1302  if( m_orientation != tmp->m_orientation )
1303  return m_orientation - tmp->m_orientation;
1304 
1305  if( m_shape != tmp->m_shape )
1306  return static_cast<int>( m_shape ) - static_cast<int>( tmp->m_shape );
1307 
1308  if( m_type != tmp->m_type )
1309  return static_cast<int>( m_type ) - static_cast<int>( tmp->m_type );
1310 
1311  if( m_attributes != tmp->m_attributes )
1312  return m_attributes - tmp->m_attributes;
1313 
1314  if( m_width != tmp->m_width )
1315  return m_width - tmp->m_width;
1316 
1317  if( m_numTextSize != tmp->m_numTextSize )
1318  return m_numTextSize - tmp->m_numTextSize;
1319 
1320  if( m_nameTextSize != tmp->m_nameTextSize )
1321  return m_nameTextSize - tmp->m_nameTextSize;
1322 
1323  return 0;
1324 }
int m_nameTextSize
Definition: lib_pin.h:80
#define UNIT
GRAPHIC_PINSHAPE m_shape
Definition: lib_pin.h:73
int m_numTextSize
Definition: lib_pin.h:79
wxString m_name
Definition: lib_pin.h:77
int m_length
Definition: lib_pin.h:71
int m_orientation
Definition: lib_pin.h:72
wxString m_number
Definition: lib_pin.h:78
int m_attributes
Definition: lib_pin.h:76
wxPoint m_position
Definition: lib_pin.h:70
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75
int m_width
Definition: lib_pin.h:74
virtual int compare(const LIB_ITEM &aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags=LIB_ITEM::COMPARE_FLAGS::NORMAL) const
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_item.cpp:76
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References LIB_ITEM::compare(), LIB_PIN_T, m_attributes, m_length, m_name, m_nameTextSize, m_number, m_numTextSize, m_orientation, m_position, m_shape, m_type, m_width, EDA_ITEM::Type(), UNIT, wxPoint::x, and wxPoint::y.

◆ 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 drawing an item. This would be called for each additional left click when the mouse is captured while the item is being drawn.

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_POLYLINE.

Definition at line 145 of file lib_item.h.

145 { return false; }

Referenced by LIB_DRAWING_TOOLS::DrawShape().

◆ 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 531 of file lib_pin.cpp.

532 {
533  LIB_PINS pinList;
534 
535  if( GetParent() == NULL )
536  return;
537 
538  GetParent()->GetPins( pinList );
539 
540  for( size_t i = 0; i < pinList.size(); i++ )
541  {
542  if( pinList[i] == this )
543  continue;
544 
545  if( ( pinList[i]->m_position == m_position )
546  && ( pinList[i]->m_orientation == m_orientation )
547  && !IsNew() && !aEditPinByPin && aEnable )
548  {
549  pinList[i]->SetFlags( IS_LINKED | IN_EDIT );
550  }
551  else
552  pinList[i]->ClearFlags( IS_LINKED | IN_EDIT );
553  }
554 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
#define IN_EDIT
Item currently edited.
Definition: base_struct.h:115
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
bool IsNew() const
Definition: base_struct.h:199
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
Definition: lib_pin.h:72
#define NULL
wxPoint m_position
Definition: lib_pin.h:70

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

Referenced by LIB_PIN_TOOL::EditPinProperties().

◆ EndEdit()

virtual void LIB_ITEM::EndEdit ( )
inlinevirtualinherited

End an object editing action.

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

Reimplemented in LIB_POLYLINE.

Definition at line 152 of file lib_item.h.

152 {}

Referenced by LIB_DRAWING_TOOLS::DrawShape().

◆ 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 130 of file lib_pin.h.

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

References GetBoundingBox().

Referenced by SCH_PIN::GetBoundingBox(), GetBoundingBox(), HitTest(), 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 1499 of file lib_pin.cpp.

1500 {
1501  EDA_RECT bbox;
1502  wxPoint begin;
1503  wxPoint end;
1504  int nameTextOffset = 0;
1505  bool showName = !m_name.IsEmpty() && (m_name != wxT( "~" ));
1506  bool showNum = !m_number.IsEmpty();
1507  int minsizeV = TARGET_PIN_RADIUS;
1508 
1509  if( !aIncludeInvisibles && !IsVisible() )
1510  showName = false;
1511 
1512  if( GetParent() )
1513  {
1514  if( GetParent()->ShowPinNames() )
1515  nameTextOffset = GetParent()->GetPinNameOffset();
1516  else
1517  showName = false;
1518 
1519  if( !GetParent()->ShowPinNumbers() )
1520  showNum = false;
1521  }
1522 
1523  // First, calculate boundary box corners position
1524  int numberTextLength = showNum ? m_numTextSize * m_number.Len() : 0;
1525 
1526  // Actual text height is bigger than text size
1527  int numberTextHeight = showNum ? KiROUND( m_numTextSize * 1.1 ) : 0;
1528 
1530  minsizeV = std::max( TARGET_PIN_RADIUS, externalPinDecoSize( nullptr, *this ) );
1531 
1532  // calculate top left corner position
1533  // for the default pin orientation (PIN_RIGHT)
1534  begin.y = std::max( minsizeV, numberTextHeight + Mils2iu( PIN_TEXT_MARGIN ) );
1535  begin.x = std::min( -TARGET_PIN_RADIUS, m_length - (numberTextLength / 2) );
1536 
1537  // calculate bottom right corner position and adjust top left corner position
1538  int nameTextLength = 0;
1539  int nameTextHeight = 0;
1540 
1541  if( showName )
1542  {
1543  int length = m_name.Len();
1544 
1545  // Don't count the line over text symbol.
1546  if( m_name.Left( 1 ) == wxT( "~" ) )
1547  length -= 1;
1548 
1549  nameTextLength = ( m_nameTextSize * length ) + nameTextOffset;
1550 
1551  // Actual text height are bigger than text size
1552  nameTextHeight = KiROUND( m_nameTextSize * 1.1 ) + Mils2iu( PIN_TEXT_MARGIN );
1553  }
1554 
1555  if( nameTextOffset ) // for values > 0, pin name is inside the body
1556  {
1557  end.x = m_length + nameTextLength + TARGET_PIN_RADIUS;
1558  end.y = std::min( -minsizeV, -nameTextHeight / 2 );
1559  }
1560  else // if value == 0:
1561  // pin name is outside the body, and above the pin line
1562  // pin num is below the pin line
1563  {
1564  end.x = std::max( m_length + TARGET_PIN_RADIUS, nameTextLength );
1565  end.y = -begin.y;
1566  begin.y = std::max( minsizeV, nameTextHeight );
1567  }
1568 
1569  // Now, calculate boundary box corners position for the actual pin orientation
1570  int orient = PinDrawOrient( DefaultTransform );
1571 
1572  /* Calculate the pin position */
1573  switch( orient )
1574  {
1575  case PIN_UP:
1576  // Pin is rotated and texts positions are mirrored
1577  RotatePoint( &begin, wxPoint( 0, 0 ), -900 );
1578  RotatePoint( &end, wxPoint( 0, 0 ), -900 );
1579  break;
1580 
1581  case PIN_DOWN:
1582  RotatePoint( &begin, wxPoint( 0, 0 ), 900 );
1583  RotatePoint( &end, wxPoint( 0, 0 ), 900 );
1584  begin.x = -begin.x;
1585  end.x = -end.x;
1586  break;
1587 
1588  case PIN_LEFT:
1589  begin.x = -begin.x;
1590  end.x = -end.x;
1591  break;
1592 
1593  case PIN_RIGHT:
1594  break;
1595  }
1596 
1597  begin += m_position;
1598  end += m_position;
1599 
1600  bbox.SetOrigin( begin );
1601  bbox.SetEnd( end );
1602  bbox.Normalize();
1603  bbox.Inflate( ( GetPenWidth() / 2 ) + 1 );
1604 
1605  // Draw Y axis is reversed in schematic:
1606  bbox.RevertYAxis();
1607 
1608  return bbox;
1609 }
int m_nameTextSize
Definition: lib_pin.h:80
GRAPHIC_PINSHAPE m_shape
Definition: lib_pin.h:73
int GetPinNameOffset()
int m_numTextSize
Definition: lib_pin.h:79
LIB_PART * GetParent() const
Definition: lib_item.h:182
TRANSFORM DefaultTransform
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:131
wxString m_name
Definition: lib_pin.h:77
Definition: lib_pin.h:58
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
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:1232
int m_length
Definition: lib_pin.h:71
void RevertYAxis()
Function RevertYAxis Mirror the rectangle from the X axis (negate Y pos and size)
Definition: eda_rect.h:209
wxString m_number
Definition: lib_pin.h:78
void SetEnd(int x, int y)
Definition: eda_rect.h:192
int GetPenWidth() const override
Definition: lib_pin.cpp:565
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
void Normalize()
Function Normalize ensures that the height ant width are positive.
wxPoint m_position
Definition: lib_pin.h:70
#define PIN_TEXT_MARGIN
Definition: lib_pin.cpp:70
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
#define TARGET_PIN_RADIUS
Definition: lib_pin.h:46
static int externalPinDecoSize(RENDER_SETTINGS *aSettings, const LIB_PIN &aPin)
Utility for getting the size of the 'external' pin decorators (as a radius)
Definition: lib_pin.cpp:150
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References DefaultTransform, externalPinDecoSize(), LIB_ITEM::GetParent(), GetPenWidth(), LIB_PART::GetPinNameOffset(), EDA_RECT::Inflate(), INVERTED, INVERTED_CLOCK, IsVisible(), KiROUND(), m_length, m_name, m_nameTextSize, m_number, m_numTextSize, m_position, m_shape, EDA_RECT::Normalize(), PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_TEXT_MARGIN, PIN_UP, PinDrawOrient(), EDA_RECT::RevertYAxis(), RotatePoint(), EDA_RECT::SetEnd(), EDA_RECT::SetOrigin(), TARGET_PIN_RADIUS, wxPoint::x, and wxPoint::y.

◆ 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 83 of file lib_pin.cpp.

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

◆ 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 249 of file lib_pin.h.

250  {
252  }
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75
wxString const GetCanonicalElectricalTypeName() const
return a string giving the electrical type of the pin.
Definition: lib_pin.h:249

References m_type.

◆ GetClass()

wxString LIB_PIN::GetClass ( ) const
inlineoverridevirtual

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 100 of file lib_pin.h.

101  {
102  return wxT( "LIB_PIN" );
103  }

◆ GetConvert()

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 237 of file base_struct.h.

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

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

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

◆ 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 258 of file lib_pin.h.

259  {
260  return GetText( m_type );
261  }
wxString GetText(GRAPHIC_PINSHAPE aShape)
Definition: pin_shape.cpp:58
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75

References GetText(), and m_type.

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

◆ GetFillMode()

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

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

Reimplemented in DRAWSEGMENT, and TRACK.

Definition at line 344 of file base_struct.h.

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

References EDA_ITEM::GetPosition().

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

◆ GetLength()

◆ 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 1652 of file lib_pin.cpp.

1653 {
1654  return GetBitmap( m_type );
1655 }
BITMAP_DEF GetBitmap(GRAPHIC_PINSHAPE aShape)
Definition: pin_shape.cpp:68
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75

References GetBitmap(), and m_type.

◆ GetMsgPanelInfo() [1/2]

void LIB_PIN::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
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 LIB_PIN_TOOL::EditPinProperties(), and SCH_PIN::GetMsgPanelInfo().

◆ GetMsgPanelInfo() [2/2]

void LIB_PIN::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
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 1463 of file lib_pin.cpp.

1465 {
1466  getMsgPanelInfoBase( aFrame, aList );
1467 
1468  if( !aComponent )
1469  return;
1470 
1471  wxString text;
1472  wxPoint pinpos = aComponent->GetTransform().TransformCoordinate( GetPosition() )
1473  + aComponent->GetPosition();
1474 
1475  text = MessageTextFromValue( aFrame->GetUserUnits(), pinpos.x, true );
1476  aList.emplace_back( _( "Pos X" ), text, DARKMAGENTA );
1477 
1478  text = MessageTextFromValue( aFrame->GetUserUnits(), pinpos.y, true );
1479  aList.emplace_back( _( "Pos Y" ), text, DARKMAGENTA );
1480 
1481  aList.emplace_back( aComponent->GetField( REFERENCE )->GetShownText(),
1482  aComponent->GetField( VALUE )->GetShownText(), DARKCYAN );
1483 
1484 #if defined(DEBUG)
1485 
1486  SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( aFrame );
1487 
1488  if( !frame )
1489  return;
1490 
1491  auto conn = aComponent->GetConnectionForPin( this, frame->GetCurrentSheet() );
1492 
1493  if( conn )
1494  conn->AppendDebugInfoToMsgPanel( aList );
1495 
1496 #endif
1497 }
void getMsgPanelInfoBase(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Build the pin basic info to display in message panel.
Definition: lib_pin.cpp:1421
Schematic editor (Eeschema) main window.
Field Reference of part, i.e. "IC21".
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: sch_field.cpp:102
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:42
#define VALUE
TRANSFORM & GetTransform() const
const wxPoint GetPosition() const override
SCH_CONNECTION * GetConnectionForPin(LIB_PIN *aPin, const SCH_SHEET_PATH &aSheet)
Retrieves the connection for a given pin of the component.
const wxPoint GetPosition() const override
Definition: lib_pin.h:430
void AppendDebugInfoToMsgPanel(MSG_PANEL_ITEMS &aList) const
Adds extended debug information about the connection object to aList.
SCH_FIELD * GetField(int aFieldNdx)
Returns a field in this symbol.
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:124
#define _(s)
Definition: 3d_actions.cpp:33
SCH_SHEET_PATH & GetCurrentSheet() const
EDA_UNITS GetUserUnits() const
Return the user units currently in use.

References _, SCH_CONNECTION::AppendDebugInfoToMsgPanel(), DARKCYAN, DARKMAGENTA, SCH_COMPONENT::GetConnectionForPin(), SCH_EDIT_FRAME::GetCurrentSheet(), SCH_COMPONENT::GetField(), getMsgPanelInfoBase(), GetPosition(), SCH_COMPONENT::GetPosition(), SCH_FIELD::GetShownText(), SCH_COMPONENT::GetTransform(), EDA_BASE_FRAME::GetUserUnits(), MessageTextFromValue(), REFERENCE, TRANSFORM::TransformCoordinate(), VALUE, wxPoint::x, and wxPoint::y.

◆ getMsgPanelInfoBase()

void LIB_PIN::getMsgPanelInfoBase ( EDA_DRAW_FRAME aFrame,
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 1421 of file lib_pin.cpp.

1422 {
1423  wxString text = m_number.IsEmpty() ? wxT( "?" ) : m_number;
1424 
1425  LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
1426 
1427  aList.push_back( MSG_PANEL_ITEM( _( "Name" ), m_name, DARKCYAN ) );
1428  aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text, DARKCYAN ) );
1429  aList.push_back( MSG_PANEL_ITEM( _( "Type" ), GetText( m_type ), RED ) );
1430 
1431  text = GetText( m_shape );
1432  aList.push_back( MSG_PANEL_ITEM( _( "Style" ), text, BLUE ) );
1433 
1434  text = IsVisible() ? _( "Yes" ) : _( "No" );
1435  aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), text, DARKGREEN ) );
1436 
1437  // Display pin length
1438  text = StringFromValue( aFrame->GetUserUnits(), m_length, true );
1439  aList.push_back( MSG_PANEL_ITEM( _( "Length" ), text, MAGENTA ) );
1440 
1442  aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), text, DARKMAGENTA ) );
1443 }
GRAPHIC_PINSHAPE m_shape
Definition: lib_pin.h:73
static const wxString getPinOrientationName(unsigned aPinOrientationCode)
Definition: lib_pin.cpp:112
static int GetOrientationIndex(int aCode)
Get the index of the orientation code.
Definition: lib_pin.cpp:1632
wxString m_name
Definition: lib_pin.h:77
int m_length
Definition: lib_pin.h:71
int m_orientation
Definition: lib_pin.h:72
wxString m_number
Definition: lib_pin.h:78
wxString GetText(GRAPHIC_PINSHAPE aShape)
Definition: pin_shape.cpp:58
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
Definition: color4d.h:59
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
Definition: lib_item.cpp:52
Definition: color4d.h:56
#define _(s)
Definition: 3d_actions.cpp:33
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233
EDA_UNITS GetUserUnits() const
Return the user units currently in use.

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

Referenced by GetMsgPanelInfo().

◆ GetName()

◆ GetNameTextSize()

◆ GetNumber()

◆ GetNumberTextSize()

◆ GetOrientation()

◆ 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 1623 of file lib_pin.cpp.

1624 {
1625  if( index >= 0 && index < (int) PIN_ORIENTATION_CNT )
1626  return pin_orientation_codes[ index ];
1627 
1628  return PIN_RIGHT;
1629 }
static const int pin_orientation_codes[]
Definition: lib_pin.cpp:60
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:67

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 1632 of file lib_pin.cpp.

1633 {
1634  size_t i;
1635 
1636  for( i = 0; i < PIN_ORIENTATION_CNT; i++ )
1637  {
1638  if( pin_orientation_codes[i] == code )
1639  return (int) i;
1640  }
1641 
1642  return wxNOT_FOUND;
1643 }
static const int pin_orientation_codes[]
Definition: lib_pin.cpp:60
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:67

References 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 ( )
static

Get a list of pin orientation names.

Returns
List of valid pin orientation names.

Definition at line 1612 of file lib_pin.cpp.

1613 {
1614  wxArrayString tmp;
1615 
1616  for( unsigned ii = 0; ii < PIN_ORIENTATION_CNT; ii++ )
1617  tmp.Add( getPinOrientationName( ii ) );
1618 
1619  return tmp;
1620 }
static const wxString getPinOrientationName(unsigned aPinOrientationCode)
Definition: lib_pin.cpp:112
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:67

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 1646 of file lib_pin.cpp.

1647 {
1648  return iconsPinsOrientations;
1649 }
static const BITMAP_DEF iconsPinsOrientations[]
Definition: lib_pin.cpp:74

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 298 of file lib_pin.h.

298 { return m_Unit; }
int m_Unit
Unit identification for multiple parts per package.
Definition: lib_item.h:81

References LIB_ITEM::m_Unit.

◆ GetPenWidth()

int LIB_PIN::GetPenWidth ( ) const
overridevirtual

Implements LIB_ITEM.

Definition at line 565 of file lib_pin.cpp.

566 {
567  return std::max( m_width, 1 );
568 }
int m_width
Definition: lib_pin.h:74

References m_width.

Referenced by GetBoundingBox(), PlotPinTexts(), PlotSymbol(), PrintPinSymbol(), and PrintPinTexts().

◆ GetPosition()

◆ GetSelectMenuText()

wxString LIB_PIN::GetSelectMenuText ( EDA_UNITS  aUnits) const
overridevirtual

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

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

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 1658 of file lib_pin.cpp.

1659 {
1660  return wxString::Format( _( "Pin %s, %s, %s" ),
1661  m_number,
1663  GetText( m_shape ));
1664 }
GRAPHIC_PINSHAPE m_shape
Definition: lib_pin.h:73
wxString m_number
Definition: lib_pin.h:78
wxString const GetElectricalTypeName() const
return a translated string for messages giving the electrical type of the pin.
Definition: lib_pin.h:258
wxString GetText(GRAPHIC_PINSHAPE aShape)
Definition: pin_shape.cpp:58
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define _(s)
Definition: 3d_actions.cpp:33

References _, Format(), GetElectricalTypeName(), GetText(), m_number, and m_shape.

Referenced by SCH_PIN::GetSelectMenuText(), and Matches().

◆ GetShape()

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 216 of file base_struct.h.

217  {
218  return m_Status & type;
219  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

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

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 229 of file base_struct.h.

229 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

◆ 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 234 of file lib_pin.h.

234 { return m_type; }
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75

References m_type.

Referenced by KIGFX::SCH_PAINTER::draw(), LIB_PIN_TOOL::EditPinProperties(), SCH_PIN::GetType(), IsPowerConnection(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), LIB_PIN_TOOL::PlacePin(), SCH_SEXPR_PLUGIN_CACHE::savePin(), 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 105 of file lib_pin.h.

106  {
107  return _( "Pin" );
108  }
#define _(s)
Definition: 3d_actions.cpp:33

References _.

◆ GetUnit()

◆ GetWidth()

int LIB_PIN::GetWidth ( ) const
inlineoverridevirtual

Implements LIB_ITEM.

Definition at line 447 of file lib_pin.h.

447 { return m_width; }
int m_width
Definition: lib_pin.h:74

References m_width.

◆ HasFlag()

◆ HitTest() [1/2]

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

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

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

Reimplemented from LIB_ITEM.

Definition at line 557 of file lib_pin.cpp.

558 {
559  EDA_RECT rect = GetBoundingBox();
560 
561  return rect.Inflate( aAccuracy ).Contains( aPosition );
562 }
const EDA_RECT GetBoundingBox() const override
Definition: lib_pin.h:130
bool Contains(const wxPoint &aPoint) const
Function Contains.
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(), GetBoundingBox(), and EDA_RECT::Inflate().

◆ HitTest() [2/2]

bool LIB_ITEM::HitTest ( const EDA_RECT aRect,
bool  aContained,
int  aAccuracy = 0 
) const
overridevirtualinherited

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

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

Reimplemented from EDA_ITEM.

Reimplemented in LIB_POLYLINE, and LIB_TEXT.

Definition at line 122 of file lib_item.cpp.

123 {
124  if( m_Flags & ( STRUCT_DELETED | SKIP_STRUCT ) )
125  return false;
126 
127  EDA_RECT sel = aRect;
128 
129  if ( aAccuracy )
130  sel.Inflate( aAccuracy );
131 
132  if( aContained )
133  return sel.Contains( GetBoundingBox() );
134 
135  return sel.Intersects( GetBoundingBox() );
136 }
const EDA_RECT GetBoundingBox() const override
Definition: lib_item.h:201
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:128
bool Contains(const wxPoint &aPoint) const
Function Contains.
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References EDA_RECT::Contains(), LIB_ITEM::GetBoundingBox(), EDA_RECT::Inflate(), EDA_RECT::Intersects(), EDA_ITEM::m_Flags, SKIP_STRUCT, and STRUCT_DELETED.

◆ IsBrightened()

bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 201 of file base_struct.h.

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

References IS_DRAGGED, and EDA_ITEM::m_Flags.

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

◆ 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.

Definition at line 292 of file lib_item.h.

292 { return m_isFillable; }
bool m_isFillable
Definition: lib_item.h:94

References LIB_ITEM::m_isFillable.

Referenced by LIB_EDIT_TOOL::editGraphicProperties(), formatFill(), and DIALOG_LIB_EDIT_DRAW_ITEM::TransferDataToWindow().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 286 of file base_struct.h.

286 { return m_forceVisible; }
bool m_forceVisible
Definition: base_struct.h:175

References EDA_ITEM::m_forceVisible.

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

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 198 of file base_struct.h.

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

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ 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 351 of file lib_pin.h.

352  {
354  && ( !IsVisible() || (LIB_PART*) GetParent()->IsPower() );
355  }
power input (GND, VCC for ICs). Must be connected to a power output.
LIB_PART * GetParent() const
Definition: lib_item.h:182
Define a library symbol object.
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
ELECTRICAL_PINTYPE GetType() const
Get the electrical type of the pin.
Definition: lib_pin.h:234
bool IsPower() const

References LIB_ITEM::GetParent(), GetType(), LIB_PART::IsPower(), IsVisible(), and PT_POWER_IN.

Referenced by KIGFX::SCH_PAINTER::draw(), SCH_PIN::GetDefaultNetName(), and SCH_PIN::IsPowerConnection().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

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

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

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

Definition at line 501 of file base_struct.h.

501 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 204 of file base_struct.h.

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

References IS_RESIZED, and EDA_ITEM::m_Flags.

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

◆ IsSelected()

◆ IsType()

virtual bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[]) const
inlinevirtualinherited

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

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

Reimplemented in SCH_LABEL, VIA, DIMENSION, D_PAD, DRAWSEGMENT, TEXTE_MODULE, SCH_FIELD, SCH_LINE, EDGE_MODULE, and TEXTE_PCB.

Definition at line 262 of file base_struct.h.

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

Referenced by GetRule(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), TEXTE_PCB::IsType(), EDGE_MODULE::IsType(), SCH_LINE::IsType(), SCH_FIELD::IsType(), TEXTE_MODULE::IsType(), DRAWSEGMENT::IsType(), D_PAD::IsType(), DIMENSION::IsType(), VIA::IsType(), SCH_LABEL::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsVisible()

bool LIB_PIN::IsVisible ( ) const
inline

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 202 of file base_struct.h.

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

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

◆ IterateForward() [1/2]

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

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

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

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

Definition at line 383 of file base_struct.h.

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

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

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

◆ IterateForward() [2/2]

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

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

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

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

Definition at line 404 of file base_struct.h.

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

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

◆ Matches() [1/2]

bool LIB_PIN::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData 
)
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.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented from EDA_ITEM.

Definition at line 1667 of file lib_pin.cpp.

1668 {
1669  wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText( EDA_UNITS::MILLIMETRES ) );
1670 
1671  // Note: this will have to be modified if we add find and replace capability to the
1672  // compoment library editor. Otherwise, you wont be able to replace pin text.
1673  if( !( aSearchData.GetFlags() & FR_SEARCH_ALL_PINS )
1674  || ( aSearchData.GetFlags() & FR_SEARCH_REPLACE ) )
1675  return false;
1676 
1677  wxLogTrace(
1678  traceFindItem, wxT( " child item " ) + GetSelectMenuText( EDA_UNITS::MILLIMETRES ) );
1679 
1680  return EDA_ITEM::Matches( GetName(), aSearchData )
1681  || EDA_ITEM::Matches( m_number, aSearchData );
1682 }
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: lib_pin.cpp:1658
wxString m_number
Definition: lib_pin.h:78
const wxString & GetName() const
Definition: lib_pin.h:151
const wxChar *const traceFindItem
Flag to enable find debug tracing.
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:457

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

Referenced by SCH_PIN::Matches().

◆ Matches() [2/2]

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

Function Matches compares aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

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

Definition at line 143 of file base_struct.cpp.

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

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 1343 of file lib_pin.cpp.

1344 {
1345  m_position.x -= center.x;
1346  m_position.x *= -1;
1347  m_position.x += center.x;
1348 
1349  if( m_orientation == PIN_RIGHT )
1351  else if( m_orientation == PIN_LEFT )
1353 }
int m_orientation
Definition: lib_pin.h:72
wxPoint m_position
Definition: lib_pin.h:70

References m_orientation, m_position, PIN_LEFT, PIN_RIGHT, and wxPoint::x.

◆ 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 1355 of file lib_pin.cpp.

1356 {
1357  m_position.y -= center.y;
1358  m_position.y *= -1;
1359  m_position.y += center.y;
1360 
1361  if( m_orientation == PIN_UP )
1363  else if( m_orientation == PIN_DOWN )
1365 }
Definition: lib_pin.h:58
int m_orientation
Definition: lib_pin.h:72
wxPoint m_position
Definition: lib_pin.h:70

References m_orientation, m_position, PIN_DOWN, PIN_UP, and wxPoint::y.

◆ MoveTo()

void LIB_PIN::MoveTo ( const wxPoint aPosition)
overridevirtual

Move a draw object to aPosition.

Parameters
aPositionPosition to move draw item to.

Implements LIB_ITEM.

Definition at line 1333 of file lib_pin.cpp.

1334 {
1335  if( m_position != newPosition )
1336  {
1337  m_position = newPosition;
1338  SetModified();
1339  }
1340 }
void SetModified()
Definition: base_struct.cpp:85
wxPoint m_position
Definition: lib_pin.h:70

References m_position, and EDA_ITEM::SetModified().

Referenced by CalcEdit(), and LIB_PIN_TOOL::CreatePin().

◆ Offset()

void LIB_PIN::Offset ( 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 1327 of file lib_pin.cpp.

1328 {
1329  m_position += aOffset;
1330 }
wxPoint m_position
Definition: lib_pin.h:70

References m_position.

Referenced by LIB_PIN_TOOL::RepeatPin().

◆ 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 101 of file lib_item.cpp.

102 {
103  int result = m_Convert - aOther.m_Convert;
104 
105  if( result != 0 )
106  return result < 0;
107 
108  result = m_Unit - aOther.m_Unit;
109 
110  if( result != 0 )
111  return result < 0;
112 
113  result = Type() - aOther.Type();
114 
115  if( result != 0 )
116  return result < 0;
117 
118  return ( compare( aOther ) < 0 );
119 }
int m_Unit
Unit identification for multiple parts per package.
Definition: lib_item.h:81
int m_Convert
Shape identification for alternate body styles.
Definition: lib_item.h:87
virtual int compare(const LIB_ITEM &aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags=LIB_ITEM::COMPARE_FLAGS::NORMAL) const
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_item.cpp:76
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

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

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

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

◆ 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 95 of file lib_item.cpp.

96 {
97  return compare( aOther ) == 0;
98 }
virtual int compare(const LIB_ITEM &aOther, LIB_ITEM::COMPARE_FLAGS aCompareFlags=LIB_ITEM::COMPARE_FLAGS::NORMAL) const
Provide the draw object specific comparison called by the == and < operators.
Definition: lib_item.cpp:76

References LIB_ITEM::compare().

◆ operator==() [2/2]

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

Definition at line 221 of file lib_item.h.

222  {
223  return *this == *aOther;
224  }

◆ 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 1232 of file lib_pin.cpp.

1233 {
1234  int orient;
1235  wxPoint end; // position of pin end starting at 0,0 according to its orientation, length = 1
1236 
1237  switch( m_orientation )
1238  {
1239  case PIN_UP: end.y = 1; break;
1240  case PIN_DOWN: end.y = -1; break;
1241  case PIN_LEFT: end.x = -1; break;
1242  case PIN_RIGHT: end.x = 1; break;
1243  }
1244 
1245  // = pos of end point, according to the component orientation
1246  end = aTransform.TransformCoordinate( end );
1247  orient = PIN_UP;
1248 
1249  if( end.x == 0 )
1250  {
1251  if( end.y > 0 )
1252  orient = PIN_DOWN;
1253  }
1254  else
1255  {
1256  orient = PIN_RIGHT;
1257 
1258  if( end.x < 0 )
1259  orient = PIN_LEFT;
1260  }
1261 
1262  return orient;
1263 }
Definition: lib_pin.h:58
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:42
int m_orientation
Definition: lib_pin.h:72

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

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

◆ PinEndPoint()

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

Definition at line 1216 of file lib_pin.cpp.

1217 {
1218  wxPoint pos = m_position;
1219 
1220  switch( m_orientation )
1221  {
1222  case PIN_UP: pos.y += m_length; break;
1223  case PIN_DOWN: pos.y -= m_length; break;
1224  case PIN_LEFT: pos.x -= m_length; break;
1225  case PIN_RIGHT: pos.x += m_length; break;
1226  }
1227 
1228  return pos;
1229 }
Definition: lib_pin.h:58
int m_length
Definition: lib_pin.h:71
int m_orientation
Definition: lib_pin.h:72
wxPoint m_position
Definition: lib_pin.h:70

References m_length, m_orientation, m_position, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, wxPoint::x, and wxPoint::y.

◆ 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 1396 of file lib_pin.cpp.

1398 {
1399  if( ! IsVisible() )
1400  return;
1401 
1402  int orient = PinDrawOrient( aTransform );
1403  wxPoint pos = aTransform.TransformCoordinate( m_position ) + offset;
1404 
1405  PlotSymbol( plotter, pos, orient );
1406  PlotPinTexts( plotter, pos, orient, GetParent()->GetPinNameOffset(),
1407  GetParent()->ShowPinNumbers(), GetParent()->ShowPinNames() );
1408 }
LIB_PART * GetParent() const
Definition: lib_item.h:182
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:1232
void PlotPinTexts(PLOTTER *aPlotter, wxPoint &aPosition, int aOrientation, int aTextInside, bool aDrawPinNum, bool aDrawPinName)
Plot the pin number and pin text info, given the pin line coordinates.
Definition: lib_pin.cpp:1030
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:42
void PlotSymbol(PLOTTER *aPlotter, const wxPoint &aPosition, int aOrientation)
Definition: lib_pin.cpp:902
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
wxPoint m_position
Definition: lib_pin.h:70

References LIB_ITEM::GetParent(), 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 
)

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 1030 of file lib_pin.cpp.

1032 {
1033  if( m_name.IsEmpty() || m_name == wxT( "~" ) )
1034  DrawPinName = false;
1035 
1036  if( m_number.IsEmpty() )
1037  DrawPinNum = false;
1038 
1039  if( !DrawPinNum && !DrawPinName )
1040  return;
1041 
1042  int x, y;
1043  wxSize PinNameSize = wxSize( m_nameTextSize, m_nameTextSize );
1044  wxSize PinNumSize = wxSize( m_numTextSize, m_numTextSize );
1045 
1046  int namePenWidth = std::max( Clamp_Text_PenSize( GetPenWidth(), m_nameTextSize, false ),
1047  plotter->RenderSettings()->GetDefaultPenWidth() );
1048  int numPenWidth = std::max( Clamp_Text_PenSize( GetPenWidth(), m_numTextSize, false ),
1049  plotter->RenderSettings()->GetDefaultPenWidth() );
1050 
1051  int name_offset = Mils2iu( PIN_TEXT_MARGIN ) + namePenWidth;
1052  int num_offset = Mils2iu( PIN_TEXT_MARGIN ) + numPenWidth;
1053 
1054  /* Get the num and name colors */
1055  COLOR4D NameColor = plotter->RenderSettings()->GetLayerColor( LAYER_PINNAM );
1056  COLOR4D NumColor = plotter->RenderSettings()->GetLayerColor( LAYER_PINNUM );
1057 
1058  int x1 = pin_pos.x;
1059  int y1 = pin_pos.y;
1060 
1061  switch( orient )
1062  {
1063  case PIN_UP: y1 -= m_length; break;
1064  case PIN_DOWN: y1 += m_length; break;
1065  case PIN_LEFT: x1 -= m_length; break;
1066  case PIN_RIGHT: x1 += m_length; break;
1067  }
1068 
1069  /* Draw the text inside, but the pin numbers outside. */
1070  if( TextInside )
1071  {
1072  if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) ) /* Its an horizontal line. */
1073  {
1074  if( DrawPinName )
1075  {
1076  if( orient == PIN_RIGHT )
1077  {
1078  x = x1 + TextInside;
1079  plotter->Text( wxPoint( x, y1 ), NameColor,
1080  m_name,
1082  PinNameSize,
1085  namePenWidth, false, false );
1086  }
1087  else // orient == PIN_LEFT
1088  {
1089  x = x1 - TextInside;
1090 
1091  if( DrawPinName )
1092  plotter->Text( wxPoint( x, y1 ),
1093  NameColor, m_name, TEXT_ANGLE_HORIZ,
1094  PinNameSize,
1097  namePenWidth, false, false );
1098  }
1099  }
1100  if( DrawPinNum )
1101  {
1102  plotter->Text( wxPoint( (x1 + pin_pos.x) / 2,
1103  y1 - num_offset ),
1104  NumColor, m_number,
1105  TEXT_ANGLE_HORIZ, PinNumSize,
1108  numPenWidth, false, false );
1109  }
1110  }
1111  else /* Its a vertical line. */
1112  {
1113  if( orient == PIN_DOWN )
1114  {
1115  y = y1 + TextInside;
1116 
1117  if( DrawPinName )
1118  plotter->Text( wxPoint( x1, y ), NameColor,
1119  m_name,
1120  TEXT_ANGLE_VERT, PinNameSize,
1123  namePenWidth, false, false );
1124 
1125  if( DrawPinNum )
1126  {
1127  plotter->Text( wxPoint( x1 - num_offset,
1128  (y1 + pin_pos.y) / 2 ),
1129  NumColor, m_number,
1130  TEXT_ANGLE_VERT, PinNumSize,
1133  numPenWidth, false, false );
1134  }
1135  }
1136  else /* PIN_UP */
1137  {
1138  y = y1 - TextInside;
1139 
1140  if( DrawPinName )
1141  plotter->Text( wxPoint( x1, y ), NameColor,
1142  m_name,
1143  TEXT_ANGLE_VERT, PinNameSize,
1146  namePenWidth, false, false );
1147 
1148  if( DrawPinNum )
1149  {
1150  plotter->Text( wxPoint( x1 - num_offset,
1151  (y1 + pin_pos.y) / 2 ),
1152  NumColor, m_number,
1153  TEXT_ANGLE_VERT, PinNumSize,
1156  numPenWidth, false, false );
1157  }
1158  }
1159  }
1160  }
1161  else /* Draw num & text pin outside */
1162  {
1163  if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) )
1164  {
1165  /* Its an horizontal line. */
1166  if( DrawPinName )
1167  {
1168  x = (x1 + pin_pos.x) / 2;
1169  plotter->Text( wxPoint( x, y1 - name_offset ),
1170  NameColor, m_name,
1171  TEXT_ANGLE_HORIZ, PinNameSize,
1174  namePenWidth, false, false );
1175  }
1176 
1177  if( DrawPinNum )
1178  {
1179  x = ( x1 + pin_pos.x ) / 2;
1180  plotter->Text( wxPoint( x, y1 + num_offset ),
1181  NumColor, m_number,
1182  TEXT_ANGLE_HORIZ, PinNumSize,
1185  numPenWidth, false, false );
1186  }
1187  }
1188  else /* Its a vertical line. */
1189  {
1190  if( DrawPinName )
1191  {
1192  y = ( y1 + pin_pos.y ) / 2;
1193  plotter->Text( wxPoint( x1 - name_offset, y ),
1194  NameColor, m_name,
1195  TEXT_ANGLE_VERT, PinNameSize,
1198  namePenWidth, false, false );
1199  }
1200 
1201  if( DrawPinNum )
1202  {
1203  plotter->Text( wxPoint( x1 + num_offset,
1204  ( y1 + pin_pos.y ) / 2 ),
1205  NumColor, m_number,
1206  TEXT_ANGLE_VERT, PinNumSize,
1209  numPenWidth, false, false );
1210  }
1211  }
1212  }
1213 }
#define TEXT_ANGLE_HORIZ
int m_nameTextSize
Definition: lib_pin.h:80
#define TEXT_ANGLE_VERT
int m_numTextSize
Definition: lib_pin.h:79
wxString m_name
Definition: lib_pin.h:77
Definition: lib_pin.h:58
int m_length
Definition: lib_pin.h:71
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize Don't allow text to become cluttered up in its own fatness.
Definition: gr_text.cpp:72
wxString m_number
Definition: lib_pin.h:78
int GetPenWidth() const override
Definition: lib_pin.cpp:565
#define PIN_TEXT_MARGIN
Definition: lib_pin.cpp:70
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References Clamp_Text_PenSize(), KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), KIGFX::RENDER_SETTINGS::GetLayerColor(), GetPenWidth(), 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::RenderSettings(), PLOTTER::Text(), TEXT_ANGLE_HORIZ, TEXT_ANGLE_VERT, wxPoint::x, and wxPoint::y.

Referenced by Plot().

◆ PlotSymbol()

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

Definition at line 902 of file lib_pin.cpp.

903 {
904  int MapX1, MapY1, x1, y1;
906  int penWidth = std::max( GetPenWidth(), aPlotter->RenderSettings()->GetDefaultPenWidth() );
907 
908  aPlotter->SetColor( color );
909  aPlotter->SetCurrentLineWidth( penWidth );
910 
911  MapX1 = MapY1 = 0;
912  x1 = aPosition.x; y1 = aPosition.y;
913 
914  switch( aOrientation )
915  {
916  case PIN_UP: y1 = aPosition.y - m_length; MapY1 = 1; break;
917  case PIN_DOWN: y1 = aPosition.y + m_length; MapY1 = -1; break;
918  case PIN_LEFT: x1 = aPosition.x - m_length; MapX1 = 1; break;
919  case PIN_RIGHT: x1 = aPosition.x + m_length; MapX1 = -1; break;
920  }
921 
923  {
924  const int radius = externalPinDecoSize( aPlotter->RenderSettings(), *this );
925  aPlotter->Circle( wxPoint( MapX1 * radius + x1, MapY1 * radius + y1 ), radius * 2,
926  NO_FILL, penWidth );
927 
928  aPlotter->MoveTo( wxPoint( MapX1 * radius * 2 + x1, MapY1 * radius * 2 + y1 ) );
929  aPlotter->FinishTo( aPosition );
930  }
932  {
933  const int deco_size = internalPinDecoSize( aPlotter->RenderSettings(), *this );
934  if( MapY1 == 0 ) /* MapX1 = +- 1 */
935  {
936  aPlotter->MoveTo( wxPoint( x1, y1 + deco_size ) );
937  aPlotter->LineTo( wxPoint( x1 + MapX1 * deco_size * 2, y1 ) );
938  aPlotter->FinishTo( wxPoint( x1, y1 - deco_size ) );
939  }
940  else /* MapX1 = 0 */
941  {
942  aPlotter->MoveTo( wxPoint( x1 + deco_size, y1 ) );
943  aPlotter->LineTo( wxPoint( x1, y1 + MapY1 * deco_size * 2 ) );
944  aPlotter->FinishTo( wxPoint( x1 - deco_size, y1 ) );
945  }
946 
947  aPlotter->MoveTo( wxPoint( MapX1 * deco_size * 2 + x1, MapY1 * deco_size * 2 + y1 ) );
948  aPlotter->FinishTo( aPosition );
949  }
950  else
951  {
952  aPlotter->MoveTo( wxPoint( x1, y1 ) );
953  aPlotter->FinishTo( aPosition );
954  }
955 
958  {
959  const int deco_size = internalPinDecoSize( aPlotter->RenderSettings(), *this );
960  if( MapY1 == 0 ) /* MapX1 = +- 1 */
961  {
962  aPlotter->MoveTo( wxPoint( x1, y1 + deco_size ) );
963  aPlotter->LineTo( wxPoint( x1 - MapX1 * deco_size * 2, y1 ) );
964  aPlotter->FinishTo( wxPoint( x1, y1 - deco_size ) );
965  }
966  else /* MapX1 = 0 */
967  {
968  aPlotter->MoveTo( wxPoint( x1 + deco_size, y1 ) );
969  aPlotter->LineTo( wxPoint( x1, y1 - MapY1 * deco_size * 2 ) );
970  aPlotter->FinishTo( wxPoint( x1 - deco_size, y1 ) );
971  }
972  }
973 
975  || m_shape == GRAPHIC_PINSHAPE::CLOCK_LOW ) /* IEEE symbol "Active Low Input" */
976  {
977  const int deco_size = externalPinDecoSize( aPlotter->RenderSettings(), *this );
978 
979  if( MapY1 == 0 ) /* MapX1 = +- 1 */
980  {
981  aPlotter->MoveTo( wxPoint( x1 + MapX1 * deco_size * 2, y1 ) );
982  aPlotter->LineTo( wxPoint( x1 + MapX1 * deco_size * 2, y1 - deco_size * 2 ) );
983  aPlotter->FinishTo( wxPoint( x1, y1 ) );
984  }
985  else /* MapX1 = 0 */
986  {
987  aPlotter->MoveTo( wxPoint( x1, y1 + MapY1 * deco_size * 2 ) );
988  aPlotter->LineTo( wxPoint( x1 - deco_size * 2, y1 + MapY1 * deco_size * 2 ) );
989  aPlotter->FinishTo( wxPoint( x1, y1 ) );
990  }
991  }
992 
993 
994  if( m_shape == GRAPHIC_PINSHAPE::OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */
995  {
996  const int symbol_size = externalPinDecoSize( aPlotter->RenderSettings(), *this );
997 
998  if( MapY1 == 0 ) /* MapX1 = +- 1 */
999  {
1000  aPlotter->MoveTo( wxPoint( x1, y1 - symbol_size * 2 ) );
1001  aPlotter->FinishTo( wxPoint( x1 + MapX1 * symbol_size * 2, y1 ) );
1002  }
1003  else /* MapX1 = 0 */
1004  {
1005  aPlotter->MoveTo( wxPoint( x1 - symbol_size * 2, y1 ) );
1006  aPlotter->FinishTo( wxPoint( x1, y1 + MapY1 * symbol_size * 2 ) );
1007  }
1008  }
1009  else if( m_shape == GRAPHIC_PINSHAPE::NONLOGIC ) /* NonLogic pin symbol */
1010  {
1011  const int deco_size = externalPinDecoSize( aPlotter->RenderSettings(), *this );
1012  aPlotter->MoveTo( wxPoint( x1 - (MapX1 + MapY1) * deco_size, y1 - (MapY1 - MapX1) * deco_size ) );
1013  aPlotter->FinishTo( wxPoint( x1 + (MapX1 + MapY1) * deco_size, y1 + (MapY1 - MapX1) * deco_size ) );
1014  aPlotter->MoveTo( wxPoint( x1 - (MapX1 - MapY1) * deco_size, y1 - (MapY1 + MapX1) * deco_size ) );
1015  aPlotter->FinishTo( wxPoint( x1 + (MapX1 - MapY1) * deco_size, y1 + (MapY1 + MapX1) * deco_size ) );
1016  }
1017  if( m_type == ELECTRICAL_PINTYPE::PT_NC ) // Draw a N.C. symbol
1018  {
1019  const int deco_size = TARGET_PIN_RADIUS;
1020  const int ex1 = aPosition.x;
1021  const int ey1 = aPosition.y;
1022  aPlotter->MoveTo( wxPoint( ex1 - deco_size, ey1 - deco_size ) );
1023  aPlotter->FinishTo( wxPoint( ex1 + deco_size, ey1 + deco_size ) );
1024  aPlotter->MoveTo( wxPoint( ex1 + deco_size, ey1 - deco_size ) );
1025  aPlotter->FinishTo( wxPoint( ex1 - deco_size, ey1 + deco_size ) );
1026  }
1027 }
void FinishTo(const wxPoint &pos)
Definition: plotter.h:267
GRAPHIC_PINSHAPE m_shape
Definition: lib_pin.h:73
virtual void SetColor(COLOR4D color)=0
int color
Definition: DXF_plotter.cpp:61
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
Definition: lib_pin.h:58
int m_length
Definition: lib_pin.h:71
static int internalPinDecoSize(RENDER_SETTINGS *aSettings, const LIB_PIN &aPin)
Utility for getting the size of the 'internal' pin decorators (as a radius)
Definition: lib_pin.cpp:137
void LineTo(const wxPoint &pos)
Definition: plotter.h:262
int GetPenWidth() const override
Definition: lib_pin.cpp:565
void MoveTo(const wxPoint &pos)
Definition: plotter.h:257
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
#define TARGET_PIN_RADIUS
Definition: lib_pin.h:46
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75
int GetDefaultPenWidth() const
static int externalPinDecoSize(RENDER_SETTINGS *aSettings, const LIB_PIN &aPin)
Utility for getting the size of the 'external' pin decorators (as a radius)
Definition: lib_pin.cpp:150
not connected (must be left open)
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.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References PLOTTER::Circle(), CLOCK, CLOCK_LOW, color, externalPinDecoSize(), FALLING_EDGE_CLOCK, PLOTTER::FinishTo(), KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), KIGFX::RENDER_SETTINGS::GetLayerColor(), GetPenWidth(), INPUT_LOW, internalPinDecoSize(), INVERTED, INVERTED_CLOCK, LAYER_PIN, PLOTTER::LineTo(), m_length, m_shape, m_type, PLOTTER::MoveTo(), NO_FILL, NONLOGIC, OUTPUT_LOW, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, PT_NC, PLOTTER::RenderSettings(), PLOTTER::SetColor(), PLOTTER::SetCurrentLineWidth(), TARGET_PIN_RADIUS, wxPoint::x, and wxPoint::y.

Referenced by Plot().

◆ print()

void LIB_PIN::print ( RENDER_SETTINGS aSettings,
const wxPoint aOffset,
void *  aData,
const TRANSFORM aTransform 
)
overrideprivatevirtual

Print a pin, with or without the pin texts.

Parameters
aOffsetOffset to draw
aData= used here as a boolean indicating whether or not to draw the pin electrical types
aTransformTransform Matrix (rotation, mirror ..)

Implements LIB_ITEM.

Definition at line 571 of file lib_pin.cpp.

573 {
574  PART_DRAW_OPTIONS* opts = (PART_DRAW_OPTIONS*) aData;
575  bool drawHiddenFields = opts ? opts->draw_hidden_fields : false;
576  bool showPinType = opts ? opts->show_elec_type : false;
577 
578  LIB_PART* part = GetParent();
579 
580  /* Calculate pin orient taking in account the component orientation. */
581  int orient = PinDrawOrient( aTransform );
582 
583  /* Calculate the pin position */
584  wxPoint pos1 = aTransform.TransformCoordinate( m_position ) + aOffset;
585 
586  if( IsVisible() || drawHiddenFields )
587  {
588  PrintPinSymbol( aSettings, pos1, orient );
589 
590  PrintPinTexts( aSettings, pos1, orient, part->GetPinNameOffset(), part->ShowPinNumbers(),
591  part->ShowPinNames() );
592 
593  if( showPinType )
594  PrintPinElectricalTypeName( aSettings, pos1, orient );
595  }
596 }
void PrintPinTexts(RENDER_SETTINGS *aSettings, wxPoint &aPosition, int aOrientation, int TextInside, bool DrawPinNum, bool DrawPinName)
Put the pin number and pin text info, given the pin line coordinates.
Definition: lib_pin.cpp:708
int GetPinNameOffset()
LIB_PART * GetParent() const
Definition: lib_item.h:182
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:1232
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:42
bool ShowPinNames()
bool ShowPinNumbers()
Define a library symbol object.
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
wxPoint m_position
Definition: lib_pin.h:70
void PrintPinSymbol(RENDER_SETTINGS *aSettings, const wxPoint &aPos, int aOrientation)
Print the pin symbol without text.
Definition: lib_pin.cpp:599
void PrintPinElectricalTypeName(RENDER_SETTINGS *aSettings, wxPoint &aPosition, int aOrientation)
Draw the electrical type text of the pin (only for the footprint editor)
Definition: lib_pin.cpp:850

References PART_DRAW_OPTIONS::draw_hidden_fields, LIB_ITEM::GetParent(), LIB_PART::GetPinNameOffset(), IsVisible(), m_position, PinDrawOrient(), PrintPinElectricalTypeName(), PrintPinSymbol(), PrintPinTexts(), PART_DRAW_OPTIONS::show_elec_type, LIB_PART::ShowPinNames(), LIB_PART::ShowPinNumbers(), and TRANSFORM::TransformCoordinate().

◆ Print()

void LIB_ITEM::Print ( RENDER_SETTINGS aSettings,
const wxPoint aOffset,
void *  aData,
const TRANSFORM aTransform 
)
virtualinherited

Draw an item.

Parameters
aDCDevice Context (can be null)
aOffsetOffset to draw
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 139 of file lib_item.cpp.

141 {
142  print( aSettings, aOffset, aData, aTransform );
143 }
virtual void print(RENDER_SETTINGS *aSettings, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform)=0
Print the item to aDC.

References LIB_ITEM::print().

Referenced by DIALOG_LIB_EDIT_PIN::OnPaintShowPanel().

◆ PrintPinElectricalTypeName()

void LIB_PIN::PrintPinElectricalTypeName ( RENDER_SETTINGS aSettings,
wxPoint aPosition,
int  aOrientation 
)

Draw the electrical type text of the pin (only for the footprint editor)

Definition at line 850 of file lib_pin.cpp.

852 {
853  wxDC* DC = aSettings->GetPrintDC();
854  wxString typeName = GetElectricalTypeName();
855 
856  // Use a reasonable (small) size to draw the text
857  int textSize = ( m_nameTextSize * 3 ) / 4;
858 
859  #define ETXT_MAX_SIZE Millimeter2iu( 0.7 )
860  if( textSize > ETXT_MAX_SIZE )
861  textSize = ETXT_MAX_SIZE;
862 
863  // Use a reasonable pen size to draw the text
864  int pensize = textSize/6;
865 
866  // Get a suitable color
868 
869  wxPoint txtpos = aPosition;
870  int offset = Millimeter2iu( 0.4 );
872  int orient = TEXT_ANGLE_HORIZ;
873 
874  switch( aOrientation )
875  {
876  case PIN_UP:
877  txtpos.y += offset;
878  orient = TEXT_ANGLE_VERT;
879  hjustify = GR_TEXT_HJUSTIFY_RIGHT;
880  break;
881 
882  case PIN_DOWN:
883  txtpos.y -= offset;
884  orient = TEXT_ANGLE_VERT;
885  break;
886 
887  case PIN_LEFT:
888  txtpos.x += offset;
889  break;
890 
891  case PIN_RIGHT:
892  txtpos.x -= offset;
893  hjustify = GR_TEXT_HJUSTIFY_RIGHT;
894  break;
895  }
896 
897  GRText( DC, txtpos, color, typeName, orient, wxSize( textSize, textSize ), hjustify,
898  GR_TEXT_VJUSTIFY_CENTER, pensize, false, false, 0 );
899 }
#define TEXT_ANGLE_HORIZ
int m_nameTextSize
Definition: lib_pin.h:80
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:47
#define ETXT_MAX_SIZE
#define TEXT_ANGLE_VERT
int color
Definition: DXF_plotter.cpp:61
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
Definition: lib_pin.h:58
wxString const GetElectricalTypeName() const
return a translated string for messages giving the electrical type of the pin.
Definition: lib_pin.h:258
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
void GRText(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 GRText Draw a graphic text (like module texts)
Definition: gr_text.cpp:134
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References color, ETXT_MAX_SIZE, GetElectricalTypeName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), KIGFX::RENDER_SETTINGS::GetPrintDC(), GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, GRText(), IsVisible(), LAYER_HIDDEN, LAYER_NOTES, m_nameTextSize, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, TEXT_ANGLE_HORIZ, TEXT_ANGLE_VERT, wxPoint::x, and wxPoint::y.

Referenced by print().

◆ PrintPinSymbol()

void LIB_PIN::PrintPinSymbol ( RENDER_SETTINGS aSettings,
const wxPoint aPos,
int  aOrientation 
)

Print the pin symbol without text.

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

Definition at line 599 of file lib_pin.cpp.

600 {
601  wxDC* DC = aSettings->GetPrintDC();
602  int MapX1, MapY1, x1, y1;
603  int width = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() );
604  int posX = aPos.x, posY = aPos.y, len = m_length;
606 
607  MapX1 = MapY1 = 0;
608  x1 = posX;
609  y1 = posY;
610 
611  switch( aOrient )
612  {
613  case PIN_UP: y1 = posY - len; MapY1 = 1; break;
614  case PIN_DOWN: y1 = posY + len; MapY1 = -1; break;
615  case PIN_LEFT: x1 = posX - len; MapX1 = 1; break;
616  case PIN_RIGHT: x1 = posX + len; MapX1 = -1; break;
617  }
618 
620  {
621  const int radius = externalPinDecoSize( aSettings, *this );
622  GRCircle( nullptr, DC, MapX1 * radius + x1, MapY1 * radius + y1, radius, width, color );
623 
624  GRMoveTo( MapX1 * radius * 2 + x1, MapY1 * radius * 2 + y1 );
625  GRLineTo( nullptr, DC, posX, posY, width, color );
626  }
627  else
628  {
629  GRMoveTo( x1, y1 );
630  GRLineTo( nullptr, DC, posX, posY, width, color );
631  }
632 
633  // Draw the clock shape (>)inside the symbol
637  {
638  const int clock_size = internalPinDecoSize( aSettings, *this );
639  if( MapY1 == 0 ) /* MapX1 = +- 1 */
640  {
641  GRMoveTo( x1, y1 + clock_size );
642  GRLineTo( nullptr, DC, x1 - MapX1 * clock_size * 2, y1, width, color );
643  GRLineTo( nullptr, DC, x1, y1 - clock_size, width, color );
644  }
645  else /* MapX1 = 0 */
646  {
647  GRMoveTo( x1 + clock_size, y1 );
648  GRLineTo( nullptr, DC, x1, y1 - MapY1 * clock_size * 2, width, color );
649  GRLineTo( nullptr, DC, x1 - clock_size, y1, width, color );
650  }
651  }
652 
653  // Draw the active low (or H to L active transition)
656  {
657  const int deco_size = externalPinDecoSize( aSettings, *this );
658  if( MapY1 == 0 ) /* MapX1 = +- 1 */
659  {
660  GRMoveTo( x1 + MapX1 * deco_size * 2, y1 );
661  GRLineTo( nullptr, DC, x1 + MapX1 * deco_size * 2, y1 - deco_size * 2, width, color );
662  GRLineTo( nullptr, DC, x1, y1, width, color );
663  }
664  else /* MapX1 = 0 */
665  {
666  GRMoveTo( x1, y1 + MapY1 * deco_size * 2 );
667  GRLineTo( nullptr, DC, x1 - deco_size * 2, y1 + MapY1 * deco_size * 2, width, color );
668  GRLineTo( nullptr, DC, x1, y1, width, color );
669  }
670  }
671 
672  if( m_shape == GRAPHIC_PINSHAPE::OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */
673  {
674  const int deco_size = externalPinDecoSize( aSettings, *this );
675  if( MapY1 == 0 ) /* MapX1 = +- 1 */
676  {
677  GRMoveTo( x1, y1 - deco_size * 2 );
678  GRLineTo( nullptr, DC, x1 + MapX1 * deco_size * 2, y1, width, color );
679  }
680  else /* MapX1 = 0 */
681  {
682  GRMoveTo( x1 - deco_size * 2, y1 );
683  GRLineTo( nullptr, DC, x1, y1 + MapY1 * deco_size * 2, width, color );
684  }
685  }
686  else if( m_shape == GRAPHIC_PINSHAPE::NONLOGIC ) /* NonLogic pin symbol */
687  {
688  const int deco_size = externalPinDecoSize( aSettings, *this );
689  GRMoveTo( x1 - (MapX1 + MapY1) * deco_size, y1 - (MapY1 - MapX1) * deco_size );
690  GRLineTo( nullptr, DC, x1 + (MapX1 + MapY1) * deco_size,
691  y1 + ( MapY1 - MapX1 ) * deco_size, width, color );
692  GRMoveTo( x1 - (MapX1 - MapY1) * deco_size, y1 - (MapY1 + MapX1) * deco_size );
693  GRLineTo( nullptr, DC, x1 + (MapX1 - MapY1) * deco_size,
694  y1 + ( MapY1 + MapX1 ) * deco_size, width, color );
695  }
696 
697  if( m_type == ELECTRICAL_PINTYPE::PT_NC ) // Draw a N.C. symbol
698  {
699  const int deco_size = TARGET_PIN_RADIUS;
700  GRLine( nullptr, DC, posX - deco_size, posY - deco_size, posX + deco_size,
701  posY + deco_size, width, color );
702  GRLine( nullptr, DC, posX + deco_size, posY - deco_size, posX - deco_size,
703  posY + deco_size, width, color );
704  }
705 }
GRAPHIC_PINSHAPE m_shape
Definition: lib_pin.h:73
int color
Definition: DXF_plotter.cpp:61
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
Definition: lib_pin.h:58
int m_length
Definition: lib_pin.h:71
void GRLineTo(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int width, COLOR4D Color)
Definition: gr_basic.cpp:266
static int internalPinDecoSize(RENDER_SETTINGS *aSettings, const LIB_PIN &aPin)
Utility for getting the size of the 'internal' pin decorators (as a radius)
Definition: lib_pin.cpp:137
int GetPenWidth() const override
Definition: lib_pin.cpp:565
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:230
void GRMoveTo(int x, int y)
Definition: gr_basic.cpp:256
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:596
#define TARGET_PIN_RADIUS
Definition: lib_pin.h:46
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75
int GetDefaultPenWidth() const
static int externalPinDecoSize(RENDER_SETTINGS *aSettings, const LIB_PIN &aPin)
Utility for getting the size of the 'external' pin decorators (as a radius)
Definition: lib_pin.cpp:150
not connected (must be left open)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References CLOCK, CLOCK_LOW, color, externalPinDecoSize(), FALLING_EDGE_CLOCK, KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), KIGFX::RENDER_SETTINGS::GetLayerColor(), GetPenWidth(), KIGFX::RENDER_SETTINGS::GetPrintDC(), GRCircle(), GRLine(), GRLineTo(), GRMoveTo(), INPUT_LOW, internalPinDecoSize(), INVERTED, INVERTED_CLOCK, IsVisible(), LAYER_HIDDEN, LAYER_PIN, m_length, m_shape, m_type, NONLOGIC, OUTPUT_LOW, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, PT_NC, TARGET_PIN_RADIUS, wxPoint::x, and wxPoint::y.

Referenced by print().

◆ PrintPinTexts()

void LIB_PIN::PrintPinTexts ( RENDER_SETTINGS aSettings,
wxPoint aPosition,
int  aOrientation,
int  TextInside,
bool  DrawPinNum,
bool  DrawPinName 
)

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

Definition at line 708 of file lib_pin.cpp.

710 {
711  if( !DrawPinName && !DrawPinNum )
712  return;
713 
714  int x, y;
715  wxDC* DC = aSettings->GetPrintDC();
716  wxSize PinNameSize( m_nameTextSize, m_nameTextSize );
717  wxSize PinNumSize( m_numTextSize, m_numTextSize );
718 
719  int namePenWidth = std::max( Clamp_Text_PenSize( GetPenWidth(), m_nameTextSize, false ),
720  aSettings->GetDefaultPenWidth() );
721  int numPenWidth = std::max( Clamp_Text_PenSize( GetPenWidth(), m_numTextSize, false ),
722  aSettings->GetDefaultPenWidth() );
723 
724  int name_offset = Mils2iu( PIN_TEXT_MARGIN ) + namePenWidth;
725  int num_offset = Mils2iu( PIN_TEXT_MARGIN ) + numPenWidth;
726 
727  /* Get the num and name colors */
728  COLOR4D NameColor = aSettings->GetLayerColor( IsVisible() ? LAYER_PINNAM : LAYER_HIDDEN );
729  COLOR4D NumColor = aSettings->GetLayerColor( IsVisible() ? LAYER_PINNUM : LAYER_HIDDEN );
730 
731  int x1 = pin_pos.x;
732  int y1 = pin_pos.y;
733 
734  switch( orient )
735  {
736  case PIN_UP: y1 -= m_length; break;
737  case PIN_DOWN: y1 += m_length; break;
738  case PIN_LEFT: x1 -= m_length; break;
739  case PIN_RIGHT: x1 += m_length; break;
740  }
741 
742  if( m_name.IsEmpty() )
743  DrawPinName = false;
744 
745  if( TextInside ) // Draw the text inside, but the pin numbers outside.
746  {
747  if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) )
748  {
749  // It is an horizontal line
750  if( DrawPinName )
751  {
752  if( orient == PIN_RIGHT )
753  {
754  x = x1 + TextInside;
755  GRText( DC, wxPoint( x, y1 ), NameColor, m_name, TEXT_ANGLE_HORIZ,
757  namePenWidth, false, false );
758  }
759  else // Orient == PIN_LEFT
760  {
761  x = x1 - TextInside;
762  GRText( DC, wxPoint( x, y1 ), NameColor, m_name, TEXT_ANGLE_HORIZ,
764  namePenWidth, false, false );
765  }
766  }
767 
768  if( DrawPinNum )
769  {
770  GRText( DC, wxPoint( (x1 + pin_pos.x) / 2, y1 - num_offset ), NumColor, m_number,
772  GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false );
773  }
774  }
775  else /* Its a vertical line. */
776  {
777  // Text is drawn from bottom to top (i.e. to negative value for Y axis)
778  if( orient == PIN_DOWN )
779  {
780  y = y1 + TextInside;
781 
782  if( DrawPinName )
783  GRText( DC, wxPoint( x1, y ), NameColor, m_name, TEXT_ANGLE_VERT, PinNameSize,
784  GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false,
785  false );
786 
787  if( DrawPinNum )
788  GRText( DC, wxPoint( x1 - num_offset, (y1 + pin_pos.y) / 2 ), NumColor,
790  GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false );
791  }
792  else /* PIN_UP */
793  {
794  y = y1 - TextInside;
795 
796  if( DrawPinName )
797  GRText( DC, wxPoint( x1, y ), NameColor, m_name, TEXT_ANGLE_VERT, PinNameSize,
798  GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false,
799  false );
800 
801  if( DrawPinNum )
802  GRText( DC, wxPoint( x1 - num_offset, (y1 + pin_pos.y) / 2 ), NumColor,
804  GR_TEXT_VJUSTIFY_BOTTOM, numPenWidth, false, false );
805  }
806  }
807  }
808  else /**** Draw num & text pin outside ****/
809  {
810  if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) )
811  {
812  /* Its an horizontal line. */
813  if( DrawPinName )
814  {
815  x = (x1 + pin_pos.x) / 2;
816  GRText( DC, wxPoint( x, y1 - name_offset ), NameColor, m_name, TEXT_ANGLE_HORIZ,
818  namePenWidth, false, false );
819  }
820  if( DrawPinNum )
821  {
822  x = (x1 + pin_pos.x) / 2;
823  GRText( DC, wxPoint( x, y1 + num_offset ), NumColor, m_number, TEXT_ANGLE_HORIZ,
824  PinNumSize, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, numPenWidth,
825  false, false );
826  }
827  }
828  else /* Its a vertical line. */
829  {
830  if( DrawPinName )
831  {
832  y = (y1 + pin_pos.y) / 2;
833  GRText( DC, wxPoint( x1 - name_offset, y ), NameColor, m_name, TEXT_ANGLE_VERT,
835  namePenWidth, false, false );
836  }
837 
838  if( DrawPinNum )
839  {
840  GRText( DC, wxPoint( x1 + num_offset, (y1 + pin_pos.y) / 2 ), NumColor, m_number,
842  numPenWidth, false, false );
843  }
844  }
845  }
846 }
#define TEXT_ANGLE_HORIZ
int m_nameTextSize
Definition: lib_pin.h:80
#define TEXT_ANGLE_VERT
int m_numTextSize
Definition: lib_pin.h:79
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
wxString m_name
Definition: lib_pin.h:77
Definition: lib_pin.h:58
int m_length
Definition: lib_pin.h:71
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize Don't allow text to become cluttered up in its own fatness.
Definition: gr_text.cpp:72
wxString m_number
Definition: lib_pin.h:78
int GetPenWidth() const override
Definition: lib_pin.cpp:565
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
void GRText(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 GRText Draw a graphic text (like module texts)
Definition: gr_text.cpp:134
#define PIN_TEXT_MARGIN
Definition: lib_pin.cpp:70
int GetDefaultPenWidth() const
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References Clamp_Text_PenSize(), KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), KIGFX::RENDER_SETTINGS::GetLayerColor(), GetPenWidth(), KIGFX::RENDER_SETTINGS::GetPrintDC(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, GRText(), IsVisible(), LAYER_HIDDEN, 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, TEXT_ANGLE_VERT, wxPoint::x, and wxPoint::y.

Referenced by print().

◆ Replace() [1/2]

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

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

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

Definition at line 170 of file base_struct.cpp.

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

References GetChars(), and traceFindReplace.

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

◆ Replace() [2/2]

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

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

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

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

Reimplemented in SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 489 of file base_struct.h.

489 { return false; }

◆ Rotate()

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 1367 of file lib_pin.cpp.

1368 {
1369  int rot_angle = aRotateCCW ? -900 : 900;
1370 
1371  RotatePoint( &m_position, center, rot_angle );
1372 
1373  if( aRotateCCW )
1374  {
1375  switch( m_orientation )
1376  {
1377  case PIN_RIGHT: m_orientation = PIN_UP; break;
1378  case PIN_UP: m_orientation = PIN_LEFT; break;
1379  case PIN_LEFT: m_orientation = PIN_DOWN; break;
1380  case PIN_DOWN: m_orientation = PIN_RIGHT; break;
1381  }
1382  }
1383  else
1384  {
1385  switch( m_orientation )
1386  {
1387  case PIN_RIGHT: m_orientation = PIN_DOWN; break;
1388  case PIN_UP: m_orientation = PIN_RIGHT; break;
1389  case PIN_LEFT: m_orientation = PIN_UP; break;
1390  case PIN_DOWN: m_orientation = PIN_LEFT; break;
1391  }
1392  }
1393 }
Definition: lib_pin.h:58
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
int m_orientation
Definition: lib_pin.h:72
wxPoint m_position
Definition: lib_pin.h:70

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

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

◆ 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 467 of file lib_pin.cpp.

468 {
469  if( m_Convert == style )
470  return;
471 
472  m_Convert = style;
473  SetFlags( IS_CHANGED );
474 
475  if( style == 0 )
476  {
477  LIB_PIN* pin;
478  LIB_PIN* tmp = GetParent()->GetNextPin();
479 
480  while( tmp != NULL )
481  {
482  pin = tmp;
483  tmp = GetParent()->GetNextPin( pin );
484 
485  if( ( pin->m_Flags & IS_LINKED ) == 0
486  || ( pin == this )
487  || ( m_Unit && ( m_Unit != pin->m_Unit ) )
488  || ( m_position != pin->m_position )
489  || ( pin->m_orientation != m_orientation ) )
490  continue;
491 
492  GetParent()->RemoveDrawItem( (LIB_ITEM*) pin );
493  }
494  }
495 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
LIB_PART * GetParent() const
Definition: lib_item.h:182
int m_Unit
Unit identification for multiple parts per package.
Definition: lib_item.h:81
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
int m_orientation
Definition: lib_pin.h:72
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:113
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:232
#define NULL
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
wxPoint m_position
Definition: lib_pin.h:70
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
int m_Convert
Shape identification for alternate body styles.
Definition: lib_item.h:87
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.

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, NULL, 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 232 of file base_struct.h.

232 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

References EDA_ITEM::m_Flags.

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

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

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

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

Definition at line 284 of file base_struct.h.

284 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: base_struct.h:175

References EDA_ITEM::m_forceVisible.

◆ 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 380 of file lib_pin.cpp.

381 {
382  if( m_length != length )
383  {
384  m_length = length;
385  SetModified();
386  }
387 
388  if( !aTestOtherPins )
389  return;
390 
391  if( GetParent() == NULL )
392  return;
393 
394  LIB_PINS pinList;
395  GetParent()->GetPins( pinList );
396 
397  for( size_t i = 0; i < pinList.size(); i++ )
398  {
399  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
400  || pinList[i]->m_Convert != m_Convert
401  || pinList[i]->m_length == length )
402  continue;
403 
404  pinList[i]->m_length = length;
405  SetModified();
406  }
407 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
int m_length
Definition: lib_pin.h:71
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
int m_Convert
Shape identification for alternate body styles.
Definition: lib_item.h:87

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

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

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

◆ 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 188 of file lib_pin.cpp.

189 {
190  wxString tmp = ( aName.IsEmpty() ) ? wxT( "~" ) : aName;
191 
192  // pin name string does not support spaces
193  tmp.Replace( wxT( " " ), wxT( "_" ) );
194 
195  if( m_name != tmp )
196  {
197  m_name = tmp;
198  SetModified();
199  }
200 
201  if( !aTestOtherPins )
202  return;
203 
204  if( GetParent() == NULL )
205  return;
206 
207  LIB_PINS pinList;
208  GetParent()->GetPins( pinList );
209 
210  for( size_t i = 0; i < pinList.size(); i++ )
211  {
212  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->m_name == m_name )
213  continue;
214 
215  pinList[i]->m_name = m_name;
216  SetModified();
217  }
218 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
wxString m_name
Definition: lib_pin.h:77
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

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

Referenced by DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), LIB_PIN_TOOL::RepeatPin(), TEST_SCH_PIN_FIXTURE::TEST_SCH_PIN_FIXTURE(), 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 221 of file lib_pin.cpp.

222 {
223  if( size != m_nameTextSize )
224  {
225  m_nameTextSize = size;
226  SetModified();
227  }
228 
229  if( !aTestOtherPins )
230  return;
231 
232  if( GetParent() == NULL )
233  return;
234 
235  LIB_PINS pinList;
236  GetParent()->GetPins( pinList );
237 
238  for( size_t i = 0; i < pinList.size(); i++ )
239  {
240  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->m_nameTextSize == size )
241  continue;
242 
243  pinList[i]->m_nameTextSize = size;
244  SetModified();
245  }
246 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
int m_nameTextSize
Definition: lib_pin.h:80
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

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

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

◆ 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 249 of file lib_pin.cpp.

250 {
251  // Unlike SetName, others pin numbers marked by EnableEditMode() are
252  // not modified because each pin has its own number, so set number
253  // only for this.
254 
255  wxString tmp = ( aNumber.IsEmpty() ) ? wxT( "~" ) : aNumber;
256 
257  // pin number string does not support spaces
258  tmp.Replace( wxT( " " ), wxT( "_" ) );
259 
260  if( m_number != tmp )
261  {
262  m_number = tmp;
263  SetModified();
264  }
265 }
void SetModified()
Definition: base_struct.cpp:85
wxString m_number
Definition: lib_pin.h:78

References m_number, and EDA_ITEM::SetModified().

Referenced by LIB_PIN_TOOL::CreateImagePins(), SCH_EAGLE_PLUGIN::loadSymbol(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), LIB_PIN_TOOL::RepeatPin(), TEST_SCH_PIN_FIXTURE::TEST_SCH_PIN_FIXTURE(), 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 268 of file lib_pin.cpp.

269 {
270  if( size != m_numTextSize )
271  {
272  m_numTextSize = size;
273  SetModified();
274  }
275 
276  if( !aTestOtherPins )
277  return;
278 
279  if( GetParent() == NULL )
280  return;
281 
282  LIB_PINS pinList;
283  GetParent()->GetPins( pinList );
284 
285  for( size_t i = 0; i < pinList.size(); i++ )
286  {
287  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->m_numTextSize == size )
288  continue;
289 
290  pinList[i]->m_numTextSize = size;
291  SetModified();
292  }
293 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
int m_numTextSize
Definition: lib_pin.h:79
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

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

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

◆ 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 296 of file lib_pin.cpp.

297 {
298  if( m_orientation != orientation )
299  {
300  m_orientation = orientation;
301  SetModified();
302  }
303 
304  if( !aTestOtherPins )
305  return;
306 
307  if( GetParent() == NULL )
308  return;
309 
310  LIB_PINS pinList;
311  GetParent()->GetPins( pinList );
312 
313  for( size_t i = 0; i < pinList.size(); i++ )
314  {
315  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 ||
316  pinList[i]->m_orientation == orientation )
317  continue;
318 
319  pinList[i]->m_orientation = orientation;
320  SetModified();
321  }
322 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
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
Definition: lib_pin.h:72
#define NULL
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

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

Referenced by LIB_PIN_TOOL::CreatePin(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetParent()

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Definition at line 196 of file base_struct.h.

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

References EDA_ITEM::m_Parent.

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

◆ 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 437 of file lib_pin.cpp.

438 {
439  if( m_Unit == part )
440  return;
441 
442  m_Unit = part;
443  SetModified();
444 
445  if( m_Unit == 0 )
446  {
447  LIB_PIN* pin;
448  LIB_PIN* tmp = GetParent()->GetNextPin();
449 
450  while( tmp != NULL )
451  {
452  pin = tmp;
453  tmp = GetParent()->GetNextPin( pin );
454 
455  if( pin->m_Flags == 0 || pin == this
456  || ( m_Convert && ( m_Convert != pin->m_Convert ) )
457  || ( m_position != pin->m_position )
458  || ( pin->m_orientation != m_orientation ) )
459  continue;
460 
461  GetParent()->RemoveDrawItem( (LIB_ITEM*) pin );
462  }
463  }
464 }
void SetModified()
Definition: base_struct.cpp:85
LIB_PART * GetParent() const
Definition: lib_item.h:182
int m_Unit
Unit identification for multiple parts per package.
Definition: lib_item.h:81
The base class for drawable items used by schematic library components.
Definition: lib_item.h:61
int m_orientation
Definition: lib_pin.h:72
#define NULL
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
wxPoint m_position
Definition: lib_pin.h:70
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
int m_Convert
Shape identification for alternate body styles.
Definition: lib_item.h:87
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.

References LIB_PART::GetNextPin(), LIB_ITEM::GetParent(), LIB_ITEM::m_Convert, EDA_ITEM::m_Flags, m_orientation, m_position, LIB_ITEM::m_Unit, NULL, 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 410 of file lib_pin.cpp.

411 {
412  if( m_position != aPosition )
413  {
414  m_position = aPosition;
415  SetModified();
416  }
417 
418  if( GetParent() == NULL )
419  return;
420 
421  LIB_PINS pinList;
422  GetParent()->GetPins( pinList );
423 
424  for( size_t i = 0; i < pinList.size(); i++ )
425  {
426  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
427  || pinList[i]->m_Convert != m_Convert
428  || pinList[i]->m_position == aPosition )
429  continue;
430 
431  pinList[i]->m_position = aPosition;
432  SetModified();
433  }
434 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
wxPoint m_position
Definition: lib_pin.h:70
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
int m_Convert
Shape identification for alternate body styles.
Definition: lib_item.h:87

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

Referenced by DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetPosition()

◆ SetSelected()

◆ 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 325 of file lib_pin.cpp.

326 {
327  if( m_shape != aShape )
328  {
329  m_shape = aShape;
330  SetModified();
331  }
332 
333  if( GetParent() == NULL )
334  return;
335 
336  LIB_PINS pinList;
337  GetParent()->GetPins( pinList );
338 
339  for( size_t i = 0; i < pinList.size(); i++ )
340  {
341  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0
342  || pinList[i]->m_Convert != m_Convert
343  || pinList[i]->m_shape == aShape )
344  continue;
345 
346  pinList[i]->m_shape = aShape;
347  SetModified();
348  }
349 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
GRAPHIC_PINSHAPE m_shape
Definition: lib_pin.h:73
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
int m_Convert
Shape identification for alternate body styles.
Definition: lib_item.h:87

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

Referenced by LIB_PIN_TOOL::CreatePin(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

◆ SetState()

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

Definition at line 221 of file base_struct.h.

222  {
223  if( state )
224  m_Status |= type; // state = ON or OFF
225  else
226  m_Status &= ~type;
227  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

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

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 230 of file base_struct.h.

230 { m_Status = aStatus; }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ 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 352 of file lib_pin.cpp.

353 {
354  if( m_type != aType )
355  {
356  m_type = aType;
357  SetModified();
358  }
359 
360  if( !aTestOtherPins )
361  return;
362 
363  if( GetParent() == NULL )
364  return;
365 
366  LIB_PINS pinList;
367  GetParent()->GetPins( pinList );
368 
369  for( size_t i = 0; i < pinList.size(); i++ )
370  {
371  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->m_type == aType )
372  continue;
373 
374  pinList[i]->m_type = aType;
375  SetModified();
376  }
377 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
ELECTRICAL_PINTYPE m_type
Definition: lib_pin.h:75

References LIB_ITEM::GetParent(), LIB_PART::GetPins(), IS_LINKED, EDA_ITEM::m_Flags, m_type, NULL, and EDA_ITEM::SetModified().

Referenced by LIB_PIN_TOOL::CreatePin(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), DIALOG_LIB_EDIT_PIN::OnPropertiesChange(), TEST_SCH_PIN_FIXTURE::TEST_SCH_PIN_FIXTURE(), 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 498 of file lib_pin.cpp.

499 {
500  if( visible == IsVisible() )
501  return;
502 
503  if( visible )
505  else
507 
508  SetModified();
509 
510  if( GetParent() == NULL )
511  return;
512 
513  LIB_PINS pinList;
514  GetParent()->GetPins( pinList );
515 
516  for( size_t i = 0; i < pinList.size(); i++ )
517  {
518  if( ( pinList[i]->m_Flags & IS_LINKED ) == 0 || pinList[i]->IsVisible() == visible )
519  continue;
520 
521  if( visible )
522  pinList[i]->m_attributes &= ~PIN_INVISIBLE;
523  else
524  pinList[i]->m_attributes |= PIN_INVISIBLE;
525 
526  SetModified();
527  }
528 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
void SetModified()
Definition: base_struct.cpp:85
LIB_PART * GetParent() const
Definition: lib_item.h:182
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_item.h:55
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define NULL
#define PIN_INVISIBLE
Definition: lib_pin.h:49
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:345
int m_attributes
Definition: lib_pin.h:76
STATUS_FLAGS m_Flags
Definition: base_struct.h:176

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

Referenced by LIB_PIN_TOOL::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

Implements LIB_ITEM.

Definition at line 1411 of file lib_pin.cpp.

1412 {
1413  if( m_width != aWidth )
1414  {
1415  m_width = aWidth;
1416  SetModified();
1417  }
1418 }
void SetModified()
Definition: base_struct.cpp:85
int m_width
Definition: lib_pin.h:74

References m_width, and EDA_ITEM::SetModified().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 207 of file base_struct.h.

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

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ Sort()

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

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

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

Definition at line 520 of file base_struct.h.

520 { return *aLeft < *aRight; }

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

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

References EDA_ITEM::m_StructType.

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

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

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

Returns
BOX2I - the current bounding box

Implements KIGFX::VIEW_ITEM.

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

Definition at line 218 of file base_struct.cpp.

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

References EDA_ITEM::GetBoundingBox().

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

◆ ViewDraw()

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

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

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

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

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

Definition at line 116 of file view_item.h.

117  {}

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

◆ ViewGetLayers()

void LIB_ITEM::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtualinherited

Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.

For instance, a D_PAD spans zero or more copper layers and a few technical layers. ViewDraw() or PAINTER::Draw() is repeatedly called for each of the layers returned by ViewGetLayers(), depending on the rendering order.

Parameters
aLayers[]output layer index array
aCountnumber of layer indices in aLayers[]

Reimplemented from EDA_ITEM.

Reimplemented in LIB_TEXT.

Definition at line 146 of file lib_item.cpp.

147 {
148  // Basic fallback
149  aCount = 3;
150  aLayers[0] = LAYER_DEVICE;
151  aLayers[1] = LAYER_DEVICE_BACKGROUND;
152  aLayers[2] = LAYER_SELECTION_SHADOWS;
153 }

References LAYER_DEVICE, LAYER_DEVICE_BACKGROUND, and LAYER_SELECTION_SHADOWS.

◆ ViewGetLOD()

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

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

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

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

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

Definition at line 140 of file view_item.h.

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

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

◆ viewPrivData()

◆ Visit()

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

Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data.

Implementations should call inspector->Inspect() on types in scanTypes[], and may use IterateForward() to do so on lists of such data.

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

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

Definition at line 118 of file base_struct.cpp.

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

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

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

Friends And Related Function Documentation

◆ SCH_LEGACY_PLUGIN_CACHE

friend class SCH_LEGACY_PLUGIN_CACHE
friend

Definition at line 68 of file lib_pin.h.

Member Data Documentation

◆ m_attributes

int LIB_PIN::m_attributes
private

Definition at line 76 of file lib_pin.h.

Referenced by compare(), IsVisible(), LIB_PIN(), SCH_LEGACY_PLUGIN_CACHE::loadPin(), and SetVisible().

◆ m_Convert

int LIB_ITEM::m_Convert
protectedinherited

Shape identification for alternate body styles.

Set 0 if the item is common to all body styles. This is typially used for representing DeMorgan variants in KiCad.

Definition at line 87 of file lib_item.h.

Referenced by LIB_TEXT::Clone(), LIB_ITEM::compare(), LIB_ITEM::GetConvert(), LIB_ITEM::GetMsgPanelInfo(), LIB_ITEM::LIB_ITEM(), SCH_LEGACY_PLUGIN_CACHE::loadPin(), LIB_ITEM::operator<(), SetConversion(), LIB_PART::SetConversion(), LIB_ITEM::SetConvert(), SetLength(), SetPartNumber(), SetPinPosition(), and SetShape().

◆ m_Fill

◆ m_Flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_isFillable

◆ m_length

◆ m_name

wxString LIB_PIN::m_name
private

◆ m_nameTextSize

◆ m_number

◆ m_numTextSize

int LIB_PIN::m_numTextSize
private

◆ m_orientation

◆ m_Parent

◆ m_position

◆ m_shape

◆ m_Status

STATUS_FLAGS EDA_ITEM::m_Status
protectedinherited

◆ m_type

◆ m_Unit

int LIB_ITEM::m_Unit
protectedinherited

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 162 of file base_struct.h.

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

◆ m_width

int LIB_PIN::m_width
private

Definition at line 74 of file lib_pin.h.

Referenced by compare(), GetPenWidth(), GetWidth(), LIB_PIN(), and SetWidth().


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