56 m_shape = LABEL_FLAG_SHAPE::L_INPUT;
80 wxString::Format(
"SCH_SHEET_PIN object cannot swap data with %s object.",
107 wxASSERT( aNumber >= 2 );
121 case SHEET_SIDE::LEFT:
127 case SHEET_SIDE::RIGHT:
133 case SHEET_SIDE::TOP:
139 case SHEET_SIDE::BOTTOM:
161 if( sheet ==
nullptr )
164 int leftSide = sheet->
m_pos.
x;
166 int topSide = sheet->
m_pos.
y;
171 sheetEdge.
Append( leftSide, topSide );
172 sheetEdge.
Append( rightSide, topSide );
173 sheetEdge.
Append( rightSide, botSide );
174 sheetEdge.
Append( leftSide, botSide );
175 sheetEdge.
Append( leftSide, topSide );
177 if( aAllowEdgeSwitch )
181 case 0:
SetSide( SHEET_SIDE::TOP );
break;
182 case 1:
SetSide( SHEET_SIDE::RIGHT );
break;
183 case 2:
SetSide( SHEET_SIDE::BOTTOM );
break;
184 case 3:
SetSide( SHEET_SIDE::LEFT );
break;
185 default: wxASSERT(
"Invalid segment number" );
195 case SHEET_SIDE::RIGHT:
196 case SHEET_SIDE::LEFT:
207 case SHEET_SIDE::BOTTOM:
208 case SHEET_SIDE::TOP:
219 case SHEET_SIDE::UNDEFINED:
220 wxASSERT(
"Undefined sheet side" );
233 case SHEET_SIDE::TOP:
SetSide( SHEET_SIDE::BOTTOM );
break;
234 case SHEET_SIDE::BOTTOM:
SetSide( SHEET_SIDE::TOP );
break;
248 case SHEET_SIDE::LEFT:
SetSide( SHEET_SIDE::RIGHT );
break;
249 case SHEET_SIDE::RIGHT:
SetSide( SHEET_SIDE::LEFT );
break;
270 case SHEET_SIDE::TOP:
271 case SHEET_SIDE::BOTTOM:
275 case SHEET_SIDE::LEFT:
276 case SHEET_SIDE::RIGHT:
290 case SHEET_SIDE::TOP:
291 case SHEET_SIDE::BOTTOM:
295 case SHEET_SIDE::LEFT:
296 case SHEET_SIDE::RIGHT:
308 std::vector<VECTOR2I>& aPoints,
const VECTOR2I& aPos )
const
320 case LABEL_FLAG_SHAPE::L_INPUT: shape = LABEL_FLAG_SHAPE::L_OUTPUT;
break;
321 case LABEL_FLAG_SHAPE::L_OUTPUT: shape = LABEL_FLAG_SHAPE::L_INPUT;
break;
332 aItemList.push_back( item );
338 return wxString::Format(
_(
"Hierarchical Sheet Pin %s" ),
345 return BITMAPS::add_hierar_pin;
361void SCH_SHEET_PIN::Show(
int nestLevel, std::ostream& os )
const
364 NestedSpace( nestLevel, os ) <<
'<' <<
GetClass().Lower().mb_str() <<
">"
366 <<
'"' <<
"/>\n" << std::flush;
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Helper class used to store the state of schematic items that can be connected to other schematic item...
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
const VECTOR2I & GetTextPos() const
virtual const wxString & GetText() const
Return the string associated with the text object.
void SetTextPos(const VECTOR2I &aPoint)
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
SCHEMATIC_SETTINGS & Settings() const
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset)=0
Print a schematic item.
virtual wxString GetClass() const override
Return the class name.
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual void SwapData(SCH_ITEM *aItem)
Swap the internal data structures aItem with the schematic item.
const BOX2I GetBoundingBox() const override
Return the bounding box of the label including its fields.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetNumber(int aNumber)
Set the sheet label number.
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
Print a schematic item.
SCH_SHEET_PIN(SCH_SHEET *parent, const VECTOR2I &pos=VECTOR2I(0, 0), const wxString &text=wxEmptyString)
int m_number
Label number use for saving sheet label to file.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
void ConstrainOnEdge(VECTOR2I aPos, bool aAllowEdgeSwitch)
Adjust label position to edge based on proximity to vertical or horizontal edge of the parent sheet.
int GetPenWidth() const override
static SHEET_SIDE GetOppositeSide(SHEET_SIDE aSide)
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
SHEET_SIDE GetSide() const
wxString GetClass() const override
Return the class name.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool operator==(const SCH_SHEET_PIN *aPin) const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
SCH_SHEET * GetParent() const
Get the parent sheet object of this sheet pin.
void SetSide(SHEET_SIDE aEdge)
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
bool IsVerticalOrientation() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int NearestSegment(const VECTOR2I &aP) const
Find the segment nearest the given point.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
static constexpr EDA_ANGLE & ANGLE_90
wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
static struct SCH_SHEET_PIN_DESC _SCH_SHEET_PIN_DESC
SHEET_SIDE
Define the edge of the sheet that the sheet pin is positioned.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
constexpr int MilsToIU(int mils) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)