37 #define MIN_SHEET_WIDTH 500 // Units are mils. 38 #define MIN_SHEET_HEIGHT 150 // Units are mils. 76 return wxT(
"SCH_SHEET" );
98 void SetFields(
const std::vector<SCH_FIELD>& aFields );
185 const std::vector<SCH_SHEET_PIN*>&
GetPins()
const 220 bool HasPin(
const wxString& aName )
const;
323 wxString tmp = aFilename;
324 tmp.Replace( wxT(
"\\" ), wxT(
"/" ) );
330 void Move(
const wxPoint& aMoveVector )
override;
333 void Rotate(
const wxPoint& aCenter )
override;
335 bool Matches(
const wxFindReplaceData& aSearchData,
void* aAuxData )
const override;
344 void Resize(
const wxSize& aSize );
348 void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
override;
377 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
380 void SetPosition(
const wxPoint& aPosition )
override;
382 bool HitTest(
const wxPoint& aPosition,
int aAccuracy )
const override;
383 bool HitTest(
const EDA_RECT& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
446 static int ComparePageNum(
const wxString& aPageNumberA,
const wxString& aPageNumberB );
449 void Show(
int nestLevel, std::ostream& os )
const override;
465 bool doIsConnected(
const wxPoint& aPosition )
const override;
485 #endif // SCH_SHEEET_H
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
SCH_SHEET_PIN * GetPin(const wxPoint &aPosition)
Return the sheet pin item found at aPosition in the sheet.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
KIGFX::COLOR4D m_borderColor
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
void SetFileName(const wxString &aFilename)
int GetMinWidth(bool aFromLeft) const
Return the minimum width of the sheet based on the widths of the sheet pin text.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compares page numbers of schematic sheets.
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslated=true)
KIGFX::COLOR4D GetBorderColor() const
bool UsesDefaultStroke() const
Test this sheet to see if the default stroke is used to draw the outline.
int GetMinHeight(bool aFromTop) const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
bool operator<(const SCH_ITEM &aItem) const override
The base class for create windows for drawing purpose.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
SCH_SCREEN * GetScreen() const
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
void SetPageNumber(const SCH_SHEET_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
const INSPECTOR_FUNC & INSPECTOR
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
std::vector< SCH_SHEET_INSTANCE > m_instances
void Rotate(const wxPoint &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
void Plot(PLOTTER *aPlotter) const override
Plot the schematic item to aPlotter.
KIGFX::COLOR4D GetBackgroundColor() const
void SetBorderWidth(int aWidth)
void SetInstances(const std::vector< SCH_SHEET_INSTANCE > &aInstances)
std::vector< SCH_FIELD > & GetFields()
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
void renumberPins()
Renumber the sheet pins in the sheet.
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.
wxString GetClass() const override
Return the class name.
int GetBorderWidth() const
void SetBackgroundColor(KIGFX::COLOR4D aColor)
bool IsConnectable() const override
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
int GetPenWidth() const override
std::vector< SCH_SHEET_PIN * > m_pins
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
void SetBorderColor(KIGFX::COLOR4D aColor)
bool IsMovableFromAnchorPoint() const override
Return true for items which are moved with the anchor point at mouse cursor and false for items moved...
const EDA_RECT GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
int SymbolCount() const
Count our own symbols, without the power symbols.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString GetFileName() const
Return the filename corresponding to this sheet.
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
wxPoint GetPosition() const override
SCH_SHEET(EDA_ITEM *aParent=nullptr, const wxPoint &aPos=wxPoint(0, 0), wxSize aSize=wxSize(Mils2iu(MIN_SHEET_WIDTH), Mils2iu(MIN_SHEET_HEIGHT)), FIELDS_AUTOPLACED aAutoplaceFields=FIELDS_AUTOPLACED_AUTO)
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetSize(const wxSize &aSize)
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a schematic item.
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
std::vector< SCH_SHEET_PIN * > & GetPins()
std::vector< SCH_FIELD > m_fields
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
bool LocatePathOfScreen(SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Base plotter engine class.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
BITMAPS
A list of all bitmap identifiers.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
bool CanConnect(const SCH_ITEM *aItem) const override
bool IsVerticalOrientation() const
void SetPosition(const wxPoint &aPosition) override
KIGFX::COLOR4D m_backgroundColor
Handle the component boundary box.
static bool ClassOf(const EDA_ITEM *aItem)
A base class for most all the KiCad significant classes used in schematics and boards.
wxPoint GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
const std::vector< SCH_FIELD > & GetFields() const
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
bool HasPin(const wxString &aName) const
Checks if the sheet already has a sheet pin named aName.
Base class for any item which can be embedded within the SCHEMATIC container class,...
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
wxString GetPageNumber(const SCH_SHEET_PATH &aInstance) const
Return the sheet page number for aInstance.
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
KICAD_T Type() const
Returns the type of object.
bool AddInstance(const SCH_SHEET_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
void Resize(const wxSize &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
A color representation with 4 components: red, green, blue, alpha.
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Test if aPosition is inside or on the boundary of this item.
const std::vector< SCH_SHEET_PIN * > & GetPins() const