28#include <unordered_map>
47class NETLIST_OBJECT_LIST;
163 return wxT(
"SCH_ITEM" );
166 bool IsType(
const std::vector<KICAD_T>& aScanTypes )
const override
171 for(
KICAD_T scanType : aScanTypes )
270 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
341 virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {}
497 virtual void Plot(
PLOTTER* aPlotter,
bool aBackground,
Calculate the connectivity of a schematic and generates netlists.
Helper class used to store the state of schematic items that can be connected to other schematic item...
const EDA_ITEM * m_parent
The type of connection of m_item.
bool operator==(const DANGLING_END_ITEM &aB) const
DANGLING_END_T m_type
The position of the connection point.
bool operator!=(const DANGLING_END_ITEM &aB) const
DANGLING_END_ITEM(DANGLING_END_T aType, EDA_ITEM *aItem, const VECTOR2I &aPosition)
DANGLING_END_T GetType() const
bool operator<(const DANGLING_END_ITEM &rhs) const
DANGLING_END_ITEM(DANGLING_END_T aType, EDA_ITEM *aItem, const VECTOR2I &aPosition, const EDA_ITEM *aParent)
VECTOR2I m_pos
A pointer to the connectable object.
const EDA_ITEM * GetParent() 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 bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Base plotter engine class.
Holds all the data relating to one schematic.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual bool GetExcludedFromSim() const
void SetStoredPos(const VECTOR2I &aPos)
virtual void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset)=0
Print a schematic item.
virtual bool CanConnect(const SCH_ITEM *aItem) const
virtual bool IsConnectable() const
virtual bool IsLocked() const
virtual int GetPenWidth() const
SCH_ITEM & operator=(const SCH_ITEM &aPin)
virtual bool doIsConnected(const VECTOR2I &aPosition) const
Provide the object specific test to see if it is connected to aPosition.
virtual void MirrorVertically(int aCenter)=0
Mirror item vertically about aCenter.
virtual void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList)
Add the schematic item end points to aItemList if the item has end points.
const wxString & GetDefaultFont() const
virtual wxString GetClass() const override
Return the class name.
virtual const wxString & GetCachedDriverName() const
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual void SetLastResolvedState(const SCH_ITEM *aItem)
virtual bool IsDangling() const
virtual bool IsPointClickableAnchor(const VECTOR2I &aPos) const
SCH_CONNECTION * InitializeConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
Create a new connection object associated with this object.
void ClearConnections()
Clears all of the connection items from the list.
void AddConnectionTo(const SCH_SHEET_PATH &aPath, SCH_ITEM *aItem)
Add a connection link between this item and another.
SCH_ITEM_SET & ConnectedItems(const SCH_SHEET_PATH &aPath)
Retrieve the set of items connected to this item on the given sheet.
std::map< SCH_SHEET_PATH, SCH_ITEM_SET, SHEET_PATH_CMP > m_connected_items
Store pointers to other items that are connected to this one, per sheet.
virtual void SetLocked(bool aLocked)
Set the 'lock' status to aLocked for of this item.
virtual void MirrorHorizontally(int aCenter)=0
Mirror item horizontally about aCenter.
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
virtual void PrintBackground(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset)
Print the (optional) backaground elements if they exist.
bool m_connectivity_dirty
void ClearFieldsAutoplaced()
virtual void ClearCaches()
void SetLayer(SCH_LAYER_ID aLayer)
Set the layer this item is on.
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
virtual double Similarity(const SCH_ITEM &aItem) const =0
Return a measure of how likely the other object is to represent the same object.
FIELDS_AUTOPLACED GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
virtual void SetStroke(const STROKE_PARAMS &aStroke)
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction)
virtual void SwapData(SCH_ITEM *aItem)
Swap the internal data structures aItem with the schematic item.
void SetConnectivityDirty(bool aDirty=true)
virtual void Move(const VECTOR2I &aMoveVector)=0
Move the item by aMoveVector to a new position.
void SetFieldsAutoplaced()
FIELDS_AUTOPLACED m_fieldsAutoplaced
bool RenderAsBitmap(double aWorldScale) const override
virtual bool operator==(const SCH_ITEM &aItem) const =0
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.
virtual void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_SETTINGS &aPlotSettings) const
Plot the schematic item to aPlotter.
bool IsConnectivityDirty() const
virtual void SetExcludedFromSim(bool aExclude)
void SetConnectionGraph(CONNECTION_GRAPH *aGraph)
Updates the connection graph for all connections in this item.
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
bool IsConnected(const VECTOR2I &aPoint) const
Test the item to see if it is connected to aPoint.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
std::unordered_map< SCH_SHEET_PATH, SCH_CONNECTION * > m_connection_map
Store connectivity information, per sheet.
virtual bool HasCachedDriverName() const
virtual bool operator<(const SCH_ITEM &aItem) const
virtual bool IsHypertext() const
Allow items to support hypertext actions when hovered/clicked.
SCH_CONNECTION * GetOrInitConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
virtual bool IsMovableFromAnchorPoint() const
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
virtual void DoHypertextAction(EDA_DRAW_FRAME *aFrame) const
VECTOR2I & GetStoredPos()
const KIFONT::METRICS & GetFontMetrics() const
virtual void Rotate(const VECTOR2I &aCenter)=0
Rotate the item around aCenter 90 degrees in the clockwise direction.
virtual STROKE_PARAMS GetStroke() const
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
virtual bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const
Return true if this item should propagate connection info to aItem.
virtual std::vector< VECTOR2I > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Simple container to manage line stroke parameters.
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
SCH_LAYER_ID
Eeschema drawing layers.
#define DECLARE_ENUM_TO_WXANY(type)
std::vector< SCH_ITEM * > SCH_ITEM_SET
@ FIELDS_AUTOPLACED_MANUAL
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T