82 static std::atomic<uint64_t> lastId{ 0 };
119 wxT(
"SCH_SCREEN must have a SCHEMATIC parent!" ) );
127 for(
const std::pair<const wxString, LIB_SYMBOL*>& libSymbol :
m_libSymbols )
128 delete libSymbol.second;
152 wxCHECK_RET(
m_refCount != 0, wxT(
"Screen reference count already zero. Bad programmer!" ) );
161 return sheets.
begin() != sheets.
end();
206 std::vector<wxString> matches;
209 foundSymbol =
nullptr;
211 for(
const wxString& libSymbolName : matches )
218 foundSymbol = it->second;
220 wxCHECK2( foundSymbol,
continue );
230 newName = libSymbolName;
236 foundSymbol =
nullptr;
243 newName.Printf( wxT(
"%s_%d" ),
250 newName.Printf( wxT(
"%s_%d" ),
264 LIB_ID newLibId( wxEmptyString, newName );
268 newLibSymbol->
SetName( newName );
298 wxCHECK_RET( aScreen,
"Invalid screen object." );
305 aScreen->
Clear(
false );
335 std::vector<SCH_ITEM*> delete_list;
337 std::copy_if(
m_rtree.begin(),
m_rtree.end(), std::back_inserter( delete_list ),
340 return ( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T );
352 if(
Remove( aItem, aUpdateLibSymbol ) )
353 Append( aItem, aUpdateLibSymbol );
366 bool retv =
m_rtree.remove( aItem );
396 if( alternate.Format().wx_str() == aName )
414 wxCHECK_RET( aItem, wxT(
"Cannot delete invalid item from screen." ) );
428 wxCHECK_RET( sheet, wxT(
"Sheet pin parent not properly set, bad programmer!" ) );
439 return m_rtree.contains( aItem,
true );
451 if( item->HitTest( aPosition, aAccuracy ) )
461#define PROCESSED CANDIDATE
463 std::set<SCH_ITEM*> retval;
464 std::stack<SCH_ITEM*> toSearch;
466 auto getItemEndpoints = [](
SCH_ITEM* aCandidate ) -> std::vector<VECTOR2I>
494 if( !aItem || getItemEndpoints( aItem ).
empty() )
497 toSearch.push( aItem );
499 while( !toSearch.empty() )
513 for(
SCH_ITEM* candidate :
Items().Overlapping( type, bbox ) )
518 std::vector<VECTOR2I> endpoints = getItemEndpoints( candidate );
520 if( endpoints.empty() )
524 if( item->
GetLayer() != candidate->GetLayer() )
527 bool sharesEndpoint =
false;
529 for(
const VECTOR2I& pt : endpoints )
533 sharesEndpoint =
true;
540 retval.insert( junction );
545 if( !sharesEndpoint )
548 toSearch.push( candidate );
549 retval.insert( candidate );
555 item->ClearTempFlags();
565 return info.isJunction;
574 return info.AllowsExplicitJunction();
583 return info.AllowsExplicitJunction() && !
info.hasExplicitJunctionDot;
592 return info.AllowsExplicitJunction();
600 auto ret = aDefaultOrientation;
607 switch( item->Type() )
612 if( busEntry->m_connected_bus_item )
616 auto bus =
static_cast<const SCH_LINE*
>( busEntry->m_connected_bus_item );
617 if( bus->Angle().AsDegrees() == 90.0 )
621 if( aPosition.
x < bus->GetPosition().x )
623 else if( aPosition.
x > bus->GetPosition().x )
626 else if( bus->Angle().AsDegrees() == 0.0 )
630 if( aPosition.
y < bus->GetPosition().y )
632 else if( aPosition.
y > bus->GetPosition().y )
641 auto line =
static_cast<const SCH_LINE*
>( item );
645 if( -45 < angle && angle <= 45 )
647 if( line->GetStartPoint().x <= line->GetEndPoint().x )
654 if( line->GetStartPoint().y <= line->GetEndPoint().y )
668 if(
pin->GetPosition() == aPosition )
688 wxT(
"Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );
701 if( sheetPin && sheetPin->
IsConnected( aPosition ) )
724 if(
GetPin( aPosition,
nullptr,
true ) )
737 if( sheetPin && sheetPin->
IsConnected( aPosition ) )
753 wxCHECK_RET(
Schematic(),
"Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" );
756 std::vector<SCH_SYMBOL*> symbols;
767 symbols.push_back(
static_cast<SCH_SYMBOL*
>( item ) );
781 auto it =
m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
787 msg.Printf(
_(
"Setting schematic symbol '%s %s' library identifier to '%s'." ),
795 symbol->SetLibSymbol(
new LIB_SYMBOL( *it->second ) );
799 if( !symbol->GetLibId().IsValid() && !( aLegacyLibs && symbol->GetLibId().IsLegacy() ) )
803 msg.Printf(
_(
"Schematic symbol reference '%s' library identifier is not valid. "
804 "Unable to link library symbol." ),
815 std::optional<LIBRARY_TABLE_ROW*> libRow = libs->
GetRow( symbol->GetLibId().GetLibNickname() );
816 bool hasLibraryRow = libRow.has_value();
817 bool hasLoadedLibrary = libs->
HasLibrary( symbol->GetLibId().GetLibNickname() );
819 if( !hasLibraryRow && !legacyLibs )
823 msg.Printf(
_(
"Symbol library '%s' not found and no fallback cache library "
824 "available. Unable to link library symbol." ),
825 symbol->GetLibId().GetLibNickname().wx_str() );
832 if( hasLibraryRow && !hasLoadedLibrary )
834 libs->
LoadOne( symbol->GetLibId().GetLibNickname() );
835 hasLoadedLibrary = libs->
HasLibrary( symbol->GetLibId().GetLibNickname() );
838 if( hasLoadedLibrary )
848 msg.Printf(
_(
"I/O error %s resolving library symbol %s" ), ioe.
What(),
860 wxCHECK2( legacyCacheLib.
IsCache(),
continue );
862 wxString
id = symbol->GetLibId().Format();
864 id.Replace(
':',
'_' );
868 msg.Printf(
_(
"Falling back to cache to set symbol '%s:%s' link '%s'." ),
881 std::unique_ptr<LIB_SYMBOL> libSymbol = tmp->
Flatten();
882 libSymbol->SetParent();
884 m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
889 msg.Printf(
_(
"Setting schematic symbol '%s %s' library identifier to '%s'." ),
896 symbol->SetLibSymbol( libSymbol.release() );
902 msg.Printf(
_(
"No library symbol found for schematic symbol '%s %s'." ),
921 std::vector<SCH_SYMBOL*> symbols;
924 symbols.push_back(
static_cast<SCH_SYMBOL*
>( item ) );
931 auto it =
m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
934 symbol->SetLibSymbol(
new LIB_SYMBOL( *it->second ) );
936 symbol->SetLibSymbol(
nullptr );
960 switch( aItem->
Type() )
986 auto [it, inserted] =
index.emplace( aItem->m_Uuid, aItem );
988 if( !inserted && it->second != aItem )
989 it->second =
nullptr;
1016 std::vector<SCH_ITEM*> items;
1017 items.reserve(
Items().size() );
1020 items.push_back( item );
1022 Plot( aPlotter, aPlotOpts, items );
1029 std::vector<SCH_ITEM*> junctions;
1030 std::vector<SCH_ITEM*> bitmaps;
1031 std::vector<SCH_SYMBOL*> symbols;
1032 std::vector<SCH_ITEM*> other;
1033 double hopOverScale = 0.0;
1036 if( !aItems.empty() && aItems[0]->Schematic() )
1038 hopOverScale = aItems[0]->Schematic()->Settings().GetHopOverScale();
1039 defaultLineWidth = aItems[0]->Schematic()->Settings().m_DefaultLineWidth;
1044 if( item->IsMoving() )
1048 junctions.push_back( item );
1050 bitmaps.push_back( item );
1052 other.push_back( item );
1063 symbols.push_back(
static_cast<SCH_SYMBOL*
>( item ) );
1071 std::sort( other.begin(), other.end(),
1074 if( a->Type() == b->Type() )
1075 return a->GetLayer() > b->GetLayer();
1077 return a->Type() > b->Type();
1081 constexpr bool background =
true;
1089 item->Plot( aPlotter, background, aPlotOpts, 0, 0, { 0, 0 }, false );
1096 item->Plot( aPlotter, background, aPlotOpts, 0, 0, { 0, 0 }, false );
1102 double lineWidth = item->GetEffectivePenWidth( renderSettings );
1107 item->Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
1115 item->Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
1119 double arcRadius = defaultLineWidth * hopOverScale;
1127 for(
size_t ii = 1; ii < curr_wire_shape.size(); ii++ )
1129 VECTOR2I start( curr_wire_shape[ii-1].x, curr_wire_shape[ii-1].y );
1131 if( curr_wire_shape[ii-1].z == 0 )
1134 VECTOR2I end( curr_wire_shape[ii].x, curr_wire_shape[ii].y );
1141 curr_line.
Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
1145 VECTOR2I arc_middle( curr_wire_shape[ii].x, curr_wire_shape[ii].y );
1147 VECTOR2I arc_end( curr_wire_shape[ii].x, curr_wire_shape[ii].y );
1156 arc.
Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
1165 TRANSFORM savedTransform = renderSettings->m_Transform;
1172 renderSettings->m_Transform = sym->GetTransform();
1175 bool dnp = sym->GetDNP( sheet, variant );
1177 for(
SCH_FIELD field : sym->GetFields() )
1179 field.ClearRenderCache();
1180 field.Plot( aPlotter,
false, aPlotOpts, sym->GetUnit(), sym->GetBodyStyle(), { 0, 0 }, dnp );
1182 if( sym->IsSymbolLikePowerLocalLabel()
1184 && ( field.IsVisible() || field.IsForceVisible() ) )
1186 sym->PlotLocalPowerIconShape( aPlotter );
1190 sym->PlotPins( aPlotter, dnp );
1192 if( dnp &&
Schematic()->Settings().m_ShowDNPMarkers )
1193 sym->PlotDNP( aPlotter );
1196 renderSettings->m_Transform = savedTransform;
1201 item->Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
1209 item->ClearTempFlags();
1214 bool aEndPointOnly )
const
1221 candidate =
static_cast<SCH_SYMBOL*
>( item );
1251 if(
pin && aSymbol )
1252 *aSymbol = candidate;
1266 sheetPin = sheet->
GetPin( aPosition );
1282 if( ( item->Type() !=
SCH_JUNCTION_T || aTestJunctions ) && item->IsConnected( aPos ) )
1320 static const std::vector<KICAD_T> hierarchicalTypes = {
SCH_SYMBOL_T,
1326 if( item->IsType( hierarchicalTypes ) )
1327 aItems->push_back( item );
1335 aItems->push_back( item );
1337 std::sort( aItems->begin(), aItems->end(),
1340 if( a->GetPosition().x == b->GetPosition().x )
1343 if( a->GetPosition().y == b->GetPosition().y )
1344 return a->m_Uuid < b->m_Uuid;
1346 return a->GetPosition().y < b->GetPosition().y;
1350 return a->GetPosition().x < b->GetPosition().x;
1357 std::function<
void(
SCH_ITEM* )>* aChangedHandler )
const
1361 std::vector<DANGLING_END_ITEM> endPointsByPos;
1362 std::vector<DANGLING_END_ITEM> endPointsByType;
1367 if( item->IsConnectable() )
1368 item->GetEndPoints( endPointsByType );
1374 if( item->UpdateDanglingState( endPointsByType, endPointsByPos, aPath ) )
1376 if( aChangedHandler )
1377 ( *aChangedHandler )( item );
1387 PROF_TIMER sortTimer(
"SCH_SCREEN::TestDanglingEnds pre-sort" );
1388 endPointsByPos = endPointsByType;
1397 update_state( item );
1410 aAccuracy = std::max( aAccuracy, 1 );
1412 for(
SCH_ITEM* item :
Items().Overlapping( aPosition, aAccuracy ) )
1417 if( item->GetLayer() != aLayer )
1420 if( !item->HitTest( aPosition, aAccuracy ) )
1423 switch( aSearchType )
1429 if( !( (
SCH_LINE*) item )->IsEndPoint( aPosition ) )
1434 if( ( (
SCH_LINE*) item )->IsEndPoint( aPosition ) )
1444 bool aIgnoreEndpoints )
const
1446 std::vector<SCH_LINE*> retVal;
1450 if( item->IsType( { SCH_ITEM_LOCATE_WIRE_T, SCH_ITEM_LOCATE_BUS_T } ) )
1454 if( aIgnoreEndpoints && wire->
IsEndPoint( aPosition ) )
1458 retVal.push_back( wire );
1468 std::vector<VECTOR2I> retval;
1475 std::vector<VECTOR2I> pts = item->GetConnectionPoints();
1476 retval.insert( retval.end(), pts.begin(), pts.end() );
1481 std::sort( retval.begin(), retval.end(),
1484 return a.x < b.x || ( a.x == b.x && a.y < b.y );
1487 retval.erase( std::unique( retval.begin(), retval.end() ), retval.end() );
1495 std::vector<VECTOR2I> pts;
1498 for(
const EDA_ITEM* edaItem : aItems )
1506 pts.insert( pts.end(), new_pts.begin(), new_pts.end() );
1514 for(
const VECTOR2I& pt : connections )
1517 pts.push_back( pt );
1523 std::sort( pts.begin(), pts.end(),
1526 return a.x < b.x || ( a.x == b.x && a.y < b.y );
1529 pts.erase( unique( pts.begin(), pts.end() ), pts.end() );
1532 pts.erase( std::remove_if( pts.begin(), pts.end(),
1533 [
this](
const VECTOR2I& a ) ->
bool
1535 return !IsExplicitJunctionNeeded( a );
1545 for(
SCH_ITEM* item :
Items().Overlapping( aPosition, aAccuracy ) )
1547 switch( item->Type() )
1553 if( item->HitTest( aPosition, aAccuracy ) )
1569 std::unique_ptr<LIB_SYMBOL> symbol( aLibSymbol );
1572 wxString key = symbol->GetLibId().Format().wx_str();
1579 wxCHECK( aLibSymbol, );
1581 auto insertion =
m_libSymbols.try_emplace( aKey,
nullptr );
1582 auto it = insertion.first;
1583 LIB_SYMBOL* previous = std::exchange( it->second, aLibSymbol.release() );
1594 if( alternate == aSymbol.
GetLibId() )
1597 wxString key = alternate.Format().wx_str();
1605 bool usedAsBase =
false;
1608 usedAsBase |=
static_cast<SCH_SYMBOL*
>( item )->GetSchSymbolLibraryName() == key;
1616 libSymbol->SetParent();
1621 item->ClearCaches();
1635 for(
auto& [filename, embeddedFile] : libSym->EmbeddedFileMap() )
1643 embeddedFile->data_hash = file->
data_hash;
1644 embeddedFile->is_valid = file->
is_valid;
1648 libSym->RunOnChildren(
1652 textItem->ResolveFont( embeddedFonts );
1657 std::vector<SCH_ITEM*> items_to_update;
1661 bool update =
false;
1664 update |= textItem->ResolveFont( embeddedFonts );
1666 item->RunOnChildren(
1670 update |= textItem->ResolveFont( embeddedFonts );
1675 items_to_update.push_back( item );
1678 for(
SCH_ITEM* item : items_to_update )
1686 schematic->AddBusAlias( aAlias );
1727 std::vector<wxString>& aMatches )
1732 aMatches.emplace_back( searchName );
1741 if( pair.first.StartsWith( searchName, &suffix ) && suffix.ToLong( &tmp ) )
1742 aMatches.emplace_back( pair.first );
1745 return aMatches.size();
1757 if( aProjectName.IsEmpty() )
1764 wxCHECK2( symbol,
continue );
1766 std::set<KIID_PATH> pathsToPrune;
1767 const std::vector<SCH_SYMBOL_INSTANCE> instances = symbol->
GetInstances();
1772 if( aProjectName != instance.m_ProjectName )
1775 std::optional<SCH_SHEET_PATH> pathFound =
1781 pathsToPrune.emplace( instance.m_Path );
1782 else if( pathFound.value().LastScreen() !=
this )
1783 pathsToPrune.emplace( pathFound.value().Path() );
1786 for(
const KIID_PATH& sheetPath : pathsToPrune )
1789 aProjectName, sheetPath.AsString() );
1804 if( aProjectName.IsEmpty() )
1811 wxCHECK2( sheet,
continue );
1813 std::set<KIID_PATH> pathsToPrune;
1814 const std::vector<SCH_SHEET_INSTANCE> instances = sheet->
GetInstances();
1819 if( aProjectName != instance.m_ProjectName )
1822 std::optional<SCH_SHEET_PATH> pathFound =
1828 pathsToPrune.emplace( instance.m_Path );
1829 else if( pathFound.value().LastScreen() !=
this )
1830 pathsToPrune.emplace( pathFound.value().Path() );
1833 for(
const KIID_PATH& sheetPath : pathsToPrune )
1836 aProjectName, sheetPath.AsString() );
1845 wxString trimmedFieldName;
1851 wxCHECK2( symbol,
continue );
1855 trimmedFieldName = field.GetName();
1856 trimmedFieldName.Trim();
1857 trimmedFieldName.Trim(
false );
1859 if( field.GetName() != trimmedFieldName )
1870 std::set<wxString> retv;
1876 wxCHECK2( sheet,
continue );
1878 retv.emplace( sheet->
GetName() );
1895 const std::vector<SCH_SYMBOL_INSTANCE> symbolInstances = symbol->
GetInstances();
1899 if( !hierarchy.
HasPath( instance.m_Path ) )
1908 const std::vector<SCH_SHEET_INSTANCE> sheetInstances = sheet->
GetInstances();
1912 if( !hierarchy.
HasPath( instance.m_Path ) )
1929 return wxEmptyString;
1948 std::unordered_set<EDA_GROUP*> knownCycleFreeGroups;
1950 std::unordered_set<EDA_GROUP*> currentChainGroups;
1952 std::unordered_set<EDA_GROUP*> toCheckGroups;
1956 toCheckGroups.insert(
static_cast<SCH_GROUP*
>( item ) );
1958 while( !toCheckGroups.empty() )
1960 currentChainGroups.clear();
1965 if( currentChainGroups.find(
group ) != currentChainGroups.end() )
1970 return "Cycle detected in group membership";
1972 else if( knownCycleFreeGroups.find(
group ) != knownCycleFreeGroups.end() )
1978 currentChainGroups.insert(
group );
1980 toCheckGroups.erase(
group );
1982 group =
group->AsEdaItem()->GetParentGroup();
1993 knownCycleFreeGroups.insert( currentChainGroups.begin(), currentChainGroups.end() );
2006 wxFileName thisProjectFn(
Schematic()->Project().GetProjectFullName() );
2008 wxCHECK( thisProjectFn.IsAbsolute(),
false );
2010 if( thisScreenFn.GetDirCount() < thisProjectFn.GetDirCount() )
2013 while( thisProjectFn.GetDirCount() != thisScreenFn.GetDirCount() )
2014 thisScreenFn.RemoveLastDir();
2016 return thisScreenFn.GetPath() == thisProjectFn.GetPath();
2022 std::set<wxString> variantNames;
2028 wxCHECK2( symbol,
continue );
2030 const std::vector<SCH_SYMBOL_INSTANCE> symbolInstances = symbol->
GetInstances();
2034 for(
const auto& [
name, variant] : instance.m_Variants )
2035 variantNames.emplace(
name );
2043 wxCHECK2( sheet,
continue );
2045 const std::vector<SCH_SHEET_INSTANCE> sheetInstances = sheet->
GetInstances();
2049 for(
const auto& [
name, variant] : instance.m_Variants )
2050 variantNames.emplace(
name );
2054 return variantNames;
2060 wxCHECK( !aVariantName.IsEmpty(), );
2066 wxCHECK2( symbol,
continue );
2068 std::vector<SCH_SYMBOL_INSTANCE> symbolInstances = symbol->
GetInstances();
2072 if( instance.m_Variants.contains( aVariantName ) )
2075 aCommit->
Modify( item,
this );
2086 wxCHECK2( sheet,
continue );
2088 std::vector<SCH_SHEET_INSTANCE> sheetInstances = sheet->
GetInstances();
2092 if( instance.m_Variants.contains( aVariantName ) )
2095 aCommit->
Modify( item,
this );
2107 wxCHECK( !aOldName.IsEmpty() && !aNewName.IsEmpty(), );
2113 wxCHECK2( symbol,
continue );
2115 std::vector<SCH_SYMBOL_INSTANCE> symbolInstances = symbol->
GetInstances();
2119 if( instance.m_Variants.contains( aOldName ) )
2122 aCommit->
Modify( item,
this );
2124 symbol->
RenameVariant( instance.m_Path, aOldName, aNewName );
2133 wxCHECK2( sheet,
continue );
2135 std::vector<SCH_SHEET_INSTANCE> sheetInstances = sheet->
GetInstances();
2139 if( instance.m_Variants.contains( aOldName ) )
2142 aCommit->
Modify( item,
this );
2144 sheet->
RenameVariant( instance.m_Path, aOldName, aNewName );
2154 wxCHECK( !aSourceVariant.IsEmpty() && !aNewVariant.IsEmpty(), );
2160 wxCHECK2( symbol,
continue );
2162 std::vector<SCH_SYMBOL_INSTANCE> symbolInstances = symbol->
GetInstances();
2166 if( instance.m_Variants.contains( aSourceVariant ) )
2169 aCommit->
Modify( item,
this );
2171 symbol->
CopyVariant( instance.m_Path, aSourceVariant, aNewVariant );
2180 wxCHECK2( sheet,
continue );
2182 std::vector<SCH_SHEET_INSTANCE> sheetInstances = sheet->
GetInstances();
2186 if( instance.m_Variants.contains( aSourceVariant ) )
2189 aCommit->
Modify( item,
this );
2191 sheet->
CopyVariant( instance.m_Path, aSourceVariant, aNewVariant );
2199void SCH_SCREEN::Show(
int nestLevel, std::ostream& os )
const
2202 NestedSpace( nestLevel, os ) <<
'<' <<
GetClass().Lower().mb_str() <<
">\n";
2205 item->Show( nestLevel + 1, os );
2207 NestedSpace( nestLevel, os ) <<
"</" <<
GetClass().Lower().mb_str() <<
">\n";
2264 if( aScreen ==
nullptr )
2269 if( screen == aScreen )
2304 wxCHECK_RET( sch,
"Null schematic in SCH_SCREENS::ClearAnnotationOfNewSheetPaths" );
2314 bool path_exists =
false;
2316 for(
const SCH_SHEET_PATH& existing_sheetpath: aInitialSheetPathList )
2318 if( existing_sheetpath.Path() == sheetpath.Path() )
2328 SCH_SCREEN* curr_screen = sheetpath.LastScreen();
2343 std::vector<SCH_ITEM*> items;
2348 return a->
m_Uuid < b->m_Uuid;
2351 std::set<
EDA_ITEM*,
decltype( timestamp_cmp )> unique_stamps( timestamp_cmp );
2359 for(
SCH_ITEM* item : screen->Items() )
2360 items.push_back( item );
2363 if( items.size() < 2 )
2368 if( !unique_stamps.insert( item ).second )
2373 const_cast<KIID&
>( item->m_Uuid ) =
KIID();
2375 if(
SCH_SCREEN* screen = item->GetParentScreen() )
2376 screen->BumpConnectivityRevision();
2394 for(
SCH_ITEM* item : screen->Items() )
2395 item->ClearEditFlags();
2406 if( item == aMarker )
2408 screen->DeleteItem( item );
2417 bool aIncludeExclusions )
2421 std::vector<SCH_ITEM*> markers;
2426 std::shared_ptr<RC_ITEM>rcItem = marker->
GetRCItem();
2429 && ( aErrorCode ==
ERCE_UNSPECIFIED || rcItem->GetErrorCode() == aErrorCode )
2430 && ( !marker->
IsExcluded() || aIncludeExclusions ) )
2432 markers.push_back( item );
2437 screen->DeleteItem( marker );
2443 bool aIncludeExclusions )
2452 screen->UpdateSymbolLinks( aReporter );
2461 wxCHECK_RET( sch,
"Null schematic in SCH_SCREENS::UpdateSymbolLinks" );
2470 bool has_symbols =
false;
2485 return has_symbols ? true :
false;
2498 if( !nickname.
empty() && ( aLibNicknames.Index( nickname ) == wxNOT_FOUND ) )
2499 aLibNicknames.Add( nickname );
2503 return aLibNicknames.GetCount();
2536 if( screen->GetFileName() == aSchematicFileName )
2553 wxCHECK_RET( sch,
"Null schematic in SCH_SCREENS::BuildClientSheetPathList" );
2560 curr_screen->GetClientSheetPaths().clear();
2564 SCH_SCREEN* used_screen = sheetpath.LastScreen();
2569 if( used_screen == curr_screen )
2571 curr_screen->GetClientSheetPaths().push_back( sheetpath );
2582 screen->SetLegacySymbolInstanceData();
2589 screen->FixLegacyPowerSymbolMismatches();
2611 if( aProjectName.IsEmpty() )
2615 screen->PruneOrphanedSymbolInstances( aProjectName, aValidSheetPaths );
2622 if( aProjectName.IsEmpty() )
2626 screen->PruneOrphanedSheetInstances( aProjectName, aValidSheetPaths );
2634 if( screen->HasSymbolFieldNamesWithWhiteSpace() )
2644 std::set<wxString> variantNames;
2648 for(
const wxString& variantName : screen->GetVariantNames() )
2649 variantNames.emplace( variantName );
2652 return variantNames;
2658 wxCHECK( !aVariantName.IsEmpty(), );
2661 screen->DeleteVariant( aVariantName, aCommit );
2668 wxCHECK( !aOldName.IsEmpty() && !aNewName.IsEmpty(), );
2671 screen->RenameVariant( aOldName, aNewName, aCommit );
2678 wxCHECK( !aSourceVariant.IsEmpty() && !aNewVariant.IsEmpty(), );
2681 screen->CopyVariant( aSourceVariant, aNewVariant, aCommit );
constexpr EDA_IU_SCALE schIUScale
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
bool m_Center
Center on screen.
int m_pageCount
The number of BASE_SCREEN objects in this design.
BASE_SCREEN(EDA_ITEM *aParent, KICAD_T aType=SCREEN_T)
void SetContentModified(bool aModified=true)
void InitDataPoints(const VECTOR2I &aPageSizeInternalUnits)
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr void SetOrigin(const Vec &pos)
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
static void sort_dangling_end_items(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos)
A set of EDA_ITEMs (i.e., without duplicates).
A base class for most all the KiCad significant classes used in schematics and boards.
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
EDA_ITEM * GetParent() const
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
std::vector< VECTOR2I > GetPolyPoints() const
Duplicate the polygon outlines into a flat list of VECTOR2I points.
void SetLineStyle(const LINE_STYLE aStyle)
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SetLineColor(const COLOR4D &aColor)
std::vector< VECTOR2I > GetRectCorners() const
virtual void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the three controlling points for an arc.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
EE_TYPE OfType(KICAD_T aType) const
EMBEDDED_FILE * GetEmbeddedFile(const wxString &aName) const
Returns the embedded file with the given name or nullptr if it does not exist.
const std::vector< wxString > * UpdateFontFiles()
Helper function to get a list of fonts for fontconfig to add to the library.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A color representation with 4 components: red, green, blue, alpha.
A collection of LIB_SYMBOL objects.
Object used to load, save, search, and otherwise manipulate symbol library files.
LIB_SYMBOL * FindSymbol(const wxString &aName) const
Find LIB_SYMBOL by aName.
void AbortAsyncLoad(bool aCancelPlugins=false)
Aborts any async load in progress; blocks until fully done aborting.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library tables.
std::optional< LIBRARY_TABLE_ROW * > GetRow(const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) const
Like LIBRARY_MANAGER::GetRow but filtered to the LIBRARY_TABLE_TYPE of this adapter.
A logical library item identifier and consists of various portions much like a URI.
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
wxString GetUniStringLibId() const
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Define a library symbol object.
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
wxString GetName() const override
EMBEDDED_FILES * GetEmbeddedFiles() override
bool IsGlobalPower() const override
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
void SetLibId(const LIB_ID &aLibId)
virtual void SetName(const wxString &aName)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
std::shared_ptr< RC_ITEM > GetRCItem() const
enum MARKER_T GetMarkerType() const
Base plotter engine class.
RENDER_SETTINGS * RenderSettings()
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
A small class to help profiling.
void Show(std::ostream &aStream=std::cerr)
Print the elapsed time (in a suitable unit) to a stream.
void Stop()
Save the time when this function was called, and set the counter stane to stop.
static SYMBOL_LIBRARY_ADAPTER * SymbolLibAdapter(PROJECT *aProject)
Accessor for project symbol library manager adapter.
static LEGACY_SYMBOL_LIBS * LegacySchLibs(PROJECT *aProject)
Returns the list of symbol libraries from a legacy (pre-5.x) design This is only used from the remapp...
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Holds all the data relating to one schematic.
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
bool HasHierarchy() const
Check if the hierarchy has been built.
wxString GetCurrentVariant() const
Return the current variant being edited.
EMBEDDED_FILES * GetEmbeddedFiles() override
void RebuildConnectivity(std::function< void(SCH_ITEM *)> *aChangedItemHandler=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr, KIGFX::SCH_VIEW *aSchView=nullptr)
SCH_SHEET_PATH & CurrentSheet() const
Class for a wire to bus entry.
Commit for the schematic and symbol editors.
A set of SCH_ITEMs (i.e., without duplicates).
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual bool IsEndPoint(const VECTOR2I &aPt) const
Test if aPt is an end point of this schematic object.
virtual bool IsConnectable() const
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
bool IsConnected(const VECTOR2I &aPoint) const
Test the item to see if it is connected to aPoint.
virtual std::vector< VECTOR2I > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
Segment description base class to describe items which have 2 end points (track, wire,...
void SetStartPoint(const VECTOR2I &aPosition)
std::vector< VECTOR3I > BuildWireWithHopShape(const SCH_SCREEN *aScreen, double aArcRadius) const
For wires only: build the list of points to draw the shape using segments and 180 deg arcs Points are...
bool IsWire() const
Return true if the line is a wire.
LINE_STYLE GetEffectiveLineStyle() const
EDA_ANGLE Angle() const
Get the angle between the start and end lines.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
VECTOR2I GetEndPoint() const
VECTOR2I GetStartPoint() const
bool IsBus() const
Return true if the line is a bus.
void SetLineStyle(const LINE_STYLE aStyle)
bool IsEndPoint(const VECTOR2I &aPoint) const override
Test if aPt is an end point of this schematic object.
KIGFX::COLOR4D GetLineColor() const
Return COLOR4D::UNSPECIFIED if a custom color hasn't been set for this line.
void SetLineColor(const KIGFX::COLOR4D &aColor)
void SetEndPoint(const VECTOR2I &aPosition)
std::vector< SCH_SHEET * > m_sheets
SCH_SCREEN * GetScreen(unsigned int aIndex) const
void UpdateSymbolLinks(REPORTER *aReporter=nullptr)
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in the full schematic.
void DeleteMarker(SCH_MARKER *aMarker)
Delete a specific marker.
void DeleteMarkers(enum MARKER_BASE::MARKER_T aMarkerTyp, int aErrorCode, bool aIncludeExclusions=true)
Delete all markers of a particular type and error code.
void buildScreenList(SCH_SHEET *aSheet)
void FixLegacyPowerSymbolMismatches()
Fix legacy power symbols that have mismatched value text fields and invisible power pin names.
void CopyVariant(const wxString &aSourceVariant, const wxString &aNewVariant, SCH_COMMIT *aCommit=nullptr)
void DeleteAllMarkers(enum MARKER_BASE::MARKER_T aMarkerType, bool aIncludeExclusions)
Delete all electronic rules check markers of aMarkerType from all the screens in the list.
void PruneOrphanedSheetInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
int ChangeSymbolLibNickname(const wxString &aFrom, const wxString &aTo)
Change all of the symbol library nicknames.
void RenameVariant(const wxString &aOldName, const wxString &aNewName, SCH_COMMIT *aCommit=nullptr)
SCH_SCREENS(SCH_SHEET *aSheet)
void BuildClientSheetPathList()
Build the list of sheet paths sharing a screen for each screen in use.
bool HasSymbolFieldNamesWithWhiteSpace() const
void ClearAnnotationOfNewSheetPaths(SCH_SHEET_LIST &aInitialSheetPathList)
Clear the annotation for the symbols inside new sheetpaths when a complex hierarchy is modified and n...
void PruneOrphanedSymbolInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
bool HasNoFullyDefinedLibIds()
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.
SCH_SHEET * GetSheet(unsigned int aIndex) const
int ReplaceDuplicateTimeStamps()
Test all sheet and symbol objects in the schematic for duplicate time stamps and replaces them as nec...
std::set< wxString > GetVariantNames() const
std::vector< SCH_SCREEN * > m_screens
void DeleteVariant(const wxString &aVariantName, SCH_COMMIT *aCommit=nullptr)
bool HasSchematic(const wxString &aSchematicFileName)
Check if one of the schematics in the list of screens is aSchematicFileName.
size_t GetLibNicknames(wxArrayString &aLibNicknames)
Fetch all of the symbol library nicknames into aLibNicknames.
void SetLegacySymbolInstanceData()
Update the symbol value and footprint instance data for legacy designs.
void addScreenToList(SCH_SCREEN *aScreen, SCH_SHEET *aSheet)
std::set< wxString > GetVariantNames() const
std::shared_ptr< CONNECTIVITY_SOURCE > m_connectivitySource
uint64_t m_connectivitySymbolRevision
void DeleteVariant(const wxString &aVariantName, SCH_COMMIT *aCommit=nullptr)
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
SCH_PIN * GetPin(const VECTOR2I &aPosition, SCH_SYMBOL **aSymbol=nullptr, bool aEndPointOnly=false) const
Test the screen for a symbol pin item at aPosition.
bool m_fileExists
Flag to indicate the file associated with this screen has been created.
void ClearDrawingState()
Clear the state flags of all the items in the screen.
SCH_LINE * GetLine(const VECTOR2I &aPosition, int aAccuracy=0, int aLayer=LAYER_NOTES, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Return a line item located at aPosition.
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
void AddLibSymbol(LIB_SYMBOL *aLibSymbol)
Add aLibSymbol to the library symbol map.
bool HasSymbolFieldNamesWithWhiteSpace() const
void AddBusAlias(std::shared_ptr< BUS_ALIAS > aAlias)
Add a bus alias definition.
void FixLegacyPowerSymbolMismatches()
Fix legacy power symbols that have mismatched value text fields and invisible power pin names.
bool HasItems(KICAD_T aItemType) const
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
bool HasInstanceDataFromOtherProjects() const
Check symbols for instance data from other projects.
void PruneOrphanedSymbolInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
Remove all invalid symbol instance data in this screen object for the project defined by aProjectName...
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
SCH_LINE * GetWire(const VECTOR2I &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
const uint64_t m_connectivityId
std::set< SCH_ITEM * > MarkConnections(SCH_ITEM *aItem, bool aSecondPass)
Return all wires and junctions connected to aItem which are not connected any symbol pin or all graph...
std::set< wxString > GetSheetNames() const
void TestDanglingEnds(const SCH_SHEET_PATH *aPath=nullptr, std::function< void(SCH_ITEM *)> *aChangedHandler=nullptr) const
Test all of the connectable objects in the schematic for unused connection points.
static bool IsConnectivitySource(const SCH_ITEM *aItem)
Markers, bitmaps, plain shapes, graphic lines and groups carry nothing captured by connectivity.
void EnsureAlternateReferencesExist()
For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any refere...
void PruneOrphanedSheetInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
Remove all invalid sheet instance data in this screen object for the project defined by aProjectName ...
std::vector< SCH_LINE * > GetBusesAndWires(const VECTOR2I &aPosition, bool aIgnoreEndpoints=false) const
Return buses and wires passing through aPosition.
wxString GroupsSanityCheckInternal(bool repair)
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
void UpdateDisplayBounds(SCH_ITEM *aItem)
Refresh display bounds only; the item's source and membership must be unchanged.
bool IsExplicitJunction(const VECTOR2I &aPosition) const
Indicate that a junction dot is necessary at the given location.
EE_RTREE & Items()
Get the full RTree, usually for iterating.
int m_fileFormatVersionAtLoad
SCH_ITEM * GetItem(const VECTOR2I &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
Check aPosition within a distance of aAccuracy for items of type aFilter.
bool IsExplicitJunctionAllowed(const VECTOR2I &aPosition) const
Indicate that a junction dot may be placed at the given location.
bool IsTerminalPoint(const VECTOR2I &aPosition, int aLayer) const
Test if aPosition is a connection point on aLayer.
void UpdateLocalLibSymbolLinks()
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic with the local projec...
void BumpConnectivityRevision(KICAD_T aChangedType=TYPE_NOT_INIT)
Increment the connectivity revisions of this screen.
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
static bool ClassOf(const EDA_ITEM *aItem)
void SetLegacySymbolInstanceData()
Update the symbol value and footprint instance data for legacy designs.
uint64_t m_connectivityRevision
void UpdateSymbolLinks(REPORTER *aReporter=nullptr, LEGACY_SYMBOL_LIBS *aLegacyLibs=nullptr, SYMBOL_LIBRARY_ADAPTER *aLibraries=nullptr)
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic from the project LIBR...
SCH_LINE * GetBus(const VECTOR2I &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
bool Remove(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Remove aItem from the schematic associated with this screen.
SCH_SCREEN(EDA_ITEM *aParent=nullptr)
SCHEMATIC * Schematic() const
void FixupEmbeddedData()
After loading a file from disk, the library symbols do not yet contain the full data for their embedd...
SCH_ITEM * GetConnectivityItem(const KIID &aId) const
Resolve a drawing item or a connectable child on this screen; ambiguous IDs return null.
void CopyVariant(const wxString &aSourceVariant, const wxString &aNewVariant, SCH_COMMIT *aCommit=nullptr)
void GetHierarchicalItems(std::vector< SCH_ITEM * > *aItems) const
Add all schematic sheet and symbol objects in the screen to aItems.
bool IsExplicitJunctionNeeded(const VECTOR2I &aPosition) const
Indicate that a junction dot is necessary at the given location, and does not yet exist.
SCH_SHEET_PIN * GetSheetPin(const VECTOR2I &aPosition) const
Test the screen if aPosition is a sheet label object.
wxString GroupsSanityCheck(bool repair=false)
Consistency check of internal m_groups structure.
bool InProjectPath() const
Check if the schematic file is in the current project path.
void RenameVariant(const wxString &aOldName, const wxString &aNewName, SCH_COMMIT *aCommit=nullptr)
void FreeDrawList()
Free all the items from the schematic associated with the screen.
void Plot(PLOTTER *aPlotter, const SCH_PLOT_OPTS &aPlotOpts) const
Plot all the schematic objects to aPlotter.
virtual wxString GetClass() const override
Return the class name.
void Update(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Refresh a changed item in the tree and invalidate connectivity.
std::vector< VECTOR2I > GetNeededJunctions(const std::deque< EDA_ITEM * > &aItems) const
Return the unique set of points belonging to aItems where a junction is needed.
bool IsJunction(const VECTOR2I &aPosition) const
Test if a junction is required for the items at aPosition on the screen.
bool m_isReadOnly
Read only status of the screen file.
void GetSheets(std::vector< SCH_ITEM * > *aItems) const
Similar to Items().OfType( SCH_SHEET_T ), but return the sheets in a deterministic order (L-R,...
bool CheckIfOnDrawList(const SCH_ITEM *aItem) const
std::vector< VECTOR2I > GetConnections() const
Collect a unique list of all possible connection points in the schematic.
SPIN_STYLE GetLabelOrientationForPoint(const VECTOR2I &aPosition, SPIN_STYLE aDefaultOrientation, const SCH_SHEET_PATH *aSheet) const
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath, bool aResetPrefix)
Clear the annotation for the symbols in aSheetPath on the screen.
size_t CountConnectedItems(const VECTOR2I &aPos, bool aTestJunctions) const
bool PruneUnusedLibSymbol(const wxString &aName)
Remove the library symbol cached under aName if no symbol on this screen still references that name.
void MigrateSimModels()
Migrate any symbols having V6 simulation models to their V7 equivalents.
void IncludeVariantSymbols(const SCH_SYMBOL &aSymbol, bool aRefresh=false)
Include the alternate symbols that aSymbol's variants select in the library symbols.
void DeleteItem(SCH_ITEM *aItem)
Remove aItem from the linked list and deletes the object.
size_t getLibSymbolNameMatches(const SCH_SYMBOL &aSymbol, std::vector< wxString > &aMatches)
Return a list of potential library symbol matches for aSymbol.
std::optional< std::unordered_map< KIID, SCH_ITEM * > > m_connectivityItems
SCH_LABEL_BASE * GetLabel(const VECTOR2I &aPosition, int aAccuracy=0) const
Return a label item located at aPosition.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
std::optional< SCH_SHEET_PATH > GetSheetPathByKIIDPath(const KIID_PATH &aPath, bool aIncludeLastSheet=true) const
Finds a SCH_SHEET_PATH that matches the provided KIID_PATH.
bool HasPath(const KIID_PATH &aPath) const
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
SCH_SHEET * GetParent() const
Get the parent sheet object of this sheet pin.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void CopyVariant(const KIID_PATH &aPath, const wxString &aSourceVariant, const wxString &aNewVariant)
void RemoveInstance(const KIID_PATH &aInstancePath)
SCH_SHEET_PIN * GetPin(const VECTOR2I &aPosition)
Return the sheet pin item found at aPosition in the sheet.
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
void RenameVariant(const KIID_PATH &aPath, const wxString &aOldName, const wxString &aNewName)
void DeleteVariant(const KIID_PATH &aPath, const wxString &aVariantName)
SCH_SCREEN * GetScreen() const
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
void SetLibId(const LIB_ID &aName)
SCH_ITEM * GetDrawItem(const VECTOR2I &aPosition, KICAD_T aType=TYPE_NOT_INIT)
Return the symbol library item at aPosition that is part of this symbol.
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
void RemoveInstance(const SCH_SHEET_PATH &aInstancePath)
std::vector< LIB_ID > GetVariantSymbolOverrides() const
wxString GetSchSymbolLibraryName() const
std::vector< const SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet) const
Retrieve a list of the SCH_PINs for the given sheet path.
bool AddSheetPathReferenceEntryIfMissing(const KIID_PATH &aSheetPath)
Add an instance to the alternate references list (m_instances), if this entry does not already exist.
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath, bool aResetPrefix)
Clear exiting symbol annotation.
void RenameVariant(const KIID_PATH &aPath, const wxString &aOldName, const wxString &aNewName)
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
std::vector< SCH_PIN * > GetAllLibPins() const
std::unique_ptr< LIB_SYMBOL > LoadAlternateFromLibrary(const LIB_ID &aLibId) const
Load a flattened copy of an alternate symbol from the project's symbol libraries.
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit)
Add a full hierarchical reference to this symbol.
const LIB_ID & GetLibId() const override
void SetSchSymbolLibraryName(const wxString &aName)
The name of the symbol in the schematic library symbol list.
void SetValueFieldText(const wxString &aValue, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString)
std::vector< SCH_PIN * > GetLibPins() const
Populate a vector with all the pins from the library object that match the current unit and bodyStyle...
static void BumpRefGeneration()
Mark every cache built from references as stale.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
void DeleteVariant(const KIID_PATH &aPath, const wxString &aVariantName)
void SetLibSymbol(LIB_SYMBOL *aLibSymbol)
Set this schematic symbol library symbol reference to aLibSymbol.
VECTOR2I GetPinPhysicalPosition(const SCH_PIN *Pin) const
void CopyVariant(const KIID_PATH &aPath, const wxString &aSourceVariant, const wxString &aNewVariant)
static void MigrateSimModel(T &aSymbol, const PROJECT *aProject)
Spin style for labels of all kinds on schematics.
An interface to the global shared library manager that is schematic-specific and linked to one projec...
std::optional< LIB_STATUS > LoadOne(LIB_DATA *aLib) override
Loads or reloads the given library, if it exists.
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
#define DEFAULT_LINE_WIDTH_MILS
The default line width in mils. (can be changed in preference menu)
static bool empty(const wxTextEntryBase *aCtrl)
#define STRUCT_DELETED
flag indication structures to be erased
#define IS_MOVING
Item being moved.
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
static const wxChar DanglingProfileMask[]
Flag to enable connectivity profiling.
const wxChar *const traceSchSheetPaths
Flag to enable debug output of schematic symbol sheet path manipulation code.
Definition for symbol library class.
POINT_INFO AnalyzePoint(const EE_RTREE &aItem, const VECTOR2I &aPosition, bool aBreakCrossings)
Check a tree of items for a confluence at a given point and work out what kind of junction it is,...
Class to handle a set of SCH_ITEMs.
static uint64_t nextConnectivityId()
wxString UnescapeString(const wxString &aSource)
LINE_STYLE
Dashed line types.
The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.
std::vector< char > decompressedData
std::string compressedEncodedData
A selection of information about a point in the schematic that might be eligible for turning into a j...
A simple container for sheet instance information.
A simple container for schematic symbol instance information.
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
wxLogTrace helper definitions.
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.
VECTOR2< int32_t > VECTOR2I