KiCad PCB EDA Suite
LIB_PIN Class Reference

#include <lib_pin.h>

Inheritance diagram for LIB_PIN:
LIB_ITEM EDA_ITEM KIGFX::VIEW_ITEM

Public Member Functions

 LIB_PIN (LIB_PART *aParent)
 
 ~LIB_PIN ()
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
wxString GetTypeName () override
 Provide a user-consumable name of the object type. More...
 
bool HitTest (const wxPoint &aPosition) const override
 Function HitTest tests if aPosition is contained within or on the bounding area of an item. More...
 
bool HitTest (const wxPoint &aPosRef, int aThreshold, const TRANSFORM &aTransform) const override
 
void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
 Display basic info (type, part and convert) about the current item in message panel. More...
 
void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList, SCH_COMPONENT *aComponent)
 Display pin info (given by GetMsgPanelInfo) and add some info related to aComponent (schematic pin position, and sheet path) More...
 
bool Matches (wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation) override
 Function Matches compares the item against the search criteria in aSearchData. More...
 
const EDA_RECT GetBoundingBox () const override
 
const EDA_RECT GetBoundingBox (bool aIncludeInvisibles) const
 
wxPoint PinEndPoint () const
 
int PinDrawOrient (const TRANSFORM &aTransform) const
 Return the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT), according to its orientation and the matrix transform (rot, mirror) aTransform. More...
 
const wxString & GetName () const
 
void SetName (const wxString &aName, bool aTestOtherPins=true)
 Set the pin name. More...
 
void SetNameTextSize (int aSize, bool aTestOtherPins=true)
 Set the aSize of the pin name text. More...
 
int GetNameTextSize () const
 
const wxString & GetNumber () const
 
void SetNumber (const wxString &aNumber)
 Set the pin number. More...
 
void SetNumberTextSize (int aSize, bool aTestOtherPins=true)
 Set the size of the pin number text. More...
 
int GetNumberTextSize () const
 
int GetOrientation () const
 
void SetOrientation (int aOrientation, bool aTestOtherPins=true)
 Set orientation on the pin. More...
 
void Rotate () override
 Rotate the draw item. More...
 
GRAPHIC_PINSHAPE GetShape () const
 
void SetShape (GRAPHIC_PINSHAPE aShape)
 Set the shape of the pin to aShape. More...
 
ELECTRICAL_PINTYPE GetType () const
 Get the electrical type of the pin. More...
 
wxString const GetCanonicalElectricalTypeName () const
 return a string giving the electrical type of the pin. More...
 
wxString const GetElectricalTypeName () const
 return a translated string for messages giving the electrical type of the pin. More...
 
void SetType (ELECTRICAL_PINTYPE aType, bool aTestOtherPins=true)
 Set the electrical type of the pin. More...
 
void SetLength (int aLength, bool aTestOtherPins=true)
 Set the pin length. More...
 
int GetLength ()
 
void SetPartNumber (int aPart)
 Set the pin part number. More...
 
int GetPartNumber () const
 Get the pin part number. More...
 
void SetConversion (int aConversion)
 Set the body style (conversion) of the pin. More...
 
void SetVisible (bool aVisible)
 Set or clear the visibility flag for the pin. More...
 
void EnableEditMode (bool aEnable, bool aEditPinByPin=false)
 Enable or clear pin editing mode. More...
 
bool IsVisible () const
 Return the visibility status of the draw object. More...
 
bool IsPowerConnection () const
 Return whether this pin forms an implicit power connection: i.e., is hidden and of type POWER_IN. More...
 
int GetPenSize () const override
 
void DrawPinSymbol (EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aPosition, int aOrientation, GR_DRAWMODE aDrawMode, COLOR4D aColor=COLOR4D::UNSPECIFIED, bool aDrawDangling=true, bool aOnlyTarget=false)
 Draw the pin symbol without text. More...
 
void DrawPinTexts (EDA_DRAW_PANEL *aPanel, wxDC *aDC, wxPoint &aPosition, int aOrientation, int TextInside, bool DrawPinNum, bool DrawPinName, COLOR4D aColor, GR_DRAWMODE aDrawMode)
 Put the pin number and pin text info, given the pin line coordinates. More...
 
