47#define BITMAP_FONT_SIZE_THRESHOLD 3
120 return static_cast<SCHEMATIC*
>( parent );
168 conn->SetGraph( aGraph );
170 for(
auto& member : conn->AllMembers() )
171 member->SetGraph( aGraph );
178 static std::shared_ptr<NETCLASS> nullNetclass = std::make_shared<NETCLASS>( wxEmptyString );
188 return netSettings->GetEffectiveNetClass( connection->
Name() );
190 return netSettings->m_DefaultNetClass;
208 if( set.size() == set.capacity() )
209 set.reserve( set.size() + 4096 );
211 set.emplace_back( aItem );
256 static wxString s_empty;
290 auto clearTextCaches =
297 text->ClearBoundingBoxCache();
298 text->ClearRenderCache();
302 clearTextCaches(
this );
334 return schematic->Settings().m_FontMetrics;
354 wxFAIL_MSG( wxT(
"Plot() method not implemented for class " ) +
GetClass() );
365 if( layerEnum.
Choices().GetCount() == 0 )
369 for(
SCH_LAYER_ID value : magic_enum::enum_values<SCH_LAYER_ID>() )
Calculates the connectivity of a schematic and generates netlists.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
EDA_ITEM_FLAGS GetEditFlags() const
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
EDA_ITEM_FLAGS GetTempFlags() const
EDA_ITEM * GetParent() const
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
ENUM_MAP & Undefined(T aValue)
static const METRICS & Default()
Base plotter engine class.
std::shared_ptr< NET_SETTINGS > m_NetSettings
Net settings for this project (owned here)
virtual PROJECT_FILE & GetProjectFile() const
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()
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
void Reset()
Clears connectivity information.
wxString Name(bool aIgnoreSheet=false) const
void SetGraph(CONNECTION_GRAPH *aGraph)
void SetSheet(SCH_SHEET_PATH aSheet)
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual bool IsConnectable() const
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType)
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.
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.
SCH_CONNECTION * InitializeConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
Create a new connection object associated with this object.
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.
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
bool m_connectivity_dirty
virtual void ClearCaches()
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.
FIELDS_AUTOPLACED m_fieldsAutoplaced
bool RenderAsBitmap(double aWorldScale) const override
void SetConnectionGraph(CONNECTION_GRAPH *aGraph)
Updates the connection graph for all connections in this item.
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 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)
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
const KIFONT::METRICS & GetFontMetrics() const
virtual void Plot(PLOTTER *aPlotter, bool aBackground) const
Plot the schematic item to aPlotter.
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
#define BRIGHTENED
item is drawn with a bright contour
#define SELECTED
Item was manually selected by the user.
#define STRUCT_DELETED
flag indication structures to be erased
#define SKIP_STRUCT
flag indicating that the structure should be ignored
std::uint32_t EDA_ITEM_FLAGS
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
SCH_LAYER_ID
Eeschema drawing layers.
@ LAYER_SELECTION_SHADOWS
#define UNIMPLEMENTED_FOR(type)
#define IMPLEMENT_ENUM_TO_WXANY(type)
#define BITMAP_FONT_SIZE_THRESHOLD
static struct SCH_ITEM_DESC _SCH_ITEM_DESC
std::vector< SCH_ITEM * > SCH_ITEM_SET
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
wxLogTrace helper definitions.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.