28 #include <unordered_map> 44 class wxFindReplaceData;
47 class NETLIST_OBJECT_LIST;
145 const COLOR4D& aColor = COLOR4D::UNSPECIFIED ) :
195 return wxT(
"SCH_ITEM" );
271 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
291 virtual void Move(
const wxPoint& aMoveVector ) = 0;
306 virtual void Rotate(
const wxPoint& aCenter ) = 0;
318 virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {}
484 virtual bool doIsConnected(
const wxPoint& aPosition )
const {
return false; }
virtual STROKE_PARAMS GetStroke() const
bool operator<(const DANGLING_END_ITEM &rhs) const
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
virtual void SetLastResolvedState(const SCH_ITEM *aItem)
void SetWidth(int aWidth)
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
wxPoint GetPosition() const
virtual bool IsConnectable() const
SCH_CONNECTION * GetOrInitConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
virtual std::vector< wxPoint > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Holds all the data relating to one schematic.
const EDA_ITEM * GetParent() const
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
virtual void DoHypertextMenu(EDA_DRAW_FRAME *aFrame)
virtual void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList)
Add the schematic item end points to aItemList if the item has end points.
Calculates the connectivity of a schematic and generates netlists.
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
void AddConnectionTo(const SCH_SHEET_PATH &aPath, SCH_ITEM *aItem)
Add a connection link between this item and another.
virtual bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const
Return true if this item should propagate connection info to aItem.
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual void MirrorVertically(int aCenter)=0
Mirror item vertically about aCenter.
Schematic editor (Eeschema) main window.
void SetPlotStyle(PLOT_DASH_TYPE aPlotStyle)
STROKE_PARAMS(int aWidth=Mils2iu(DEFAULT_LINE_WIDTH_MILS), PLOT_DASH_TYPE aPlotStyle=PLOT_DASH_TYPE::DEFAULT, const COLOR4D &aColor=COLOR4D::UNSPECIFIED)
The base class for create windows for drawing purpose.
virtual void Rotate(const wxPoint &aCenter)=0
Rotate the item around aCenter 90 degrees in the clockwise direction.
virtual void SetLocked(bool aLocked)
Set the 'lock' status to aLocked for of this item.
FIELDS_AUTOPLACED m_fieldsAutoplaced
bool IsConnectivityDirty() const
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
FIELDS_AUTOPLACED GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
void SetFieldsAutoplaced()
virtual bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr)
Test the schematic item to aItemList to check if it's dangling state has changed.
NETCLASSPTR NetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
std::vector< SCH_ITEM * > SCH_ITEM_SET
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction)
DANGLING_END_T m_type
The position of the connection point.
bool operator!=(const DANGLING_END_ITEM &aB) const
virtual bool CanConnect(const SCH_ITEM *aItem) const
SCH_CONNECTION * InitializeConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
Create a new connection object associated with this object.
virtual void SetStroke(const STROKE_PARAMS &aStroke)
virtual void Plot(PLOTTER *aPlotter) const
Plot the schematic item to aPlotter.
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
virtual void SwapData(SCH_ITEM *aItem)
Swap the internal data structures aItem with the schematic item.
virtual bool IsMovableFromAnchorPoint() const
SCH_LAYER_ID
Eeschema drawing layers.
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
void SetLayer(SCH_LAYER_ID aLayer)
Set the layer this item is on.
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
virtual bool IsHypertext() const
Allow items to support hypertext actions when hovered/clicked.
virtual void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset)=0
Print a schematic item.
EDA_ITEM * GetItem() const
void ClearFieldsAutoplaced()
PLOT_DASH_TYPE GetPlotStyle() const
bool m_connectivity_dirty
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
std::unordered_map< SCH_SHEET_PATH, SCH_CONNECTION * > m_connection_map
Store connectivity information, per sheet.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
DANGLING_END_ITEM(DANGLING_END_T aType, EDA_ITEM *aItem, const wxPoint &aPosition, const EDA_ITEM *aParent)
virtual void MirrorHorizontally(int aCenter)=0
Mirror item horizontally about aCenter.
std::unordered_map< SCH_SHEET_PATH, SCH_ITEM_SET > m_connected_items
Store pointers to other items that are connected to this one, per sheet.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
virtual int GetPenWidth() const
PLOT_DASH_TYPE
Dashed line types.
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
virtual bool IsLocked() const
Base plotter engine class.
virtual bool IsPointClickableAnchor(const wxPoint &aPos) const
DANGLING_END_ITEM(DANGLING_END_T aType, EDA_ITEM *aItem, const wxPoint &aPosition)
bool operator!=(const STROKE_PARAMS &aOther)
SCH_ITEM_SET & ConnectedItems(const SCH_SHEET_PATH &aPath)
Retrieve the set of items connected to this item on the given sheet.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
Simple container to manage line stroke parameters.
void ClearConnections()
Clears all of the connection items from the list.
DANGLING_END_T GetType() const
A base class for most all the KiCad significant classes used in schematics and boards.
wxPoint m_pos
A pointer to the connectable object.
virtual wxString GetClass() const override
Return the class name.
virtual bool operator<(const SCH_ITEM &aItem) const
void SetColor(const COLOR4D &aColor)
virtual bool doIsConnected(const wxPoint &aPosition) const
Provide the object specific test to see if it is connected to aPosition.
virtual bool IsDangling() const
Helper class used to store the state of schematic items that can be connected to other schematic item...
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
bool operator==(const DANGLING_END_ITEM &aB) const
void SetStoredPos(const wxPoint &aPos)
Base class for any item which can be embedded within the SCHEMATIC container class,...
bool IsConnected(const wxPoint &aPoint) const
Test the item to see if it is connected to aPoint.
SCH_ITEM & operator=(const SCH_ITEM &aPin)
const EDA_ITEM * m_parent
The type of connection of m_item.
PLOT_DASH_TYPE m_plotstyle
void SetConnectivityDirty(bool aDirty=true)
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType)
A color representation with 4 components: red, green, blue, alpha.
virtual void Move(const wxPoint &aMoveVector)=0
Move the item by aMoveVector to a new position.