void DrawPinElectricalTypeName (EDA_DRAW_PANEL *aPanel, wxDC *aDC, wxPoint &aPosition, int aOrientation, COLOR4D aColor, GR_DRAWMODE aDrawMode)
 Draw the electrical type text of the pin (only for the footprint editor) aDrawMode = GR_OR, XOR ... More...
 
void PlotPinTexts (PLOTTER *aPlotter, wxPoint &aPosition, int aOrientation, int aTextInside, bool aDrawPinNum, bool aDrawPinName, int aWidth)
 Plot the pin number and pin text info, given the pin line coordinates. More...
 
void PlotSymbol (PLOTTER *aPlotter, const wxPoint &aPosition, int aOrientation)
 
void SetOffset (const wxPoint &aOffset) override
 Set the drawing object by aOffset from the current position. More...
 
bool Inside (EDA_RECT &aRect) const override
 Test if any part of the draw object is inside rectangle bounds of aRect. More...
 
void Move (const wxPoint &aPosition) override
 Move a draw object to aPosition. More...
 
wxPoint GetPosition () const override
 Return the current draw object position. More...
 
void SetPinPosition (wxPoint aPosition)
 move this and all linked pins to the new position used in pin editing. More...
 
void MirrorHorizontal (const wxPoint &aCenter) override
 Mirror the draw object along the horizontal (X) axis about aCenter point. More...
 
void MirrorVertical (const wxPoint &aCenter) override
 Mirror the draw object along the MirrorVertical (Y) axis about aCenter point. More...
 
void Rotate (const wxPoint &aCenter, bool aRotateCCW=true) override
 Rotate the object about aCenter point. More...
 
void Plot (PLOTTER *aPlotter, const wxPoint &aOffset, bool aFill, const TRANSFORM &aTransform) override
 Plot the draw item using the plot object. More...
 
int GetWidth () const override
 Return the width of the draw item. More...
 
void SetWidth (int aWidth) override
 Set the width of the draw item to aWidth. More...
 
BITMAP_DEF GetMenuImage () const override
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
wxString GetSelectMenuText (EDA_UNITS_T aUnits) const override
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
EDA_ITEMClone () const override
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
void CalcEdit (const wxPoint &aPosition) override
 Calculates the attributes of an item at aPosition when it is being edited. More...
 
virtual void BeginEdit (STATUS_FLAGS aEditMode, const wxPoint aPosition=wxPoint(0, 0))
 Begin an editing a component library draw item in aEditMode at aPosition. More...
 
virtual bool ContinueEdit (const wxPoint aPosition)
 Continue an edit in progress at aPosition. More...
 
virtual void EndEdit (const wxPoint &aPosition, bool aAbort=false)
 End an object editing action. More...
 
virtual void Draw (EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void *aData, const TRANSFORM &aTransform)
 Draw an item. More...
 
LIB_PARTGetParent () const
 
void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. More...
 
bool operator== (const LIB_ITEM &aOther) const
 Test LIB_ITEM objects for equivalence. More...
 
bool operator== (const LIB_ITEM *aOther) const
 
bool operator< (const LIB_ITEM &aOther) const
 Test if another draw item is less than this draw object. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
void SetPosition (const wxPoint &aPosition)
 
bool IsFillable () const
 Check if draw object can be filled. More...
 
bool InEditMode () const
 Return the draw item editing mode status. More...
 
virtual COLOR4D GetDefaultColor ()
 
void SetUnit (int aUnit)
 
int GetUnit () const
 
void SetConvert (int aConvert)
 
int GetConvert () const
 
void SetFillMode (FILL_T aFillMode)
 
FILL_T GetFillMode () const
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (timestamp_t aNewTimeStamp)
 
timestamp_t GetTimeStamp () const
 
EDA_ITEMNext () const
 
EDA_ITEMBack () const
 
DHEADGetList () const
 
void SetNext (EDA_ITEM *aNext)
 
void SetBack (EDA_ITEM *aBack)
 
void SetParent (EDA_ITEM *aParent)
 
void SetList (DHEAD *aList)
 
bool IsNew () const
 
bool IsModified () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool IsType (const KICAD_T aScanTypes[])
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
virtual SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
virtual unsigned int ViewGetLOD (int aLayer, VIEW *aView) const
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 

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...
 
