88 default: wxFAIL_MSG( wxS(
"SCH_BUS_WIRE_ENTRY ctor: unexpected quadrant" ) );
127 return (
m_pos == aPosition ||
GetEnd() == aPosition );
142 wxCHECK_RET( item, wxT(
"Cannot swap bus entry data with invalid item." ) );
249 aItemList.push_back( item );
252 aItemList.push_back( item1 );
259 aItemList.push_back( item );
262 aItemList.push_back( item1 );
267 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
316 std::vector<DANGLING_END_ITEM>& aItemListByPos,
325 bool has_wire[2] = {
false };
326 bool has_bus[2] = {
false };
328 for(
unsigned ii = 0; ii < aItemListByType.size(); ii++ )
364 if( ( has_wire[0] && has_bus[1] ) || ( has_wire[1] && has_bus[0] ) )
366 else if( has_wire[0] || has_bus[0] )
368 else if( has_wire[1] || has_bus[1] )
376 std::vector<DANGLING_END_ITEM>& aItemListByPos,
385 for(
unsigned ii = 0; ii < aItemListByType.size(); ii++ )
437 wxCHECK( busEntry,
false );
448 return wxString(
_(
"Bus to Wire Entry" ) );
454 return wxString(
_(
"Bus to Bus Entry" ) );
460 return BITMAPS::add_line2bus;
466 return BITMAPS::add_bus2bus;
494 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
506 penWidth = std::max( penWidth, renderSettings->
GetMinPenWidth() );
514 aPlotter->
SetDash( penWidth, LINE_STYLE::SOLID );
519 std::vector<MSG_PANEL_ITEM>& aList )
530 aList.emplace_back(
_(
"Bus Entry Type" ), msg );
554 if(
GetLayer() != symbol->GetLayer() )
555 return GetLayer() < symbol->GetLayer();
563 if(
GetEnd().
x != symbol->GetEnd().x )
564 return GetEnd().
x < symbol->GetEnd().x;
566 return GetEnd().
y < symbol->GetEnd().y;
656 if( plotDashTypeEnum.
Choices().GetCount() == 0 )
658 plotDashTypeEnum.
Map( LINE_STYLE::DEFAULT,
_HKI(
"Default" ) )
659 .
Map( LINE_STYLE::SOLID,
_HKI(
"Solid" ) )
660 .
Map( LINE_STYLE::DASH,
_HKI(
"Dashed" ) )
661 .
Map( LINE_STYLE::DOT,
_HKI(
"Dotted" ) )
662 .
Map( LINE_STYLE::DASHDOT,
_HKI(
"Dash-Dot" ) )
663 .
Map( LINE_STYLE::DASHDOTDOT,
_HKI(
"Dash-Dot-Dot" ) );
671 _HKI(
"Line Style" ),
676 PROPERTY_DISPLAY::PT_SIZE ) );
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 BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
constexpr bool Contains(const Vec &aPoint) const
constexpr void SetEnd(coord_type x, coord_type y)
constexpr bool Intersects(const BOX2< Vec > &aRect) const
Helper class used to store the state of schematic items that can be connected to other schematic item...
DANGLING_END_T GetType() const
EDA_ITEM * GetItem() const
VECTOR2I GetPosition() const
The base class for create windows for drawing purpose.
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 const wxString & GetText() const
Return the string associated with the text object.
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
A color representation with 4 components: red, green, blue, alpha.
int GetDefaultPenWidth() const
int GetMinPenWidth() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxDC * GetPrintDC() const
Base plotter engine class.
void MoveTo(const VECTOR2I &pos)
virtual void SetDash(int aLineWidth, LINE_STYLE aLineStyle)=0
void FinishTo(const VECTOR2I &pos)
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void SetColor(const COLOR4D &color)=0
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()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
Class for a bus to bus entry.
int GetPenWidth() const override
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
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.
SCH_BUS_BUS_ENTRY(const VECTOR2I &pos=VECTOR2I(0, 0), bool aFlipY=false)
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
SCH_ITEM * m_connected_bus_items[2]
Pointer to the bus items (usually bus wires) connected to this bus-bus entry (either or both may be n...
Base class for a bus or wire entry.
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
LINE_STYLE m_lastResolvedLineStyle
COLOR4D GetBusEntryColor() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
LINE_STYLE GetLineStyle() const
void SetBusEntryColor(const COLOR4D &aColor)
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
VECTOR2I GetPosition() const override
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
void SetPenWidth(int aWidth)
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
bool operator==(const SCH_ITEM &aItem) const override
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
void SetLineStyle(LINE_STYLE aStyle)
bool IsConnectable() const override
int GetPenWidth() const override
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
bool IsDangling() const override
COLOR4D m_lastResolvedColor
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
SCH_BUS_ENTRY_BASE(KICAD_T aType, const VECTOR2I &pos=VECTOR2I(0, 0), bool aFlipY=false)
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool operator<(const SCH_ITEM &aItem) const override
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Class for a wire to bus entry.
SCH_BUS_WIRE_ENTRY(const VECTOR2I &pos=VECTOR2I(0, 0), bool aFlipY=false)
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
int GetPenWidth() const override
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
virtual bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
SCH_ITEM * m_connected_bus_item
Pointer to the bus item (usually a bus wire) connected to this bus-wire entry, if it is connected to ...
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
void AppendInfoToMsgPanel(std::vector< MSG_PANEL_ITEM > &aList) const
Adds information about the connection object to aList.
static bool IsBusLabel(const wxString &aLabel)
Test if aLabel has a bus notation.
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
bool IsConnectivityDirty() const
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
Segment description base class to describe items which have 2 end points (track, wire,...
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void SetLineStyle(LINE_STYLE aLineStyle)
void SetWidth(int aWidth)
void SetColor(const KIGFX::COLOR4D &aColor)
LINE_STYLE GetLineStyle() const
KIGFX::COLOR4D GetColor() const
static void Stroke(const SHAPE *aShape, LINE_STYLE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS *aRenderSettings, const std::function< void(const VECTOR2I &a, const VECTOR2I &b)> &aStroker)
#define DEFAULT_SCH_ENTRY_SIZE
The default text size in mils. (can be changed in preference menu)
#define DEFAULT_WIRE_WIDTH_MILS
The default bus width in mils. (can be changed in preference menu)
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_270
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
@ LAYER_NET_COLOR_HIGHLIGHT
@ LAYER_SELECTION_SHADOWS
constexpr void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
static struct SCH_BUS_ENTRY_DESC _SCH_BUS_ENTRY_DESC
LINE_STYLE
Dashed line types.
constexpr int MilsToIU(int mils) const
bool TestSegmentHit(const VECTOR2I &aRefPoint, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
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.
bool IsPointOnSegment(const VECTOR2I &aSegStart, const VECTOR2I &aSegEnd, const VECTOR2I &aTestPoint)
Test if aTestPoint is on line defined by aSegStart and aSegEnd.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I