90 default: wxFAIL_MSG( wxS(
"SCH_BUS_WIRE_ENTRY ctor: unexpected quadrant" ) );
129 return (
m_pos == aPosition ||
GetEnd() == aPosition );
142 wxCHECK_RET( item, wxT(
"Cannot swap bus entry data with invalid item." ) );
243 aItemList.push_back( item );
246 aItemList.push_back( item1 );
253 aItemList.push_back( item );
256 aItemList.push_back( item1 );
316 bool has_wire[2] = {
false };
317 bool has_bus[2] = {
false };
319 for(
unsigned ii = 0; ii < aItemList.size(); ii++ )
355 if( ( has_wire[0] && has_bus[1] ) || ( has_wire[1] && has_bus[0] ) )
357 else if( has_wire[0] || has_bus[0] )
359 else if( has_wire[1] || has_bus[1] )
374 for(
unsigned ii = 0; ii < aItemList.size(); ii++ )
418 return wxString(
_(
"Bus to Wire Entry" ) );
424 return wxString(
_(
"Bus to Bus Entry" ) );
430 return BITMAPS::add_line2bus;
436 return BITMAPS::add_bus2bus;
471 ? settings->GetLayerColor(
m_layer )
476 penWidth = std::max( penWidth, settings->GetMinPenWidth() );
484 aPlotter->
SetDash( penWidth, PLOT_DASH_TYPE::SOLID );
489 std::vector<MSG_PANEL_ITEM>& aList )
500 aList.emplace_back(
_(
"Bus Entry Type" ), msg );
524 if(
GetLayer() != symbol->GetLayer() )
525 return GetLayer() < symbol->GetLayer();
533 if(
GetEnd().
x != symbol->GetEnd().x )
534 return GetEnd().
x < symbol->GetEnd().x;
536 return GetEnd().
y < symbol->GetEnd().y;
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
bool Intersects(const BOX2< Vec > &aRect) const
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.
void SetEnd(coord_type x, coord_type y)
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.
A color representation with 4 components: red, green, blue, alpha.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxDC * GetPrintDC() const
Store schematic specific render settings.
Base plotter engine class.
virtual void SetDash(int aLineWidth, PLOT_DASH_TYPE aLineStyle)=0
void MoveTo(const VECTOR2I &pos)
void FinishTo(const VECTOR2I &pos)
RENDER_SETTINGS * RenderSettings()
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void SetColor(const COLOR4D &color)=0
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.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
SCH_BUS_BUS_ENTRY(const VECTOR2I &pos=VECTOR2I(0, 0), bool aFlipY=false)
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...
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Base class for a bus or wire entry.
PLOT_DASH_TYPE GetLineStyle() const
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.
void SetBusEntryColor(const COLOR4D &aColor)
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
Print a schematic item.
VECTOR2I GetPosition() const override
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void Plot(PLOTTER *aPlotter, bool aBackground) const override
Plot the schematic item to aPlotter.
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.
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
bool IsConnectable() const override
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.
void SetLineStyle(PLOT_DASH_TYPE aStyle)
SCH_BUS_ENTRY_BASE(KICAD_T aType, const VECTOR2I &pos=VECTOR2I(0, 0), bool aFlipY=false)
PLOT_DASH_TYPE m_lastResolvedLineStyle
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void Rotate(const VECTOR2I &aCenter) 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)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) 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.
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.
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,...
virtual int GetPenWidth() 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
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 SetWidth(int aWidth)
void SetColor(const KIGFX::COLOR4D &aColor)
static void Stroke(const SHAPE *aShape, PLOT_DASH_TYPE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS *aRenderSettings, std::function< void(const VECTOR2I &a, const VECTOR2I &b)> aStroker)
KIGFX::COLOR4D GetColor() const
PLOT_DASH_TYPE GetPlotStyle() const
void SetPlotStyle(PLOT_DASH_TYPE aPlotStyle)
#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
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
@ LAYER_SELECTION_SHADOWS
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
PLOT_DASH_TYPE
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)
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.