39#define MIN_SHEET_WIDTH 500
40#define MIN_SHEET_HEIGHT 150
79 return wxT(
"SCH_SHEET" );
101 void SetFields(
const std::vector<SCH_FIELD>& aFields );
214 bool HasPin(
const wxString& aName )
const;
315 wxString tmp = aFilename;
316 tmp.Replace( wxT(
"\\" ), wxT(
"/" ) );
340 void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
override;
343 std::vector<DANGLING_END_ITEM>& aItemListByPos,
362 const std::vector<KICAD_T>& aScanTypes )
override;
398 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
403 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy )
const override;
404 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
407 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
override;
410 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
override;
457 static int ComparePageNum(
const wxString& aPageNumberA,
const wxString& aPageNumberB );
464 void Show(
int nestLevel, std::ostream& os )
const override;
515 bool aTestFromEnd =
false )
const;
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
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.
A color representation with 4 components: red, green, blue, alpha.
Base plotter engine class.
Object to parser s-expression symbol library and schematic file formats.
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
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...
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 GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
bool GetExcludedFromBOM() const
void SetBorderColor(KIGFX::COLOR4D aColor)
const std::vector< SCH_SHEET_PIN * > & GetPins() const
void SetFileName(const wxString &aFilename)
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
wxString GetFileName() const
Return the filename corresponding to this sheet.
bool getInstance(SCH_SHEET_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetSize(const VECTOR2I &aSize)
void RemoveInstance(const KIID_PATH &aInstancePath)
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslated=true)
bool addInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
bool HasRootInstance() const
Check to see if this sheet has a root sheet instance.
wxString GetClass() const override
Return the class name.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
int GetPenWidth() const override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool IsConnectable() const override
SCH_SHEET_PATH findSelf() const
Get the sheetpath of this sheet.
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
std::vector< SCH_FIELD > & GetFields()
KIGFX::COLOR4D m_borderColor
void renumberPins()
Renumber the sheet pins in the sheet.
void SetExcludedFromBOM(bool aExcludeFromBOM)
Set or clear the exclude from schematic bill of materials flag.
VECTOR2I GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
SCH_SHEET_PIN * GetPin(const VECTOR2I &aPosition)
Return the sheet pin item found at aPosition in the sheet.
bool operator<(const SCH_ITEM &aItem) const override
bool GetExcludedFromBoard() const
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
void SetPositionIgnoringPins(const VECTOR2I &aPosition)
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
bool LocatePathOfScreen(SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
Search the existing hierarchy for an instance of screen loaded from aFileName.
std::vector< SCH_SHEET_INSTANCE > m_instances
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
void SetPosition(const VECTOR2I &aPosition) override
void SetBackgroundColor(KIGFX::COLOR4D aColor)
int SymbolCount() const
Count our own symbols, without the power symbols.
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.
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
void AddInstance(const SCH_SHEET_INSTANCE &aInstance)
int GetMinWidth(bool aFromLeft) const
Return the minimum width of the sheet based on the widths of the sheet pin text.
bool operator==(const SCH_ITEM &aOther) const override
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::vector< SCH_FIELD > m_fields
KIGFX::COLOR4D m_backgroundColor
void SetName(const wxString &aName)
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
SCH_SCREEN * GetScreen() const
VECTOR2I GetPosition() const override
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
bool HasPin(const wxString &aName) const
Checks if the sheet already has a sheet pin named aName.
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compares page numbers of schematic sheets.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
bool HasPageNumberChanges(const SCH_SHEET &aOther) const
Check if the instance data of this sheet has any changes compared to aOther.
const SCH_SHEET_INSTANCE & GetRootInstance() const
Return the root sheet instance data.
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
void setInstances(const std::vector< SCH_SHEET_INSTANCE > &aInstances)
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const std::vector< SCH_FIELD > & GetFields() const
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
KIGFX::COLOR4D GetBorderColor() const
std::vector< SCH_SHEET_PIN * > m_pins
bool IsMovableFromAnchorPoint() const override
Return true for items which are moved with the anchor point at mouse cursor and false for items moved...
bool CanConnect(const SCH_ITEM *aItem) const override
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
void SetBorderWidth(int aWidth)
static bool ClassOf(const EDA_ITEM *aItem)
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void setPageNumber(const KIID_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
bool GetExcludedFromSim() const override
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
int GetMinHeight(bool aFromTop) const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
void Resize(const VECTOR2I &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
int GetBorderWidth() const
void SetExcludedFromBoard(bool aExcludeFromBoard)
Set or clear exclude from board netlist flag.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
std::vector< SCH_SHEET_PIN * > & GetPins()
wxString GetShownName(bool aAllowExtraText) const
friend SCH_IO_KICAD_SEXPR_PARSER
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
bool IsVerticalOrientation() const
void SetExcludedFromSim(bool aExcludeFromSim) override
Set or clear the exclude from simulation flag.
bool GetDNP() const
Set or clear the 'Do Not Populate' flaga.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy) const override
Test if aPosition is inside or on the boundary of this item.
KIGFX::COLOR4D GetBackgroundColor() const
wxString getPageNumber(const KIID_PATH &aInstance) const
Return the sheet page number for aInstance.
const INSPECTOR_FUNC & INSPECTOR
@ SHEET_MANDATORY_FIELDS
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
constexpr int MilsToIU(int mils) const
A simple container for sheet instance information.
VECTOR2< int32_t > VECTOR2I