static SEARCH_RESULT IterateForward (EDA_ITEM *listStart, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

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

Private Attributes

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

Friends

class SCH_LEGACY_PLUGIN_CACHE
 

Detailed Description

Definition at line 68 of file lib_pin.h.

Constructor & Destructor Documentation

LIB_PIN::LIB_PIN ( LIB_PART aParent)

Definition at line 147 of file lib_pin.cpp.

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

Referenced by Clone().

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

Definition at line 111 of file lib_pin.h.

111 { }

Member Function Documentation

EDA_ITEM* EDA_ITEM::Back ( ) const
inlineinherited

Definition at line 210 of file base_struct.h.

References EDA_ITEM::Pback.

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

210 { return Pback; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:168
virtual void LIB_ITEM::BeginEdit ( STATUS_FLAGS  aEditMode,
const wxPoint  aPosition = wxPoint( 0, 0 ) 
)
inlinevirtualinherited

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

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

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

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

Definition at line 158 of file lib_draw_item.h.

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

158 {}
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 2010 of file lib_pin.cpp.

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

Referenced by GetWidth().

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

Definition at line 236 of file base_struct.h.

References BRIGHTENED, EDA_ITEM::ClearFlags(), and EDA_ITEM::SetModified().

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

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

Definition at line 257 of file base_struct.h.

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

257 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 235 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

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

Definition at line 234 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and SELECTED.

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

234 { ClearFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257
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 1553 of file lib_pin.cpp.

References LIB_PIN().

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

1554 {
1555  return new LIB_PIN( *this );
1556 }
LIB_PIN(LIB_PART *aParent)
Definition: lib_pin.cpp:147
int LIB_PIN::compare ( const LIB_ITEM aOther) const
overrideprivatevirtual

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

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

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

The pin specific sort order is as follows:

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

Implements LIB_ITEM.

Definition at line 1559 of file lib_pin.cpp.

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

Referenced by GetWidth().

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

Continue an edit in progress at aPosition.

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

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

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

Definition at line 170 of file lib_draw_item.h.

170 { return false; }
void LIB_ITEM::Draw ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
const wxPoint aOffset,
COLOR4D  aColor,
GR_DRAWMODE  aDrawMode,
void *  aData,
const TRANSFORM aTransform 
)
virtualinherited

Draw an item.

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

Definition at line 114 of file lib_draw_item.cpp.

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

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

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

Draw a pin, with or without the pin texts.

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

Implements LIB_ITEM.

Definition at line 576 of file lib_pin.cpp.

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

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

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

Definition at line 1068 of file lib_pin.cpp.

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

Referenced by drawGraphic(), and IsPowerConnection().

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

Draw the pin symbol without text.

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

Definition at line 655 of file lib_pin.cpp.

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

Referenced by drawGraphic(), and IsPowerConnection().

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

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

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

Definition at line 854 of file lib_pin.cpp.

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

Referenced by drawGraphic(), and IsPowerConnection().

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

Enable or clear pin editing mode.

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

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

Definition at line 514 of file lib_pin.cpp.

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

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

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

End an object editing action.

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

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

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

Definition at line 180 of file lib_draw_item.h.

References EDA_ITEM::m_Flags.

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

180 { m_Flags = 0; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
const EDA_RECT LIB_PIN::GetBoundingBox ( ) const
inlineoverridevirtual
Returns
the boundary box for this, in library coordinates

Reimplemented from LIB_ITEM.

Definition at line 145 of file lib_pin.h.

References GetBoundingBox(), PinDrawOrient(), and PinEndPoint().

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

145 { return GetBoundingBox( false ); }
const EDA_RECT GetBoundingBox() const override
Definition: lib_pin.h:145
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 1777 of file lib_pin.cpp.

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

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

return a string giving the electrical type of a pin.

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

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

Definition at line 76 of file lib_pin.cpp.

References PINTYPE_COUNT.

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

return a string giving the electrical type of the pin.

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

Returns
The canonical electrical name of the pin.

Definition at line 266 of file lib_pin.h.

Referenced by GetType().

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

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 113 of file lib_pin.h.

Referenced by Matches().

114  {
115  return wxT( "LIB_PIN" );
116  }
COLOR4D LIB_ITEM::GetDefaultColor ( )
virtualinherited

Reimplemented in LIB_FIELD.

Definition at line 165 of file lib_draw_item.cpp.

References GetLayerColor(), and LAYER_DEVICE.

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

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

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

Returns
The electrical name of the pin.

Definition at line 275 of file lib_pin.h.

References GetText(), SetLength(), and SetType().

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

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

Definition at line 258 of file base_struct.h.

References EDA_ITEM::m_Flags.

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

258 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
int LIB_PIN::GetLength ( )
inline
DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited
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 1958 of file lib_pin.cpp.

References GetBitmap(), and m_type.

Referenced by GetWidth().

1959 {
1960  return GetBitmap( m_type );
1961 }
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80
BITMAP_DEF GetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:70
void LIB_PIN::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

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

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

Parameters
aListis the list to populate.

Reimplemented from LIB_ITEM.

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

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

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

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

Definition at line 1754 of file lib_pin.cpp.

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

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

Build the pin basic info to display in message panel.

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

Definition at line 1707 of file lib_pin.cpp.

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

Referenced by GetMsgPanelInfo(), and GetWidth().

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

References PIN_ORIENTATION_CNT, pin_orientation_codes, and PIN_RIGHT.

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

1902 {
1903  if( index >= 0 && index < (int) PIN_ORIENTATION_CNT )
1904  return pin_orientation_codes[ index ];
1905 
1906  return PIN_RIGHT;
1907 }
static const int pin_orientation_codes[]
Definition: lib_pin.cpp:53
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:60
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 1910 of file lib_pin.cpp.

References i, PIN_ORIENTATION_CNT, and pin_orientation_codes.

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

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

Get a list of pin orientation names.

Returns
List of valid pin orientation names.

Definition at line 1890 of file lib_pin.cpp.

References getPinOrientationName(), and PIN_ORIENTATION_CNT.

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

1891 {
1892  wxArrayString tmp;
1893 
1894  for( unsigned ii = 0; ii < PIN_ORIENTATION_CNT; ii++ )
1895  tmp.Add( getPinOrientationName( ii ) );
1896 
1897  return tmp;
1898 }
static const wxString getPinOrientationName(unsigned aPinOrientationCode)
Definition: lib_pin.cpp:108
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:60
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 1952 of file lib_pin.cpp.

References iconsPinsOrientations.

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

1953 {
1954  return iconsPinsOrientations;
1955 }
static const BITMAP_DEF iconsPinsOrientations[]
Definition: lib_pin.cpp:67
int LIB_PIN::GetPartNumber ( ) const
inline

Get the pin part number.

Definition at line 315 of file lib_pin.h.

References EnableEditMode(), LIB_ITEM::m_Unit, SetConversion(), and SetVisible().

315 { return m_Unit; }
int m_Unit
Unit identification for multiple parts per package.
int LIB_PIN::GetPenSize ( ) const
overridevirtual
Returns
the size of the "pen" that be used to draw or plot this item

Implements LIB_ITEM.

Definition at line 564 of file lib_pin.cpp.

References GetDefaultLineThickness(), and m_width.

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

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

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

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

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 1964 of file lib_pin.cpp.

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

Referenced by GetWidth(), and Matches().

1965 {
1966  return wxString::Format( _( "Pin %s, %s, %s" ),
1967  m_number,
1969  GetText( m_shape ));
1970 }
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
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:275
wxString m_number
Definition: lib_pin.h:83
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
GRAPHIC_PINSHAPE LIB_PIN::GetShape ( ) const
inline

Definition at line 235 of file lib_pin.h.

References m_shape, and SetShape().

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

235 { return m_shape; }
GRAPHIC_PINSHAPE m_shape
Shape drawn around pin.
Definition: lib_pin.h:78
STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 253 of file base_struct.h.

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format(), and GERBER_DRAW_ITEM::HitTest().

253 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:164
timestamp_t EDA_ITEM::GetTimeStamp ( ) const
inlineinherited

Definition at line 207 of file base_struct.h.

References EDA_ITEM::m_TimeStamp.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddSheetPathReferenceEntryIfMissing(), SCH_EDIT_FRAME::AnnotateComponents(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), PCB_EDIT_FRAME::Delete_OldZone_Fill(), PCB_EDIT_FRAME::Delete_Zone_Contour(), DuplicateStruct(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::format(), FormatProbeItem(), NETLIST_OBJECT::GetShortNetName(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), NETLIST_EXPORTER_GENERIC::makeComponents(), mapExistingAnnotation(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), SCH_SHEET_PATH::Path(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_REFERENCE::SCH_REFERENCE(), ZONE_FILLER_TOOL::SegzoneDeleteFill(), SortByTimeStamp(), SwapItemData(), DIALOG_SCH_SHEET_PROPS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS().

207 { return m_TimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
ELECTRICAL_PINTYPE LIB_PIN::GetType ( ) const
inline

Get the electrical type of the pin.

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

Definition at line 251 of file lib_pin.h.

References GetCanonicalElectricalTypeName(), and m_type.

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

251 { return m_type; }
ELECTRICAL_PINTYPE m_type
Electrical type of the pin. See enum ELECTRICAL_PINTYPE.
Definition: lib_pin.h:80
wxString LIB_PIN::GetTypeName ( )
inlineoverridevirtual

Provide a user-consumable name of the object type.

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

Implements LIB_ITEM.

Definition at line 118 of file lib_pin.h.

References GetMsgPanelInfo(), HitTest(), and Matches().

119  {
120  return _( "Pin" );
121  }
int LIB_PIN::GetWidth ( ) const
inlineoverridevirtual

Return the width of the draw item.

Returns
Width of draw object.

Implements LIB_ITEM.

Definition at line 482 of file lib_pin.h.

References CalcEdit(), Clone(), compare(), GetMenuImage(), getMsgPanelInfoBase(), GetSelectMenuText(), m_width, and SetWidth().

482 { return m_width; }
int m_width
Line width of the pin.
Definition: lib_pin.h:79
bool LIB_PIN::HitTest ( const wxPoint aPosition) const
overridevirtual

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

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

Reimplemented from LIB_ITEM.

Definition at line 540 of file lib_pin.cpp.

References DefaultTransform.

Referenced by GetTypeName().

541 {
542  return HitTest( aPosition, 0, DefaultTransform );
543 }
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
Definition: lib_pin.cpp:540
TRANSFORM DefaultTransform
Definition: eeschema.cpp:59
bool LIB_PIN::HitTest ( const wxPoint aPosition,
int  aThreshold,
const TRANSFORM aTransform 
) const
overridevirtual
Parameters
aPositionA wxPoint to test.
aThresholdMaximum distance to this object (usually the half thickness of a line) if < 0, it will be automatically set to half pen size when locating lines or arcs and set to 0 for other items.
aTransformThe transform matrix.
Returns
True if the point aPosition is near this object

Implements LIB_ITEM.

Definition at line 546 of file lib_pin.cpp.

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

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

Return the draw item editing mode status.

Returns
True if the item is being edited.

Definition at line 372 of file lib_draw_item.h.

References LIB_ITEM::GetDefaultColor(), IS_DRAGGED, IS_MOVED, IS_NEW, IS_RESIZED, and EDA_ITEM::m_Flags.

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

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

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

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

Implements LIB_ITEM.

Definition at line 1589 of file lib_pin.cpp.

References EDA_RECT::Contains(), m_position, PinEndPoint(), wxPoint::x, and wxPoint::y.

Referenced by IsPowerConnection().

1590 {
1591  wxPoint end = PinEndPoint();
1592 
1593  return rect.Contains( m_position.x, -m_position.y ) || rect.Contains( end.x, -end.y );
1594 }
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
wxPoint PinEndPoint() const
Definition: lib_pin.cpp:1481
bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

Definition at line 227 of file base_struct.h.

References BRIGHTENED.

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

227 { return m_Flags & BRIGHTENED; }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:138
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
bool EDA_ITEM::IsDragging ( ) const
inlineinherited
bool LIB_ITEM::IsFillable ( ) const
inlineinherited

Check if draw object can be filled.

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

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

Definition at line 365 of file lib_draw_item.h.

References LIB_ITEM::m_isFillable.

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

365 { return m_isFillable; }
bool m_isFillable
Flag to indicate if draw item is fillable.
bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 226 of file base_struct.h.

References HIGHLIGHTED.

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

Definition at line 220 of file base_struct.h.

References IS_CHANGED.

Referenced by LIB_EDIT_FRAME::OnEditPin().

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

Definition at line 219 of file base_struct.h.

References IS_NEW.

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

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

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

Definition at line 368 of file lib_pin.h.

References DrawPinElectricalTypeName(), DrawPinSymbol(), DrawPinTexts(), GetOrientationCode(), GetOrientationIndex(), GetOrientationNames(), GetOrientationSymbols(), LIB_ITEM::GetParent(), GetPenSize(), GetType(), Inside(), IsVisible(), Move(), PIN_POWER_IN, PlotPinTexts(), PlotSymbol(), and SetOffset().

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

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

Function IsReplaceable.

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

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

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

Definition at line 464 of file base_struct.h.

References EDA_ITEM::operator<().

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

464 { return false; }
bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 225 of file base_struct.h.

References IS_RESIZED.

Referenced by ExitSheet().

225 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:115
bool EDA_ITEM::IsSelected ( ) const
inlineinherited
bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[])
inlineinherited

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

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

Definition at line 266 of file base_struct.h.

References EOT.

267  {
268  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
269  {
270  if( m_StructType == *p )
271  return true;
272  }
273 
274  return false;
275  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it...
Definition: base_struct.h:163
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool LIB_PIN::IsVisible ( ) const
inline

Return the visibility status of the draw object.

Returns
True if draw object is visible otherwise false.

Definition at line 362 of file lib_pin.h.

References PIN_INVISIBLE.

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

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

Definition at line 223 of file base_struct.h.

References IS_WIRE_IMAGE.

Referenced by SCH_FIELD::Draw().

223 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:118
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
SEARCH_RESULT EDA_ITEM::IterateForward ( EDA_ITEM listStart,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
staticinherited

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

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

Definition at line 130 of file base_struct.cpp.

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

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

134 {
135  EDA_ITEM* p = listStart;
136 
137  for( ; p; p = p->Pnext )
138  {
139  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
140  return SEARCH_QUIT;
141  }
142 
143  return SEARCH_CONTINUE;
144 }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167
bool LIB_PIN::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData,
wxPoint aFindLocation 
)
overridevirtual

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

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

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
aFindLocationA pointer to a wxPoint object to store the location of matched item. The pointer can be NULL if it is not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented from EDA_ITEM.

Definition at line 1973 of file lib_pin.cpp.

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

Referenced by GetTypeName().

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

Function Matches compares aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

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

Definition at line 182 of file base_struct.cpp.

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

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

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

Referenced by GetPosition().

1608 {
1609  m_position.x -= center.x;
1610  m_position.x *= -1;
1611  m_position.x += center.x;
1612 
1613  if( m_orientation == PIN_RIGHT )
1615  else if( m_orientation == PIN_LEFT )
1617 }
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
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 1619 of file lib_pin.cpp.

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

Referenced by GetPosition().

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

Move a draw object to aPosition.

Parameters
aPositionPosition to move draw item to.

Implements LIB_ITEM.

Definition at line 1597 of file lib_pin.cpp.

References m_position, and EDA_ITEM::SetModified().

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

1598 {
1599  if( m_position != newPosition )
1600  {
1601  m_position = newPosition;
1602  SetModified();
1603  }
1604 }
void SetModified()
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
bool LIB_ITEM::operator< ( const LIB_ITEM aOther) const
inherited

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

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

Definition at line 93 of file lib_draw_item.cpp.

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

Referenced by LIB_ITEM::operator==().

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

Test if another item is less than this object.

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

Definition at line 239 of file base_struct.cpp.

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

Referenced by EDA_ITEM::IsReplaceable(), and LIB_ALIAS::operator==().

240 {
241  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
242  GetChars( GetClass() ) ) );
243 
244  return false;
245 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
bool LIB_ITEM::operator== ( const LIB_ITEM aOther) const
inherited

Test LIB_ITEM objects for equivalence.

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

Definition at line 84 of file lib_draw_item.cpp.

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

Referenced by LIB_ITEM::GetBoundingBox().

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

Definition at line 263 of file lib_draw_item.h.

References LIB_ITEM::GetPosition(), LIB_ITEM::Inside(), LIB_ITEM::Move(), LIB_ITEM::operator<(), and LIB_ITEM::SetOffset().

264  {
265  return *this == *aOther;
266  }
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 1508 of file lib_pin.cpp.

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

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

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

Definition at line 1481 of file lib_pin.cpp.

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

Referenced by GetBoundingBox(), and Inside().

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

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

Referenced by GetPosition().

1682 {
1683  if( ! IsVisible() )
1684  return;
1685 
1686  int orient = PinDrawOrient( aTransform );
1687 
1688  wxPoint pos = aTransform.TransformCoordinate( m_position ) + offset;
1689 
1690  PlotSymbol( plotter, pos, orient );
1691  PlotPinTexts( plotter, pos, orient, GetParent()->GetPinNameOffset(),
1692  GetParent()->ShowPinNumbers(), GetParent()->ShowPinNames(),
1693  GetPenSize() );
1694 }
void PlotPinTexts(PLOTTER *aPlotter, wxPoint &aPosition, int aOrientation, int aTextInside, bool aDrawPinNum, bool aDrawPinName, int aWidth)
Plot the pin number and pin text info, given the pin line coordinates.
Definition: lib_pin.cpp:1281
wxPoint TransformCoordinate(const wxPoint &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:41
int GetPenSize() const override
Definition: lib_pin.cpp:564
LIB_PART * GetParent() const
void PlotSymbol(PLOTTER *aPlotter, const wxPoint &aPosition, int aOrientation)
Definition: lib_pin.cpp:1130
bool IsVisible() const
Return the visibility status of the draw object.
Definition: lib_pin.h:362
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
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:1508
void LIB_PIN::PlotPinTexts ( PLOTTER aPlotter,
wxPoint aPosition,
int  aOrientation,
int  aTextInside,
bool  aDrawPinNum,
bool  aDrawPinName,
int  aWidth 
)

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

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

Definition at line 1281 of file lib_pin.cpp.

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

Referenced by IsPowerConnection(), and Plot().

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

Definition at line 1130 of file lib_pin.cpp.

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

Referenced by IsPowerConnection(), and Plot().

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

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

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

Definition at line 209 of file base_struct.cpp.

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

Referenced by EDA_ITEM::Matches(), SCH_TEXT::Replace(), SCH_FIELD::Replace(), SCH_SHEET_PIN::Replace(), SCH_SHEET::Replace(), and SCH_FIND_COLLECTOR::ReplaceItem().

210 {
211  wxCHECK_MSG( IsReplaceable(), false,
212  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
213 
214  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
215 
216  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
217  aSearchData.GetFindString() :
218  aSearchData.GetFindString().Upper() );
219 
220  if( result == wxNOT_FOUND )
221  return false;
222 
223  wxString prefix = aText.Left( result );
224  wxString suffix;
225 
226  if( aSearchData.GetFindString().length() + result < aText.length() )
227  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
228 
229  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
230  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
231  GetChars( suffix ) );
232 
233  aText = prefix + aSearchData.GetReplaceString() + suffix;
234 
235  return true;
236 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:464
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
virtual bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
void *  aAuxData = NULL 
)
inlinevirtualinherited

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

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

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

Reimplemented in SCH_SHEET, SCH_SHEET_PIN, SCH_FIELD, and SCH_TEXT.

Definition at line 452 of file base_struct.h.

452 { return false; }
void LIB_PIN::Rotate ( )
overridevirtual

Rotate the draw item.

Reimplemented from LIB_ITEM.

Definition at line 1924 of file lib_pin.cpp.

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

Referenced by GetOrientation(), and GetPosition().

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

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

1632 {
1633  int rot_angle = aRotateCCW ? -900 : 900;
1634 
1635  RotatePoint( &m_position, center, rot_angle );
1636 
1637  if( aRotateCCW )
1638  {
1639  switch( m_orientation )
1640  {
1641  case PIN_RIGHT:
1643  break;
1644 
1645  case PIN_UP:
1647  break;
1648  case PIN_LEFT:
1650  break;
1651 
1652  case PIN_DOWN:
1654  break;
1655  }
1656  }
1657  else
1658  {
1659  switch( m_orientation )
1660  {
1661  case PIN_RIGHT:
1663  break;
1664 
1665  case PIN_UP:
1667  break;
1668  case PIN_LEFT:
1670  break;
1671 
1672  case PIN_DOWN:
1674  break;
1675  }
1676  }
1677 }
Definition: lib_pin.h:55
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
int m_orientation
Pin orientation (Up, Down, Left, Right)
Definition: lib_pin.h:77
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 215 of file base_struct.h.

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

215 { Pback = aBack; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:168
void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 232 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::SetFlags().

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

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

Set the body style (conversion) of the pin.

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

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

Definition at line 450 of file lib_pin.cpp.

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

Referenced by GetPartNumber(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

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

Definition at line 256 of file base_struct.h.

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

256 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

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

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

Definition at line 285 of file base_struct.h.

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

285 { m_forceVisible = aEnable; }
bool m_forceVisible
Set to true to override the visibility setting of the item.
Definition: base_struct.h:175
void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 231 of file base_struct.h.

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

231 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:137
void LIB_PIN::SetLength ( int  aLength,
bool  aTestOtherPins = true 
)

Set the pin length.

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

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

Definition at line 363 of file lib_pin.cpp.

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

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

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

Definition at line 217 of file base_struct.h.

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

217 { m_List = aList; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:169
void EDA_ITEM::SetModified ( )
inherited

Definition at line 100 of file base_struct.cpp.

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

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

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

Set the pin name.

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

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

Definition at line 161 of file lib_pin.cpp.

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

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

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

Set the aSize of the pin name text.

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

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

Definition at line 194 of file lib_pin.cpp.

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

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

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

Definition at line 214 of file base_struct.h.

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

214 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167
void LIB_PIN::SetNumber ( const wxString &  aNumber)

Set the pin number.

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

Parameters
aNumberNew pin number.

Definition at line 222 of file lib_pin.cpp.

References m_number, and EDA_ITEM::SetModified().

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

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

Set the size of the pin number text.

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

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

Definition at line 241 of file lib_pin.cpp.

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

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

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

Set the drawing object by aOffset from the current position.

Parameters
aOffsetCoordinates to offset the item position.

Implements LIB_ITEM.

Definition at line 1583 of file lib_pin.cpp.

References m_position.

Referenced by IsPowerConnection().

1584 {
1585  m_position += aOffset;
1586 }
wxPoint m_position
Position of the pin.
Definition: lib_pin.h:75
void LIB_PIN::SetOrientation ( int  aOrientation,
bool  aTestOtherPins = true 
)

Set orientation on the pin.

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

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

Definition at line 269 of file lib_pin.cpp.

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

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

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

Set the pin part number.

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

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

Definition at line 420 of file lib_pin.cpp.

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

Referenced by GetLength(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

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

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

use SetPinPosition to set the position of this only

Parameters
aPositionis the new position of this and linked pins

Definition at line 393 of file lib_pin.cpp.

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

Referenced by GetPosition(), and DIALOG_LIB_EDIT_PIN::TransferDataFromWindow().

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

Definition at line 230 of file base_struct.h.

References SELECTED, and EDA_ITEM::SetFlags().

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

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

Set the shape of the pin to aShape.

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

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

Definition at line 298 of file lib_pin.cpp.

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

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

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

Definition at line 206 of file base_struct.h.

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

206 { m_TimeStamp = aNewTimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
void LIB_PIN::SetType ( ELECTRICAL_PINTYPE  aType,
bool  aTestOtherPins = true 
)

Set the electrical type of the pin.

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

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

Definition at line 327 of file lib_pin.cpp.

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

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

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

Set or clear the visibility flag for the pin.

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

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

Definition at line 481 of file lib_pin.cpp.

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

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

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

Set the width of the draw item to aWidth.

Implements LIB_ITEM.

Definition at line 1697 of file lib_pin.cpp.

References m_width, and EDA_ITEM::SetModified().

Referenced by GetWidth().

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

Definition at line 229 of file base_struct.h.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

229 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:118
static bool EDA_ITEM::Sort ( const EDA_ITEM aLeft,
const EDA_ITEM aRight 
)
inlinestaticinherited

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

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

Definition at line 483 of file base_struct.h.

References EDA_ITEM::Matches(), EDA_ITEM::operator=(), EDA_ITEM::ViewBBox(), and EDA_ITEM::ViewGetLayers().

Referenced by PART_LIB::GetEntryTypePowerNames().

483 { return *aLeft < *aRight; }
KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Function Type()

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

Returns
KICAD_T - the type of object.

Definition at line 201 of file base_struct.h.

References EDA_ITEM::m_StructType.

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

202  {
203  return m_StructType;