67 wxT(
"Cannot swap junction data with invalid item." ) );
70 std::swap(
m_pos, item->m_pos );
72 std::swap(
m_color, item->m_color );
124 if(
color == COLOR4D::UNSPECIFIED )
155 aItemList.push_back( item );
166 void SCH_JUNCTION::Show(
int nestLevel, std::ostream& os )
const 171 NestedSpace( nestLevel, os ) <<
'<' << s.Lower().mb_str() <<
m_pos <<
", " <<
m_diameter 179 if(
m_color != COLOR4D::UNSPECIFIED )
206 return aPosition ==
m_pos;
228 return selRect.
Collide( &junction, aAccuracy );
235 return m_pos == aPosition;
241 auto* settings = static_cast<KIGFX::SCH_RENDER_SETTINGS*>( aPlotter->
RenderSettings() );
244 if(
color == COLOR4D::UNSPECIFIED )
267 auto junction = static_cast<const SCH_JUNCTION*>( &aItem );
270 return GetPosition().x < junction->GetPosition().x;
273 return GetPosition().y < junction->GetPosition().y;
278 return GetColor() < junction->GetColor();
wxString GetClass() const override
Return the class name.
bool Collide(const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
COLOR4D GetJunctionColor() const
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
COLOR4D m_color
Color of the junction. #COLOR4D::UNSPECIFIED is user default.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
#define DEFAULT_WIRE_WIDTH_MILS
The default bus width in mils. (can be changed in preference menu)
SCHEMATIC_SETTINGS & Settings() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void SetOrigin(const wxPoint &pos)
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
#define DEFAULT_JUNCTION_DIAM
The default bus and wire entry size in mils.
const VECTOR2I GetCenter() const
void RotatePoint(int *pX, int *pY, double angle)
virtual bool operator<(const SCH_ITEM &aItem) const override
bool Contains(const wxPoint &aPoint) const
bool IsConnectivityDirty() const
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
SCH_JUNCTION(const wxPoint &aPosition=wxPoint(0, 0), int aDiameter=0, SCH_LAYER_ID aLayer=LAYER_JUNCTION)
NETCLASSPTR NetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
bool Collide(const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance,...
SCH_LAYER_ID
Eeschema drawing layers.
wxPoint GetPosition() const override
const wxPoint GetPosition() const
COLOR4D m_lastResolvedColor
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void Plot(PLOTTER *aPlotter) const override
Plot the schematic item to aPlotter.
#define STRUCT_DELETED
flag indication structures to be erased
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
wxDC * GetPrintDC() const
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
wxPoint m_pos
Position of the junction.
virtual void SetColor(const COLOR4D &color)=0
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a schematic item.
Base plotter engine class.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
RENDER_SETTINGS * RenderSettings()
#define SKIP_STRUCT
flag indicating that the structure should be ignored
BITMAPS
A list of all bitmap identifiers.
int GetEffectiveDiameter() const
int m_lastResolvedDiameter
Handle the component boundary box.
SHAPE_CIRCLE getEffectiveShape() const
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
A base class for most all the KiCad significant classes used in schematics and boards.
Helper class used to store the state of schematic items that can be connected to other schematic item...
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
int m_diameter
Diameter of the junction. Zero is user default.
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
KICAD_T Type() const
Returns the type of object.
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, const COLOR4D &Color, const COLOR4D &BgColor)
A color representation with 4 components: red, green, blue, alpha.