55#include <dialogs/dialog_image_properties.h>
64#include <dialogs/dialog_text_properties.h>
69#include <wx/textdlg.h>
78 SetIcon( BITMAPS::component_select_unit );
113 for(
int ii = 0; ii < symbol->
GetLibSymbolRef()->GetUnitCount(); ii++ )
148 wxASSERT_MSG( drawingTools,
"eeshema.InteractiveDrawing tool is not available" );
156 auto sheetHasUndefinedPins =
159 if( aSel.Size() == 1 && aSel.Front()->Type() ==
SCH_SHEET_T )
160 return static_cast<SCH_SHEET*
>( aSel.Front() )->HasUndefinedPins();
185 auto duplicateCondition =
194 auto orientCondition =
203 auto propertiesCondition =
206 if( aSel.GetSize() == 0 )
223 if( !firstItem || !eeSelection )
226 switch( firstItem->
Type() )
240 return aSel.GetSize() == 1;
245 if( std::all_of( aSel.Items().begin(), aSel.Items().end(),
249 &&
static_cast<const SCH_LINE*
>( item )->IsGraphicLine();
254 else if( std::all_of( aSel.Items().begin(), aSel.Items().end(),
262 else if( std::all_of( aSel.Items().begin(), aSel.Items().end(),
267 wxCHECK( schItem,
false );
283 auto autoplaceCondition =
297 static std::vector<KICAD_T> allTextTypes = {
SCH_LABEL_T,
363 transformMoveSubMenu->
SetTitle(
_(
"Transform Selection" ) );
364 moveMenu.
AddMenu( transformMoveSubMenu, orientCondition, 200 );
373 attribMoveSubMenu->
SetTitle(
_(
"Attributes" ) );
378 attribSimMoveSubMenu->
SetTitle(
_(
"Simulation" ) );
390 attribBOMMoveSubMenu->
SetTitle(
_(
"Bill of Materials" ) );
399 attribBoardMoveSubMenu->
SetTitle(
_(
"Exclude from board" ) );
411 attribDNPMoveSubMenu->
SetTitle(
_(
"Do not populate" ) );
423 editMoveItemSubMenu->
SetTitle(
_(
"Edit Main Fields" ) );
424 editMoveItemSubMenu->
SetIcon( BITMAPS::right );
431 std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu = std::make_shared<SYMBOL_UNIT_MENU>();
432 symUnitMenu->SetTool(
this );
455 transformDrawSubMenu->
SetTitle(
_(
"Transform Selection" ) );
456 drawMenu.
AddMenu( transformDrawSubMenu, orientCondition, 200 );
465 attribMoveSubMenu->
SetTitle(
_(
"Attributes" ) );
470 attribSimMoveSubMenu->
SetTitle(
_(
"Simulation" ) );
481 attribBOMMoveSubMenu->
SetTitle(
_(
"Bill of Materials" ) );
490 attribBoardMoveSubMenu->
SetTitle(
_(
"Exclude from board" ) );
499 attribDNPMoveSubMenu->
SetTitle(
_(
"Do not populate" ) );
510 editDrawItemSubMenu->
SetTitle(
_(
"Edit Main Fields" ) );
511 editDrawItemSubMenu->
SetIcon( BITMAPS::right );
521 std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu2 = std::make_shared<SYMBOL_UNIT_MENU>();
522 symUnitMenu2->SetTool( drawingTools );
540 transformSelSubMenu->
SetTitle(
_(
"Transform Selection" ) );
541 selToolMenu.
AddMenu( transformSelSubMenu, orientCondition, 200 );
550 attribMoveSubMenu->
SetTitle(
_(
"Attributes" ) );
555 attribSimMoveSubMenu->
SetTitle(
_(
"Simulation" ) );
566 attribBOMMoveSubMenu->
SetTitle(
_(
"Bill of Materials" ) );
575 attribBoardMoveSubMenu->
SetTitle(
_(
"Exclude from board" ) );
584 attribDNPMoveSubMenu->
SetTitle(
_(
"Do not populate" ) );
596 editSelItemSubMenu->
SetTitle(
_(
"Edit Main Fields" ) );
597 editSelItemSubMenu->
SetIcon( BITMAPS::right );
606 std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu3 = std::make_shared<SYMBOL_UNIT_MENU>();
618 convertToSubMenu->
SetTitle(
_(
"Change To" ) );
619 convertToSubMenu->
SetIcon( BITMAPS::right );
620 selToolMenu.
AddMenu( convertToSubMenu, toChangeCondition, 200 );
677 int principalItemCount = 0;
681 for(
unsigned ii = 0; ii < selection.
GetSize(); ii++ )
688 principalItemCount++;
697 if( principalItemCount == 1 )
709 switch( head->
Type() )
715 for(
int i = 0; clockwise ? i < 3 : i < 1; ++i )
716 symbol->
Rotate( rotPoint );
741 for(
int i = 0; clockwise ? i < 3 : i < 1; ++i )
774 for(
int i = 0; clockwise ? i < 3 : i < 1; ++i )
796 for(
int i = 0; clockwise ? i < 1 : i < 3; ++i )
802 for(
int i = 0; clockwise ? i < 3 : i < 1; ++i )
815 for(
int i = 0; clockwise ? i < 3 : i < 1; ++i )
816 sheet->
Rotate( rotPoint );
835 for(
unsigned ii = 0; ii < selection.
GetSize(); ii++ )
847 for(
int i = 0; clockwise ? i < 3 : i < 1; ++i )
886 field->
Rotate( rotPoint );
943 bool connections =
false;
951 switch( item->
Type() )
1041 else if( selection.
GetSize() > 1 )
1045 for(
unsigned ii = 0; ii < selection.
GetSize(); ii++ )
1098 for(
EDA_ITEM* selected : selection )
1151 if( selection.
Size() < 2 )
1155 bool appendUndo = isMoving;
1156 bool connections =
false;
1160 for(
size_t i = 0; i < sorted.size() - 1; i++ )
1166 std::swap( aPos, bPos );
1191 std::swap( aOrient, bOrient );
1209 for(
EDA_ITEM* selected : selection )
1235 if( sourceItems.empty() )
1240 bool appendUndo =
false;
1243 for(
const std::unique_ptr<SCH_ITEM>& item : sourceItems )
1282 static_cast<SCH_SYMBOL*
>( newItem )->ClearAnnotation(
nullptr,
false );
1287 annotateStartNum,
false,
false, reporter, appendUndo );
1293 newItems.
Add( newItem );
1298 if( !newItems.
Empty() )
1311 if( !newItems.
Empty() )
1314 for(
size_t ii = 1; ii < newItems.
GetSize(); ++ii )
1348 bool appendToUndo =
false;
1349 std::vector<VECTOR2I> pts;
1370 pts.insert( pts.end(), tmp_pts.begin(), tmp_pts.end() );
1387 appendToUndo =
true;
1397 static_cast<SCH_FIELD*
>( sch_item )->SetVisible(
false );
1398 appendToUndo =
true;
1406 appendToUndo =
true;
1437#define HITTEST_THRESHOLD_PIXELS 5
1454 [
this](
const VECTOR2D& aPosition ) ->
bool
1493 [
this](
const int& aFinalState )
1525 wxString translated_fieldname;
1528 caption.Printf(
_(
"Edit %s Field" ),
TitleCaps( translated_fieldname ) );
1533 caption.Printf(
_(
"Edit '%s' Field" ), aField->
GetName() );
1546 if( !commit.
Empty() )
1547 commit.
Push( caption );
1568 if( sel.
Size() != 1 )
1571 bool clearSelection = sel.
IsHover();
1592 clearSelection =
true;
1595 if( clearSelection )
1607 bool moving = head && head->
IsMoving();
1609 if( selection.
Empty() )
1612 std::vector<SCH_ITEM*> autoplaceItems;
1614 for(
unsigned ii = 0; ii < selection.
GetSize(); ii++ )
1619 autoplaceItems.push_back( item );
1624 for(
SCH_ITEM* sch_item : autoplaceItems )
1626 if( !moving && !sch_item->IsNew() )
1642 if( !commit.
Empty() )
1643 commit.
Push(
_(
"Autoplace Fields" ) );
1658 if( !selection.
Empty() )
1681 if( selection.
Empty() )
1698 if( !symbol->
IsNew() )
1703 if( symbol->
IsNew() )
1716 bool clearSelection = selection.
IsHover();
1718 if( selection.
Empty() )
1734 switch( curr_item->
Type() )
1742 if( selection.
Size() > 1 )
1748 switch( curr_item->
Type() )
1780 if( wxWindow* blocking_win =
editor->Kiway().GetBlockingDialog() )
1781 blocking_win->Close(
true );
1787 editor->LoadSymbolFromSchematic( symbol );
1797 if( wxWindow* blocking_win =
editor->Kiway().GetBlockingDialog() )
1798 blocking_win->Close(
true );
1821 bool doClearAnnotation;
1822 bool doRefresh =
false;
1830 &doClearAnnotation );
1835 if( doClearAnnotation )
1909 clearSelection =
true;
1917 if( dlg.ShowModal() == wxID_OK )
1930 if( dlg.ShowModal() == wxID_OK )
1943 if( std::all_of( selection.
Items().begin(), selection.
Items().end(),
1946 return item->Type() == SCH_LINE_T
1947 && static_cast<const SCH_LINE*>( item )->IsGraphicLine();
1950 std::deque<SCH_LINE*> lines;
1953 lines.push_back(
static_cast<SCH_LINE*
>( selItem ) );
1957 if( dlg.ShowModal() == wxID_OK )
1963 else if( std::all_of( selection.
Items().begin(), selection.
Items().end(),
1966 return item->Type() == SCH_JUNCTION_T;
1969 std::deque<SCH_JUNCTION*> junctions;
1972 junctions.push_back(
static_cast<SCH_JUNCTION*
>( selItem ) );
1976 if( dlg.ShowModal() == wxID_OK )
1982 else if( std::all_of( selection.
Items().begin(), selection.
Items().end(),
1985 const SCH_ITEM* schItem = dynamic_cast<const SCH_ITEM*>( item );
1987 wxCHECK( schItem, false );
1989 return ( schItem->HasLineStroke() && schItem->IsConnectable() )
1990 || item->Type() == SCH_JUNCTION_T;
1993 std::deque<SCH_ITEM*> items;
1996 items.push_back(
static_cast<SCH_ITEM*
>( selItem ) );
2000 if( dlg.ShowModal() == wxID_OK )
2018 wxFAIL_MSG( wxString(
"Cannot edit schematic item type " ) + curr_item->
GetClass() );
2023 if( clearSelection )
2037 for(
unsigned int i = 0; i < selection.GetSize(); ++i )
2041 if( item && item->
Type() != convertTo )
2051 switch( item->
Type() )
2071 txt =
_(
"<empty>" );
2082 txt =
text->GetText();
2083 orientation =
text->GetTextSpinStyle();
2084 href =
text->GetHyperlink();
2101 int textSize =
text->GetTextSize().y;
2144 auto getValidNetname =
2145 [](
const wxString& aText )
2147 wxString local_txt = aText;
2148 local_txt.Replace(
"\n",
"_" );
2149 local_txt.Replace(
"\r",
"_" );
2150 local_txt.Replace(
"\t",
"_" );
2154 local_txt.Replace(
" ",
"_" );
2159 if( local_txt.IsEmpty() )
2160 return _(
"<empty>" );
2174 newtext = new_label;
2185 newtext = new_label;
2196 newtext = new_label;
2210 SCH_FIELD netclass( position, 0, new_label, wxT(
"Netclass" ) );
2213 new_label->
GetFields().push_back( netclass );
2216 new_label->
SetShape( LABEL_FLAG_SHAPE::F_ROUND );
2219 newtext = new_label;
2239 bbox.
Inflate( -label->GetLabelBoxExpansion() );
2242 wxCHECK(textItem, 0 );
2251 int slop = margin / 20;
2253 switch( orientation )
2281 newtext = new_textbox;
2290 wxCHECK2( newtext,
continue );
2301 wxCHECK2( eda_text && new_eda_text,
continue );
2314 if( label && new_label )
2323 std::vector<SCH_FIELD>& fields = new_label->
GetFields();
2325 for(
int ii = fields.size()-1; ii >= min_idx; ii-- )
2327 if( fields[ii].GetCanonicalName() == wxT(
"Intersheetrefs" ) )
2328 fields.erase( fields.begin() + ii );
2335 if( !item->
IsNew() )
2365 if( selection.IsHover() )
2378 std::vector<SCH_LINE*> lines;
2382 if(
SCH_LINE* line = dyn_cast<SCH_LINE*>( item ) )
2384 if( !line->IsEndPoint( cursorPos ) )
2385 lines.push_back( line );
2397 if( lines.size() == 1 && line->HitTest( cursorPos ) )
2420 if( !lines.empty() )
2442 if( !
IsOK(
m_frame,
_(
"Do you wish to delete the unreferenced pins from this sheet?" ) ) )
2484 if( prevInstance.
size() )
2502 msg.Printf(
_(
"Enter page number for sheet path%s" ),
2503 ( sheetPath.Length() > 20 ) ?
"\n" + sheetPath :
" " + sheetPath );
2505 wxTextEntryDialog dlg(
m_frame, msg,
_(
"Edit Sheet Page Number" ), pageNumber );
2507 dlg.SetTextValidator( wxFILTER_ALPHANUMERIC );
2509 if( dlg.ShowModal() == wxID_CANCEL || dlg.GetValue() == instance.
GetPageNumber() )
2530 wxString aFileName = *aEvent.
Parameter<wxString*>();
2540 if( selection.
Empty() )
2545 if(
SCH_SYMBOL* sym = dyn_cast<SCH_SYMBOL*>( item ) )
2550 sym->SetDNP(
true );
2553 sym->SetExcludeFromSim(
true );
2556 sym->SetIncludeInBom(
false );
2559 sym->SetIncludeOnBoard(
false );
2563 commit.
Push(
_(
"Set Attribute" ) );
2573 if( selection.
Empty() )
2578 if(
SCH_SYMBOL* sym = dyn_cast<SCH_SYMBOL*>( item ) )
2583 sym->SetDNP(
false );
2586 sym->SetExcludeFromSim(
false );
2589 sym->SetIncludeInBom(
true );
2592 sym->SetIncludeOnBoard(
true );
2596 commit.
Push(
_(
"Clear Attribute" ) );
2606 if( selection.
Empty() )
2611 if(
SCH_SYMBOL* sym = dyn_cast<SCH_SYMBOL*>( item ) )
2616 sym->SetDNP( !sym->GetDNP() );
2619 sym->SetExcludeFromSim( !sym->GetExcludeFromSim() );
2622 sym->SetIncludeInBom( !sym->GetIncludeInBom() );
2625 sym->SetIncludeOnBoard( !sym->GetIncludeOnBoard() );
2629 commit.
Push(
_(
"Toggle Attribute" ) );
constexpr EDA_IU_SCALE schIUScale
static TOOL_ACTION pickerTool
static TOOL_ACTION pasteSpecial
static TOOL_ACTION pageSettings
static TOOL_ACTION duplicate
static TOOL_ACTION doDelete
static TOOL_ACTION deleteTool
static TOOL_ACTION refreshPreview
static TOOL_ACTION selectAll
void SetPageNumber(const wxString &aPageNumber)
const Vec & GetPosition() const
const Vec & GetOrigin() const
const Vec GetCenter() const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
int GetCount() const
Return the number of objects in the list.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
bool Empty() const
Returns status of an item.
Dialog to update or change schematic library symbols.
Handle editing a single symbol field in the schematic editor.
void UpdateField(SCH_FIELD *aField, SCH_SHEET_PATH *aSheetPath)
Dialog used to edit SCH_SYMBOL objects in a schematic.
bool HitTestDrawingSheetItems(KIGFX::VIEW *aView, const VECTOR2I &aPosition)
bool IsHorizontal() const
void ShowInfoBarWarning(const wxString &aWarningMsg, bool aShowCloseButton=false)
Show the WX_INFOBAR displayed on the top of the canvas with a message and a warning icon on the left ...
VECTOR2I GetNearestGridPosition(const VECTOR2I &aPosition) const
Return the nearest aGridSize location to aPosition.
VECTOR2I GetNearestHalfGridPosition(const VECTOR2I &aPosition) const
Return the nearest aGridSize / 2 location to aPosition.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
virtual void SetPosition(const VECTOR2I &aPos)
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
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)
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
EDA_ITEM * GetParent() const
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
virtual wxString GetClass() const =0
Return the class name.
void SetEnd(const VECTOR2I &aEnd)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
KIFONT::FONT * GetFont() const
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
wxString GetHyperlink() const
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetHyperlink(wxString aLink)
GR_TEXT_V_ALIGN_T GetVertJustify() const
void SetTextSize(const VECTOR2I &aNewSize)
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
int GetTextThickness() const
void SetItalic(bool aItalic)
void SetFont(KIFONT::FONT *aFont)
VECTOR2I GetTextSize() const
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
PANEL_ANNOTATE m_AnnotatePanel
AUTOPLACE_FIELDS m_AutoplaceFields
static TOOL_ACTION mirrorV
static TOOL_ACTION unsetDNP
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION properties
static TOOL_ACTION toggleExcludeFromSimulation
static TOOL_ACTION unsetExcludeFromSimulation
static TOOL_ACTION setExcludeFromBoard
static TOOL_ACTION clearHighlight
static TOOL_ACTION toGLabel
static TOOL_ACTION toggleExcludeFromBoard
static TOOL_ACTION setDNP
static TOOL_ACTION cleanupSheetPins
static TOOL_ACTION clearSelection
Clears the current selection.
static TOOL_ACTION toText
static TOOL_ACTION placeClassLabel
static TOOL_ACTION showDeMorganAlternate
static TOOL_ACTION toggleExcludeFromBOM
static TOOL_ACTION autoplaceFields
static TOOL_ACTION showDeMorganStandard
static TOOL_ACTION rotateCCW
static TOOL_ACTION editValue
static TOOL_ACTION toLabel
static TOOL_ACTION toTextBox
static TOOL_ACTION breakWire
static TOOL_ACTION mirrorH
static TOOL_ACTION rotateCW
static TOOL_ACTION unsetExcludeFromBOM
static TOOL_ACTION editWithLibEdit
static TOOL_ACTION placeGlobalLabel
static TOOL_ACTION removeItemFromSel
static TOOL_ACTION ddAppendFile
static TOOL_ACTION placeHierLabel
static TOOL_ACTION addItemToSel
Selects an item (specified as the event parameter).
static TOOL_ACTION editPageNumber
static TOOL_ACTION changeSymbol
static TOOL_ACTION editFootprint
static TOOL_ACTION enterSheet
static TOOL_ACTION editReference
static TOOL_ACTION updateSymbols
static TOOL_ACTION placeSchematicText
static TOOL_ACTION setExcludeFromBOM
static TOOL_ACTION changeSymbols
static TOOL_ACTION setExcludeFromSimulation
static TOOL_ACTION unsetExcludeFromBoard
static TOOL_ACTION toCLabel
static TOOL_ACTION placeLabel
static TOOL_ACTION repeatDrawItem
static TOOL_ACTION toHLabel
static TOOL_ACTION editTextAndGraphics
static TOOL_ACTION toggleDNP
static TOOL_ACTION toggleDeMorgan
static TOOL_ACTION updateSymbol
void Collect(SCH_SCREEN *aScreen, const std::vector< KICAD_T > &aScanTypes, const VECTOR2I &aPos, int aUnit=0, int aConvert=0)
Scan a EDA_ITEM using this class's Inspector method which does the collection.
static const std::vector< KICAD_T > EditableItems
static const std::vector< KICAD_T > FieldOwners
static SELECTION_CONDITION SingleSymbol
static SELECTION_CONDITION SingleSymbolOrPower
static SELECTION_CONDITION SingleMultiUnitSymbol
static SELECTION_CONDITION MultipleSymbolsOrPower
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
void RecacheAllItems()
Rebuild GAL display lists.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
static wxString SubReference(int aUnit, bool aAddSeparator=true)
static bool ParseBusGroup(const wxString &aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parse a bus group label into the name and a list of components.
A singleton reporter that reports to nowhere.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
These settings were stored in SCH_BASE_FRAME previously.
SCHEMATIC_SETTINGS & Settings() const
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EESCHEMA_SETTINGS * eeconfig() const
void RemoveFromScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen)
Remove an item from the screen (and view) aScreen is the screen the item is located on,...
Object to handle a bitmap image that can be inserted in a schematic.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Schematic editor (Eeschema) main window.
bool SchematicCleanUp(SCH_SCREEN *aScreen=nullptr)
Perform routine schematic cleaning including breaking wire and buses and deleting identical objects s...
void ConvertPart(SCH_SYMBOL *aSymbol)
void DeleteJunction(SCH_ITEM *aItem, bool aAppend=false)
Removes a given junction and heals any wire segments under the junction.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, bool aDirtyConnectivity=true)
Create a copy of the current schematic item, and put it in the undo list.
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
const std::vector< std::unique_ptr< SCH_ITEM > > & GetRepeatItems() const
Return the items which are to be repeated with the insert key.
void OnPageSettingsChange() override
Called when modifying the page settings.
bool AddSheetAndUpdateDisplay(const wxString aFullFileName)
Add a sheet file into the current sheet and updates display.
bool EditSheetProperties(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
void BreakSegment(SCH_LINE *aSegment, const VECTOR2I &aPoint, SCH_LINE **aNewSegment=nullptr, SCH_SCREEN *aScreen=nullptr)
Break a single segment into two at the specified point.
const wxString & GetHighlightedConnection() const
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
void UpdateHierarchyNavigator()
Update the hierarchy navigation tree and history.
void AddCopyForRepeatItem(const SCH_ITEM *aItem)
void StartNewUndo()
Create a new, blank stack for future Undo commands to be pushed to.
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void AutoRotateItem(SCH_SCREEN *aScreen, SCH_ITEM *aItem)
Automatically set the rotation of an item (if the item supports it)
void AnnotateSymbols(ANNOTATE_SCOPE_T aAnnotateScope, ANNOTATE_ORDER_T aSortOption, ANNOTATE_ALGO_T aAlgoOption, bool aRecursive, int aStartNumber, bool aResetAnnotation, bool aRepairTimestamps, REPORTER &aReporter, bool appendUndo=false)
Annotate the symbols in the schematic that are not currently annotated.
void SaveCopyForRepeatItem(const SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual bool IsConnectable() const
virtual void MirrorVertically(int aCenter)=0
Mirror item vertically about aCenter.
virtual wxString GetClass() const override
Return the class name.
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual bool IsDangling() const
virtual void MirrorHorizontally(int aCenter)=0
Mirror item horizontally about aCenter.
void ClearFieldsAutoplaced()
virtual void Move(const VECTOR2I &aMoveVector)=0
Move the item by aMoveVector to a new position.
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
virtual void Rotate(const VECTOR2I &aCenter)=0
Rotate the item around aCenter 90 degrees in the clockwise direction.
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 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.
void AddFields(const std::vector< SCH_FIELD > &aFields)
void SetShape(LABEL_FLAG_SHAPE aShape) override
std::vector< SCH_FIELD > & GetFields()
Segment description base class to describe items which have 2 end points (track, wire,...
void RotateEnd(const VECTOR2I &aCenter)
void RotateStart(const VECTOR2I &aCenter)
VECTOR2I GetEndPoint() const
VECTOR2I GetStartPoint() const
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void ClearAnnotationOfNewSheetPaths(SCH_SHEET_LIST &aInitialSheetPathList)
Clear the annotation for the symbols inside new sheetpaths when a complex hierarchy is modified and n...
bool IsExplicitJunction(const VECTOR2I &aPosition) const
Indicates that a junction dot is necessary at the given location.
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
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.
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath, bool aResetPrefix)
Clear the annotation for the symbols in aSheetPath on the screen.
void SetPosition(const VECTOR2I &aPos) override
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false) const
Return the sheet path in a human readable form made from the sheet names.
SCH_SCREEN * LastScreen()
wxString GetPageNumber() const
void SetPageNumber(const wxString &aPageNumber)
Set the sheet instance user definable page number.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
size_t size() const
Forwarded method from std::vector.
void pop_back()
Forwarded method from std::vector.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
VECTOR2I GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
SCH_SCREEN * GetScreen() const
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...
bool IsMissingLibSymbol() const
Check to see if the library symbol is set to the dummy library symbol.
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
int GetOrientation() const
Get the display symbol orientation.
const LIB_ID & GetLibId() const
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
int GetTextMargin() const
virtual void Rotate90(bool aClockwise)
TEXT_SPIN_STYLE GetTextSpinStyle() const
virtual LABEL_FLAG_SHAPE GetShape() const
virtual void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
virtual void MirrorSpinStyle(bool aLeftRight)
static SELECTION_CONDITION HasTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if among the selected items there is at least one of a given types.
static SELECTION_CONDITION HasType(KICAD_T aType)
Create a functor that tests if among the selected items there is at least one of a given type.
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static SELECTION_CONDITION MoreThan(int aNumber)
Create a functor that tests if the number of selected items is greater than the value given as parame...
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static bool IdleSelection(const SELECTION &aSelection)
Test if all selected items are not being edited.
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
virtual void Add(EDA_ITEM *aItem)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
const std::deque< EDA_ITEM * > GetItems() const
const std::vector< EDA_ITEM * > GetItemsSortedBySelectionOrder() const
VECTOR2I GetReferencePoint() const
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
virtual unsigned int GetSize() const override
Return the number of stored items.
int Size() const
Returns the number of selected parts.
std::deque< EDA_ITEM * > & Items()
bool Empty() const
Checks if there is anything selected.
bool HasReferencePoint() const
The symbol library editor main window.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
This file is part of the common library.
@ SYMBOL_PROPS_EDIT_SCHEMATIC_SYMBOL
@ SYMBOL_PROPS_WANT_EXCHANGE_SYMBOL
@ SYMBOL_PROPS_WANT_UPDATE_SYMBOL
@ SYMBOL_PROPS_EDIT_LIBRARY_SYMBOL
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
static constexpr EDA_ANGLE & ANGLE_VERTICAL
#define IS_NEW
New item, just created.
#define SELECTED_BY_DRAG
Item was algorithmically selected as a dragged item.
#define STRUCT_DELETED
flag indication structures to be erased
#define ENDPOINT
ends. (Used to support dragging.)
#define STARTPOINT
When a line is selected, these flags indicate which.
@ ID_POPUP_SCH_SELECT_UNIT1
@ ID_POPUP_SCH_SELECT_UNIT_CMP
@ ID_POPUP_SCH_SELECT_UNIT_SYM_MAX
@ FRAME_SCH_SYMBOL_EDITOR
@ LAYER_SCHEMATIC_DRAWINGSHEET
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
#define UNIMPLEMENTED_FOR(type)
@ REPAINT
Item needs to be redrawn.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
ANNOTATE_ORDER_T
Schematic annotation order options.
@ ANNOTATE_SELECTION
Annotate the selection.
ANNOTATE_ALGO_T
Schematic annotation type options.
@ SHEET_MANDATORY_FIELDS
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
wxString UnescapeString(const wxString &aSource)
wxString TitleCaps(const wxString &aString)
Capitalize the first letter in each word.
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
constexpr int MilsToIU(int mils) const
int default_repeat_offset_x
int default_repeat_offset_y
int repeat_label_increment
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslateForHI=false)
Return a default symbol field name for field aFieldNdx for all components.
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ MANDATORY_FIELDS
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ SCH_FIELD_LOCATE_REFERENCE_T
@ SCH_FIELD_LOCATE_FOOTPRINT_T
@ SCH_FIELD_LOCATE_VALUE_T
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".