56 m_shape = LABEL_FLAG_SHAPE::L_INPUT;
69 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
81 wxString::Format(
"SCH_SHEET_PIN object cannot swap data with %s object.",
108 wxASSERT( aNumber >= 2 );
122 case SHEET_SIDE::LEFT:
128 case SHEET_SIDE::RIGHT:
134 case SHEET_SIDE::TOP:
140 case SHEET_SIDE::BOTTOM:
162 if( sheet ==
nullptr )
165 int leftSide = sheet->
m_pos.
x;
167 int topSide = sheet->
m_pos.
y;
172 sheetEdge.
Append( leftSide, topSide );
173 sheetEdge.
Append( rightSide, topSide );
174 sheetEdge.
Append( rightSide, botSide );
175 sheetEdge.
Append( leftSide, botSide );
176 sheetEdge.
Append( leftSide, topSide );
178 if( aAllowEdgeSwitch )
182 case 0:
SetSide( SHEET_SIDE::TOP );
break;
183 case 1:
SetSide( SHEET_SIDE::RIGHT );
break;
184 case 2:
SetSide( SHEET_SIDE::BOTTOM );
break;
185 case 3:
SetSide( SHEET_SIDE::LEFT );
break;
186 default: wxASSERT(
"Invalid segment number" );
196 case SHEET_SIDE::RIGHT:
197 case SHEET_SIDE::LEFT:
208 case SHEET_SIDE::BOTTOM:
209 case SHEET_SIDE::TOP:
220 case SHEET_SIDE::UNDEFINED:
221 wxASSERT(
"Undefined sheet side" );
234 case SHEET_SIDE::TOP:
SetSide( SHEET_SIDE::BOTTOM );
break;
235 case SHEET_SIDE::BOTTOM:
SetSide( SHEET_SIDE::TOP );
break;
249 case SHEET_SIDE::LEFT:
SetSide( SHEET_SIDE::RIGHT );
break;
250 case SHEET_SIDE::RIGHT:
SetSide( SHEET_SIDE::LEFT );
break;
271 case SHEET_SIDE::TOP:
272 case SHEET_SIDE::BOTTOM:
276 case SHEET_SIDE::LEFT:
277 case SHEET_SIDE::RIGHT:
291 case SHEET_SIDE::TOP:
292 case SHEET_SIDE::BOTTOM:
296 case SHEET_SIDE::LEFT:
297 case SHEET_SIDE::RIGHT:
309 std::vector<VECTOR2I>& aPoints,
const VECTOR2I& aPos )
const
321 case LABEL_FLAG_SHAPE::L_INPUT: shape = LABEL_FLAG_SHAPE::L_OUTPUT;
break;
322 case LABEL_FLAG_SHAPE::L_OUTPUT: shape = LABEL_FLAG_SHAPE::L_INPUT;
break;
333 aItemList.push_back( item );
339 return wxString::Format(
_(
"Hierarchical Sheet Pin %s" ),
346 return BITMAPS::add_hierar_pin;
379 double similarity = 1.0;
403 wxCHECK(
pin,
false );
414void SCH_SHEET_PIN::Show(
int nestLevel, std::ostream& os )
const
417 NestedSpace( nestLevel, os ) <<
'<' <<
GetClass().Lower().mb_str() <<
">"
419 <<
'"' <<
"/>\n" << std::flush;
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr bool Contains(const Vec &aPoint) const
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 SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed)
Print an item.
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual double Similarity(const SCH_ITEM &aItem) const
Return a measure of how likely the other object is to represent the same object.
virtual bool operator==(const SCH_ITEM &aOther) const
virtual void SwapData(SCH_ITEM *aItem)
Swap the internal data structures aItem with the schematic item.
wxString GetClass() const override
Return the class name.
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const override
const BOX2I GetBoundingBox() const override
Return the bounding box of the label including its fields.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
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.
SCH_SHEET_PIN(SCH_SHEET *parent, const VECTOR2I &pos=VECTOR2I(0, 0), const wxString &text=wxEmptyString)
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
int m_number
Label number use for saving sheet label to file.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
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.
bool operator==(const SCH_SHEET_PIN *aPin) const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
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
VECTOR2I GetPosition() const override
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
static constexpr EDA_ANGLE ANGLE_270
KICOMMON_API 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)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I